Merge branch 'master' into an-not-taters

This commit is contained in:
Lucwousin
2019-11-21 22:09:01 +01:00
committed by GitHub
3 changed files with 13 additions and 41 deletions

View File

@@ -41,7 +41,6 @@ import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Client;
import net.runelite.api.GameState;
import net.runelite.api.Point;
import static net.runelite.api.ScriptID.MAGIC_SPELLBOOK_REDRAW;
import net.runelite.api.VarClientInt;
import net.runelite.api.Varbits;
import net.runelite.api.events.GameStateChanged;
@@ -52,13 +51,8 @@ import net.runelite.api.util.Text;
import net.runelite.api.vars.InterfaceTab;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo;
import static net.runelite.api.widgets.WidgetInfo.SPELLBOOK;
import static net.runelite.api.widgets.WidgetInfo.SPELLBOOK_FILTERED_BOUNDS;
import static net.runelite.api.widgets.WidgetInfo.SPELLBOOK_FILTERED_SPELLS_PARENT;
import static net.runelite.api.widgets.WidgetInfo.SPELLBOOK_FILTER_BUTTON;
import static net.runelite.api.widgets.WidgetInfo.SPELLBOOK_FILTER_BUTTONS_PARENT;
import static net.runelite.api.widgets.WidgetInfo.SPELLBOOK_FILTER_BUTTON_PARENT;
import static net.runelite.api.widgets.WidgetInfo.SPELLBOOK_FILTER_SECTION_PARENT;
import static net.runelite.api.widgets.WidgetInfo.SPELL_TOOLTIP;
import net.runelite.client.callback.ClientThread;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
@@ -476,12 +470,7 @@ private void updateConfig()
return;
}
// CHECKSTYLE:OFF
final Collection<Spell> gson = GSON.fromJson(cfg, new TypeToken<List<Spell>>()
{
}
.getType());
// CHECKSTYLE:ON
final Collection<Spell> gson = GSON.fromJson(cfg, new TypeToken<List<Spell>>() {}.getType());
for (final Spell s : gson)
{
@@ -510,23 +499,17 @@ private void updateConfig()
// The magic numbers probably are mobile specific widgetids
// openosrs mobile when?
clientThread.invoke(() ->
client.runScript(
MAGIC_SPELLBOOK_REDRAW,
SPELLBOOK_FILTERED_BOUNDS.getId(),
0x00da00b3,
SPELL_TOOLTIP.getId(),
SPELLBOOK_FILTERED_SPELLS_PARENT.getId(),
SPELLBOOK_FILTER_BUTTON_PARENT.getId(),
0x00da00ba,
SPELLBOOK_FILTER_BUTTON.getId(),
0x00da0002,
SPELLBOOK_FILTER_SECTION_PARENT.getId(),
SPELLBOOK_FILTER_BUTTONS_PARENT.getId(),
"Info",
"Filters",
false
)
);
{
final Widget spellWidget = client.getWidget(SPELLBOOK);
if (spellWidget != null)
{
final Object[] args = spellWidget.getOnInvTransmit();
if (args != null)
{
client.runScript(args);
}
}
});
}
boolean isNotOnSpellWidget()