Merge branch 'master' of https://github.com/runelite/runelite into upstream-4-7-2020
Conflicts: http-api/src/main/java/net/runelite/http/api/item/ItemClient.java http-service/src/main/java/net/runelite/http/service/item/ItemController.java http-service/src/main/java/net/runelite/http/service/item/ItemEntry.java http-service/src/main/java/net/runelite/http/service/item/ItemService.java http-service/src/main/java/net/runelite/http/service/item/RSItem.java http-service/src/main/java/net/runelite/http/service/item/RSItemResponse.java runelite-api/src/main/java/net/runelite/api/ScriptID.java runelite-api/src/main/java/net/runelite/api/Varbits.java runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java runelite-client/src/main/java/net/runelite/client/callback/Hooks.java runelite-client/src/main/java/net/runelite/client/plugins/antidrag/AntiDragConfig.java runelite-client/src/main/java/net/runelite/client/plugins/antidrag/AntiDragPlugin.java runelite-client/src/main/java/net/runelite/client/plugins/camera/CameraPlugin.java runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java runelite-client/src/main/java/net/runelite/client/plugins/config/PluginHubPanel.java runelite-client/src/main/java/net/runelite/client/plugins/kourendlibrary/BookPanel.java runelite-client/src/main/java/net/runelite/client/plugins/kourendlibrary/KourendLibraryConfig.java runelite-client/src/main/java/net/runelite/client/plugins/kourendlibrary/KourendLibraryPanel.java runelite-client/src/main/java/net/runelite/client/plugins/kourendlibrary/KourendLibraryPlugin.java runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java runelite-client/src/main/java/net/runelite/client/plugins/party/PartyPlugin.java runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldHopperPlugin.java
This commit is contained in:
@@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2017, Adam <Adam@sigterm.info>
|
|
||||||
* 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.http.api.item;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class Item
|
|
||||||
{
|
|
||||||
private int id;
|
|
||||||
private String name;
|
|
||||||
private String description;
|
|
||||||
private ItemType type;
|
|
||||||
}
|
|
||||||
@@ -26,12 +26,15 @@ package net.runelite.http.api.item;
|
|||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.gson.JsonParseException;
|
import com.google.gson.JsonParseException;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
import com.google.gson.stream.JsonReader;
|
import com.google.gson.stream.JsonReader;
|
||||||
import io.reactivex.rxjava3.core.Observable;
|
import io.reactivex.rxjava3.core.Observable;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2017, Adam <Adam@sigterm.info>
|
|
||||||
* 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.http.api.item;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class SearchResult
|
|
||||||
{
|
|
||||||
private List<Item> items;
|
|
||||||
|
|
||||||
public List<Item> getItems()
|
|
||||||
{
|
|
||||||
return items;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setItems(List<Item> items)
|
|
||||||
{
|
|
||||||
this.items = items;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -59,6 +59,12 @@ public final class ScriptID
|
|||||||
@ScriptArguments(integer = 1, string = 1)
|
@ScriptArguments(integer = 1, string = 1)
|
||||||
public static final int CHATBOX_INPUT = 96;
|
public static final int CHATBOX_INPUT = 96;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rebuilds the chatbox
|
||||||
|
*/
|
||||||
|
@ScriptArguments()
|
||||||
|
public static final int BUILD_CHATBOX = 216;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens the Private Message chat interface
|
* Opens the Private Message chat interface
|
||||||
*
|
*
|
||||||
@@ -127,6 +133,23 @@ public final class ScriptID
|
|||||||
@ScriptArguments(integer = 20)
|
@ScriptArguments(integer = 20)
|
||||||
public static final int BANK_PIN_OP = 685;
|
public static final int BANK_PIN_OP = 685;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds the chatbox input widget
|
||||||
|
*/
|
||||||
|
@ScriptArguments()
|
||||||
|
public static final int CHAT_PROMPT_INIT = 223;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Displays the game messages when clicking on an item inside the Items Kept on Death interface
|
||||||
|
* <ul>
|
||||||
|
* <li> int (boolean) Item kept on death </li>
|
||||||
|
* <li> int Item Quantity </li>
|
||||||
|
* <li> String Item Name </li>
|
||||||
|
* </ul>
|
||||||
|
*/
|
||||||
|
@ScriptArguments(integer = 2, string = 1)
|
||||||
|
public static final int DEATH_KEEP_ITEM_EXAMINE = 1603;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks the state of the given stash unit.
|
* Checks the state of the given stash unit.
|
||||||
* <ul>
|
* <ul>
|
||||||
@@ -135,7 +158,7 @@ public final class ScriptID
|
|||||||
* <li>int Bitpacked stash unit states 2</li>
|
* <li>int Bitpacked stash unit states 2</li>
|
||||||
* <li>int Bitpacked stash unit states 3</li>
|
* <li>int Bitpacked stash unit states 3</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* <p>
|
*
|
||||||
* Returns a pair of booleans indicating if the stash unit is built and if it is filled
|
* Returns a pair of booleans indicating if the stash unit is built and if it is filled
|
||||||
*/
|
*/
|
||||||
@ScriptArguments(integer = 4)
|
@ScriptArguments(integer = 4)
|
||||||
@@ -163,8 +186,8 @@ public final class ScriptID
|
|||||||
public static final int XPDROP_DISABLED = 2091;
|
public static final int XPDROP_DISABLED = 2091;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <ul>
|
|
||||||
* Queries the completion state of a quest by its struct id
|
* Queries the completion state of a quest by its struct id
|
||||||
|
* <ul>
|
||||||
* <li> int (struct) The id of the quest
|
* <li> int (struct) The id of the quest
|
||||||
* </ul>
|
* </ul>
|
||||||
* Returns
|
* Returns
|
||||||
@@ -185,6 +208,18 @@ public final class ScriptID
|
|||||||
@ScriptArguments(integer = 2)
|
@ScriptArguments(integer = 2)
|
||||||
public static final int DIARY_QUEST_UPDATE_LINECOUNT = 2523;
|
public static final int DIARY_QUEST_UPDATE_LINECOUNT = 2523;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles zoom input
|
||||||
|
*
|
||||||
|
* Updates the VarClientInts (73, 74) to this same value
|
||||||
|
* <ul>
|
||||||
|
* <li> int Reset zoom position </li>
|
||||||
|
* <li> int Reset zoom position </li>
|
||||||
|
* </ul>
|
||||||
|
*/
|
||||||
|
@ScriptArguments(integer = 2)
|
||||||
|
public static final int CAMERA_DO_ZOOM = 42;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rebuilds the Spellbook
|
* Rebuilds the Spellbook
|
||||||
*/
|
*/
|
||||||
@@ -206,6 +241,17 @@ public final class ScriptID
|
|||||||
@ScriptArguments(string = 2)
|
@ScriptArguments(string = 2)
|
||||||
public static final int PRIVMSG = 10004;
|
public static final int PRIVMSG = 10004;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a disabled experience drop
|
||||||
|
*
|
||||||
|
* <ul>
|
||||||
|
* <li>int (Skill ordinal) Sets what icon to use</li>
|
||||||
|
* <li>int Amount of exp to drop</li>
|
||||||
|
* </ul>
|
||||||
|
*/
|
||||||
|
@ScriptArguments(integer = 2)
|
||||||
|
public static final int XPDROP_DISABLED = 2091;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join a clan, duh
|
* Join a clan, duh
|
||||||
*/
|
*/
|
||||||
@@ -309,4 +355,3 @@ public final class ScriptID
|
|||||||
@ScriptArguments(integer = 7)
|
@ScriptArguments(integer = 7)
|
||||||
public static final int IGNORE_UPDATE = 630;
|
public static final int IGNORE_UPDATE = 630;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,12 @@ public enum VarClientInt
|
|||||||
*/
|
*/
|
||||||
INPUT_TYPE(5),
|
INPUT_TYPE(5),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The game sets this to the same value as {@link #CAMERA_ZOOM_RESIZABLE_VIEWPORT}
|
||||||
|
*/
|
||||||
|
CAMERA_ZOOM_FIXED_VIEWPORT(73),
|
||||||
|
CAMERA_ZOOM_RESIZABLE_VIEWPORT(74),
|
||||||
|
|
||||||
MEMBERSHIP_STATUS(103),
|
MEMBERSHIP_STATUS(103),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -435,12 +435,12 @@ public enum Varbits
|
|||||||
DAILY_ESSENCE_COLLECTED(4547),
|
DAILY_ESSENCE_COLLECTED(4547),
|
||||||
DAILY_RUNES_COLLECTED(4540),
|
DAILY_RUNES_COLLECTED(4540),
|
||||||
DAILY_SAND_COLLECTED(4549),
|
DAILY_SAND_COLLECTED(4549),
|
||||||
DAILY_ARROWS_STATE(4563),
|
|
||||||
DAILY_FLAX_STATE(4559),
|
DAILY_FLAX_STATE(4559),
|
||||||
|
DAILY_ARROWS_STATE(4563),
|
||||||
/**
|
/**
|
||||||
* This varbit tracks how much bonemeal has been redeemed from Robin
|
* This varbit tracks how much bonemeal has been redeemed from Robin
|
||||||
* The player gets 13 for each diary completed above and including Medium, for a maxiumum of 39
|
* The player gets 13 for each diary completed above and including Medium, for a maxiumum of 39
|
||||||
*/
|
*/
|
||||||
DAILY_BONEMEAL_STATE(4543),
|
DAILY_BONEMEAL_STATE(4543),
|
||||||
|
|
||||||
DAILY_DYNAMITE_COLLECTED(7939),
|
DAILY_DYNAMITE_COLLECTED(7939),
|
||||||
@@ -746,6 +746,22 @@ public enum Varbits
|
|||||||
/**
|
/**
|
||||||
* Starts at 100, counts down every 10 ticks (6 seconds)
|
* Starts at 100, counts down every 10 ticks (6 seconds)
|
||||||
*/
|
*/
|
||||||
|
TWISTED_LEAGUE_RELIC_1(10049),
|
||||||
|
TWISTED_LEAGUE_RELIC_2(10050),
|
||||||
|
TWISTED_LEAGUE_RELIC_3(10051),
|
||||||
|
TWISTED_LEAGUE_RELIC_4(10052),
|
||||||
|
TWISTED_LEAGUE_RELIC_5(10053),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the Special Attack orb is disabled due to being in a PvP area
|
||||||
|
*
|
||||||
|
* 0 = Enabled (player is not in PvP)
|
||||||
|
* 1 = Disabled (player in in PvP)
|
||||||
|
*
|
||||||
|
* @see <a href="https://oldschool.runescape.wiki/w/Minimap#Special_attack_orb">The OSRS Wiki's Minimap page</a>
|
||||||
|
*/
|
||||||
|
PVP_SPEC_ORB(8121);
|
||||||
|
|
||||||
LMS_POISON_PROGRESS(5317),
|
LMS_POISON_PROGRESS(5317),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -787,7 +803,6 @@ public enum Varbits
|
|||||||
EMOTES_TAB_HOTKEY(4687),
|
EMOTES_TAB_HOTKEY(4687),
|
||||||
CLAN_TAB_HOTKEY(4683),
|
CLAN_TAB_HOTKEY(4683),
|
||||||
MUSIC_TAB_HOTKEY(4688);
|
MUSIC_TAB_HOTKEY(4688);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The raw varbit ID.
|
* The raw varbit ID.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1321,6 +1321,7 @@ public class WidgetID
|
|||||||
|
|
||||||
static class Options
|
static class Options
|
||||||
{
|
{
|
||||||
|
static final int CAMERA_ZOOM_SLIDER_HANDLE = 15;
|
||||||
static final int MUSIC_SLIDER = 37;
|
static final int MUSIC_SLIDER = 37;
|
||||||
static final int SOUND_EFFECT_SLIDER = 43;
|
static final int SOUND_EFFECT_SLIDER = 43;
|
||||||
static final int AREA_SOUND_SLIDER = 49;
|
static final int AREA_SOUND_SLIDER = 49;
|
||||||
|
|||||||
@@ -592,9 +592,13 @@ public enum WidgetInfo
|
|||||||
FOSSIL_MUSHROOM_MEADOW(WidgetID.FOSSIL_ISLAND_MUSHROOM_TELE_GROUP_ID, WidgetID.FossilMushroomTeleport.MUSHROOM_MEADOW),
|
FOSSIL_MUSHROOM_MEADOW(WidgetID.FOSSIL_ISLAND_MUSHROOM_TELE_GROUP_ID, WidgetID.FossilMushroomTeleport.MUSHROOM_MEADOW),
|
||||||
|
|
||||||
MINIGAME_TELEPORT_BUTTON(WidgetID.MINIGAME_TAB_ID, WidgetID.Minigames.TELEPORT_BUTTON),
|
MINIGAME_TELEPORT_BUTTON(WidgetID.MINIGAME_TAB_ID, WidgetID.Minigames.TELEPORT_BUTTON),
|
||||||
|
|
||||||
PVP_FOG_OVERLAY(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.FOG_OVERLAY),
|
PVP_FOG_OVERLAY(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.FOG_OVERLAY),
|
||||||
PVP_CONTAINER(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.PVP_WIDGET_CONTAINER),
|
PVP_CONTAINER(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.PVP_WIDGET_CONTAINER)
|
||||||
|
SPELL_LUMBRIDGE_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.StandardSpellBook.LUMBRIDGE_HOME_TELEPORT),
|
||||||
|
SPELL_EDGEVILLE_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.AncientSpellBook.EDGEVILLE_HOME_TELEPORT),
|
||||||
|
SPELL_LUNAR_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.LunarSpellBook.LUNAR_HOME_TELEPORT),
|
||||||
|
SPELL_ARCEUUS_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.ArceuusSpellBook.ARCEUUS_HOME_TELEPORT),
|
||||||
|
SPELL_KOUREND_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.StandardSpellBook.KOUREND_HOME_TELEPORT),
|
||||||
|
|
||||||
PVP_SKULL_CONTAINER(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.SKULL_CONTAINER),
|
PVP_SKULL_CONTAINER(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.SKULL_CONTAINER),
|
||||||
PVP_SKULL(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.SKULL),
|
PVP_SKULL(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.SKULL),
|
||||||
@@ -871,14 +875,13 @@ public enum WidgetInfo
|
|||||||
SEED_VAULT_ITEM_CONTAINER(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.ITEM_CONTAINER),
|
SEED_VAULT_ITEM_CONTAINER(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.ITEM_CONTAINER),
|
||||||
SEED_VAULT_ITEM_TEXT(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.ITEM_TEXT),
|
SEED_VAULT_ITEM_TEXT(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.ITEM_TEXT),
|
||||||
SEED_VAULT_INVENTORY_ITEMS_CONTAINER(WidgetID.SEED_VAULT_INVENTORY_GROUP_ID, WidgetID.SeedVault.INVENTORY_ITEM_CONTAINER),
|
SEED_VAULT_INVENTORY_ITEMS_CONTAINER(WidgetID.SEED_VAULT_INVENTORY_GROUP_ID, WidgetID.SeedVault.INVENTORY_ITEM_CONTAINER),
|
||||||
|
|
||||||
JEWELLERY_BOX_DUEL_RING(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.DUEL_RING),
|
JEWELLERY_BOX_DUEL_RING(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.DUEL_RING),
|
||||||
JEWELLERY_BOX_GAME_NECK(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.GAME_NECK),
|
JEWELLERY_BOX_GAME_NECK(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.GAME_NECK),
|
||||||
JEWELLERY_BOX_COMB_BRAC(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.COMB_BRAC),
|
JEWELLERY_BOX_COMB_BRAC(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.COMB_BRAC),
|
||||||
JEWELLERY_BOX_SKIL_NECK(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.SKIL_NECK),
|
JEWELLERY_BOX_SKIL_NECK(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.SKIL_NECK),
|
||||||
JEWELLERY_BOX_RING_OFGP(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.RING_OFGP),
|
JEWELLERY_BOX_RING_OFGP(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.RING_OFGP),
|
||||||
JEWELLERY_BOX_AMUL_GLOR(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.AMUL_GLOR),
|
JEWELLERY_BOX_AMUL_GLOR(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.AMUL_GLOR),
|
||||||
|
OPTIONS_CAMERA_ZOOM_SLIDER_HANDLE(WidgetID.OPTIONS_GROUP_ID, WidgetID.Options.CAMERA_ZOOM_SLIDER_HANDLE),
|
||||||
OPTIONS_MUSIC_SLIDER(WidgetID.OPTIONS_GROUP_ID, WidgetID.Options.MUSIC_SLIDER),
|
OPTIONS_MUSIC_SLIDER(WidgetID.OPTIONS_GROUP_ID, WidgetID.Options.MUSIC_SLIDER),
|
||||||
OPTIONS_SOUND_EFFECT_SLIDER(WidgetID.OPTIONS_GROUP_ID, WidgetID.Options.SOUND_EFFECT_SLIDER),
|
OPTIONS_SOUND_EFFECT_SLIDER(WidgetID.OPTIONS_GROUP_ID, WidgetID.Options.SOUND_EFFECT_SLIDER),
|
||||||
OPTIONS_AREA_SOUND_SLIDER(WidgetID.OPTIONS_GROUP_ID, WidgetID.Options.AREA_SOUND_SLIDER),
|
OPTIONS_AREA_SOUND_SLIDER(WidgetID.OPTIONS_GROUP_ID, WidgetID.Options.AREA_SOUND_SLIDER),
|
||||||
@@ -976,4 +979,4 @@ public enum WidgetInfo
|
|||||||
return groupId << 16 | childId;
|
return groupId << 16 | childId;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,11 +42,11 @@ import javax.inject.Singleton;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.BufferProvider;
|
import net.runelite.api.BufferProvider;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.Constants;
|
|
||||||
import net.runelite.api.Entity;
|
import net.runelite.api.Entity;
|
||||||
import net.runelite.api.MainBufferProvider;
|
import net.runelite.api.MainBufferProvider;
|
||||||
import net.runelite.api.NullItemID;
|
import net.runelite.api.NullItemID;
|
||||||
import net.runelite.api.RenderOverview;
|
import net.runelite.api.RenderOverview;
|
||||||
|
import net.runelite.api.Renderable;
|
||||||
import net.runelite.api.Skill;
|
import net.runelite.api.Skill;
|
||||||
import net.runelite.api.WorldMapManager;
|
import net.runelite.api.WorldMapManager;
|
||||||
import net.runelite.api.events.BeforeMenuRender;
|
import net.runelite.api.events.BeforeMenuRender;
|
||||||
@@ -65,6 +65,7 @@ import net.runelite.client.Notifier;
|
|||||||
import net.runelite.client.RuneLite;
|
import net.runelite.client.RuneLite;
|
||||||
import net.runelite.client.chat.ChatMessageManager;
|
import net.runelite.client.chat.ChatMessageManager;
|
||||||
import net.runelite.client.eventbus.EventBus;
|
import net.runelite.client.eventbus.EventBus;
|
||||||
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
import net.runelite.client.input.KeyManager;
|
import net.runelite.client.input.KeyManager;
|
||||||
import net.runelite.client.input.MouseManager;
|
import net.runelite.client.input.MouseManager;
|
||||||
import net.runelite.client.task.Scheduler;
|
import net.runelite.client.task.Scheduler;
|
||||||
@@ -75,6 +76,7 @@ import net.runelite.client.ui.overlay.OverlayManager;
|
|||||||
import net.runelite.client.ui.overlay.OverlayRenderer;
|
import net.runelite.client.ui.overlay.OverlayRenderer;
|
||||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||||
import net.runelite.client.util.DeferredEventBus;
|
import net.runelite.client.util.DeferredEventBus;
|
||||||
|
import net.runelite.client.util.RSTimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class contains field required for mixins and runelite hooks to work.
|
* This class contains field required for mixins and runelite hooks to work.
|
||||||
@@ -85,13 +87,16 @@ import net.runelite.client.util.DeferredEventBus;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class Hooks implements Callbacks
|
public class Hooks implements Callbacks
|
||||||
{
|
{
|
||||||
private static final long CHECK = Constants.GAME_TICK_LENGTH; // ms - how often to run checks
|
private static final long CHECK = RSTimeUnit.GAME_TICKS.getDuration().toNanos(); // ns - how often to run checks
|
||||||
|
|
||||||
private static final Injector injector = RuneLite.getInjector();
|
private static final Injector injector = RuneLite.getInjector();
|
||||||
private static final Client client = injector.getInstance(Client.class);
|
private static final Client client = injector.getInstance(Client.class);
|
||||||
private static final OverlayRenderer renderer = injector.getInstance(OverlayRenderer.class);
|
private static final OverlayRenderer renderer = injector.getInstance(OverlayRenderer.class);
|
||||||
private static final OverlayManager overlayManager = injector.getInstance(OverlayManager.class);
|
private static final OverlayManager overlayManager = injector.getInstance(OverlayManager.class);
|
||||||
|
|
||||||
|
private static final GameTick GAME_TICK = new GameTick();
|
||||||
|
private static final BeforeRender BEFORE_RENDER = new BeforeRender();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private EventBus eventBus;
|
private EventBus eventBus;
|
||||||
|
|
||||||
@@ -139,7 +144,6 @@ public class Hooks implements Callbacks
|
|||||||
/**
|
/**
|
||||||
* Get the Graphics2D for the MainBufferProvider image
|
* Get the Graphics2D for the MainBufferProvider image
|
||||||
* This caches the Graphics2D instance so it can be reused
|
* This caches the Graphics2D instance so it can be reused
|
||||||
*
|
|
||||||
* @param mainBufferProvider
|
* @param mainBufferProvider
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -190,7 +194,7 @@ public class Hooks implements Callbacks
|
|||||||
|
|
||||||
clientThread.invoke();
|
clientThread.invoke();
|
||||||
|
|
||||||
long now = System.currentTimeMillis();
|
long now = System.nanoTime();
|
||||||
|
|
||||||
if (now - lastCheck < CHECK)
|
if (now - lastCheck < CHECK)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,74 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2020, Sean Dewar <https://github.com/seandewar>
|
||||||
|
* 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.camera;
|
||||||
|
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Graphics2D;
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import net.runelite.api.Client;
|
||||||
|
import net.runelite.api.Point;
|
||||||
|
import net.runelite.api.VarClientInt;
|
||||||
|
import net.runelite.api.widgets.Widget;
|
||||||
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
|
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||||
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
|
import net.runelite.client.ui.overlay.tooltip.Tooltip;
|
||||||
|
import net.runelite.client.ui.overlay.tooltip.TooltipManager;
|
||||||
|
|
||||||
|
class CameraOverlay extends Overlay
|
||||||
|
{
|
||||||
|
private final CameraConfig config;
|
||||||
|
private final Client client;
|
||||||
|
private final TooltipManager tooltipManager;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private CameraOverlay(final CameraConfig config, final Client client, final TooltipManager tooltipManager)
|
||||||
|
{
|
||||||
|
this.config = config;
|
||||||
|
this.client = client;
|
||||||
|
this.tooltipManager = tooltipManager;
|
||||||
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
|
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Dimension render(final Graphics2D graphics)
|
||||||
|
{
|
||||||
|
final Widget slider = client.getWidget(WidgetInfo.OPTIONS_CAMERA_ZOOM_SLIDER_HANDLE);
|
||||||
|
final Point mousePos = client.getMouseCanvasPosition();
|
||||||
|
|
||||||
|
if (slider == null || slider.isHidden() || !slider.getBounds().contains(mousePos.getX(), mousePos.getY()))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
final int value = client.getVar(VarClientInt.CAMERA_ZOOM_RESIZABLE_VIEWPORT);
|
||||||
|
final int max = config.innerLimit() ? config.INNER_ZOOM_LIMIT : CameraPlugin.DEFAULT_INNER_ZOOM_LIMIT;
|
||||||
|
|
||||||
|
tooltipManager.add(new Tooltip("Camera Zoom: " + value + " / " + max));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user