Merge remote-tracking branch 'runelite/master'
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
object ProjectVersions {
|
object ProjectVersions {
|
||||||
const val launcherVersion = "2.2.0"
|
const val launcherVersion = "2.2.0"
|
||||||
const val rlVersion = "1.8.0"
|
const val rlVersion = "1.8.1"
|
||||||
|
|
||||||
const val openosrsVersion = "4.15.0"
|
const val openosrsVersion = "4.15.0"
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class ObjectDefinition
|
|||||||
private int sizeX = 1;
|
private int sizeX = 1;
|
||||||
private int sizeY = 1;
|
private int sizeY = 1;
|
||||||
private int anInt2083 = 0;
|
private int anInt2083 = 0;
|
||||||
private int[] anIntArray2084;
|
private int[] ambientSoundIds;
|
||||||
private int offsetX = 0;
|
private int offsetX = 0;
|
||||||
private boolean mergeNormals = false;
|
private boolean mergeNormals = false;
|
||||||
private int wallOrDoor = -1;
|
private int wallOrDoor = -1;
|
||||||
|
|||||||
@@ -300,7 +300,7 @@ public class ObjectLoader
|
|||||||
anIntArray2084[index] = is.readUnsignedShort();
|
anIntArray2084[index] = is.readUnsignedShort();
|
||||||
}
|
}
|
||||||
|
|
||||||
def.setAnIntArray2084(anIntArray2084);
|
def.setAmbientSoundIds(anIntArray2084);
|
||||||
}
|
}
|
||||||
else if (opcode == 81)
|
else if (opcode == 81)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -176,14 +176,14 @@ public class ObjectSaver
|
|||||||
out.writeShort(obj.getAmbientSoundId());
|
out.writeShort(obj.getAmbientSoundId());
|
||||||
out.writeByte(obj.getAnInt2083());
|
out.writeByte(obj.getAnInt2083());
|
||||||
}
|
}
|
||||||
if (obj.getAnIntArray2084() != null)
|
if (obj.getAmbientSoundIds() != null)
|
||||||
{
|
{
|
||||||
out.writeByte(79);
|
out.writeByte(79);
|
||||||
out.writeShort(obj.getAnInt2112());
|
out.writeShort(obj.getAnInt2112());
|
||||||
out.writeShort(obj.getAnInt2113());
|
out.writeShort(obj.getAnInt2113());
|
||||||
out.writeByte(obj.getAnInt2083());
|
out.writeByte(obj.getAnInt2083());
|
||||||
out.writeByte(obj.getAnIntArray2084().length);
|
out.writeByte(obj.getAmbientSoundIds().length);
|
||||||
for (int i : obj.getAnIntArray2084())
|
for (int i : obj.getAmbientSoundIds())
|
||||||
{
|
{
|
||||||
out.writeShort(i);
|
out.writeShort(i);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018, Shaun Dreclin <shaundreclin@gmail.com>
|
* Copyright (c) 2021, Adam <Adam@sigterm.info>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -22,32 +22,38 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.roguesden;
|
package net.runelite.api;
|
||||||
|
|
||||||
import com.google.common.collect.Sets;
|
import net.runelite.api.coords.LocalPoint;
|
||||||
import java.util.Set;
|
|
||||||
import static net.runelite.api.ObjectID.*;
|
|
||||||
import static net.runelite.api.NullObjectID.*;
|
|
||||||
|
|
||||||
class Obstacles
|
/**
|
||||||
|
* An ambient sound effect. These are loaded only at scene load and are used to play ambient
|
||||||
|
* sound effects that are purely client side and not sent from the server.
|
||||||
|
*/
|
||||||
|
public interface AmbientSoundEffect
|
||||||
{
|
{
|
||||||
public static final Set<Integer> OBSTACLE_IDS_HULL = Sets.newHashSet(
|
/**
|
||||||
SPINNING_BLADES_7224,
|
* The id of the sound effect
|
||||||
CONTORTION_BARS,
|
* @see SoundEffectID
|
||||||
PENDULUM,
|
* @return
|
||||||
WALL_7249, /*Wall crushers*/
|
*/
|
||||||
WALL_7248, /*Wall blade*/
|
int getSoundEffectId();
|
||||||
LEDGE_7240, /*Ledge climb*/
|
|
||||||
NULL_7235 /*Wall safe*/
|
|
||||||
);
|
|
||||||
|
|
||||||
public static final Set<Integer> OBSTACLE_IDS_TILE = Sets.newHashSet(
|
/**
|
||||||
FLOOR, /*Floor spikes*/
|
* The plane the sound effect is on
|
||||||
WALL_7228, /*Wall spikes*/
|
* @return
|
||||||
WALL_7229, /*Wall spears*/
|
*/
|
||||||
FLOOR_7245, /*Pressure pad a*/
|
int getPlane();
|
||||||
FLOOR_7230, /*Pressure pad b*/
|
|
||||||
BLADE_7252, /*Floor blade*/
|
/**
|
||||||
7239 /*Bridge [Ground object]*/
|
* The min x/y position of the area this sound effect is at.
|
||||||
);
|
* @return
|
||||||
|
*/
|
||||||
|
LocalPoint getMinPosition();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The max x/y position of the area this sound effect is at
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
LocalPoint getMaxPosition();
|
||||||
}
|
}
|
||||||
@@ -2339,4 +2339,10 @@ public interface Client extends GameEngine
|
|||||||
ClanSettings getClanSettings(int clanId);
|
ClanSettings getClanSettings(int clanId);
|
||||||
|
|
||||||
void setUnlockedFps(boolean unlock);
|
void setUnlockedFps(boolean unlock);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the ambient sound effects
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Deque<AmbientSoundEffect> getAmbientSoundEffects();
|
||||||
}
|
}
|
||||||
|
|||||||
36
runelite-api/src/main/java/net/runelite/api/Deque.java
Normal file
36
runelite-api/src/main/java/net/runelite/api/Deque.java
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2021, 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.api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A doubly linked list
|
||||||
|
*/
|
||||||
|
public interface Deque<T> extends Iterable<T>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* clear the deque
|
||||||
|
*/
|
||||||
|
void clear();
|
||||||
|
}
|
||||||
@@ -68,6 +68,11 @@ public enum VarClientInt
|
|||||||
|
|
||||||
INVENTORY_TAB(171),
|
INVENTORY_TAB(171),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* time to block keypresses til
|
||||||
|
*/
|
||||||
|
BLOCK_KEYPRESS(187),
|
||||||
|
|
||||||
WORLD_MAP_SEARCH_FOCUSED(190);
|
WORLD_MAP_SEARCH_FOCUSED(190);
|
||||||
|
|
||||||
private final int index;
|
private final int index;
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ import net.runelite.api.ItemContainer;
|
|||||||
import net.runelite.api.ItemID;
|
import net.runelite.api.ItemID;
|
||||||
import net.runelite.api.MenuEntry;
|
import net.runelite.api.MenuEntry;
|
||||||
import net.runelite.api.ScriptID;
|
import net.runelite.api.ScriptID;
|
||||||
|
import net.runelite.api.VarClientInt;
|
||||||
import net.runelite.api.VarClientStr;
|
import net.runelite.api.VarClientStr;
|
||||||
import net.runelite.api.events.ItemContainerChanged;
|
import net.runelite.api.events.ItemContainerChanged;
|
||||||
import net.runelite.api.events.MenuEntryAdded;
|
import net.runelite.api.events.MenuEntryAdded;
|
||||||
@@ -238,18 +239,9 @@ public class BankPlugin extends Plugin
|
|||||||
|
|
||||||
log.debug("Bank pin keypress");
|
log.debug("Bank pin keypress");
|
||||||
|
|
||||||
final String chatboxTypedText = client.getVar(VarClientStr.CHATBOX_TYPED_TEXT);
|
client.runScript(onOpListener);
|
||||||
final String inputText = client.getVar(VarClientStr.INPUT_TEXT);
|
// Block the key press this tick in keypress_permit so it doesn't enter the chatbox
|
||||||
clientThread.invokeLater(() ->
|
client.setVar(VarClientInt.BLOCK_KEYPRESS, client.getGameCycle() + 1);
|
||||||
{
|
|
||||||
// reset chatbox input to avoid pin going to chatbox..
|
|
||||||
client.setVar(VarClientStr.CHATBOX_TYPED_TEXT, chatboxTypedText);
|
|
||||||
client.runScript(ScriptID.CHAT_PROMPT_INIT);
|
|
||||||
client.setVar(VarClientStr.INPUT_TEXT, inputText);
|
|
||||||
client.runScript(ScriptID.CHAT_TEXT_INPUT_REBUILD, "");
|
|
||||||
|
|
||||||
client.runScript(onOpListener);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ public enum STASHUnit
|
|||||||
FINE_CLOTHES_ENTRANCE(NullObjectID.NULL_34737, new WorldPoint(3209, 3416, 0)),
|
FINE_CLOTHES_ENTRANCE(NullObjectID.NULL_34737, new WorldPoint(3209, 3416, 0)),
|
||||||
BOB_AXES_ENTRANCE(NullObjectID.NULL_34738, new WorldPoint(3233, 3200, 0)),
|
BOB_AXES_ENTRANCE(NullObjectID.NULL_34738, new WorldPoint(3233, 3200, 0)),
|
||||||
CRYSTALLINE_MAPLE_TREES(NullObjectID.NULL_34953, new WorldPoint(2213, 3427, 0)),
|
CRYSTALLINE_MAPLE_TREES(NullObjectID.NULL_34953, new WorldPoint(2213, 3427, 0)),
|
||||||
CHARCOAL_BURNERS(NullObjectID.NULL_41758, new WorldPoint(1712, 3469, 0)),
|
CHARCOAL_BURNERS(NullObjectID.NULL_41758, new WorldPoint(1712, 3470, 0)),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final int objectId;
|
private final int objectId;
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public enum HotColdLocation
|
|||||||
DESERT_SHANTY(MASTER, new WorldPoint(3292, 3107, 0), DESERT, "South-west of Shantay Pass.", BRASSICAN_MAGE),
|
DESERT_SHANTY(MASTER, new WorldPoint(3292, 3107, 0), DESERT, "South-west of Shantay Pass.", BRASSICAN_MAGE),
|
||||||
DRAYNOR_MANOR_MUSHROOMS(BEGINNER, new WorldPoint(3096, 3379, 0), MISTHALIN, "Patch of mushrooms just northwest of Draynor Manor"),
|
DRAYNOR_MANOR_MUSHROOMS(BEGINNER, new WorldPoint(3096, 3379, 0), MISTHALIN, "Patch of mushrooms just northwest of Draynor Manor"),
|
||||||
DRAYNOR_WHEAT_FIELD(BEGINNER, new WorldPoint(3120, 3282, 0), MISTHALIN, "Inside the wheat field next to Draynor Village"),
|
DRAYNOR_WHEAT_FIELD(BEGINNER, new WorldPoint(3120, 3282, 0), MISTHALIN, "Inside the wheat field next to Draynor Village"),
|
||||||
FELDIP_HILLS_JIGGIG(MASTER, new WorldPoint(2409, 3053, 0), FELDIP_HILLS, "West of Jiggig, east of the fairy ring bkp.", BRASSICAN_MAGE),
|
FELDIP_HILLS_JIGGIG(MASTER, new WorldPoint(2409, 3053, 0), FELDIP_HILLS, "West of Jiggig, east of the fairy ring BKP.", BRASSICAN_MAGE),
|
||||||
FELDIP_HILLS_SW(MASTER, new WorldPoint(2586, 2897, 0), FELDIP_HILLS, "West of the southeasternmost lake in Feldip Hills.", BRASSICAN_MAGE),
|
FELDIP_HILLS_SW(MASTER, new WorldPoint(2586, 2897, 0), FELDIP_HILLS, "West of the southeasternmost lake in Feldip Hills.", BRASSICAN_MAGE),
|
||||||
FELDIP_HILLS_GNOME_GLITER(MASTER, new WorldPoint(2555, 2972, 0), FELDIP_HILLS, "East of the gnome glider (Lemantolly Undri).", BRASSICAN_MAGE),
|
FELDIP_HILLS_GNOME_GLITER(MASTER, new WorldPoint(2555, 2972, 0), FELDIP_HILLS, "East of the gnome glider (Lemantolly Undri).", BRASSICAN_MAGE),
|
||||||
FELDIP_HILLS_RANTZ(MASTER, new WorldPoint(2611, 2950, 0), FELDIP_HILLS, "South of Rantz, west of the empty glass bottles.", BRASSICAN_MAGE),
|
FELDIP_HILLS_RANTZ(MASTER, new WorldPoint(2611, 2950, 0), FELDIP_HILLS, "South of Rantz, west of the empty glass bottles.", BRASSICAN_MAGE),
|
||||||
|
|||||||
@@ -33,42 +33,84 @@ import net.runelite.api.ItemID;
|
|||||||
enum ItemIdentification
|
enum ItemIdentification
|
||||||
{
|
{
|
||||||
//Seeds
|
//Seeds
|
||||||
GUAM_SEED(Type.SEED, "Guam", "G", ItemID.GUAM_SEED),
|
GUAM_SEED(Type.SEED_HERB, "Guam", "G", ItemID.GUAM_SEED),
|
||||||
MARRENTILL_SEED(Type.SEED, "Marren", "M", ItemID.MARRENTILL_SEED),
|
MARRENTILL_SEED(Type.SEED_HERB, "Marren", "M", ItemID.MARRENTILL_SEED),
|
||||||
TARROMIN_SEED(Type.SEED, "Tarro", "TAR", ItemID.TARROMIN_SEED),
|
TARROMIN_SEED(Type.SEED_HERB, "Tarro", "TAR", ItemID.TARROMIN_SEED),
|
||||||
HARRALANDER_SEED(Type.SEED, "Harra", "H", ItemID.HARRALANDER_SEED),
|
HARRALANDER_SEED(Type.SEED_HERB, "Harra", "H", ItemID.HARRALANDER_SEED),
|
||||||
RANARR_SEED(Type.SEED, "Ranarr", "R", ItemID.RANARR_SEED),
|
RANARR_SEED(Type.SEED_HERB, "Ranarr", "R", ItemID.RANARR_SEED),
|
||||||
TOADFLAX_SEED(Type.SEED, "Toad", "TOA", ItemID.TOADFLAX_SEED),
|
TOADFLAX_SEED(Type.SEED_HERB, "Toad", "TOA", ItemID.TOADFLAX_SEED),
|
||||||
IRIT_SEED(Type.SEED, "Irit", "I", ItemID.IRIT_SEED),
|
IRIT_SEED(Type.SEED_HERB, "Irit", "I", ItemID.IRIT_SEED),
|
||||||
AVANTOE_SEED(Type.SEED, "Avan", "A", ItemID.AVANTOE_SEED),
|
AVANTOE_SEED(Type.SEED_HERB, "Avan", "A", ItemID.AVANTOE_SEED),
|
||||||
KWUARM_SEED(Type.SEED, "Kwuarm", "K", ItemID.KWUARM_SEED),
|
KWUARM_SEED(Type.SEED_HERB, "Kwuarm", "K", ItemID.KWUARM_SEED),
|
||||||
SNAPDRAGON_SEED(Type.SEED, "Snap", "S", ItemID.SNAPDRAGON_SEED),
|
SNAPDRAGON_SEED(Type.SEED_HERB, "Snap", "S", ItemID.SNAPDRAGON_SEED),
|
||||||
CADANTINE_SEED(Type.SEED, "Cadan", "C", ItemID.CADANTINE_SEED),
|
CADANTINE_SEED(Type.SEED_HERB, "Cadan", "C", ItemID.CADANTINE_SEED),
|
||||||
LANTADYME_SEED(Type.SEED, "Lanta", "L", ItemID.LANTADYME_SEED),
|
LANTADYME_SEED(Type.SEED_HERB, "Lanta", "L", ItemID.LANTADYME_SEED),
|
||||||
DWARF_WEED_SEED(Type.SEED, "Dwarf", "D", ItemID.DWARF_WEED_SEED),
|
DWARF_WEED_SEED(Type.SEED_HERB, "Dwarf", "D", ItemID.DWARF_WEED_SEED),
|
||||||
TORSTOL_SEED(Type.SEED, "Torstol", "TOR", ItemID.TORSTOL_SEED),
|
TORSTOL_SEED(Type.SEED_HERB, "Torstol", "TOR", ItemID.TORSTOL_SEED),
|
||||||
|
|
||||||
POISON_IVY_SEED(Type.SEED, "Ivy", "I", ItemID.POISON_IVY_SEED),
|
REDBERRY_SEED(Type.SEED_BERRY, "Redberry", "RED", ItemID.REDBERRY_SEED),
|
||||||
WHITEBERRY_SEED(Type.SEED, "White", "W", ItemID.WHITEBERRY_SEED),
|
CADAVABERRY_SEED(Type.SEED_BERRY, "Cadava", "CAD", ItemID.CADAVABERRY_SEED),
|
||||||
SEAWEED_SPORE(Type.SEED, "Seaweed", "SW", ItemID.SEAWEED_SPORE),
|
DWELLBERRY_SEED(Type.SEED_BERRY, "Dwell", "DWEL", ItemID.DWELLBERRY_SEED),
|
||||||
|
JANGERBERRY_SEED(Type.SEED_BERRY, "Janger", "JANG", ItemID.JANGERBERRY_SEED),
|
||||||
|
WHITEBERRY_SEED(Type.SEED_BERRY, "White", "WHIT", ItemID.WHITEBERRY_SEED),
|
||||||
|
POISON_IVY_SEED(Type.SEED_BERRY, "Ivy", "POI", ItemID.POISON_IVY_SEED),
|
||||||
|
|
||||||
HESPORI_SEED(Type.SEED, "Hespori", "HES", ItemID.HESPORI_SEED),
|
GRAPE_SEED(Type.SEED_SPECIAL, "Grape", "GRA", ItemID.GRAPE_SEED),
|
||||||
KRONOS_SEED(Type.SEED, "Kronos", "KRO", ItemID.KRONOS_SEED),
|
MUSHROOM_SPORE(Type.SEED_SPECIAL, "Mushroom", "MUSH", ItemID.MUSHROOM_SPORE),
|
||||||
IASOR_SEED(Type.SEED, "Iasor", "IA", ItemID.IASOR_SEED),
|
BELLADONNA_SEED(Type.SEED_SPECIAL, "Bella", "BELL", ItemID.BELLADONNA_SEED),
|
||||||
ATTAS_SEED(Type.SEED, "Attas", "AT", ItemID.ATTAS_SEED),
|
SEAWEED_SPORE(Type.SEED_SPECIAL, "Seaweed", "SW", ItemID.SEAWEED_SPORE),
|
||||||
CELASTRUS_SEED(Type.SEED, "Celas", "CEL", ItemID.CELASTRUS_SEED),
|
HESPORI_SEED(Type.SEED_SPECIAL, "Hespori", "HES", ItemID.HESPORI_SEED),
|
||||||
SPIRIT_SEED(Type.SEED, "Spirit", "SPI", ItemID.SPIRIT_SEED),
|
KRONOS_SEED(Type.SEED_SPECIAL, "Kronos", "KRO", ItemID.KRONOS_SEED),
|
||||||
CALQUAT_SEED(Type.SEED, "Calquat", "CAL", ItemID.CALQUAT_TREE_SEED),
|
IASOR_SEED(Type.SEED_SPECIAL, "Iasor", "IA", ItemID.IASOR_SEED),
|
||||||
|
ATTAS_SEED(Type.SEED_SPECIAL, "Attas", "AT", ItemID.ATTAS_SEED),
|
||||||
|
CACTUS_SEED(Type.SEED_SPECIAL, "Cactus", "CAC", ItemID.CACTUS_SEED),
|
||||||
|
POTATO_CACTUS_SEED(Type.SEED_SPECIAL, "P.Cact", "P.CAC", ItemID.POTATO_CACTUS_SEED),
|
||||||
|
|
||||||
ACORN(Type.SEED, "Oak", "OAK", ItemID.ACORN),
|
ACORN(Type.SEED_TREE, "Oak", "OAK", ItemID.ACORN),
|
||||||
WILLOW_SEED(Type.SEED, "Willow", "WIL", ItemID.WILLOW_SEED),
|
WILLOW_SEED(Type.SEED_TREE, "Willow", "WIL", ItemID.WILLOW_SEED),
|
||||||
MAPLE_SEED(Type.SEED, "Maple", "MAP", ItemID.MAPLE_SEED),
|
MAPLE_SEED(Type.SEED_TREE, "Maple", "MAP", ItemID.MAPLE_SEED),
|
||||||
YEW_SEED(Type.SEED, "Yew", "YEW", ItemID.YEW_SEED),
|
YEW_SEED(Type.SEED_TREE, "Yew", "YEW", ItemID.YEW_SEED),
|
||||||
MAGIC_SEED(Type.SEED, "Magic", "MAG", ItemID.MAGIC_SEED),
|
MAGIC_SEED(Type.SEED_TREE, "Magic", "MAG", ItemID.MAGIC_SEED),
|
||||||
REDWOOD_SEED(Type.SEED, "Red", "RED", ItemID.REDWOOD_TREE_SEED),
|
REDWOOD_SEED(Type.SEED_TREE, "Red", "RED", ItemID.REDWOOD_TREE_SEED),
|
||||||
TEAK_SEED(Type.SEED, "Teak", "TEAK", ItemID.TEAK_SEED),
|
TEAK_SEED(Type.SEED_TREE, "Teak", "TEAK", ItemID.TEAK_SEED),
|
||||||
MAHOGANY_SEED(Type.SEED, "Mahog", "MAH", ItemID.MAHOGANY_SEED),
|
MAHOGANY_SEED(Type.SEED_TREE, "Mahog", "MAH", ItemID.MAHOGANY_SEED),
|
||||||
CRYSTAL_ACORN(Type.SEED, "Crystal", "CRY", ItemID.CRYSTAL_ACORN),
|
CRYSTAL_ACORN(Type.SEED_TREE, "Crystal", "CRY", ItemID.CRYSTAL_ACORN),
|
||||||
|
CELASTRUS_SEED(Type.SEED_TREE, "Celas", "CEL", ItemID.CELASTRUS_SEED),
|
||||||
|
SPIRIT_SEED(Type.SEED_TREE, "Spirit", "SPI", ItemID.SPIRIT_SEED),
|
||||||
|
CALQUAT_SEED(Type.SEED_TREE, "Calquat", "CAL", ItemID.CALQUAT_TREE_SEED),
|
||||||
|
|
||||||
|
APPLE_TREE_SEED(Type.SEED_FRUIT_TREE, "Apple", "APP", ItemID.APPLE_TREE_SEED),
|
||||||
|
BANANA_TREE_SEED(Type.SEED_FRUIT_TREE, "Banana", "BAN", ItemID.BANANA_TREE_SEED),
|
||||||
|
ORANGE_TREE_SEED(Type.SEED_FRUIT_TREE, "Orange", "ORA", ItemID.ORANGE_TREE_SEED),
|
||||||
|
CURRY_TREE_SEED(Type.SEED_FRUIT_TREE, "Curry", "CUR", ItemID.CURRY_TREE_SEED),
|
||||||
|
PINEAPPLE_SEED(Type.SEED_FRUIT_TREE, "Pine.A", "PINE", ItemID.PINEAPPLE_SEED),
|
||||||
|
PAPAYA_TREE_SEED(Type.SEED_FRUIT_TREE, "Papaya", "PAPA", ItemID.PAPAYA_TREE_SEED),
|
||||||
|
PALM_TREE_SEED(Type.SEED_FRUIT_TREE, "Palm", "PALM", ItemID.PALM_TREE_SEED),
|
||||||
|
DRAGONFRIUT_TREE_SEED(Type.SEED_FRUIT_TREE, "Dragon", "DRA", ItemID.DRAGONFRUIT_TREE_SEED),
|
||||||
|
|
||||||
|
POTATO_SEED(Type.SEED_ALLOTMENT, "Potato", "POT", ItemID.POTATO_SEED),
|
||||||
|
ONION_SEED(Type.SEED_ALLOTMENT, "Onion", "ONI", ItemID.ONION_SEED),
|
||||||
|
CABBAGE_SEED(Type.SEED_ALLOTMENT, "Cabbage", "CAB", ItemID.CABBAGE_SEED),
|
||||||
|
TOMATO_SEED(Type.SEED_ALLOTMENT, "Tomato", "TOM", ItemID.TOMATO_SEED),
|
||||||
|
SWEETCORN_SEED(Type.SEED_ALLOTMENT, "S.Corn", "CORN", ItemID.SWEETCORN_SEED),
|
||||||
|
STRAWBERRY_SEED(Type.SEED_ALLOTMENT, "S.Berry", "STRA", ItemID.STRAWBERRY_SEED),
|
||||||
|
WATERMELON_SEED(Type.SEED_ALLOTMENT, "Melon", "MEL", ItemID.WATERMELON_SEED),
|
||||||
|
SNAPE_GRASS_SEED(Type.SEED_ALLOTMENT, "Snape", "SNA", ItemID.SNAPE_GRASS_SEED),
|
||||||
|
|
||||||
|
MARIGOLD_SEED(Type.SEED_FLOWER, "Marigo", "MARI", ItemID.MARIGOLD_SEED),
|
||||||
|
ROSEMARY_SEED(Type.SEED_FLOWER, "Rosemar", "ROSE", ItemID.ROSEMARY_SEED),
|
||||||
|
NASTURTIUM_SEED(Type.SEED_FLOWER, "Nastur", "NAS", ItemID.NASTURTIUM_SEED),
|
||||||
|
WOAD_SEED(Type.SEED_FLOWER, "Woad", "WOAD", ItemID.WOAD_SEED),
|
||||||
|
LIMPWURT_SEED(Type.SEED_FLOWER, "Limpwurt", "LIMP", ItemID.LIMPWURT_SEED),
|
||||||
|
WHITE_LILY_SEED(Type.SEED_FLOWER, "Lily", "LILY", ItemID.WHITE_LILY_SEED),
|
||||||
|
|
||||||
|
BARLEY_SEED(Type.HOPS_SEED, "Barley", "BAR", ItemID.BARLEY_SEED),
|
||||||
|
HAMMERSTONE_SEED(Type.HOPS_SEED, "Hammer", "HAMM", ItemID.HAMMERSTONE_SEED),
|
||||||
|
ASGARNIAN_SEED(Type.HOPS_SEED, "Asgar", "ASG", ItemID.ASGARNIAN_SEED),
|
||||||
|
JUTE_SEED(Type.HOPS_SEED, "Jute", "JUTE", ItemID.JUTE_SEED),
|
||||||
|
YANILLIAN_SEED(Type.HOPS_SEED, "Yani", "YAN", ItemID.YANILLIAN_SEED),
|
||||||
|
KRANDORIAN_SEED(Type.HOPS_SEED, "Krand", "KRA", ItemID.KRANDORIAN_SEED),
|
||||||
|
WILDBLOOD_SEED(Type.HOPS_SEED, "Wild.B", "WILD", ItemID.WILDBLOOD_SEED),
|
||||||
|
|
||||||
//Sacks
|
//Sacks
|
||||||
SACK(Type.SACK, "Empty", "EMP", ItemID.EMPTY_SACK),
|
SACK(Type.SACK, "Empty", "EMP", ItemID.EMPTY_SACK),
|
||||||
@@ -121,16 +163,16 @@ enum ItemIdentification
|
|||||||
MAGIC_LOG(Type.LOGS, "Magic", "MAG", ItemID.MAGIC_LOGS),
|
MAGIC_LOG(Type.LOGS, "Magic", "MAG", ItemID.MAGIC_LOGS),
|
||||||
REDWOOD_LOG(Type.LOGS, "Red", "RED", ItemID.REDWOOD_LOGS),
|
REDWOOD_LOG(Type.LOGS, "Red", "RED", ItemID.REDWOOD_LOGS),
|
||||||
|
|
||||||
PYRE_LOGS(Type.LOGS, "Pyre", "P", ItemID.PYRE_LOGS),
|
PYRE_LOGS(Type.LOGS_PYRE, "Pyre", "P", ItemID.PYRE_LOGS),
|
||||||
ARCTIC_PYRE_LOGS(Type.LOGS, "Art P", "AP", ItemID.ARCTIC_PYRE_LOGS),
|
ARCTIC_PYRE_LOGS(Type.LOGS_PYRE, "Art P", "AP", ItemID.ARCTIC_PYRE_LOGS),
|
||||||
OAK_PYRE_LOGS(Type.LOGS, "Oak P", "OAKP", ItemID.OAK_PYRE_LOGS),
|
OAK_PYRE_LOGS(Type.LOGS_PYRE, "Oak P", "OAKP", ItemID.OAK_PYRE_LOGS),
|
||||||
WILLOW_PYRE_LOGS(Type.LOGS, "Wil P", "WILP", ItemID.WILLOW_PYRE_LOGS),
|
WILLOW_PYRE_LOGS(Type.LOGS_PYRE, "Wil P", "WILP", ItemID.WILLOW_PYRE_LOGS),
|
||||||
TEAK_PYRE_LOGS(Type.LOGS, "Teak P", "TEAKP", ItemID.TEAK_PYRE_LOGS),
|
TEAK_PYRE_LOGS(Type.LOGS_PYRE, "Teak P", "TEAKP", ItemID.TEAK_PYRE_LOGS),
|
||||||
MAPLE_PYRE_LOGS(Type.LOGS, "Map P", "MAPP", ItemID.MAPLE_PYRE_LOGS),
|
MAPLE_PYRE_LOGS(Type.LOGS_PYRE, "Map P", "MAPP", ItemID.MAPLE_PYRE_LOGS),
|
||||||
MAHOGANY_PYRE_LOGS(Type.LOGS, "Mah P", "MAHP", ItemID.MAHOGANY_PYRE_LOGS),
|
MAHOGANY_PYRE_LOGS(Type.LOGS_PYRE, "Mah P", "MAHP", ItemID.MAHOGANY_PYRE_LOGS),
|
||||||
YEW_PYRE_LOGS(Type.LOGS, "Yew P", "YEWP", ItemID.YEW_PYRE_LOGS),
|
YEW_PYRE_LOGS(Type.LOGS_PYRE, "Yew P", "YEWP", ItemID.YEW_PYRE_LOGS),
|
||||||
MAGIC_PYRE_LOGS(Type.LOGS, "Mag P", "MAGP", ItemID.MAGIC_PYRE_LOGS),
|
MAGIC_PYRE_LOGS(Type.LOGS_PYRE, "Mag P", "MAGP", ItemID.MAGIC_PYRE_LOGS),
|
||||||
REDWOOD_PYRE_LOGS(Type.LOGS, "Red P", "REDP", ItemID.REDWOOD_PYRE_LOGS),
|
REDWOOD_PYRE_LOGS(Type.LOGS_PYRE, "Red P", "REDP", ItemID.REDWOOD_PYRE_LOGS),
|
||||||
|
|
||||||
//Planks
|
//Planks
|
||||||
PLANK(Type.PLANK, "Plank", "PLANK", ItemID.PLANK),
|
PLANK(Type.PLANK, "Plank", "PLANK", ItemID.PLANK),
|
||||||
@@ -424,10 +466,18 @@ enum ItemIdentification
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
enum Type
|
enum Type
|
||||||
{
|
{
|
||||||
SEED(ItemIdentificationConfig::showSeeds),
|
SEED_HERB(ItemIdentificationConfig::showHerbSeeds),
|
||||||
|
SEED_BERRY(ItemIdentificationConfig::showBerrySeeds),
|
||||||
|
SEED_ALLOTMENT(ItemIdentificationConfig::showAllotmentSeeds),
|
||||||
|
SEED_SPECIAL(ItemIdentificationConfig::showSpecialSeeds),
|
||||||
|
SEED_TREE(ItemIdentificationConfig::showTreeSeeds),
|
||||||
|
SEED_FRUIT_TREE(ItemIdentificationConfig::showFruitTreeSeeds),
|
||||||
|
SEED_FLOWER(ItemIdentificationConfig::showFlowerSeeds),
|
||||||
|
HOPS_SEED(ItemIdentificationConfig::showHopsSeeds),
|
||||||
SACK(ItemIdentificationConfig::showSacks),
|
SACK(ItemIdentificationConfig::showSacks),
|
||||||
HERB(ItemIdentificationConfig::showHerbs),
|
HERB(ItemIdentificationConfig::showHerbs),
|
||||||
LOGS(ItemIdentificationConfig::showLogs),
|
LOGS(ItemIdentificationConfig::showLogs),
|
||||||
|
LOGS_PYRE(ItemIdentificationConfig::showPyreLogs),
|
||||||
PLANK(ItemIdentificationConfig::showPlanks),
|
PLANK(ItemIdentificationConfig::showPlanks),
|
||||||
SAPLING(ItemIdentificationConfig::showSaplings),
|
SAPLING(ItemIdentificationConfig::showSaplings),
|
||||||
COMPOST(ItemIdentificationConfig::showComposts),
|
COMPOST(ItemIdentificationConfig::showComposts),
|
||||||
|
|||||||
@@ -63,20 +63,98 @@ public interface ItemIdentificationConfig extends Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "showSeeds",
|
keyName = "showHerbSeeds",
|
||||||
name = "Seeds",
|
name = "Seeds (Herb)",
|
||||||
description = "Show identification on Seeds",
|
description = "Show identification on Herb Seeds",
|
||||||
section = identificationSection
|
section = identificationSection
|
||||||
)
|
)
|
||||||
default boolean showSeeds()
|
default boolean showHerbSeeds()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "showAllotmentSeeds",
|
||||||
|
name = "Seeds (Allotment)",
|
||||||
|
description = "Show identification on Allotment Seeds",
|
||||||
|
section = identificationSection
|
||||||
|
)
|
||||||
|
default boolean showAllotmentSeeds()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "showFlowerSeeds",
|
||||||
|
name = "Seeds (Flower)",
|
||||||
|
description = "Show identification on Flower Seeds",
|
||||||
|
section = identificationSection
|
||||||
|
)
|
||||||
|
default boolean showFlowerSeeds()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "showFruitTreeSeeds",
|
||||||
|
name = "Seeds (Fruit Tree)",
|
||||||
|
description = "Show identification on Fruit Tree Seeds",
|
||||||
|
section = identificationSection
|
||||||
|
)
|
||||||
|
default boolean showFruitTreeSeeds()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "showTreeSeeds",
|
||||||
|
name = "Seeds (Tree)",
|
||||||
|
description = "Show identification on Tree Seeds",
|
||||||
|
section = identificationSection
|
||||||
|
)
|
||||||
|
default boolean showTreeSeeds()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "showSpecialSeeds",
|
||||||
|
name = "Seeds (Special)",
|
||||||
|
description = "Show identification on Special Seeds",
|
||||||
|
section = identificationSection
|
||||||
|
)
|
||||||
|
default boolean showSpecialSeeds()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "showBerrySeeds",
|
||||||
|
name = "Seeds (Berry)",
|
||||||
|
description = "Show identification on Berry Seeds",
|
||||||
|
section = identificationSection
|
||||||
|
)
|
||||||
|
default boolean showBerrySeeds()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "showHopSeeds",
|
||||||
|
name = "Seeds (Hops)",
|
||||||
|
description = "Show identification on Hops Seeds",
|
||||||
|
section = identificationSection
|
||||||
|
)
|
||||||
|
default boolean showHopsSeeds()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "showSacks",
|
keyName = "showSacks",
|
||||||
name = "Sacks",
|
name = "Sacks",
|
||||||
description = "Show identification on Sacks"
|
description = "Show identification on Sacks",
|
||||||
|
section = identificationSection
|
||||||
)
|
)
|
||||||
default boolean showSacks()
|
default boolean showSacks()
|
||||||
{
|
{
|
||||||
@@ -105,6 +183,17 @@ public interface ItemIdentificationConfig extends Config
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "showPyreLogs",
|
||||||
|
name = "Logs (Pyre)",
|
||||||
|
description = "Show identification on Pyre Logs",
|
||||||
|
section = identificationSection
|
||||||
|
)
|
||||||
|
default boolean showPyreLogs()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "showPlanks",
|
keyName = "showPlanks",
|
||||||
name = "Planks",
|
name = "Planks",
|
||||||
|
|||||||
@@ -28,10 +28,12 @@ import net.runelite.client.config.Config;
|
|||||||
import net.runelite.client.config.ConfigGroup;
|
import net.runelite.client.config.ConfigGroup;
|
||||||
import net.runelite.client.config.ConfigItem;
|
import net.runelite.client.config.ConfigItem;
|
||||||
|
|
||||||
@ConfigGroup("music")
|
@ConfigGroup(MusicConfig.GROUP)
|
||||||
public interface MusicConfig extends Config
|
public interface MusicConfig extends Config
|
||||||
{
|
{
|
||||||
|
String GROUP = "music";
|
||||||
String GRANULAR_SLIDERS = "granularSliders";
|
String GRANULAR_SLIDERS = "granularSliders";
|
||||||
|
String MUTE_AMBIENT_SOUNDS = "muteAmbientSounds";
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "muteOwnAreaSounds",
|
keyName = "muteOwnAreaSounds",
|
||||||
@@ -77,11 +79,22 @@ public interface MusicConfig extends Config
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = MUTE_AMBIENT_SOUNDS,
|
||||||
|
name = "Mute ambient sounds",
|
||||||
|
description = "Mute background noise such as magic trees and furnaces",
|
||||||
|
position = 4
|
||||||
|
)
|
||||||
|
default boolean muteAmbientSounds()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "mutePrayerSounds",
|
keyName = "mutePrayerSounds",
|
||||||
name = "Mute prayer sounds",
|
name = "Mute prayer sounds",
|
||||||
description = "Mute prayer activation and deactivation sounds",
|
description = "Mute prayer activation and deactivation sounds",
|
||||||
position = 4
|
position = 5
|
||||||
)
|
)
|
||||||
default boolean mutePrayerSounds()
|
default boolean mutePrayerSounds()
|
||||||
{
|
{
|
||||||
@@ -92,7 +105,7 @@ public interface MusicConfig extends Config
|
|||||||
keyName = GRANULAR_SLIDERS,
|
keyName = GRANULAR_SLIDERS,
|
||||||
name = "Granular volume sliders",
|
name = "Granular volume sliders",
|
||||||
description = "Make the volume sliders allow better control of volume",
|
description = "Make the volume sliders allow better control of volume",
|
||||||
position = 5
|
position = 6
|
||||||
)
|
)
|
||||||
default boolean granularSliders()
|
default boolean granularSliders()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -221,12 +221,21 @@ public class MusicPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onGameStateChanged(GameStateChanged gameStateChanged)
|
public void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||||
{
|
{
|
||||||
if (gameStateChanged.getGameState() == GameState.LOGIN_SCREEN)
|
GameState gameState = gameStateChanged.getGameState();
|
||||||
|
if (gameState == GameState.LOGIN_SCREEN)
|
||||||
{
|
{
|
||||||
// Reset music filter on logout
|
// Reset music filter on logout
|
||||||
currentMusicFilter = MusicState.ALL;
|
currentMusicFilter = MusicState.ALL;
|
||||||
tracks = null;
|
tracks = null;
|
||||||
}
|
}
|
||||||
|
else if (gameState == GameState.LOGGED_IN)
|
||||||
|
{
|
||||||
|
if (musicConfig.muteAmbientSounds())
|
||||||
|
{
|
||||||
|
client.getAmbientSoundEffects()
|
||||||
|
.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
@@ -308,7 +317,7 @@ public class MusicPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onConfigChanged(ConfigChanged configChanged)
|
public void onConfigChanged(ConfigChanged configChanged)
|
||||||
{
|
{
|
||||||
if ("music".equals(configChanged.getGroup()))
|
if (configChanged.getGroup().equals(MusicConfig.GROUP))
|
||||||
{
|
{
|
||||||
clientThread.invoke(() ->
|
clientThread.invoke(() ->
|
||||||
{
|
{
|
||||||
@@ -324,6 +333,14 @@ public class MusicPlugin extends Plugin
|
|||||||
teardownMusicOptions();
|
teardownMusicOptions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (MusicConfig.MUTE_AMBIENT_SOUNDS.equals(configChanged.getKey()))
|
||||||
|
{
|
||||||
|
// Reload the scene to reapply ambient sounds
|
||||||
|
if (client.getGameState() == GameState.LOGGED_IN)
|
||||||
|
{
|
||||||
|
client.setGameState(GameState.LOADING);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
updateMusicOptions();
|
updateMusicOptions();
|
||||||
|
|||||||
@@ -1,93 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2018, Shaun Dreclin <shaundreclin@gmail.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.plugins.roguesden;
|
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.awt.Dimension;
|
|
||||||
import java.awt.Graphics2D;
|
|
||||||
import java.awt.Polygon;
|
|
||||||
import java.awt.Shape;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import net.runelite.api.Client;
|
|
||||||
import net.runelite.api.coords.LocalPoint;
|
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
|
||||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
|
||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
|
||||||
|
|
||||||
public class RoguesDenOverlay extends Overlay
|
|
||||||
{
|
|
||||||
private static final int MAX_DISTANCE = 2350;
|
|
||||||
|
|
||||||
private final Client client;
|
|
||||||
private final RoguesDenPlugin plugin;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
public RoguesDenOverlay(Client client, RoguesDenPlugin plugin)
|
|
||||||
{
|
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
|
||||||
setLayer(OverlayLayer.ABOVE_SCENE);
|
|
||||||
this.client = client;
|
|
||||||
this.plugin = plugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Dimension render(Graphics2D graphics)
|
|
||||||
{
|
|
||||||
if (!plugin.isHasGem())
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
LocalPoint playerLocation = client.getLocalPlayer().getLocalLocation();
|
|
||||||
|
|
||||||
plugin.getObstaclesHull().forEach((obstacle, tile) ->
|
|
||||||
{
|
|
||||||
if (tile.getPlane() == client.getPlane() && obstacle.getLocalLocation().distanceTo(playerLocation) < MAX_DISTANCE)
|
|
||||||
{
|
|
||||||
Shape p = tile.getGameObjects()[0].getConvexHull();
|
|
||||||
if (p != null)
|
|
||||||
{
|
|
||||||
graphics.setColor(Color.CYAN);
|
|
||||||
graphics.draw(p);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
plugin.getObstaclesTile().forEach((obstacle, tile) ->
|
|
||||||
{
|
|
||||||
if (tile.getPlane() == client.getPlane() && obstacle.getLocalLocation().distanceTo(playerLocation) < MAX_DISTANCE)
|
|
||||||
{
|
|
||||||
Polygon p = obstacle.getCanvasTilePoly();
|
|
||||||
if (p != null)
|
|
||||||
{
|
|
||||||
graphics.setColor(Color.CYAN);
|
|
||||||
graphics.draw(p);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,159 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2018-2019, Shaun Dreclin <https://github.com/ShaunDreclin>
|
|
||||||
* 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.roguesden;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import lombok.AccessLevel;
|
|
||||||
import lombok.Getter;
|
|
||||||
import net.runelite.api.GameState;
|
|
||||||
import net.runelite.api.InventoryID;
|
|
||||||
import net.runelite.api.ItemContainer;
|
|
||||||
import net.runelite.api.ItemID;
|
|
||||||
import net.runelite.api.Tile;
|
|
||||||
import net.runelite.api.TileObject;
|
|
||||||
import net.runelite.api.events.GameObjectChanged;
|
|
||||||
import net.runelite.api.events.GameObjectDespawned;
|
|
||||||
import net.runelite.api.events.GameObjectSpawned;
|
|
||||||
import net.runelite.api.events.GameStateChanged;
|
|
||||||
import net.runelite.api.events.GroundObjectChanged;
|
|
||||||
import net.runelite.api.events.GroundObjectDespawned;
|
|
||||||
import net.runelite.api.events.GroundObjectSpawned;
|
|
||||||
import net.runelite.api.events.ItemContainerChanged;
|
|
||||||
import net.runelite.client.eventbus.Subscribe;
|
|
||||||
import net.runelite.client.plugins.Plugin;
|
|
||||||
import net.runelite.client.plugins.PluginDescriptor;
|
|
||||||
import net.runelite.client.ui.overlay.OverlayManager;
|
|
||||||
|
|
||||||
@PluginDescriptor(
|
|
||||||
name = "Rogues' Den",
|
|
||||||
description = "Mark tiles and clickboxes to help traverse the maze",
|
|
||||||
tags = {"agility", "maze", "minigame", "overlay", "thieving"}
|
|
||||||
)
|
|
||||||
public class RoguesDenPlugin extends Plugin
|
|
||||||
{
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private final HashMap<TileObject, Tile> obstaclesHull = new HashMap<>();
|
|
||||||
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private final HashMap<TileObject, Tile> obstaclesTile = new HashMap<>();
|
|
||||||
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private boolean hasGem;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
private OverlayManager overlayManager;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
private RoguesDenOverlay overlay;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void startUp() throws Exception
|
|
||||||
{
|
|
||||||
overlayManager.add(overlay);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void shutDown() throws Exception
|
|
||||||
{
|
|
||||||
overlayManager.remove(overlay);
|
|
||||||
obstaclesHull.clear();
|
|
||||||
obstaclesTile.clear();
|
|
||||||
hasGem = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void onItemContainerChanged(ItemContainerChanged event)
|
|
||||||
{
|
|
||||||
if (event.getContainerId() != InventoryID.INVENTORY.getId())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ItemContainer itemContainer = event.getItemContainer();
|
|
||||||
hasGem = itemContainer.contains(ItemID.MYSTIC_JEWEL);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void onGameObjectSpawned(GameObjectSpawned event)
|
|
||||||
{
|
|
||||||
onTileObject(event.getTile(), null, event.getGameObject());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void onGameObjectChanged(GameObjectChanged event)
|
|
||||||
{
|
|
||||||
onTileObject(event.getTile(), event.getPrevious(), event.getGameObject());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void onGameObjectDespawned(GameObjectDespawned event)
|
|
||||||
{
|
|
||||||
onTileObject(event.getTile(), event.getGameObject(), null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void onGroundObjectSpawned(GroundObjectSpawned event)
|
|
||||||
{
|
|
||||||
onTileObject(event.getTile(), null, event.getGroundObject());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void onGroundObjectChanged(GroundObjectChanged event)
|
|
||||||
{
|
|
||||||
onTileObject(event.getTile(), event.getPrevious(), event.getGroundObject());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void onGroundObjectDespawned(GroundObjectDespawned event)
|
|
||||||
{
|
|
||||||
onTileObject(event.getTile(), event.getGroundObject(), null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void onGameStateChanged(GameStateChanged event)
|
|
||||||
{
|
|
||||||
if (event.getGameState() == GameState.LOADING)
|
|
||||||
{
|
|
||||||
obstaclesHull.clear();
|
|
||||||
obstaclesTile.clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onTileObject(Tile tile, TileObject oldObject, TileObject newObject)
|
|
||||||
{
|
|
||||||
obstaclesHull.remove(oldObject);
|
|
||||||
if (newObject != null && Obstacles.OBSTACLE_IDS_HULL.contains(newObject.getId()))
|
|
||||||
{
|
|
||||||
obstaclesHull.put(newObject, tile);
|
|
||||||
}
|
|
||||||
|
|
||||||
obstaclesTile.remove(oldObject);
|
|
||||||
if (newObject != null && Obstacles.OBSTACLE_IDS_TILE.contains(newObject.getId()))
|
|
||||||
{
|
|
||||||
obstaclesTile.put(newObject, tile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user