Merge branch 'master' into better-script-info

# Conflicts:
#	runelite-client/src/main/resources/scripts/ChatboxInputWidgetBuilder.rs2asm
#	runelite-client/src/main/resources/scripts/OptionsPanelRebuilder.rs2asm
#	runelite-client/src/main/resources/scripts/SpecbarRedraw.rs2asm
#	runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.hash
#	runelite-client/src/main/scripts/OptionsPanelRebuilder.hash
#	runelite-client/src/main/scripts/SpecbarRedraw.hash
This commit is contained in:
therealunull
2020-10-29 13:23:04 -04:00
36 changed files with 603 additions and 145 deletions

View File

@@ -61,6 +61,7 @@ import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
@@ -246,6 +247,7 @@ public class ConfigManager
return str;
}
@Nullable
static String objectToString(Object object)
{
if (object instanceof Color)
@@ -310,7 +312,8 @@ public class ConfigManager
{
return String.valueOf(object);
}
return object.toString();
return object == null ? null : object.toString();
}
public static <T extends Enum<T>> Class<T> getElementType(EnumSet<T> enumSet)

View File

@@ -0,0 +1,32 @@
/*
* Copyright (c) 2020 Jordan <nightfirecat@protonmail.com>
* 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.game;
public class AlternateSprites
{
public static final String DISEASE_HEART = "1067-DISEASE.png";
public static final String POISON_HEART = "1067-POISON.png";
public static final String VENOM_HEART = "1067-VENOM.png";
}

View File

@@ -68,8 +68,8 @@ public enum ItemMapping
ITEM_DRAGON_SCIMITAR(DRAGON_SCIMITAR, DRAGON_SCIMITAR_OR),
ITEM_DRAGON_SCIMITAR_ORNAMENT_KIT(DRAGON_SCIMITAR_ORNAMENT_KIT, DRAGON_SCIMITAR_OR),
ITEM_DRAGON_DEFENDER(DRAGON_DEFENDER_ORNAMENT_KIT, DRAGON_DEFENDER_T),
ITEM_DRAGON_PICKAXE(DRAGON_PICKAXE, DRAGON_PICKAXE_12797, DRAGON_PICKAXEOR),
ITEM_DRAGON_PICKAXE_OR(ZALCANO_SHARD, DRAGON_PICKAXEOR),
ITEM_DRAGON_PICKAXE(DRAGON_PICKAXE, DRAGON_PICKAXE_12797, DRAGON_PICKAXE_OR),
ITEM_DRAGON_PICKAXE_OR(ZALCANO_SHARD, DRAGON_PICKAXE_OR),
ITEM_DRAGON_KITESHIELD(DRAGON_KITESHIELD, DRAGON_KITESHIELD_G),
ITEM_DRAGON_KITESHIELD_ORNAMENT_KIT(DRAGON_KITESHIELD_ORNAMENT_KIT, DRAGON_KITESHIELD_G),
ITEM_DRAGON_FULL_HELM(DRAGON_FULL_HELM, DRAGON_FULL_HELM_G),

View File

@@ -51,6 +51,7 @@ public abstract class Overlay implements LayoutableRenderableEntity
private OverlayLayer layer = OverlayLayer.UNDER_WIDGETS;
private final List<OverlayMenuEntry> menuEntries = new ArrayList<>();
private boolean resizable;
private int minimumSize = 32;
private boolean resettable = true;
/**

View File

@@ -74,7 +74,6 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
private static final int BORDER = 5;
private static final int BORDER_TOP = BORDER + 15;
private static final int PADDING = 2;
private static final int MIN_OVERLAY_SIZE = 32;
private static final int OVERLAY_RESIZE_TOLERANCE = 5;
private static final Dimension SNAP_CORNER_SIZE = new Dimension(80, 80);
private static final Color SNAP_CORNER_COLOR = new Color(0, 255, 255, 50);
@@ -557,8 +556,9 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
// center
}
final int widthOverflow = Math.max(0, MIN_OVERLAY_SIZE - width);
final int heightOverflow = Math.max(0, MIN_OVERLAY_SIZE - height);
final int minOverlaySize = currentManagedOverlay.getMinimumSize();
final int widthOverflow = Math.max(0, minOverlaySize - width);
final int heightOverflow = Math.max(0, minOverlaySize - height);
final int dx = x - originalX;
final int dy = y - originalY;
@@ -566,7 +566,7 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
// dimensions and adjust the x/y position accordingly as needed
if (widthOverflow > 0)
{
width = MIN_OVERLAY_SIZE;
width = minOverlaySize;
if (dx > 0)
{
@@ -575,7 +575,7 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
}
if (heightOverflow > 0)
{
height = MIN_OVERLAY_SIZE;
height = minOverlaySize;
if (dy > 0)
{

View File

@@ -65,6 +65,9 @@ public class WidgetOverlay extends Overlay
.put(WidgetInfo.GAUNTLET_TIMER_CONTAINER, OverlayPosition.TOP_LEFT)
.put(WidgetInfo.HALLOWED_SEPULCHRE_TIMER_CONTAINER, OverlayPosition.TOP_LEFT)
.put(WidgetInfo.HEALTH_OVERLAY_BAR, OverlayPosition.TOP_CENTER)
.put(WidgetInfo.NIGHTMARE_PILLAR_HEALTH, OverlayPosition.TOP_LEFT)
.put(WidgetInfo.VOLCANIC_MINE_VENTS_INFOBOX_GROUP, OverlayPosition.BOTTOM_RIGHT)
.put(WidgetInfo.VOLCANIC_MINE_STABILITY_INFOBOX_GROUP, OverlayPosition.BOTTOM_LEFT)
.build();
public static Collection<WidgetOverlay> createOverlays(final Client client)

View File

@@ -594,7 +594,7 @@ public class WeaponMap
StyleMap.put(ItemID.MITHRIL_KNIFEP_5657, WeaponStyle.RANGE);
StyleMap.put(ItemID.MITHRIL_KNIFEP_5664, WeaponStyle.RANGE);
StyleMap.put(ItemID.MITHRIL_THROWNAXE, WeaponStyle.RANGE);
StyleMap.put(ItemID.MITH_CROSSBOW, WeaponStyle.RANGE);
StyleMap.put(ItemID.MITHRIL_CROSSBOW, WeaponStyle.RANGE);
StyleMap.put(ItemID.MONKEY_TALISMAN, WeaponStyle.RANGE);
StyleMap.put(ItemID.MORRIGANS_JAVELIN, WeaponStyle.RANGE);
StyleMap.put(ItemID.MORRIGANS_JAVELIN_23619, WeaponStyle.RANGE);

View File

@@ -2413,6 +2413,10 @@
1947,
5607
],
"pumpkin": [
1959,
24979
],
"easter egg": [
1961,
7928,
@@ -2432,7 +2436,11 @@
22519,
22520,
24367,
24426
24426,
24971,
24973,
24994,
24996
],
"empty cup": [
1980,
@@ -6238,6 +6246,10 @@
9179,
9459
],
"mithril crossbow": [
9181,
9461
],
"adamant crossbow": [
9183,
9463
@@ -7251,7 +7263,9 @@
21061,
21063,
24743,
24745
24745,
25069,
25071
],
"graceful cape": [
11852,
@@ -7271,7 +7285,9 @@
21064,
21066,
24746,
24748
24748,
25072,
25074
],
"graceful top": [
11854,
@@ -7291,7 +7307,9 @@
21067,
21069,
24749,
24751
24751,
25075,
25077
],
"graceful legs": [
11856,
@@ -7311,7 +7329,9 @@
21070,
21072,
24752,
24754
24754,
25078,
25080
],
"graceful gloves": [
11858,
@@ -7331,7 +7351,9 @@
21073,
21075,
24755,
24757
24757,
25081,
25083
],
"graceful boots": [
11860,
@@ -7351,7 +7373,9 @@
21076,
21078,
24758,
24760
24760,
25084,
25086
],
"slayer helmet": [
11864,
@@ -9282,6 +9306,10 @@
24365,
24366
],
"twisted adamant trophy": [
24376,
25046
],
"twisted hat": [
24387,
24397,
@@ -9311,7 +9339,7 @@
24439,
24440
],
"twisted relichunter armour set": [
"twisted relic hunter armour set": [
24469,
24472,
24475
@@ -9428,5 +9456,41 @@
"mahogany bed": [
24921,
24925
],
"trailblazer hood": [
25001,
25016,
25028
],
"trailblazer coat": [
25004,
25019,
25031
],
"trailblazer trousers": [
25007,
25022,
25034
],
"trailblazer boots": [
25010,
25025,
25037
],
"trailblazer harpoon": [
25059,
25114
],
"trailblazer pickaxe": [
25063,
25112
],
"trailblazer axe": [
25066,
25110
],
"extradimensional bag": [
25106,
25108
]
}

View File

@@ -55,7 +55,7 @@ LABEL42:
jump LABEL51
LABEL46:
sconst "<img=22>"
chat_playername
chat_playername
join_string 2
sstore 2
jump LABEL59
@@ -64,8 +64,8 @@ LABEL51:
iconst 115
iconst 1894
get_varbit 1777
enum
chat_playername
enum
chat_playername
join_string 2
sstore 2
LABEL59:
@@ -76,7 +76,7 @@ LABEL59:
LABEL63:
sload 2
sconst "<img=19>"
append
append
sstore 2
LABEL67:
sload 2
@@ -85,7 +85,7 @@ LABEL67:
sload 1
sconst "</col>"
join_string 4
append
append
sstore 2
iload 2
iconst 80
@@ -97,13 +97,13 @@ LABEL79:
sconst "*"
sconst "</col>"
join_string 3
append
append
sstore 2
LABEL86:
sload 2
iconst 2147483647
iconst 495
parawidth
parawidth
istore 3
iload 4
iconst 1
@@ -113,19 +113,19 @@ LABEL95:
iconst 60
iconst 5
iload 3
add
add
invoke 1045
iconst 30
iconst 0
iconst 0
iconst 10616871
if_setsize
if_setsize
iconst 0
iconst 0
iconst 0
iconst 2
iconst 10616871
if_setposition
if_setposition
jump LABEL124
LABEL112:
iconst 0
@@ -133,17 +133,17 @@ LABEL112:
iconst 0
iconst 1
iconst 10616871
if_setsize
if_setsize
iconst 0
iconst 0
iconst 0
iconst 2
iconst 10616871
if_setposition
if_setposition
LABEL124:
iload 3
iconst 10616890
if_getwidth
if_getwidth
if_icmpgt LABEL129
jump LABEL135
LABEL129:
@@ -151,29 +151,29 @@ LABEL129:
iconst 2
iconst 0
iconst 10616890
if_settextalign
if_settextalign
jump LABEL140
LABEL135:
iconst 0
iconst 2
iconst 0
iconst 10616890
if_settextalign
if_settextalign
LABEL140:
iconst 10616890
if_clearops
if_clearops
iconst -1
sconst ""
iconst 10616890
if_setonmouserepeat
if_setonmouserepeat
iconst -1
sconst ""
iconst 10616890
if_setonmouseleave
if_setonmouseleave
iconst -1
sconst ""
iconst 10616890
if_setonop
if_setonop
jump LABEL205
LABEL155:
invoke 3160
@@ -191,7 +191,7 @@ LABEL164:
iconst 115
iconst 1894
get_varbit 1777
enum
enum
sconst " You must set a name before you can chat."
join_string 2
sstore 2
@@ -200,35 +200,35 @@ LABEL172:
iconst 2
iconst 0
iconst 10616890
if_settextalign
if_settextalign
iconst 10
sconst "Configure"
iconst 10616890
if_setop
if_setop
sconst "<col=ff9040>"
sconst "Display name"
sconst "</col>"
join_string 3
iconst 10616890
if_setopbase
if_setopbase
iconst 45
iconst -2147483645
iload 1
sconst "Ii"
iconst 10616890
if_setonmouserepeat
if_setonmouserepeat
iconst 45
iconst -2147483645
iload 0
sconst "Ii"
iconst 10616890
if_setonmouseleave
if_setonmouseleave
iconst 489
iconst -2147483644
iconst 1024
sconst "ii"
iconst 10616890
if_setonop
if_setonop
LABEL205:
sload 2
iconst 10616890

View File

@@ -277,28 +277,28 @@ LABEL253:
get_varc_int 73
iconst 128
sconst "outerZoomLimit"
runelite_callback
runelite_callback
if_icmpge LABEL262
jump LABEL278
LABEL262:
get_varc_int 73
iconst 896
sconst "innerZoomLimit"
runelite_callback
runelite_callback
if_icmple LABEL266
jump LABEL278
LABEL266:
get_varc_int 74
iconst 128
sconst "outerZoomLimit"
runelite_callback
runelite_callback
if_icmpge LABEL270
jump LABEL278
LABEL270:
get_varc_int 74
iconst 896
sconst "innerZoomLimit"
runelite_callback
runelite_callback
if_icmple LABEL274
jump LABEL278
LABEL274:
@@ -329,17 +329,17 @@ LABEL292:
iconst 0
iconst 0
iload 2
if_setsize
if_setsize
iload 10
iload 14
sub
sub
iload 11
iload 15
sub
sub
iconst 0
iconst 0
iload 3
if_setsize
if_setsize
iload 4
iconst -1
if_icmpne LABEL312
@@ -355,39 +355,39 @@ LABEL316:
iconst 0
iconst 0
iload 4
if_setposition
if_setposition
iload 6
iload 7
iconst 0
iconst 0
iload 5
if_setposition
if_setposition
iload 6
iload 8
add
add
iload 7
iload 9
add
add
iconst 1
iconst 1
iload 4
if_setsize
if_setsize
iload 6
iload 8
add
add
iload 7
iload 9
add
add
iconst 1
iconst 1
iload 5
if_setsize
if_setsize
iload 1
iconst 73
iconst 73
iload 1
iconst 10551309
enum
enum
iload 5
iload 8
iload 9
@@ -399,7 +399,7 @@ LABEL359:
iconst 73
iload 1
iconst 10551309
enum
enum
iload 3
iconst 0
iconst 0
@@ -409,7 +409,7 @@ LABEL369:
iconst 73
iload 1
iconst 10551311
enum
enum
istore 18
iload 18
iconst -1
@@ -422,7 +422,7 @@ LABEL379:
jump LABEL417
LABEL383:
iload 18
if_hassub
if_hassub
iconst 1
if_icmpeq LABEL388
jump LABEL417
@@ -437,7 +437,7 @@ LABEL392:
iconst 0
iconst 1
iload 18
if_setsize
if_setsize
jump LABEL416
LABEL399:
get_varc_int 173
@@ -450,7 +450,7 @@ LABEL403:
iconst 1
iconst 1
iload 18
if_setsize
if_setsize
jump LABEL416
LABEL410:
iconst 512
@@ -458,7 +458,7 @@ LABEL410:
iconst 0
iconst 0
iload 18
if_setsize
if_setsize
LABEL416:
jump LABEL423
LABEL417:
@@ -467,13 +467,13 @@ LABEL417:
iconst 0
iconst 0
iload 18
if_setsize
if_setsize
LABEL423:
iconst 73
iconst 73
iload 1
iconst 10551313
enum
enum
istore 18
iconst 0
istore 19
@@ -488,8 +488,8 @@ LABEL437:
iconst 73
iload 1
iconst 10551304
enum
if_hassub
enum
if_hassub
iconst 1
if_icmpeq LABEL446
jump LABEL455
@@ -518,13 +518,13 @@ LABEL459:
LABEL463:
iconst 182
iconst 4
add
add
istore 19
jump LABEL472
LABEL468:
iconst 120
iconst 4
add
add
istore 19
LABEL472:
jump LABEL475
@@ -537,7 +537,7 @@ LABEL475:
iconst 2
iconst 0
iload 18
if_setposition
if_setposition
LABEL481:
iconst 73
iconst 73

View File

@@ -28,7 +28,7 @@ LABEL18:
iconst 0 ; Boolean
sconst "drawSpecbarAnyway"
runelite_callback
if_icmpeq LABEL38 ; change this
if_icmpeq LABEL38
iconst 1
iconst 38862883
if_sethide
@@ -103,6 +103,17 @@ LABEL69:
iload 3
iload 2
invoke 189
iconst 38862884
iconst 0
invoke 835
pop_int ; Specbar is fully built here
iload 1
iconst 0
if_icmple RETURN ; Return if the weapon isn't supposed to have a spec
jump CONTINUE ; Idk why I'm doing it like this but it's the jagex way
RETURN:
return
CONTINUE:
iload 3
iload 1
if_icmpge LABEL86

View File

@@ -0,0 +1 @@
7AA081A68C6157F9B74DDB6B04F00B1691113941EED8996A4DEABF643F45EA25

View File

@@ -0,0 +1 @@
1CCC672616971AEB7A1E4C00885367CEFC75A873DD22A37BE99652F2DA107653

View File

@@ -0,0 +1 @@
1EDA8CA79506CC62A192A844B88AC924BAD3060D9E32150C43458E135908329B

View File

@@ -122,6 +122,18 @@ public class ConfigManagerTest
TestConfig conf = manager.getConfig(TestConfig.class);
ConfigDescriptor descriptor = manager.getConfigDescriptor(conf);
Assert.assertEquals(1, descriptor.getItems().size());
Assert.assertEquals(2, descriptor.getItems().size());
}
@Test
public void testResetNullDefaultConfig()
{
TestConfig conf = manager.getConfig(TestConfig.class);
ConfigDescriptor descriptor = manager.getConfigDescriptor(conf);
conf.nullDefaultKey("new value");
manager.unsetConfiguration(descriptor.getGroup().value(), "nullDefaultKey");
manager.setDefaultConfiguration(conf, false);
Assert.assertNull(conf.nullDefaultKey());
}
}

View File

@@ -43,4 +43,21 @@ public interface TestConfig extends Config
description = "value"
)
void key(String key);
@ConfigItem(
keyName = "nullDefaultKey",
name = "Key Name",
description = "value"
)
void nullDefaultKey(String key);
@ConfigItem(
keyName = "nullDefaultKey",
name = "Key Name",
description = "value"
)
default String nullDefaultKey()
{
return null;
}
}