Merge remote-tracking branch 'runelite/master'
This commit is contained in:
@@ -34,9 +34,11 @@ import net.runelite.api.MenuOpcode;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.ObjectDefinition;
|
||||
import net.runelite.api.SpriteID;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.MenuEntryAdded;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
import net.runelite.api.events.WidgetHiddenChanged;
|
||||
import net.runelite.api.events.WidgetLoaded;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.api.widgets.JavaScriptCallback;
|
||||
@@ -104,14 +106,12 @@ public class WikiPlugin extends Plugin
|
||||
@Override
|
||||
public void startUp()
|
||||
{
|
||||
spriteManager.addSpriteOverrides(WikiSprite.values());
|
||||
clientThread.invokeLater(this::addWidgets);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutDown()
|
||||
{
|
||||
spriteManager.removeSpriteOverrides(WikiSprite.values());
|
||||
clientThread.invokeLater(() ->
|
||||
{
|
||||
Widget minimapOrbs = client.getWidget(WidgetInfo.MINIMAP_ORBS);
|
||||
@@ -126,6 +126,12 @@ public class WikiPlugin extends Plugin
|
||||
}
|
||||
children[0] = null;
|
||||
|
||||
Widget vanilla = client.getWidget(WidgetInfo.MINIMAP_WIKI_BANNER);
|
||||
if (vanilla != null)
|
||||
{
|
||||
vanilla.setHidden(false);
|
||||
}
|
||||
|
||||
onDeselect();
|
||||
client.setSpellSelected(false);
|
||||
});
|
||||
@@ -148,14 +154,20 @@ public class WikiPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
Widget vanilla = client.getWidget(WidgetInfo.MINIMAP_WIKI_BANNER);
|
||||
if (vanilla != null)
|
||||
{
|
||||
vanilla.setHidden(true);
|
||||
}
|
||||
|
||||
icon = minimapOrbs.createChild(0, WidgetType.GRAPHIC);
|
||||
icon.setSpriteId(WikiSprite.WIKI_ICON.getSpriteId());
|
||||
icon.setSpriteId(SpriteID.WIKI_DESELECTED);
|
||||
icon.setOriginalX(0);
|
||||
icon.setOriginalY(2);
|
||||
icon.setOriginalY(0);
|
||||
icon.setXPositionMode(WidgetPositionMode.ABSOLUTE_RIGHT);
|
||||
icon.setYPositionMode(WidgetPositionMode.ABSOLUTE_BOTTOM);
|
||||
icon.setOriginalWidth(42);
|
||||
icon.setOriginalHeight(16);
|
||||
icon.setOriginalWidth(40);
|
||||
icon.setOriginalHeight(14);
|
||||
icon.setTargetVerb("Lookup");
|
||||
icon.setName("Wiki");
|
||||
icon.setClickMask(WidgetConfig.USE_GROUND_ITEM | WidgetConfig.USE_ITEM | WidgetConfig.USE_NPC
|
||||
@@ -164,7 +176,7 @@ public class WikiPlugin extends Plugin
|
||||
icon.setOnTargetEnterListener((JavaScriptCallback) ev ->
|
||||
{
|
||||
wikiSelected = true;
|
||||
icon.setSpriteId(WikiSprite.WIKI_SELECTED_ICON.getSpriteId());
|
||||
icon.setSpriteId(SpriteID.WIKI_SELECTED);
|
||||
client.setAllWidgetsAreOpTargetable(true);
|
||||
});
|
||||
icon.setAction(5, "Search"); // Start at option 5 so the target op is ontop
|
||||
@@ -180,6 +192,15 @@ public class WikiPlugin extends Plugin
|
||||
icon.revalidate();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
private void onWidgetHiddenChanged(WidgetHiddenChanged ev)
|
||||
{
|
||||
if (ev.getWidget().getId() == WidgetInfo.MINIMAP_WIKI_BANNER.getId())
|
||||
{
|
||||
ev.getWidget().setHidden(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void onDeselect()
|
||||
{
|
||||
client.setAllWidgetsAreOpTargetable(false);
|
||||
@@ -187,7 +208,7 @@ public class WikiPlugin extends Plugin
|
||||
wikiSelected = false;
|
||||
if (icon != null)
|
||||
{
|
||||
icon.setSpriteId(WikiSprite.WIKI_ICON.getSpriteId());
|
||||
icon.setSpriteId(SpriteID.WIKI_DESELECTED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,59 +373,6 @@ public class WikiPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
if (Ints.contains(QUESTLIST_WIDGET_IDS, widgetID)
|
||||
&& ((wikiSelected && widgetIndex != -1) || "Read Journal:".equals(event.getOption())))
|
||||
{
|
||||
Widget w = getWidget(widgetID, widgetIndex);
|
||||
String target = w.getName();
|
||||
|
||||
client.insertMenuItem(
|
||||
MENUOP_QUICKGUIDE,
|
||||
target,
|
||||
MenuOpcode.RUNELITE.getId(),
|
||||
0,
|
||||
widgetIndex,
|
||||
widgetID,
|
||||
false
|
||||
);
|
||||
|
||||
client.insertMenuItem(
|
||||
MENUOP_GUIDE,
|
||||
target,
|
||||
MenuOpcode.RUNELITE.getId(),
|
||||
0,
|
||||
widgetIndex,
|
||||
widgetID,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
if (widgetID == WidgetInfo.ACHIEVEMENT_DIARY_CONTAINER.getId()
|
||||
&& event.getOption().contains("Open"))
|
||||
{
|
||||
Widget w = getWidget(widgetID, widgetIndex);
|
||||
if (w.getActions() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
String action = firstAction(w);
|
||||
if (action == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
client.insertMenuItem(
|
||||
MENUOP_WIKI,
|
||||
action.replace("Open ", "").replace("Journal", "Diary"),
|
||||
MenuOpcode.RUNELITE.getId(),
|
||||
0,
|
||||
widgetIndex,
|
||||
widgetID,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
if (WidgetInfo.TO_GROUP(widgetID) == WidgetInfo.SKILLS_CONTAINER.getGroupId()
|
||||
&& event.getOption().contains("View"))
|
||||
{
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Abex
|
||||
* 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.wiki;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.runelite.api.SpriteID;
|
||||
import net.runelite.client.game.SpriteOverride;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public enum WikiSprite implements SpriteOverride
|
||||
{
|
||||
WIKI_ICON(-300, "wiki.png"),
|
||||
WIKI_SELECTED_ICON(-301, "wiki_selected.png"),
|
||||
FIXED_MODE_MINIMAP_CLICKMASK(SpriteID.MINIMAP_CLICK_MASK, "fixed_mode_minimap_clickmask.png");
|
||||
|
||||
@Getter(AccessLevel.PUBLIC)
|
||||
private final int spriteId;
|
||||
|
||||
@Getter(AccessLevel.PUBLIC)
|
||||
private final String fileName;
|
||||
}
|
||||
@@ -9676,5 +9676,10 @@
|
||||
24438,
|
||||
24439,
|
||||
24440
|
||||
],
|
||||
"twisted relichunter armour set": [
|
||||
24469,
|
||||
24472,
|
||||
24475
|
||||
]
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 654 B |
Binary file not shown.
|
Before Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.0 KiB |
@@ -1 +1 @@
|
||||
2F7E219C24E4725FA8F3BCDD9F2A640666CC589B514FEBD9F5938B207F06C0EB
|
||||
1E915795AFAA25E3ABE595EEAC55423C3E5E9E5CE2582AD1A5AAEC91647CC124
|
||||
@@ -39,7 +39,7 @@ LABEL20:
|
||||
if_icmpeq LABEL31
|
||||
iconst 0 ; Modified to enable clanchat input
|
||||
sconst "clanchatInput"
|
||||
runelite_callback
|
||||
runelite_callback
|
||||
iconst 1
|
||||
if_icmpeq LABEL31 ; Compare to 1
|
||||
jump LABEL37
|
||||
@@ -82,13 +82,13 @@ LABEL58:
|
||||
iload 0
|
||||
iconst 84
|
||||
if_icmpeq LABEL62
|
||||
jump LABEL179
|
||||
jump LABEL189
|
||||
LABEL62:
|
||||
invoke 1984
|
||||
iload 2
|
||||
iconst 0
|
||||
if_icmpgt LABEL67
|
||||
jump LABEL178
|
||||
jump LABEL188
|
||||
LABEL67:
|
||||
get_varc_string 335
|
||||
sconst "/"
|
||||
@@ -146,7 +146,7 @@ LABEL108:
|
||||
iconst 0
|
||||
invoke 96
|
||||
LABEL111:
|
||||
jump LABEL174
|
||||
jump LABEL184
|
||||
LABEL112:
|
||||
get_varc_string 335
|
||||
sconst "::"
|
||||
@@ -154,12 +154,12 @@ LABEL112:
|
||||
string_indexof_string
|
||||
iconst 0
|
||||
if_icmpeq LABEL119
|
||||
jump LABEL171
|
||||
jump LABEL181
|
||||
LABEL119:
|
||||
iload 2
|
||||
iconst 2
|
||||
if_icmpgt LABEL123
|
||||
jump LABEL167
|
||||
jump LABEL177
|
||||
LABEL123:
|
||||
get_varc_string 335
|
||||
sconst "::toggleroof"
|
||||
@@ -185,23 +185,35 @@ LABEL139:
|
||||
sconst "Roofs are now all hidden."
|
||||
mes
|
||||
LABEL143:
|
||||
jump LABEL166
|
||||
jump LABEL176
|
||||
LABEL144:
|
||||
get_varc_string 335
|
||||
sconst "::bank"
|
||||
sconst "::wiki"
|
||||
iconst 0
|
||||
string_indexof_string
|
||||
iconst 0
|
||||
if_icmpeq LABEL151
|
||||
sconst "runeliteCommand" ; load callback name
|
||||
runelite_callback ; invoke callback
|
||||
jump LABEL155
|
||||
jump LABEL154
|
||||
LABEL151:
|
||||
get_varc_string 335
|
||||
invoke 3299
|
||||
jump LABEL176
|
||||
LABEL154:
|
||||
get_varc_string 335
|
||||
sconst "::bank"
|
||||
iconst 0
|
||||
string_indexof_string
|
||||
iconst 0
|
||||
if_icmpeq LABEL161
|
||||
jump LABEL165
|
||||
LABEL161:
|
||||
sconst "Hey, everyone, I just tried to do something very silly!"
|
||||
iconst 0
|
||||
invoke 96
|
||||
jump LABEL166
|
||||
LABEL155:
|
||||
jump LABEL176
|
||||
LABEL165:
|
||||
get_varc_string 335
|
||||
invoke 224
|
||||
set_varc_string 335
|
||||
@@ -213,42 +225,28 @@ LABEL155:
|
||||
iload 2
|
||||
substring
|
||||
docheat
|
||||
LABEL166:
|
||||
jump LABEL170
|
||||
LABEL167:
|
||||
LABEL176:
|
||||
jump LABEL180
|
||||
LABEL177:
|
||||
get_varc_string 335
|
||||
iconst 0
|
||||
invoke 96
|
||||
LABEL170:
|
||||
jump LABEL174
|
||||
LABEL171:
|
||||
LABEL180:
|
||||
jump LABEL184
|
||||
LABEL181:
|
||||
get_varc_string 335
|
||||
iconst 0
|
||||
invoke 96
|
||||
LABEL174:
|
||||
LABEL184:
|
||||
get_varc_string 335
|
||||
invoke 77
|
||||
sconst ""
|
||||
set_varc_string 335
|
||||
LABEL178:
|
||||
jump LABEL247
|
||||
LABEL179:
|
||||
iload 0
|
||||
iconst 104
|
||||
if_icmpeq LABEL183
|
||||
jump LABEL189
|
||||
LABEL183:
|
||||
iload 3
|
||||
iconst 1
|
||||
if_icmpeq LABEL187
|
||||
jump LABEL188
|
||||
LABEL187:
|
||||
invoke 75
|
||||
LABEL188:
|
||||
jump LABEL247
|
||||
jump LABEL257
|
||||
LABEL189:
|
||||
iload 0
|
||||
iconst 105
|
||||
iconst 104
|
||||
if_icmpeq LABEL193
|
||||
jump LABEL199
|
||||
LABEL193:
|
||||
@@ -257,38 +255,52 @@ LABEL193:
|
||||
if_icmpeq LABEL197
|
||||
jump LABEL198
|
||||
LABEL197:
|
||||
invoke 76
|
||||
invoke 75
|
||||
LABEL198:
|
||||
jump LABEL247
|
||||
jump LABEL257
|
||||
LABEL199:
|
||||
iload 0
|
||||
iconst 80
|
||||
iconst 105
|
||||
if_icmpeq LABEL203
|
||||
jump LABEL241
|
||||
jump LABEL209
|
||||
LABEL203:
|
||||
iload 3
|
||||
iconst 1
|
||||
if_icmpeq LABEL207
|
||||
jump LABEL208
|
||||
LABEL207:
|
||||
invoke 76
|
||||
LABEL208:
|
||||
jump LABEL257
|
||||
LABEL209:
|
||||
iload 0
|
||||
iconst 80
|
||||
if_icmpeq LABEL213
|
||||
jump LABEL251
|
||||
LABEL213:
|
||||
get_varc_string 356
|
||||
string_length
|
||||
iconst 0
|
||||
if_icmpgt LABEL208
|
||||
jump LABEL228
|
||||
LABEL208:
|
||||
if_icmpgt LABEL218
|
||||
jump LABEL238
|
||||
LABEL218:
|
||||
get_varc_string 356
|
||||
friend_test
|
||||
iconst 1
|
||||
if_icmpeq LABEL213
|
||||
jump LABEL216
|
||||
LABEL213:
|
||||
if_icmpeq LABEL223
|
||||
jump LABEL226
|
||||
LABEL223:
|
||||
get_varc_string 356
|
||||
invoke 107
|
||||
return
|
||||
LABEL216:
|
||||
LABEL226:
|
||||
get_varc_int 60
|
||||
clientclock
|
||||
if_icmpgt LABEL220
|
||||
jump LABEL221
|
||||
LABEL220:
|
||||
if_icmpgt LABEL230
|
||||
jump LABEL231
|
||||
LABEL230:
|
||||
return
|
||||
LABEL221:
|
||||
LABEL231:
|
||||
clientclock
|
||||
iconst 50
|
||||
add
|
||||
@@ -296,14 +308,14 @@ LABEL221:
|
||||
sconst "That player was not found on your Friends list."
|
||||
mes
|
||||
return
|
||||
LABEL228:
|
||||
LABEL238:
|
||||
get_varc_int 60
|
||||
clientclock
|
||||
if_icmpgt LABEL232
|
||||
jump LABEL233
|
||||
LABEL232:
|
||||
if_icmpgt LABEL242
|
||||
jump LABEL243
|
||||
LABEL242:
|
||||
return
|
||||
LABEL233:
|
||||
LABEL243:
|
||||
clientclock
|
||||
iconst 50
|
||||
add
|
||||
@@ -311,8 +323,8 @@ LABEL233:
|
||||
sconst "You haven't received any messages to which you can reply."
|
||||
mes
|
||||
return
|
||||
jump LABEL247
|
||||
LABEL241:
|
||||
jump LABEL257
|
||||
LABEL251:
|
||||
get_varc_string 335
|
||||
iconst 0
|
||||
iload 0
|
||||
@@ -324,9 +336,9 @@ LABEL241:
|
||||
runelite_callback ;
|
||||
if_icmpeq SKIPSETVARC ; skip setting varc with input
|
||||
set_varc_string 335
|
||||
jump LABEL247 ; jump over SKIPSETVARC
|
||||
jump LABEL257 ; jump over SKIPSETVARC
|
||||
SKIPSETVARC:
|
||||
pop_string ; pop message
|
||||
LABEL247:
|
||||
pop_string ; pop message
|
||||
LABEL257:
|
||||
invoke 223
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user