rl-client: remove chatbox performance plugin

vanilla's background was reworked so this shouldn't be necessary
This commit is contained in:
Max Weber
2021-12-09 04:55:12 -07:00
parent 9825cef621
commit 2e1e5bfd72
3 changed files with 0 additions and 653 deletions

View File

@@ -1,160 +0,0 @@
/*
* Copyright (c) 2018, Woox <https://github.com/wooxsolo>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.chatboxperformance;
import javax.inject.Inject;
import net.runelite.api.Client;
import net.runelite.api.GameState;
import net.runelite.api.ScriptID;
import net.runelite.api.events.ScriptCallbackEvent;
import net.runelite.api.widgets.WidgetType;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.api.widgets.WidgetPositionMode;
import net.runelite.api.widgets.WidgetSizeMode;
import net.runelite.client.callback.ClientThread;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
@PluginDescriptor(
name = "Chatbox performance",
hidden = true
)
public class ChatboxPerformancePlugin extends Plugin
{
@Inject
private Client client;
@Inject
private ClientThread clientThread;
@Override
public void startUp()
{
if (client.getGameState() == GameState.LOGGED_IN)
{
clientThread.invokeLater(() -> client.runScript(ScriptID.MESSAGE_LAYER_CLOSE, 0, 0, 0));
}
}
@Override
public void shutDown()
{
if (client.getGameState() == GameState.LOGGED_IN)
{
clientThread.invokeLater(() -> client.runScript(ScriptID.MESSAGE_LAYER_CLOSE, 0, 0, 0));
}
}
@Subscribe
private void onScriptCallbackEvent(ScriptCallbackEvent ev)
{
if (!"chatboxBackgroundBuilt".equals(ev.getEventName()))
{
return;
}
fixDarkBackground();
fixWhiteLines(true);
fixWhiteLines(false);
}
private void fixDarkBackground()
{
int currOpacity = 256;
int prevY = 0;
Widget[] children = client.getWidget(WidgetInfo.CHATBOX_TRANSPARENT_BACKGROUND).getDynamicChildren();
Widget prev = null;
for (Widget w : children)
{
if (w.getType() != WidgetType.RECTANGLE)
{
continue;
}
if (prev != null)
{
int relY = w.getRelativeY();
prev.setHeightMode(WidgetSizeMode.ABSOLUTE);
prev.setYPositionMode(WidgetPositionMode.ABSOLUTE_TOP);
prev.setRelativeY(prevY);
prev.setOriginalY(prev.getRelativeY());
prev.setHeight(relY - prevY);
prev.setOriginalHeight(prev.getHeight());
prev.setOpacity(currOpacity);
}
prevY = w.getRelativeY();
currOpacity -= 3; // Rough number, can't get exactly the same as Jagex because of rounding
prev = w;
}
if (prev != null)
{
prev.setOpacity(currOpacity);
}
}
private void fixWhiteLines(boolean upperLine)
{
int currOpacity = 256;
int prevWidth = 0;
Widget[] children = client.getWidget(WidgetInfo.CHATBOX_TRANSPARENT_LINES).getDynamicChildren();
Widget prev = null;
for (Widget w : children)
{
if (w.getType() != WidgetType.RECTANGLE)
{
continue;
}
if ((w.getRelativeY() == 0 && !upperLine) ||
(w.getRelativeY() != 0 && upperLine))
{
continue;
}
if (prev != null)
{
int width = w.getWidth();
prev.setWidthMode(WidgetSizeMode.ABSOLUTE);
prev.setRelativeX(width);
prev.setOriginalX(width);
prev.setWidth(prevWidth - width);
prev.setOriginalWidth(prev.getWidth());
prev.setOpacity(currOpacity);
}
prevWidth = w.getWidth();
currOpacity -= upperLine ? 3 : 4; // Rough numbers, can't get exactly the same as Jagex because of rounding
prev = w;
}
if (prev != null)
{
prev.setOpacity(currOpacity);
}
}
}

View File

@@ -1 +0,0 @@
4D29B854CF452995C8D3CF235D045560B8C8F847C2DD0ED2B3FF71B1C5A95509

View File

@@ -1,492 +0,0 @@
.id 923
.int_stack_count 0
.string_stack_count 0
.int_var_count 14
.string_var_count 0
; callback "chatboxBackgroundBuilt"
; used by the ChatboxPerformancePlugin to know when it needs to rebuild.
; Unmark the plugin as hidden and toggle it. The chatbox should change opacity
; slightly
iconst 10616834
cc_deleteall
iconst 0
istore 0
get_varc_int 41
iconst 1337
if_icmpeq LABEL15
get_varbit 542
iconst 1
if_icmpeq LABEL11
jump LABEL31
LABEL11:
getwindowmode
iconst 1
if_icmpne LABEL15
jump LABEL31
LABEL15:
invoke 922
iconst 1
if_icmpeq LABEL19
jump LABEL22
LABEL19:
iconst 1
istore 0
jump LABEL31
LABEL22:
getwindowmode
iconst 1
if_icmpeq LABEL26
jump LABEL31
LABEL26:
iconst 0
set_varc_int 41
iconst 0
iconst 0
invoke 183
LABEL31:
iload 0
iconst 10616866
if_sethide
get_varbit 6374
iconst 1
if_icmpeq LABEL38
jump LABEL55
LABEL38:
getwindowmode
iconst 1
if_icmpne LABEL42
jump LABEL55
LABEL42:
iconst 1
iconst 0
iconst 2
iconst 0
iconst 10616888
if_setposition
iconst -1
iconst 0
iconst 0
iconst 0
iconst 10617389
if_setposition
jump LABEL67
LABEL55:
iconst 0
iconst 0
iconst 0
iconst 0
iconst 10616888
if_setposition
iconst 0
iconst 0
iconst 2
iconst 0
iconst 10617389
if_setposition
LABEL67:
iconst 10616867
cc_deleteall
iconst 10616886
cc_deleteall
iconst 0
istore 1
clientclock
get_varc_int 223
if_icmplt LABEL77
jump LABEL89
LABEL77:
invoke 900
iconst 1129
if_icmpne LABEL81
jump LABEL89
LABEL81:
iconst 1
istore 1
iconst 2155
get_varc_int 223
sconst "i"
iconst 10616867
if_setontimer
jump LABEL93
LABEL89:
iconst -1
sconst ""
iconst 10616867
if_setontimer
LABEL93:
invoke 921
iconst 0
if_icmpeq LABEL97
jump LABEL163
LABEL97:
iconst 1
iconst 10616867
if_setnoclickthrough
iload 1
iconst 0
if_icmpeq LABEL104
jump LABEL142
LABEL104:
iconst 10616867
iconst 5
iconst 0
cc_create
iconst 0
iconst 0
iconst 1
iconst 1
cc_setsize
iconst 0
iconst 0
iconst 1
iconst 1
cc_setposition
iconst 1017
cc_setgraphic
iconst 0
cc_settiling
iconst 0
cc_settrans
iconst 10616886
iconst 3
iconst 0
cc_create
iconst 0
iconst 1
iconst 1
iconst 0
cc_setsize
iconst 0
iconst 15
iconst 1
iconst 2
cc_setposition
iconst 8418912
cc_setcolour
iconst 1
cc_setfill
LABEL142:
iconst 10617389
iconst 792
iconst 789
iconst 790
iconst 791
iconst 773
iconst 788
iconst 0
invoke 838
invoke 2373
iconst 1
if_icmpeq LABEL155
jump LABEL159
LABEL155:
iconst 255
iconst 10616835
if_settrans
jump LABEL162
LABEL159:
iconst 0
iconst 10616835
if_settrans
LABEL162:
return
LABEL163:
get_varbit 2570
iconst 1
if_icmpeq LABEL167
jump LABEL171
LABEL167:
iconst 1
iconst 10616867
if_setnoclickthrough
jump LABEL177
LABEL171:
iconst 0
iconst 10616867
if_setnoclickthrough
iconst 1
iconst 10616867
if_setnoscrollthrough
LABEL177:
iconst 20
istore 2
iconst 193
istore 3
iconst 253
istore 4
iconst 10616867
if_getheight
istore 5
iload 5
iload 2
div
istore 6
iload 5
iload 6
iload 2
multiply
sub
istore 7
iconst 200
istore 8
iconst 253
istore 9
iconst 10616886
if_getwidth
istore 10
iload 10
iload 2
div
istore 11
iload 10
iload 11
iload 2
multiply
sub
istore 12
iconst 0
istore 13
iload 1
iconst 0
if_icmpeq LABEL219
jump LABEL394
LABEL219:
invoke 1972
iconst 0
if_icmpeq LABEL223
jump LABEL334
LABEL223:
iload 13
iload 2
if_icmplt LABEL227
jump LABEL333
LABEL227:
iconst 10616867
iconst 3
iload 13
cc_create
iload 13
iload 2
iconst 1
sub
if_icmpeq LABEL237
jump LABEL245
LABEL237:
iconst 0
iload 6
iload 7
add
iconst 1
iconst 0
cc_setsize
jump LABEL250
LABEL245:
iconst 0
iload 6
iconst 1
iconst 0
cc_setsize
LABEL250:
iconst 0
iload 6
iload 13
multiply
iconst 0
iconst 0
cc_setposition
iconst 0
cc_setcolour
iconst 1
cc_setfill
iload 4
iload 3
iconst 0
iload 2
iload 13
interpolate
cc_settrans
iconst 10616886
iconst 3
iload 13
iconst 2
multiply
cc_create
iconst 10616886
iconst 3
iload 13
iconst 2
multiply
iconst 1
add
cc_create 1
iload 11
iconst 1
iconst 0
iconst 0
cc_setsize
iload 11
iconst 1
iconst 0
iconst 0
cc_setsize 1
iload 11
iload 13
multiply
iconst 0
iconst 0
iconst 0
cc_setposition
iload 11
iload 13
multiply
iconst 15
iconst 0
iconst 2
cc_setposition 1
iconst 16777215
cc_setcolour
iconst 16777215
cc_setcolour 1
iconst 1
cc_setfill
iconst 1
cc_setfill 1
iload 8
iload 9
iconst 0
iload 2
iload 13
interpolate
cc_settrans
iload 8
iload 9
iconst 0
iload 2
iload 13
interpolate
cc_settrans 1
iload 13
iconst 1
add
istore 13
jump LABEL223
LABEL333:
sconst "chatboxBackgroundBuilt"
runelite_callback
jump LABEL394
LABEL334:
iconst 10616867
iconst 3
iconst 0
cc_create
iconst 0
iconst 16384
iconst 1
iconst 2
cc_setsize
iconst 0
iconst 0
iconst 1
iconst 2
cc_setposition
iconst 0
cc_setcolour
iconst 1
cc_setfill
iconst 225
cc_settrans
iconst 10616886
iconst 3
iconst 0
cc_create
iconst 10616886
iconst 3
iconst 1
cc_create 1
iconst 16384
iconst 1
iconst 2
iconst 0
cc_setsize
iconst 16384
iconst 1
iconst 2
iconst 0
cc_setsize 1
iconst 0
iconst 0
iconst 0
iconst 0
cc_setposition
iconst 0
iconst 15
iconst 0
iconst 2
cc_setposition 1
iconst 16777215
cc_setcolour
iconst 16777215
cc_setcolour 1
iconst 1
cc_setfill
iconst 1
cc_setfill 1
iconst 200
cc_settrans
iconst 130
cc_settrans 1
LABEL394:
iconst 10617389
iconst 1190
iconst 1187
iconst 1188
iconst 1189
iconst 1185
iconst 1186
iconst 1
invoke 838
iload 0
iconst 1
if_icmpeq LABEL407
jump LABEL411
LABEL407:
iconst 255
iconst 10616835
if_settrans
jump LABEL442
LABEL411:
invoke 1972
iconst 0
if_icmpeq LABEL415
jump LABEL419
LABEL415:
iconst 155
iconst 10616835
if_settrans
jump LABEL442
LABEL419:
iconst 255
iconst 10616835
if_settrans
iconst 10616834
iconst 3
iconst 0
cc_create
iconst 0
iconst 0
iconst 1
iconst 1
cc_setsize
iconst 0
iconst 0
iconst 1
iconst 1
cc_setposition
iconst 0
cc_setcolour
iconst 1
cc_setfill
iconst 225
cc_settrans
LABEL442:
return