diff --git a/runelite-api/src/main/java/net/runelite/api/events/LocalPlayerDeath.java b/runelite-api/src/main/java/net/runelite/api/events/FakeXpDrop.java similarity index 82% rename from runelite-api/src/main/java/net/runelite/api/events/LocalPlayerDeath.java rename to runelite-api/src/main/java/net/runelite/api/events/FakeXpDrop.java index 6b22cf1784..698805ab24 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/LocalPlayerDeath.java +++ b/runelite-api/src/main/java/net/runelite/api/events/FakeXpDrop.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Matthew Steglinski + * Copyright (c) 2019, Adam * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,15 +24,12 @@ */ package net.runelite.api.events; -/** - * An event when the local player dies. - */ -public class LocalPlayerDeath implements Event -{ - public static final LocalPlayerDeath INSTANCE = new LocalPlayerDeath(); +import lombok.Value; +import net.runelite.api.Skill; - private LocalPlayerDeath() - { - // noop - } +@Value +public class FakeXpDrop implements Event +{ + private final Skill skill; + private final int xp; } diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java index b3a4bf0623..482c0e8b06 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java @@ -161,6 +161,7 @@ public class WidgetID public static final int LMS_INGAME_GROUP_ID = 328; public static final int JEWELLERY_BOX_GROUP_ID = 590; public static final int OPTIONS_GROUP_ID = 261; + public static final int GWD_KC_GROUP_ID = 406; static class WorldMap { @@ -658,6 +659,11 @@ public class WidgetID static final int REWARD_TEXT = 57; } + static class GWD + { + static final int CONTAINER = 7; + } + static class LevelUp { static final int SKILL = 1; @@ -827,161 +833,31 @@ public class WidgetID static final int FILTERED_SPELLS_PARENT = 1; static final int FILTERED_SPELLS_BOUNDS = 3; - // NORMAL SPELLS - static final int LUMBRIDGE_HOME_TELEPORT = 4; - static final int WIND_STRIKE = 5; - static final int CONFUSE = 6; - static final int ENCHANT_CROSSBOW_BOLT = 7; - static final int WATER_STRIKE = 8; - static final int LVL_1_ENCHANT = 9; - static final int EARTH_STRIKE = 10; - static final int WEAKEN = 11; - static final int FIRE_STRIKE = 12; - static final int BONES_TO_BANANAS = 13; - static final int WIND_BOLT = 14; - static final int CURSE = 15; - static final int BIND = 16; - static final int LOW_LEVEL_ALCHEMY = 17; - static final int WATER_BOLT = 18; - static final int VARROCK_TELEPORT = 19; - static final int LVL_2_ENCHANT = 20; - static final int EARTH_BOLT = 21; - static final int LUMBRIDGE_TELEPORT = 22; - static final int TELEKINETIC_GRAB = 23; - static final int FIRE_BOLT = 24; - static final int FALADOR_TELEPORT = 25; - static final int CRUMBLE_UNDEAD = 26; - static final int TELEPORT_TO_HOUSE = 27; - static final int WIND_BLAST = 28; - static final int SUPERHEAT_ITEM = 29; - static final int CAMELOT_TELEPORT = 30; - static final int WATER_BLAST = 31; - static final int LVL_3_ENCHANT = 32; - static final int IBAN_BLAST = 33; - static final int SNARE = 34; - static final int MAGIC_DART = 35; - static final int ARDOUGNE_TELEPORT = 36; - static final int EARTH_BLAST = 37; - static final int HIGH_LEVEL_ALCHEMY = 38; - static final int CHARGE_WATER_ORB = 39; - static final int LVL_4_ENCHANT = 40; - static final int WATCHTOWER_TELEPORT = 41; - static final int FIRE_BLAST = 42; - static final int CHARGE_EARTH_ORB = 43; - static final int BONES_TO_PEACHES = 44; - static final int SARADOMIN_STRIKE = 45; - static final int CLAWS_OF_GUTHIX = 46; - static final int FLAMES_OF_ZAMORAK = 47; - static final int TROLLHEIM_TELEPORT = 48; - static final int WIND_WAVE = 49; - static final int CHARGE_FIRE_ORB = 50; - static final int TELEPORT_TO_APE_ATOLL = 51; - static final int WATER_WAVE = 52; - static final int CHARGE_AIR_ORB = 53; - static final int VULNERABILITY = 54; - static final int LVL_5_ENCHANT = 55; - static final int TELEPORT_TO_KOUREND = 56; - static final int EARTH_WAVE = 57; - static final int ENFEEBLE = 58; - static final int TELEOTHER_LUMBRIDGE = 59; - static final int FIRE_WAVE = 60; - static final int ENTANGLE = 61; - static final int STUN = 62; - static final int CHARGE = 63; - static final int WIND_SURGE = 64; - static final int TELEOTHER_FALADOR = 65; - static final int WATER_SURGE = 66; - static final int TELE_BLOCK = 67; - static final int BOUNTY_TARGET_TELEPORT = 68; - static final int LVL_6_ENCHANT = 69; - static final int TELEOTHER_CAMELOT = 70; - static final int EARTH_SURGE = 71; - static final int LVL_7_ENCHANT = 72; - static final int FIRE_SURGE = 73; + static final int FILTER_SECTION_PARENT = 182; + static final int FILTER_BUTTONS_PARENT = 185; + static final int FILTER_BUTTON_PARENT = 186; + static final int FILTER_BUTTON = 188; + static final int TOOLTIP = 189; + } - // ANCIENT SPELLS - static final int ICE_RUSH = 74; - static final int ICE_BLITZ = 75; - static final int ICE_BURST = 76; - static final int ICE_BARRAGE = 77; - static final int BLOOD_RUSH = 78; - static final int BLOOD_BLITZ = 79; - static final int BLOOD_BURST = 80; - static final int BLOOD_BARRAGE = 81; - static final int SMOKE_RUSH = 82; - static final int SMOKE_BLITZ = 83; - static final int SMOKE_BURST = 84; - static final int SMOKE_BARRAGE = 85; - static final int SHADOW_RUSH = 86; - static final int SHADOW_BLITZ = 87; - static final int SHADOW_BURST = 88; - static final int SHADOW_BARRAGE = 89; - static final int PADDEWWA_TELEPORT = 90; - static final int SENNTISTEN_TELEPORT = 91; - static final int KHARYRLL_TELEPORT = 92; - static final int LASSAR_TELEPORT = 93; - static final int DAREEYAK_TELEPORT = 94; - static final int CARRALLANGER_TELEPORT = 95; - static final int ANNAKARL_TELEPORT = 96; - static final int GHORROCK_TELEPORT = 97; - static final int EDGEVILLE_HOME_TELEPORT = 98; - static final int TOOLTIP = 188; + static class StandardSpellBook + { + static final int LUMBRIDGE_HOME_TELEPORT = 5; + } + static class AncientSpellBook + { + static final int EDGEVILLE_HOME_TELEPORT = 99; + } - // LUNAR SPELLS - static final int LUNAR_HOME_TELEPORT = 99; - static final int BAKE_PIE = 100; - static final int CURE_PLANT = 101; - static final int MONSTER_EXAMINE = 102; - static final int NPC_CONTACT = 103; - static final int CURE_OTHER = 104; - static final int HUMIDIFY = 105; - static final int MOONCLAN_TELEPORT = 106; - static final int TELE_GROUP_MOONCLAN = 107; - static final int CURE_ME = 108; - static final int HUNTER_KIT = 109; - static final int WATERBIRTH_TELEPORT = 110; - static final int TELE_GROUP_WATERBIRTH = 111; - static final int CURE_GROUP = 112; - static final int STAT_SPY = 113; - static final int BARBARIAN_TELEPORT = 114; - static final int TELE_GROUP_BARBARIAN = 115; - static final int SUPERGLASS_MAKE = 116; - static final int TAN_LEATHER = 117; - static final int KHAZARD_TELEPORT = 118; - static final int TELE_GROUP_KHAZARD = 119; - static final int DREAM = 120; - static final int STRING_JEWELLERY = 121; - static final int STAT_RESTORE_POT_SHARE = 122; - static final int MAGIC_IMBUE = 123; - static final int FERTILE_SOIL = 124; - static final int BOOST_POTION_SHARE = 125; - static final int FISHING_GUILD_TELEPORT = 126; - static final int TELE_GROUP_FISHING_GUILD = 127; - static final int PLANK_MAKE = 128; - static final int CATHERBY_TELEPORT = 129; - static final int TELE_GROUP_CATHERBY = 130; - static final int RECHARGE_DRAGONSTONE = 131; - static final int ICE_PLATEAU_TELEPORT = 132; - static final int TELE_GROUP_ICE_PLATEAU = 133; - static final int ENERGY_TRANSFER = 134; - static final int HEAL_OTHER = 135; - static final int VENGEANCE_OTHER = 136; - static final int VENGEANCE = 137; - static final int HEAL_GROUP = 138; - static final int SPELLBOOK_SWAP = 139; - static final int GEOMANCY = 140; - static final int SPIN_FLAX = 141; - static final int OURANIA_TELEPORT = 142; + static class LunarSpellBook + { + static final int LUNAR_HOME_TELEPORT = 100; + } - // ARCEUUS SPELLS - static final int ARCEUUS_HOME_TELEPORT = 143; - static final int BATTLEFRONT_TELEPORT = 178; - - static final int FILTER_SECTION_PARENT = 181; - static final int FILTER_BUTTONS_PARENT = 184; - static final int FILTER_BUTTON_PARENT = 185; - static final int FILTER_BUTTON = 187; + static class ArceuusSpellBook + { + static final int ARCEUUS_HOME_TELEPORT = 144; } static class Pvp diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java index 2e733bd70f..95bffcac99 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java @@ -429,6 +429,8 @@ public enum WidgetInfo MOTHERLODE_MINE(WidgetID.MOTHERLODE_MINE_GROUP_ID, 0), + GWD_KC(WidgetID.GWD_KC_GROUP_ID, WidgetID.GWD.CONTAINER), + PUZZLE_BOX(WidgetID.PUZZLE_BOX_GROUP_ID, WidgetID.PuzzleBox.VISIBLE_BOX), LIGHT_BOX(WidgetID.LIGHT_BOX_GROUP_ID, WidgetID.LightBox.LIGHT_BOX), @@ -524,165 +526,17 @@ public enum WidgetInfo SPELLBOOK_FILTERED_SPELLS_PARENT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FILTERED_SPELLS_PARENT), SPELLBOOK_FILTERED_BOUNDS(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FILTERED_SPELLS_BOUNDS), -/* STANDARD SPELL BOOK WIDGETS*/ - SPELL_LUMBRIDGE_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LUMBRIDGE_HOME_TELEPORT), - SPELL_WIND_STRIKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WIND_STRIKE), - SPELL_CONFUSE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CONFUSE), - SPELL_ENCHANT_CROSSBOW_BOLT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ENCHANT_CROSSBOW_BOLT), - SPELL_WATER_STRIKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATER_STRIKE), - SPELL_LVL_1_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_1_ENCHANT), - SPELL_EARTH_STRIKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EARTH_STRIKE), - SPELL_WEAKEN(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WEAKEN), - SPELL_FIRE_STRIKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FIRE_STRIKE), - SPELL_BONES_TO_BANANAS(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BONES_TO_BANANAS), - SPELL_WIND_BOLT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WIND_BOLT), - SPELL_CURSE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CURSE), - SPELL_BIND(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BIND), - SPELL_LOW_LEVEL_ALCHEMY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LOW_LEVEL_ALCHEMY), - SPELL_WATER_BOLT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATER_BOLT), - SPELL_VARROCK_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.VARROCK_TELEPORT), - SPELL_LVL_2_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_2_ENCHANT), - SPELL_EARTH_BOLT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EARTH_BOLT), - SPELL_LUMBRIDGE_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LUMBRIDGE_TELEPORT), - SPELL_TELEKINETIC_GRAB(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEKINETIC_GRAB), - SPELL_FIRE_BOLT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FIRE_BOLT), - SPELL_FALADOR_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FALADOR_TELEPORT), - SPELL_CRUMBLE_UNDEAD(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CRUMBLE_UNDEAD), - SPELL_TELEPORT_TO_HOUSE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEPORT_TO_HOUSE), - SPELL_WIND_BLAST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WIND_BLAST), - SPELL_SUPERHEAT_ITEM(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SUPERHEAT_ITEM), - SPELL_CAMELOT_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CAMELOT_TELEPORT), - SPELL_WATER_BLAST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATER_BLAST), - SPELL_LVL_3_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_3_ENCHANT), - SPELL_IBAN_BLAST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.IBAN_BLAST), - SPELL_SNARE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SNARE), - SPELL_MAGIC_DART(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.MAGIC_DART), - SPELL_ARDOUGNE_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ARDOUGNE_TELEPORT), - SPELL_EARTH_BLAST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EARTH_BLAST), - SPELL_HIGH_LEVEL_ALCHEMY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.HIGH_LEVEL_ALCHEMY), - SPELL_CHARGE_WATER_ORB(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CHARGE_WATER_ORB), - SPELL_LVL_4_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_4_ENCHANT), - SPELL_WATCHTOWER_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATCHTOWER_TELEPORT), - SPELL_FIRE_BLAST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FIRE_BLAST), - SPELL_CHARGE_EARTH_ORB(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CHARGE_EARTH_ORB), - SPELL_BONES_TO_PEACHES(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BONES_TO_PEACHES), - SPELL_SARADOMIN_STRIKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SARADOMIN_STRIKE), - SPELL_CLAWS_OF_GUTHIX(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CLAWS_OF_GUTHIX), - SPELL_FLAMES_OF_ZAMORAK(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FLAMES_OF_ZAMORAK), - SPELL_TROLLHEIM_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TROLLHEIM_TELEPORT), - SPELL_WIND_WAVE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WIND_WAVE), - SPELL_CHARGE_FIRE_ORB(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CHARGE_FIRE_ORB), - SPELL_TELEPORT_TO_APE_ATOLL(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEPORT_TO_APE_ATOLL), - SPELL_WATER_WAVE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATER_WAVE), - SPELL_CHARGE_AIR_ORB(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CHARGE_AIR_ORB), - SPELL_VULNERABILITY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.VULNERABILITY), - SPELL_LVL_5_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_5_ENCHANT), - SPELL_TELEPORT_TO_KOUREND(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEPORT_TO_KOUREND), - SPELL_EARTH_WAVE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EARTH_WAVE), - SPELL_ENFEEBLE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ENFEEBLE), - SPELL_FIRE_WAVE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FIRE_WAVE), - SPELL_ENTANGLE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ENTANGLE), - SPELL_TELEOTHER_LUMBRIDGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEOTHER_LUMBRIDGE), - SPELL_STUN(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.STUN), - SPELL_CHARGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CHARGE), - SPELL_WIND_SURGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WIND_SURGE), - SPELL_TELEOTHER_FALADOR(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEOTHER_FALADOR), - SPELL_WATER_SURGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATER_SURGE), - SPELL_TELE_BLOCK(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_BLOCK), - SPELL_LVL_6_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_6_ENCHANT), - SPELL_TELEOTHER_CAMELOT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEOTHER_CAMELOT), - SPELL_EARTH_SURGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EARTH_SURGE), - SPELL_LVL_7_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_7_ENCHANT), - SPELL_FIRE_SURGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FIRE_SURGE), - SPELL_BOUNTY_TARGET_TELEPORT2(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BOUNTY_TARGET_TELEPORT), -/* END OF STANDARD SPELL BOOK WIDGETS*/ - - /* ANCIENT SPELL BOOK WIDGETS*/ - SPELL_ICE_RUSH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ICE_RUSH), - SPELL_ICE_BLITZ(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ICE_BLITZ), - SPELL_ICE_BURST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ICE_BURST), - SPELL_ICE_BARRAGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ICE_BARRAGE), - SPELL_BLOOD_RUSH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BLOOD_RUSH), - SPELL_BLOOD_BLITZ(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BLOOD_BLITZ), - SPELL_BLOOD_BURST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BLOOD_BURST), - SPELL_BLOOD_BARRAGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BLOOD_BARRAGE), - SPELL_SMOKE_RUSH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SMOKE_RUSH), - SPELL_SMOKE_BLITZ(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SMOKE_BLITZ), - SPELL_SMOKE_BURST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SMOKE_BURST), - SPELL_SMOKE_BARRAGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SMOKE_BARRAGE), - SPELL_SHADOW_RUSH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SHADOW_RUSH), - SPELL_SHADOW_BLITZ(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SHADOW_BLITZ), - SPELL_SHADOW_BURST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SHADOW_BURST), - SPELL_SHADOW_BARRAGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SHADOW_BARRAGE), - SPELL_PADDEWWA_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.PADDEWWA_TELEPORT), - SPELL_SENNTISTEN_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SENNTISTEN_TELEPORT), - SPELL_KHARYRLL_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.KHARYRLL_TELEPORT), - SPELL_LASSAR_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LASSAR_TELEPORT), - SPELL_DAREEYAK_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.DAREEYAK_TELEPORT), - SPELL_CARRALLANGER_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CARRALLANGER_TELEPORT), - SPELL_ANNAKARL_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ANNAKARL_TELEPORT), - SPELL_GHORROCK_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.GHORROCK_TELEPORT), - SPELL_EDGEVILLE_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EDGEVILLE_HOME_TELEPORT), - SPELL_BOUNTY_TARGET_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BOUNTY_TARGET_TELEPORT), -/* END OF ANCIENT SPELL BOOK WIDGETS*/ - -/* LUNAR SPELL BOOK WIDGETS*/ - SPELL_LUNAR_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LUNAR_HOME_TELEPORT), - SPELL_VENGEANCE_OTHER(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.VENGEANCE_OTHER), - SPELL_VENGEANCE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.VENGEANCE), - SPELL_BOUNTY_TARGET_TELEPORT3(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BOUNTY_TARGET_TELEPORT), - SPELL_BAKE_PIE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BAKE_PIE), - SPELL_CURE_PLANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CURE_PLANT), - SPELL_MONSTER_EXAMINE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.MONSTER_EXAMINE), - SPELL_NPC_CONTACT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.NPC_CONTACT), - SPELL_CURE_OTHER(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CURE_OTHER), - SPELL_HUMIDIFY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.HUMIDIFY), - SPELL_MOONCLAN_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.MOONCLAN_TELEPORT), - SPELL_TELE_GROUP_MOONCLAN(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_MOONCLAN), - SPELL_CURE_ME(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CURE_ME), - SPELL_HUNTER_KIT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.HUNTER_KIT), - SPELL_WATERBIRTH_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATERBIRTH_TELEPORT), - SPELL_TELE_GROUP_WATERBIRTH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_WATERBIRTH), - SPELL_CURE_GROUP(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CURE_GROUP), - SPELL_STAT_SPY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.STAT_SPY), - SPELL_BARBARIAN_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BARBARIAN_TELEPORT), - SPELL_TELE_GROUP_BARBARIAN(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_BARBARIAN), - SPELL_SUPERGLASS_MAKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SUPERGLASS_MAKE), - SPELL_TAN_LEATHER(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TAN_LEATHER), - SPELL_KHAZARD_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.KHAZARD_TELEPORT), - SPELL_TELE_GROUP_KHAZARD(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_KHAZARD), - SPELL_DREAM(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.DREAM), - SPELL_STRING_JEWELLERY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.STRING_JEWELLERY), - SPELL_STAT_RESTORE_POT_SHARE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.STAT_RESTORE_POT_SHARE), - SPELL_MAGIC_IMBUE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.MAGIC_IMBUE), - SPELL_FERTILE_SOIL(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FERTILE_SOIL), - SPELL_BOOST_POTION_SHARE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BOOST_POTION_SHARE), - SPELL_FISHING_GUILD_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FISHING_GUILD_TELEPORT), - SPELL_TELE_GROUP_FISHING_GUILD(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_FISHING_GUILD), - SPELL_PLANK_MAKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.PLANK_MAKE), - SPELL_CATHERBY_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CATHERBY_TELEPORT), - SPELL_TELE_GROUP_CATHERBY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_CATHERBY), - SPELL_RECHARGE_DRAGONSTONE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.RECHARGE_DRAGONSTONE), - SPELL_ICE_PLATEAU_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ICE_PLATEAU_TELEPORT), - SPELL_TELE_GROUP_ICE_PLATEAU(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_ICE_PLATEAU), - SPELL_ENERGY_TRANSFER(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ENERGY_TRANSFER), - SPELL_HEAL_OTHER(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.HEAL_OTHER), - SPELL_HEAL_GROUP(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.HEAL_GROUP), - SPELL_SPELLBOOK_SWAP(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SPELLBOOK_SWAP), - SPELL_GEOMANCY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.GEOMANCY), - SPELL_SPIN_FLAX(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SPIN_FLAX), - SPELL_OURANIA_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.OURANIA_TELEPORT), -/* END OF LUNAR SPELL BOOK WIDGETS*/ - SPELL_TOOLTIP(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TOOLTIP), -/* ARCEUUS SPELL BOOK WIDGETS*/ - SPELL_ARCEUUS_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ARCEUUS_HOME_TELEPORT), - SPELL_BATTLEFRONT_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BATTLEFRONT_TELEPORT), -/* END OF ARCEUUS SPELL BOOK WIDGETS*/ SPELLBOOK_FILTER_SECTION_PARENT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FILTER_SECTION_PARENT), SPELLBOOK_FILTER_BUTTONS_PARENT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FILTER_BUTTONS_PARENT), SPELLBOOK_FILTER_BUTTON_PARENT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FILTER_BUTTON_PARENT), SPELLBOOK_FILTER_BUTTON(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FILTER_BUTTON), + SPELL_TOOLTIP(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TOOLTIP), + + 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), KOUREND_FAVOUR_OVERLAY(WidgetID.KOUREND_FAVOUR_GROUP_ID, WidgetID.KourendFavour.KOUREND_FAVOUR_OVERLAY), ZEAH_MESS_HALL_COOKING_DISPLAY(WidgetID.ZEAH_MESS_HALL_GROUP_ID, WidgetID.Zeah.MESS_HALL_COOKING_DISPLAY), @@ -694,7 +548,6 @@ public enum WidgetInfo MULTICOMBAT_FIXED(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.MULTICOMBAT_INDICATOR), MULTICOMBAT_RESIZEABLE(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewport.MULTICOMBAT_INDICATOR), - FULLSCREEN_MAP_ROOT(WidgetID.FULLSCREEN_MAP_GROUP_ID, WidgetID.FullScreenMap.ROOT), QUESTLIST_BOX(WidgetID.QUESTLIST_GROUP_ID, WidgetID.QuestList.BOX), @@ -756,8 +609,8 @@ public enum WidgetInfo XP_DROP_7(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_7), ITEMS_KEPT_CUSTOM_TEXT_CONTAINER(WidgetID.KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.CUSTOM_TEXT_CONTAINER), - ITEMS_KEPT_ON_DEATH_CONTAINER(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.KEPT_ITEMS_CONTAINER), ITEMS_KEPT_ON_DEATH_TEXT(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.KEPT_ITEMS_TEXT), + ITEMS_KEPT_ON_DEATH_CONTAINER(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.KEPT_ITEMS_CONTAINER), ITEMS_LOST_ON_DEATH_TEXT(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.LOST_ITEMS_TEXT), ITEMS_LOST_ON_DEATH_CONTAINER(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.LOST_ITEMS_CONTAINER), ITEMS_KEPT_INFORMATION_CONTAINER(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.INFORMATION_CONTAINER), diff --git a/runelite-client/src/main/java/net/runelite/client/RuneLite.java b/runelite-client/src/main/java/net/runelite/client/RuneLite.java index 0130165588..bb4e20affd 100644 --- a/runelite-client/src/main/java/net/runelite/client/RuneLite.java +++ b/runelite-client/src/main/java/net/runelite/client/RuneLite.java @@ -51,6 +51,7 @@ import lombok.Getter; import lombok.extern.slf4j.Slf4j; import net.runelite.api.Client; import net.runelite.api.events.GameStateChanged; +import net.runelite.api.events.ScriptCallbackEvent; import net.runelite.client.account.SessionManager; import net.runelite.client.callback.Hooks; import net.runelite.client.chat.ChatMessageManager; @@ -367,6 +368,7 @@ public class RuneLite chatboxPanelManager.get(); eventBus.subscribe(GameStateChanged.class, this, hooks::onGameStateChanged); + eventBus.subscribe(ScriptCallbackEvent.class, this, hooks::onScriptCallbackEvent); // Add core overlays WidgetOverlay.createOverlays(client).forEach(overlayManager::add); diff --git a/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java b/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java index 94648a1f68..7bf3e53352 100644 --- a/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java +++ b/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java @@ -47,12 +47,15 @@ import net.runelite.api.Entity; import net.runelite.api.MainBufferProvider; import net.runelite.api.NullItemID; import net.runelite.api.RenderOverview; +import net.runelite.api.Skill; import net.runelite.api.WorldMapManager; import net.runelite.api.events.BeforeMenuRender; import net.runelite.api.events.BeforeRender; import net.runelite.api.events.Event; +import net.runelite.api.events.FakeXpDrop; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; +import net.runelite.api.events.ScriptCallbackEvent; import net.runelite.api.hooks.Callbacks; import net.runelite.api.hooks.DrawCallbacks; import net.runelite.api.widgets.Widget; @@ -544,4 +547,25 @@ public class Hooks implements Callbacks client.getCallbacks().post(BeforeMenuRender.class, event); return event.isConsumed(); } + + public void onScriptCallbackEvent(ScriptCallbackEvent scriptCallbackEvent) + { + if (!scriptCallbackEvent.getEventName().equals("fakeXpDrop")) + { + return; + } + + final int[] intStack = client.getIntStack(); + final int intStackSize = client.getIntStackSize(); + + final int statId = intStack[intStackSize - 2]; + final int xp = intStack[intStackSize - 1]; + + Skill skill = Skill.values()[statId]; + FakeXpDrop fakeXpDrop = new FakeXpDrop( + skill, + xp + ); + eventBus.post(FakeXpDrop.class, fakeXpDrop); + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cannon/CannonSpots.java b/runelite-client/src/main/java/net/runelite/client/plugins/cannon/CannonSpots.java index 848fd1dcd6..b8b8ddd9c5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cannon/CannonSpots.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cannon/CannonSpots.java @@ -40,7 +40,7 @@ public enum CannonSpots BLACK_DEMONS(new WorldPoint(2859, 9778, 0), new WorldPoint(2841, 9791, 0), new WorldPoint(1421, 10089, 1)), ELVES(new WorldPoint(2044, 4635, 0), new WorldPoint(3278, 6098, 0)), SUQAHS(new WorldPoint(2114, 3943, 0)), - TROLLS(new WorldPoint(2401, 3856, 0)), + TROLLS(new WorldPoint(2401, 3856, 0), new WorldPoint(1242, 3517, 0)), GREATER_DEMONS(new WorldPoint(1435, 10086, 2)), BRINE_RAT(new WorldPoint(2707, 10132, 0)), DAGGANOTH(new WorldPoint(2524, 10020, 0)), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java index e085efc313..6da83f5263 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java @@ -127,7 +127,7 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati .put(new WorldPoint(3058, 3884, 0), "Wilderness. Near runite ore north of Lava Maze.") .put(new WorldPoint(3290, 3889, 0), "Wilderness. Demonic Ruins.") .put(new WorldPoint(3770, 3897, 0), "Small Island north of Fossil Island.") - .put(new WorldPoint(2505, 3899, 0), "Small Island north-east of Miscellania (AJS).") + .put(new WorldPoint(2505, 3899, 0), "Small Island north-west of Miscellania (AJS).") .put(new WorldPoint(3285, 3942, 0), "Wilderness. Rogues' Castle.") .put(new WorldPoint(3159, 3959, 0), "Wilderness. North of Deserted Keep, west of Resource Area.") .put(new WorldPoint(3039, 3960, 0), "Wilderness. Pirates' Hideout.") diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java index ced104cc30..eb5d246e43 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java @@ -137,7 +137,7 @@ public class SkillChallengeClue extends ClueScroll implements NpcClueScroll new SkillChallengeClue("Mine a piece of mithril ore.", ANY_PICKAXE), new SkillChallengeClue("Smith a mithril 2h sword.", item(ItemID.HAMMER), xOfItem(ItemID.MITHRIL_BAR, 3)), new SkillChallengeClue("Catch a raw shark.", ANY_HARPOON), - new SkillChallengeClue("Chop a yew tree.", ANY_AXE), + new SkillChallengeClue("Cut a yew log.", ANY_AXE), new SkillChallengeClue("Fix a magical lamp in Dorgesh-Kaan.", item(ItemID.LIGHT_ORB)), new SkillChallengeClue("Burn a yew log.", item(ItemID.YEW_LOGS), item(ItemID.TINDERBOX)), new SkillChallengeClue("Cook a swordfish", "cook a swordfish", item(ItemID.RAW_SWORDFISH)), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathIndicatorPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathIndicatorPlugin.java index 905cdc03bd..439141d708 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathIndicatorPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathIndicatorPlugin.java @@ -48,7 +48,6 @@ import net.runelite.client.events.ConfigChanged; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; import net.runelite.api.events.ItemDespawned; -import net.runelite.api.events.LocalPlayerDeath; import net.runelite.api.events.MenuEntryAdded; import net.runelite.api.events.MenuOpened; import net.runelite.api.events.MenuOptionClicked; @@ -197,7 +196,7 @@ public class DeathIndicatorPlugin extends Plugin private void addSubscriptions() { eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged); - eventBus.subscribe(LocalPlayerDeath.class, this, this::onLocalPlayerDeath); + eventBus.subscribe(PlayerDeath.class, this, this::onPlayerDeath); eventBus.subscribe(GameTick.class, this, this::onGameTick); eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged); if (config.permaBones()) @@ -209,7 +208,6 @@ public class DeathIndicatorPlugin extends Plugin private void addBoneSubs() { eventBus.subscribe(ItemDespawned.class, BONES, this::onItemDespawn); - eventBus.subscribe(PlayerDeath.class, BONES, this::onPlayerDeath); eventBus.subscribe(MenuEntryAdded.class, BONES, this::onMenuEntryAdded); eventBus.subscribe(MenuOptionClicked.class, BONES, this::onMenuOptionClicked); eventBus.subscribe(MenuOpened.class, BONES, this::onMenuOpened); @@ -230,7 +228,26 @@ public class DeathIndicatorPlugin extends Plugin private void onPlayerDeath(PlayerDeath death) { - newBoneFor(death.getPlayer()); + if (client.isInInstancedRegion() || death.getPlayer().getWorldLocation().getRegionID() == 13362) + { + return; + } + + if (death.getPlayer() != client.getLocalPlayer()) + { + newBoneFor(death.getPlayer()); + return; + } + + Player lp = client.getLocalPlayer(); + if (config.permaBones()) + { + newBoneFor(lp); + } + + lastDeath = lp.getWorldLocation(); + lastDeathWorld = client.getWorld(); + lastDeathTime = Instant.now(); } private void newBoneFor(Player player) @@ -301,24 +318,6 @@ public class DeathIndicatorPlugin extends Plugin } } - private void onLocalPlayerDeath(LocalPlayerDeath death) - { - if (client.isInInstancedRegion()) - { - return; - } - - Player lp = client.getLocalPlayer(); - if (config.permaBones()) - { - newBoneFor(lp); - } - - lastDeath = lp.getWorldLocation(); - lastDeathWorld = client.getWorld(); - lastDeathTime = Instant.now(); - } - private void onGameTick(GameTick event) { // Check if player respawned in a death respawn location diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/defaultworld/DefaultWorldConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/defaultworld/DefaultWorldConfig.java index 480d4c891d..3a750f2e42 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/defaultworld/DefaultWorldConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/defaultworld/DefaultWorldConfig.java @@ -28,9 +28,11 @@ import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; -@ConfigGroup("defaultworld") +@ConfigGroup(DefaultWorldConfig.GROUP) public interface DefaultWorldConfig extends Config { + final String GROUP = "defaultworld"; + @ConfigItem( keyName = "defaultWorld", name = "Default world", @@ -40,4 +42,32 @@ public interface DefaultWorldConfig extends Config { return 0; } + + @ConfigItem( + keyName = "useLastWorld", + name = "Use Last World", + description = "Use the last world you used as the default" + ) + default boolean useLastWorld() + { + return false; + } + + @ConfigItem( + keyName = "lastWorld", + name = "", + description = "", + hidden = true + ) + default int lastWorld() + { + return 0; + } + + @ConfigItem( + keyName = "lastWorld", + name = "", + description = "" + ) + void lastWorld(int lastWorld); } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/defaultworld/DefaultWorldPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/defaultworld/DefaultWorldPlugin.java index cb5272a491..763736397c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/defaultworld/DefaultWorldPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/defaultworld/DefaultWorldPlugin.java @@ -107,6 +107,11 @@ public class DefaultWorldPlugin extends Plugin private void onGameStateChanged(GameStateChanged event) { + if (event.getGameState() == GameState.LOGGED_IN) + { + config.lastWorld(client.getWorld()); + } + applyWorld(); } @@ -170,7 +175,7 @@ public class DefaultWorldPlugin extends Plugin log.debug("Stored old world {}", worldCache); } - final int newWorld = config.getWorld(); + final int newWorld = !config.useLastWorld() ? config.getWorld() : config.lastWorld(); changeWorld(newWorld); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/emojis/Emoji.java b/runelite-client/src/main/java/net/runelite/client/plugins/emojis/Emoji.java index b0ed60a55e..8d6006856e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/emojis/Emoji.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/emojis/Emoji.java @@ -79,7 +79,12 @@ enum Emoji PARTY_POPPER("@@@"), EYES("O.O"), SWEAT(";;"), - PILE_OF_POO("~@~"); + PILE_OF_POO("~@~"), + FIRE("(/\\)"), + ALIEN("(@.@)"), + EGGPLANT("8=D"), + WAVE("(^_^)/"), + HEART_EYES("(*.*)"); private static final Map emojiMap; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/experiencedrop/XpDropPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/experiencedrop/XpDropPlugin.java index a987f56242..e544cafc36 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/experiencedrop/XpDropPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/experiencedrop/XpDropPlugin.java @@ -43,6 +43,7 @@ import net.runelite.api.Skill; import net.runelite.api.SpriteID; import net.runelite.api.Varbits; import net.runelite.api.WorldType; +import net.runelite.api.events.FakeXpDrop; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; import net.runelite.api.events.ScriptCallbackEvent; @@ -145,6 +146,7 @@ public class XpDropPlugin extends Plugin eventBus.subscribe(GameTick.class, this, this::onGameTick); eventBus.subscribe(XpDropEvent.class, this, this::onXpDropEvent); eventBus.subscribe(ScriptCallbackEvent.class, this, this::onScriptCallbackEvent); + eventBus.subscribe(FakeXpDrop.class, this, this::onFakeXpDrop); } private void onXpDropEvent(XpDropEvent event) @@ -351,6 +353,14 @@ public class XpDropPlugin extends Plugin client.runScript(XPDROP_DISABLED, lastSkill.ordinal(), previousExpGained); } + private void onFakeXpDrop(FakeXpDrop fakeXpDrop) + { + if (fakeXpDrop.getSkill() == Skill.HITPOINTS) + { + calculateDamageDealt(fakeXpDrop.getXp()); + } + } + private void onScriptCallbackEvent(ScriptCallbackEvent e) { if (this.showdamagedrops == XpDropConfig.DamageMode.NONE) @@ -364,21 +374,6 @@ public class XpDropPlugin extends Plugin { damage = 0; } - // Handles Fake XP drops (Ironman, DMM Cap, 200m xp, etc) - else if (eventName.equals("fakeXpDrop")) - { - final int[] intStack = client.getIntStack(); - final int intStackSize = client.getIntStackSize(); - - final int skillId = intStack[intStackSize - 2]; - final Skill skill = Skill.values()[skillId]; - - if (skill.equals(Skill.HITPOINTS)) - { - final int exp = intStack[intStackSize - 1]; - calculateDamageDealt(exp); - } - } else if (eventName.equals("hpXpGained")) { final int[] intStack = client.getIntStack(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/FreezeTimersPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/FreezeTimersPlugin.java index a97325d87c..e9ec467742 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/FreezeTimersPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/freezetimers/FreezeTimersPlugin.java @@ -40,8 +40,8 @@ import net.runelite.api.WorldType; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.ChatMessage; import net.runelite.api.events.GameTick; -import net.runelite.api.events.LocalPlayerDeath; import net.runelite.api.events.NpcDespawned; +import net.runelite.api.events.PlayerDeath; import net.runelite.api.events.SpotAnimationChanged; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.EventBus; @@ -125,7 +125,7 @@ public class FreezeTimersPlugin extends Plugin eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged); eventBus.subscribe(SpotAnimationChanged.class, this, this::onSpotAnimationChanged); eventBus.subscribe(GameTick.class, this, this::onGameTick); - eventBus.subscribe(LocalPlayerDeath.class, this, this::onLocalPlayerDeath); + eventBus.subscribe(PlayerDeath.class, this, this::onPlayerDeath); eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned); eventBus.subscribe(ChatMessage.class, this, this::onChatMessage); } @@ -207,7 +207,7 @@ public class FreezeTimersPlugin extends Plugin } } - private void onLocalPlayerDeath(LocalPlayerDeath event) + private void onPlayerDeath(PlayerDeath event) { final Player localPlayer = client.getLocalPlayer(); final long currentTime = System.currentTimeMillis(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grandexchange/GrandExchangeSearchPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/grandexchange/GrandExchangeSearchPanel.java index 0c5355a1e7..6452f17903 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grandexchange/GrandExchangeSearchPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grandexchange/GrandExchangeSearchPanel.java @@ -108,6 +108,7 @@ class GrandExchangeSearchPanel extends JPanel searchBar.setBackground(ColorScheme.DARKER_GRAY_COLOR); searchBar.setHoverBackgroundColor(ColorScheme.DARK_GRAY_HOVER_COLOR); searchBar.addActionListener(e -> executor.execute(() -> priceLookup(false))); + searchBar.addClearListener(e -> updateSearch()); searchItemsPanel.setLayout(new GridBagLayout()); searchItemsPanel.setBackground(ColorScheme.DARK_GRAY_COLOR); @@ -154,7 +155,7 @@ class GrandExchangeSearchPanel extends JPanel executor.execute(() -> priceLookup(true)); } - private void priceLookup(boolean exactMatch) + private boolean updateSearch() { String lookup = searchBar.getText(); @@ -162,7 +163,7 @@ class GrandExchangeSearchPanel extends JPanel { searchItemsPanel.removeAll(); SwingUtilities.invokeLater(searchItemsPanel::updateUI); - return; + return false; } // Input is not empty, add searching label @@ -170,8 +171,17 @@ class GrandExchangeSearchPanel extends JPanel searchBar.setBackground(ColorScheme.DARKER_GRAY_COLOR); searchBar.setEditable(false); searchBar.setIcon(IconTextField.Icon.LOADING); + return true; + } - List result = itemManager.search(lookup); + private void priceLookup(boolean exactMatch) + { + if (!updateSearch()) + { + return; + } + + List result = itemManager.search(searchBar.getText()); if (result.isEmpty()) { searchBar.setIcon(IconTextField.Icon.ERROR); @@ -182,7 +192,7 @@ class GrandExchangeSearchPanel extends JPanel } // move to client thread to lookup item composition - clientThread.invokeLater(() -> processResult(result, lookup, exactMatch)); + clientThread.invokeLater(() -> processResult(result, searchBar.getText(), exactMatch)); } private void processResult(List result, String lookup, boolean exactMatch) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridOverlay.java index 160733fdde..8a921e07c9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridOverlay.java @@ -34,7 +34,6 @@ import java.awt.Point; import java.awt.Rectangle; import java.awt.image.BufferedImage; import net.runelite.api.Client; -import net.runelite.api.Constants; import net.runelite.api.widgets.Widget; import net.runelite.api.widgets.WidgetInfo; import net.runelite.api.widgets.WidgetItem; @@ -47,11 +46,15 @@ import net.runelite.client.ui.overlay.OverlayPosition; class InventoryGridOverlay extends Overlay { private static final int INVENTORY_SIZE = 28; + private static final int DISTANCE_TO_ACTIVATE_HOVER = 5; private final InventoryGridPlugin plugin; private final Client client; private final ItemManager itemManager; + private Point initialMousePoint; + private boolean hoverActive = false; + @Inject private InventoryGridOverlay(final InventoryGridPlugin plugin, final Client client, final ItemManager itemManager) { @@ -69,9 +72,11 @@ class InventoryGridOverlay extends Overlay final Widget if1DraggingWidget = client.getIf1DraggedWidget(); final Widget inventoryWidget = client.getWidget(WidgetInfo.INVENTORY); - if (if1DraggingWidget == null || if1DraggingWidget != inventoryWidget - || client.getItemPressedDuration() < plugin.getDragDelay() / Constants.CLIENT_TICK_LENGTH) + + if (if1DraggingWidget == null || if1DraggingWidget != inventoryWidget) { + initialMousePoint = null; + hoverActive = false; return null; } @@ -82,11 +87,18 @@ class InventoryGridOverlay extends Overlay final int itemId = draggedItem.getId(); final Rectangle initialBounds = draggedItem.getCanvasBounds(); - if (itemId == -1) + if (initialMousePoint == null) + { + initialMousePoint = mousePoint; + } + + if (itemId == -1 || !hoverActive && initialMousePoint.distance(mousePoint) < DISTANCE_TO_ACTIVATE_HOVER) { return null; } + hoverActive = true; + for (int i = 0; i < INVENTORY_SIZE; ++i) { WidgetItem widgetItem = inventoryWidget.getWidgetItem(i); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java index 5cb013712f..aa6177fad4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java @@ -79,10 +79,10 @@ import net.runelite.api.Varbits; import net.runelite.api.WorldType; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.ChatMessage; +import net.runelite.api.events.PlayerDeath; import net.runelite.client.events.ConfigChanged; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.ItemContainerChanged; -import net.runelite.api.events.LocalPlayerDeath; import net.runelite.api.events.MenuOptionClicked; import net.runelite.api.events.PlayerSpawned; import net.runelite.api.events.WidgetLoaded; @@ -318,9 +318,9 @@ public class LootTrackerPlugin extends Plugin lootTrackerClient = null; } - private void onLocalPlayerDeath(LocalPlayerDeath event) + private void onPlayerDeath(PlayerDeath event) { - if (client.getVar(Varbits.IN_WILDERNESS) == 1 || WorldType.isPvpWorld(client.getWorldType())) + if ((client.getVar(Varbits.IN_WILDERNESS) == 1 || WorldType.isPvpWorld(client.getWorldType())) && event.getPlayer() == client.getLocalPlayer()) { deathInventorySnapshot(); pvpDeath = true; @@ -497,7 +497,7 @@ public class LootTrackerPlugin extends Plugin eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged); eventBus.subscribe(SessionOpen.class, this, this::onSessionOpen); eventBus.subscribe(SessionClose.class, this, this::onSessionClose); - eventBus.subscribe(LocalPlayerDeath.class, this, this::onLocalPlayerDeath); + eventBus.subscribe(PlayerDeath.class, this, this::onPlayerDeath); eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged); eventBus.subscribe(NpcLootReceived.class, this, this::onNpcLootReceived); eventBus.subscribe(PlayerSpawned.class, this, this::onPlayerSpawned); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicConfig.java index 85381a0345..1839c1fca1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicConfig.java @@ -31,6 +31,50 @@ import net.runelite.client.config.ConfigItem; @ConfigGroup("music") public interface MusicConfig extends Config { + @ConfigItem( + keyName = "muteOwnAreaSounds", + name = "Mute player area sounds", + description = "Mute area sounds caused by yourself", + position = 0 + ) + default boolean muteOwnAreaSounds() + { + return false; + } + + @ConfigItem( + keyName = "muteOtherAreaSounds", + name = "Mute other players' area sounds", + description = "Mute area sounds caused by other players", + position = 1 + ) + default boolean muteOtherAreaSounds() + { + return false; + } + + @ConfigItem( + keyName = "muteOtherAreaNPCSounds", + name = "Mute NPCs' area sounds", + description = "Mute area sounds caused by NPCs", + position = 2 + ) + default boolean muteNpcAreaSounds() + { + return false; + } + + @ConfigItem( + keyName = "muteOtherAreaEnvironmentSounds", + name = "Mute environment area sounds", + description = "Mute area sounds caused by neither NPCs nor players", + position = 3 + ) + default boolean muteEnvironmentAreaSounds() + { + return false; + } + @ConfigItem( keyName = "musicVolume", name = "", @@ -87,14 +131,4 @@ public interface MusicConfig extends Config hidden = true ) void setAreaSoundEffectVolume(int vol); - - @ConfigItem( - keyName = "muteOtherAreaSounds", - name = "Mute others' area sounds", - description = "Mute area sounds caused from other players" - ) - default boolean muteOtherAreaSounds() - { - return false; - } } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java index 1429225247..6624ac7427 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java @@ -40,6 +40,7 @@ import lombok.Setter; import net.runelite.api.Actor; import net.runelite.api.Client; import net.runelite.api.GameState; +import net.runelite.api.NPC; import net.runelite.api.Player; import net.runelite.api.ScriptID; import net.runelite.api.SoundEffectID; @@ -567,11 +568,26 @@ public class MusicPlugin extends Plugin private void onAreaSoundEffectPlayed(AreaSoundEffectPlayed areaSoundEffectPlayed) { Actor source = areaSoundEffectPlayed.getSource(); - if (source != client.getLocalPlayer() + if (source == client.getLocalPlayer() + && musicConfig.muteOwnAreaSounds()) + { + areaSoundEffectPlayed.consume(); + } + else if (source != client.getLocalPlayer() && source instanceof Player && musicConfig.muteOtherAreaSounds()) { areaSoundEffectPlayed.consume(); } + else if (source instanceof NPC + && musicConfig.muteNpcAreaSounds()) + { + areaSoundEffectPlayed.consume(); + } + else if (source == null + && musicConfig.muteEnvironmentAreaSounds()) + { + areaSoundEffectPlayed.consume(); + } } } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/performancestats/PerformanceStatsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/performancestats/PerformanceStatsPlugin.java index 5fede26720..6ac3e7370e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/performancestats/PerformanceStatsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/performancestats/PerformanceStatsPlugin.java @@ -41,10 +41,10 @@ import net.runelite.api.Client; import net.runelite.api.NPC; import net.runelite.api.Skill; import net.runelite.api.WorldType; +import net.runelite.api.events.FakeXpDrop; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; import net.runelite.api.events.HitsplatApplied; -import net.runelite.api.events.ScriptCallbackEvent; import net.runelite.api.events.StatChanged; import net.runelite.api.util.Text; import net.runelite.client.chat.ChatColorType; @@ -166,13 +166,13 @@ public class PerformanceStatsPlugin extends Plugin eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged); eventBus.subscribe(HitsplatApplied.class, this, this::onHitsplatApplied); eventBus.subscribe(StatChanged.class, this, this::onStatChanged); - eventBus.subscribe(ScriptCallbackEvent.class, this, this::onScriptCallbackEvent); eventBus.subscribe(GameTick.class, this, this::onGameTick); eventBus.subscribe(OverlayMenuClicked.class, this, this::onOverlayMenuClicked); eventBus.subscribe(Performance.class, this, this::onPerformance); eventBus.subscribe(UserSync.class, this, this::onUserSync); eventBus.subscribe(UserPart.class, this, this::onUserPart); eventBus.subscribe(PartyChanged.class, this, this::onPartyChanged); + eventBus.subscribe(FakeXpDrop.class, this, this::onFakeXpDrop); } private void onGameStateChanged(GameStateChanged event) @@ -242,25 +242,9 @@ public class PerformanceStatsPlugin extends Plugin } } - private void onScriptCallbackEvent(ScriptCallbackEvent e) + private void onFakeXpDrop(FakeXpDrop fakeXpDrop) { - // Handles Fake XP drops (Ironman in PvP, DMM Cap, 200m xp, etc) - if (isPaused()) - { - return; - } - - if (!"fakeXpDrop".equals(e.getEventName())) - { - return; - } - - final int[] intStack = client.getIntStack(); - final int intStackSize = client.getIntStackSize(); - - final int skillId = intStack[intStackSize - 2]; - final Skill skill = Skill.values()[skillId]; - if (skill.equals(Skill.HITPOINTS)) + if (fakeXpDrop.getSkill().equals(Skill.HITPOINTS)) { // Auto enables when player would have received hp exp if (!isEnabled()) @@ -268,7 +252,7 @@ public class PerformanceStatsPlugin extends Plugin enable(); } - final int exp = intStack[intStackSize - 1]; + final int exp = fakeXpDrop.getXp(); performance.addDamageDealt(calculateDamageDealt(exp), client.getTickCount()); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java index c4b8d9a109..5280371903 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java @@ -70,7 +70,6 @@ import net.runelite.api.WorldType; import net.runelite.api.events.ChatMessage; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; -import net.runelite.api.events.LocalPlayerDeath; import net.runelite.api.events.PlayerDeath; import net.runelite.api.events.WidgetLoaded; import net.runelite.api.util.Text; @@ -291,7 +290,6 @@ public class ScreenshotPlugin extends Plugin eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged); eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged); eventBus.subscribe(GameTick.class, this, this::onGameTick); - eventBus.subscribe(LocalPlayerDeath.class, this, this::onLocalPlayerDeath); eventBus.subscribe(PlayerDeath.class, this, this::onPlayerDeath); eventBus.subscribe(PlayerLootReceived.class, this, this::onPlayerLootReceived); eventBus.subscribe(ChatMessage.class, this, this::onChatMessage); @@ -338,16 +336,13 @@ public class ScreenshotPlugin extends Plugin } } - private void onLocalPlayerDeath(LocalPlayerDeath event) + private void onPlayerDeath(PlayerDeath event) { - if (this.screenshotPlayerDeath && client.getLocalPlayer().getName() != null) + if (event.getPlayer() == client.getLocalPlayer() && config.screenshotPlayerDeath()) { takeScreenshot(client.getLocalPlayer().getName() + " dead " + format(new Date()), "Deaths"); } - } - private void onPlayerDeath(PlayerDeath event) - { int tob = client.getVar(Varbits.THEATRE_OF_BLOOD); if (this.screenshotFriendDeath && event.getPlayer().getName() != null && (event.getPlayer().isFriend() || event.getPlayer().isClanMember() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/skillcalculator/SkillCalculator.java b/runelite-client/src/main/java/net/runelite/client/plugins/skillcalculator/SkillCalculator.java index 6a73c5ed9b..25cc92e7ab 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/skillcalculator/SkillCalculator.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/skillcalculator/SkillCalculator.java @@ -91,6 +91,7 @@ class SkillCalculator extends JPanel searchBar.setPreferredSize(new Dimension(PluginPanel.PANEL_WIDTH - 20, 30)); searchBar.setBackground(ColorScheme.DARKER_GRAY_COLOR); searchBar.setHoverBackgroundColor(ColorScheme.DARK_GRAY_HOVER_COLOR); + searchBar.addClearListener(e -> onSearch()); searchBar.addKeyListener(e -> onSearch()); setLayout(new DynamicGridLayout(0, 1, 0, 5)); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterPlugin.java index c28057a6b7..01f6c00362 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterPlugin.java @@ -41,9 +41,11 @@ import net.runelite.api.NPCDefinition; import net.runelite.api.Player; import net.runelite.api.Skill; import net.runelite.api.VarPlayer; +import net.runelite.api.events.FakeXpDrop; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; import net.runelite.api.events.NpcDespawned; +import net.runelite.api.events.StatChanged; import net.runelite.api.events.VarbitChanged; import net.runelite.client.callback.ClientThread; import net.runelite.client.eventbus.EventBus; @@ -67,6 +69,7 @@ public class SpecialCounterPlugin extends Plugin private int currentWorld = -1; private int specialPercentage = -1; private int specialHitpointsExperience = -1; + private int specialHitpointsGained = -1; private boolean specialUsed; private double modifier = 1d; @@ -119,6 +122,8 @@ public class SpecialCounterPlugin extends Plugin eventBus.subscribe(GameTick.class, this, this::onGameTick); eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned); eventBus.subscribe(SpecialCounterUpdate.class, this, this::onSpecialCounterUpdate); + eventBus.subscribe(StatChanged.class, this, this::onStatChanged); + eventBus.subscribe(FakeXpDrop.class, this, this::onFakeXpDrop); } private void onGameStateChanged(GameStateChanged event) @@ -154,6 +159,23 @@ public class SpecialCounterPlugin extends Plugin specialUsed = true; specialHitpointsExperience = client.getSkillExperience(Skill.HITPOINTS); + specialHitpointsGained = -1; + } + + private void onStatChanged(StatChanged statChanged) + { + if (specialUsed && statChanged.getSkill() == Skill.HITPOINTS) + { + specialHitpointsGained = statChanged.getXp() - specialHitpointsExperience; + } + } + + private void onFakeXpDrop(FakeXpDrop fakeXpDrop) + { + if (specialUsed && fakeXpDrop.getSkill() == Skill.HITPOINTS) + { + specialHitpointsGained = fakeXpDrop.getXp(); + } } private void onGameTick(GameTick tick) @@ -164,13 +186,11 @@ public class SpecialCounterPlugin extends Plugin } int interactingId = checkInteracting(); - - if (interactingId > -1 && specialHitpointsExperience != -1 && specialUsed) + if (interactingId > -1 && specialUsed) { + int deltaExperience = specialHitpointsGained; + specialUsed = false; - int hpXp = client.getSkillExperience(Skill.HITPOINTS); - int deltaExperience = hpXp - specialHitpointsExperience; - specialHitpointsExperience = -1; if (deltaExperience > 0 && specialWeapon != null) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java index 47febc85ec..790b6776d1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java @@ -71,12 +71,12 @@ enum GameTimer ANTIPOISON(ItemID.ANTIPOISON4, GameTimerImageType.ITEM, "Antipoison"), ANTIVENOM(ItemID.ANTIVENOM4, GameTimerImageType.ITEM, "Anti-venom"), DRAGON_FIRE_SHIELD(ItemID.DRAGONFIRE_SHIELD_11284, GameTimerImageType.ITEM, "Dragonfire Shield Special", 2, ChronoUnit.MINUTES), - DIVINE_SUPER_ATTACK(ItemID.DIVINE_SUPER_ATTACK_POTION4, GameTimerImageType.ITEM, "Divine Super Attack", 5, ChronoUnit.MINUTES, true), - DIVINE_SUPER_STRENGTH(ItemID.DIVINE_SUPER_STRENGTH_POTION4, GameTimerImageType.ITEM, "Divine Super Strength", 5, ChronoUnit.MINUTES, true), - DIVINE_SUPER_DEFENCE(ItemID.DIVINE_SUPER_DEFENCE_POTION4, GameTimerImageType.ITEM, "Divine Super Defence", 5, ChronoUnit.MINUTES, true), - DIVINE_SUPER_COMBAT(ItemID.DIVINE_SUPER_COMBAT_POTION4, GameTimerImageType.ITEM, "Divine Super Combat", 5, ChronoUnit.MINUTES, true), - DIVINE_RANGING(ItemID.DIVINE_RANGING_POTION4, GameTimerImageType.ITEM, "Divine Ranging", 5, ChronoUnit.MINUTES, true), - DIVINE_MAGIC(ItemID.DIVINE_MAGIC_POTION4, GameTimerImageType.ITEM, "Divine Magic", 5, ChronoUnit.MINUTES, true); + DIVINE_SUPER_ATTACK(ItemID.DIVINE_SUPER_ATTACK_POTION4, GameTimerImageType.ITEM, "Divine Super Attack", 5, ChronoUnit.MINUTES), + DIVINE_SUPER_STRENGTH(ItemID.DIVINE_SUPER_STRENGTH_POTION4, GameTimerImageType.ITEM, "Divine Super Strength", 5, ChronoUnit.MINUTES), + DIVINE_SUPER_DEFENCE(ItemID.DIVINE_SUPER_DEFENCE_POTION4, GameTimerImageType.ITEM, "Divine Super Defence", 5, ChronoUnit.MINUTES), + DIVINE_SUPER_COMBAT(ItemID.DIVINE_SUPER_COMBAT_POTION4, GameTimerImageType.ITEM, "Divine Super Combat", 5, ChronoUnit.MINUTES), + DIVINE_RANGING(ItemID.DIVINE_RANGING_POTION4, GameTimerImageType.ITEM, "Divine Ranging", 5, ChronoUnit.MINUTES), + DIVINE_MAGIC(ItemID.DIVINE_MAGIC_POTION4, GameTimerImageType.ITEM, "Divine Magic", 5, ChronoUnit.MINUTES); private final Duration duration; private final Integer graphicId; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java index 85a758a630..ef97cf3174 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java @@ -59,7 +59,7 @@ import net.runelite.client.events.ConfigChanged; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; import net.runelite.api.events.ItemContainerChanged; -import net.runelite.api.events.LocalPlayerDeath; +import net.runelite.api.events.PlayerDeath; import net.runelite.api.events.MenuOptionClicked; import net.runelite.api.events.NpcDespawned; import net.runelite.api.events.SpotAnimationChanged; @@ -220,7 +220,7 @@ public class TimersPlugin extends Plugin eventBus.subscribe(SpotAnimationChanged.class, this, this::onSpotAnimationChanged); eventBus.subscribe(ItemContainerChanged.class, this, this::onItemContainerChanged); eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned); - eventBus.subscribe(LocalPlayerDeath.class, this, this::onLocalPlayerDeath); + eventBus.subscribe(PlayerDeath.class, this, this::onPlayerDeath); eventBus.subscribe(StatChanged.class, this, this::onStatChanged); } @@ -937,9 +937,12 @@ public class TimersPlugin extends Plugin } } - private void onLocalPlayerDeath(LocalPlayerDeath event) + private void onPlayerDeath(PlayerDeath playerDeath) { - infoBoxManager.removeIf(t -> t instanceof TimerTimer && ((TimerTimer) t).getTimer().isRemovedOnDeath()); + if (playerDeath.getPlayer() == client.getLocalPlayer()) + { + infoBoxManager.removeIf(t -> t instanceof TimerTimer && ((TimerTimer) t).getTimer().isRemovedOnDeath()); + } } private void onStatChanged(StatChanged event) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tobdamagecount/DamageCounterPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/tobdamagecount/DamageCounterPlugin.java index 53ed573c96..c5fed4e81a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tobdamagecount/DamageCounterPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tobdamagecount/DamageCounterPlugin.java @@ -41,7 +41,7 @@ import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; import net.runelite.api.events.HitsplatApplied; -import net.runelite.api.events.LocalPlayerDeath; +import net.runelite.api.events.PlayerDeath; import net.runelite.api.events.NpcDespawned; import net.runelite.client.chat.ChatColorType; import net.runelite.client.chat.ChatMessageBuilder; @@ -116,7 +116,7 @@ public class DamageCounterPlugin extends Plugin eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged); eventBus.subscribe(HitsplatApplied.class, this, this::onHitsplatApplied); eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned); - eventBus.subscribe(LocalPlayerDeath.class, this, this::onLocalPlayerDeath); + eventBus.subscribe(PlayerDeath.class, this, this::onPlayerDeath); } @@ -359,9 +359,9 @@ public class DamageCounterPlugin extends Plugin //whenever you have died in tob you will get a death message with damage // made sure the message works at ToB area or else it will message every where - private void onLocalPlayerDeath(LocalPlayerDeath death) + private void onPlayerDeath(PlayerDeath death) { - if (client.getLocalPlayer() == null) + if (client.getLocalPlayer() == null || death.getPlayer() != client.getLocalPlayer()) { return; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingPlugin.java index a9c2520eea..485e379526 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/WoodcuttingPlugin.java @@ -29,6 +29,7 @@ import java.time.Duration; import java.time.Instant; import java.util.HashSet; import java.util.Set; +import java.util.regex.Pattern; import javax.inject.Inject; import javax.inject.Singleton; import lombok.AccessLevel; @@ -69,6 +70,8 @@ import net.runelite.client.ui.overlay.OverlayMenuEntry; @PluginDependency(XpTrackerPlugin.class) public class WoodcuttingPlugin extends Plugin { + private static final Pattern WOOD_CUT_PATTERN = Pattern.compile("You get (?:some|an)[\\w ]+(?:logs?|mushrooms)\\."); + @Inject private Notifier notifier; @@ -184,11 +187,11 @@ public class WoodcuttingPlugin extends Plugin } } - private void onChatMessage(ChatMessage event) + void onChatMessage(ChatMessage event) { if (event.getType() == ChatMessageType.SPAM || event.getType() == ChatMessageType.GAMEMESSAGE) { - if (event.getMessage().startsWith("You get some") && (event.getMessage().endsWith("logs.") || event.getMessage().endsWith("mushrooms."))) + if (WOOD_CUT_PATTERN.matcher(event.getMessage()).matches()) { if (session == null) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RunecraftingAltarLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RunecraftingAltarLocation.java new file mode 100644 index 0000000000..c2f8319635 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RunecraftingAltarLocation.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2019, Dava96 + * 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 HOLDER 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.worldmap; + +import lombok.Getter; +import net.runelite.api.coords.WorldPoint; + +@Getter +enum RunecraftingAltarLocation +{ + AIR_ALTAR("Air Altar", 1, new WorldPoint(2985, 3293, 0), "air_altar_icon.png"), + MIND_ALTAR("Mind Altar", 2, new WorldPoint(2982, 3514, 0), "mind_altar_icon.png"), + WATER_ALTAR("Water Altar", 5, new WorldPoint(3185, 3165, 0), "water_altar_icon.png"), + EARTH_ALTAR("Earth Altar", 9, new WorldPoint(3306, 3474, 0), "earth_altar_icon.png"), + FIRE_ALTAR("Fire Altar", 14, new WorldPoint(3313, 3255, 0), "fire_altar_icon.png"), + BODY_ALTAR("Body Altar", 20, new WorldPoint(3053, 3445, 0), "body_altar_icon.png"), + COSMIC_ALTAR("Cosmic Altar", 27, new WorldPoint(2408, 4377, 0), "cosmic_altar_icon.png"), + CHAOS_ALTAR("Chaos Altar", 35, new WorldPoint(3060, 3591, 0), "chaos_altar_icon.png"), + ASTRAL_ALTAR("Astral Altar", 40, new WorldPoint(2158, 3864, 0), "astral_altar_icon.png"), + NATURE_ALTAR("Nature Altar", 44, new WorldPoint(2869, 3019, 0), "nature_altar_icon.png"), + LAW_ALTAR("Law Altar", 54, new WorldPoint(2858, 3381, 0), "law_altar_icon.png"), + DEATH_ALTAR("Death Altar", 65, new WorldPoint(1860, 4639, 0), "death_altar_icon.png"), + BLOOD_ALTAR("Blood Altar", 77, new WorldPoint(1716, 3827, 0), "blood_altar_icon.png"), + SOUL_ALTAR("Soul Altar", 90, new WorldPoint(1814, 3856, 0), "soul_altar_icon.png"), + WRATH_ALTAR("Wrath Altar", 95, new WorldPoint(2446, 2825, 0), "wrath_altar_icon.png"); + + private final String tooltip; + private final WorldPoint location; + private final int levelReq; + private final String iconPath; + + RunecraftingAltarLocation(String description, int level, WorldPoint location, String iconPath) + { + this.tooltip = description + " - Level " + level; + this.location = location; + this.levelReq = level; + this.iconPath = iconPath; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RunecraftingAltarPoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RunecraftingAltarPoint.java new file mode 100644 index 0000000000..11cdad457f --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RunecraftingAltarPoint.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2019, Dava96 + * 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 HOLDER 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.worldmap; + +import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; +import net.runelite.client.util.ImageUtil; + +class RunecraftingAltarPoint extends WorldMapPoint +{ + RunecraftingAltarPoint(RunecraftingAltarLocation point) + { + super(point.getLocation(), WorldMapPlugin.BLANK_ICON); + setImage(ImageUtil.getResourceStreamFromClass(WorldMapPlugin.class, point.getIconPath())); + setTooltip(point.getTooltip()); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java index 698ae11a81..a5938c3845 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java @@ -153,7 +153,8 @@ enum TeleportLocationData OBELISK_44(TeleportType.OTHER, "Obelisk", "44", new WorldPoint(2980, 3866, 0), "obelisk_icon.png"), OBELISK_50(TeleportType.OTHER, "Obelisk", "50", new WorldPoint(3307, 3916, 0), "obelisk_icon.png"), WILDERNESS_CRABS_TELEPORT(TeleportType.OTHER, "Wilderness crabs teleport", new WorldPoint(3348, 3783, 0), "wilderness_crabs_teleport_icon.png"), - + CANOE_WILDERNESS(TeleportType.OTHER, "Canoe (No departure)", "35", new WorldPoint(3141, 3796, 0), "transportation_icon.png"), + // Achievement Diary ARDOUGNE_CLOAK_MONASTERY(TeleportType.OTHER, "Ardougne Cloak", "Monastery", new WorldPoint(2606, 3222, 0), "ardougne_cloak_icon.png"), ARDOUGNE_CLOAK_FARM(TeleportType.OTHER, "Ardougne Cloak", "Farm", new WorldPoint(2673, 3375, 0), "ardougne_cloak_icon.png"), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java index 7ebe417ef2..4070a77b1a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java @@ -218,4 +218,15 @@ public interface WorldMapConfig extends Config { return true; } + + @ConfigItem( + keyName = WorldMapPlugin.CONFIG_KEY_RUNECRAFTING_ALTAR_ICON, + name = "Show runecrafting altar locations", + description = "Show the icons of runecrafting altars", + position = 18 + ) + default boolean runecraftingAltarIcon() + { + return true; + } } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java index 2248a0ccc9..9ca0f617a6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java @@ -35,13 +35,13 @@ import net.runelite.api.GameState; import net.runelite.api.Quest; import net.runelite.api.QuestState; import net.runelite.api.Skill; -import net.runelite.client.events.ConfigChanged; import net.runelite.api.events.StatChanged; import net.runelite.api.events.WidgetLoaded; import net.runelite.api.widgets.WidgetID; import net.runelite.client.callback.ClientThread; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.EventBus; +import net.runelite.client.events.ConfigChanged; import net.runelite.client.game.AgilityShortcut; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; @@ -80,6 +80,7 @@ public class WorldMapPlugin extends Plugin static final String CONFIG_KEY_RARE_TREE_TOOLTIPS = "rareTreeTooltips"; static final String CONFIG_KEY_RARE_TREE_LEVEL_ICON = "rareTreeIcon"; static final String CONFIG_KEY_TRANSPORATION_TELEPORT_TOOLTIPS = "transportationTooltips"; + static final String CONFIG_KEY_RUNECRAFTING_ALTAR_ICON = "runecraftingAltarIcon"; static { @@ -181,6 +182,7 @@ public class WorldMapPlugin extends Plugin worldMapPointManager.removeIf(MinigamePoint.class::isInstance); worldMapPointManager.removeIf(FarmingPatchPoint.class::isInstance); worldMapPointManager.removeIf(RareTreePoint.class::isInstance); + worldMapPointManager.removeIf(RunecraftingAltarPoint.class::isInstance); agilityLevel = 0; woodcuttingLevel = 0; } @@ -316,32 +318,38 @@ public class WorldMapPlugin extends Plugin worldMapPointManager.removeIf(TeleportPoint.class::isInstance); // This next part gets 142 icons from disk, and does so on the EDT (at first run) - executor.submit(() -> - Arrays.stream(TeleportLocationData.values()) - .filter(data -> + Arrays.stream(TeleportLocationData.values()) + .filter(data -> + { + switch (data.getType()) { - switch (data.getType()) - { - case NORMAL_MAGIC: - return this.normalTeleportIcon; - case ANCIENT_MAGICKS: - return this.ancientTeleportIcon; - case LUNAR_MAGIC: - return this.lunarTeleportIcon; - case ARCEUUS_MAGIC: - return this.arceuusTeleportIcon; - case JEWELLERY: - return this.jewelleryTeleportIcon; - case SCROLL: - return this.scrollTeleportIcon; - case OTHER: - return this.miscellaneousTeleportIcon; - default: - return false; - } - }).map(TeleportPoint::new) - .forEach(worldMapPointManager::add) - ); + case NORMAL_MAGIC: + return this.normalTeleportIcon; + case ANCIENT_MAGICKS: + return this.ancientTeleportIcon; + case LUNAR_MAGIC: + return this.lunarTeleportIcon; + case ARCEUUS_MAGIC: + return this.arceuusTeleportIcon; + case JEWELLERY: + return this.jewelleryTeleportIcon; + case SCROLL: + return this.scrollTeleportIcon; + case OTHER: + return this.miscellaneousTeleportIcon; + default: + return false; + } + }).map(TeleportPoint::new) + .forEach(worldMapPointManager::add); + + worldMapPointManager.removeIf(RunecraftingAltarPoint.class::isInstance); + if (config.runecraftingAltarIcon()) + { + Arrays.stream(RunecraftingAltarLocation.values()) + .map(RunecraftingAltarPoint::new) + .forEach(worldMapPointManager::add); + } } private void updateQuestStartPointIcons() diff --git a/runelite-client/src/main/java/net/runelite/client/ui/components/IconTextField.java b/runelite-client/src/main/java/net/runelite/client/ui/components/IconTextField.java index c02bab2c5a..0408837302 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/components/IconTextField.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/components/IconTextField.java @@ -29,6 +29,7 @@ package net.runelite.client.ui.components; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; +import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; @@ -222,6 +223,11 @@ public class IconTextField extends JPanel textField.addKeyListener(keyListener); } + public void addClearListener(Consumer actionEventConsumer) + { + clearButton.addActionListener(actionEventConsumer::accept); + } + public void addKeyListener(Consumer keyEventConsumer) { addKeyListener(new net.runelite.client.input.KeyListener() diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java index 269e113b6a..801608a8a5 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java @@ -46,6 +46,7 @@ public class WidgetOverlay extends Overlay .put(WidgetInfo.FOSSIL_ISLAND_OXYGENBAR, OverlayPosition.TOP_LEFT) .put(WidgetInfo.EXPERIENCE_TRACKER_WIDGET, OverlayPosition.TOP_RIGHT) .put(WidgetInfo.RAIDS_POINTS_INFOBOX, OverlayPosition.TOP_RIGHT) + .put(WidgetInfo.GWD_KC, OverlayPosition.TOP_RIGHT) .put(WidgetInfo.TITHE_FARM, OverlayPosition.TOP_RIGHT) .put(WidgetInfo.PEST_CONTROL_BOAT_INFO, OverlayPosition.TOP_LEFT) .put(WidgetInfo.PEST_CONTROL_INFO, OverlayPosition.TOP_LEFT) diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/alien.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/alien.png new file mode 100644 index 0000000000..12b5cbca06 Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/alien.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/blush.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/blush.png index 7024942ef0..ed24b9dbd5 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/blush.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/blush.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/broken_heart.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/broken_heart.png index f990ce74b2..e2859dba83 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/broken_heart.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/broken_heart.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cat.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cat.png index 59cdc638de..e3e3538d6e 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cat.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cat.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/confused.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/confused.png index 0d3275a236..d959e8398c 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/confused.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/confused.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cooking.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cooking.png index 7c853a76db..e4a0e27005 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cooking.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cooking.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cowboy.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cowboy.png index 9c255c613b..ed6f1f0363 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cowboy.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cowboy.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/crab.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/crab.png index dceb67eb18..b4a48a1167 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/crab.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/crab.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cry.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cry.png index dda95de8f9..d13487b948 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cry.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cry.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/dancer.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/dancer.png index 4a307a4d4d..0b12afc22a 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/dancer.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/dancer.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/dog.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/dog.png index abdb0ecf48..03c0a78f01 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/dog.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/dog.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/eggplant.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/eggplant.png new file mode 100644 index 0000000000..f235821f5a Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/eggplant.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/expressionless.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/expressionless.png index 4d6904de06..1796dfd73e 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/expressionless.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/expressionless.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/eyes.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/eyes.png index 2ae57d4b96..21bb1e8efc 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/eyes.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/eyes.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/fire.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/fire.png new file mode 100644 index 0000000000..6d11acee7a Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/fire.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/fish.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/fish.png index 3239750a0d..c836cb5ac6 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/fish.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/fish.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/flushed.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/flushed.png index 2ca84e2af0..9afe0d1488 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/flushed.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/flushed.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/fork_and_knife.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/fork_and_knife.png index 6f9d56d4f4..f82589d6c3 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/fork_and_knife.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/fork_and_knife.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/frowning2.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/frowning2.png index bbc46462e1..d0de7f47a4 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/frowning2.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/frowning2.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/grinning.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/grinning.png index b5ed41cd83..1c2d82ebd5 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/grinning.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/grinning.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/heart_eyes.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/heart_eyes.png new file mode 100644 index 0000000000..8e025d4ed0 Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/heart_eyes.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/hearts.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/hearts.png index 4639733791..0582043360 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/hearts.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/hearts.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/hugging.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/hugging.png index 146af72906..4c3f94b269 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/hugging.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/hugging.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/hushed.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/hushed.png index d966a3ccbd..388f4f8721 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/hushed.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/hushed.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/innocent.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/innocent.png index 01ee7c2f75..a77d4f5ac2 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/innocent.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/innocent.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/joy.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/joy.png index 6bc95ee669..2d4ded730a 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/joy.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/joy.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/kissing.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/kissing.png index 5dc6f2ee44..c4040f250f 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/kissing.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/kissing.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/neutral_face.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/neutral_face.png index c1f8599802..6ba2512285 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/neutral_face.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/neutral_face.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/ok_hand.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/ok_hand.png index 677a3f045f..99c51e94b0 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/ok_hand.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/ok_hand.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/open_mouth.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/open_mouth.png index dc9163b0bb..b6f009127e 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/open_mouth.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/open_mouth.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/party_popper.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/party_popper.png index 319e3b884b..9bac2f0392 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/party_popper.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/party_popper.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/persevere.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/persevere.png index 743a6d40c6..afe426b889 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/persevere.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/persevere.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/pile_of_poo.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/pile_of_poo.png index 9626a3582c..e9e83eda20 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/pile_of_poo.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/pile_of_poo.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/rage.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/rage.png index 67af8f8a85..e3e64935d7 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/rage.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/rage.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/scream.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/scream.png index 9ee5a20df4..7c1fa0cb34 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/scream.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/scream.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/see_no_evil.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/see_no_evil.png index 8c24967ce8..8ee29a9fb3 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/see_no_evil.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/see_no_evil.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/slight_frown.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/slight_frown.png index 4ca50c44d5..1b0666d2c5 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/slight_frown.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/slight_frown.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/slight_smile.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/slight_smile.png index 7fe967d033..d39cf23163 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/slight_smile.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/slight_smile.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/smile.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/smile.png index 547d0c1af6..557bdb8f12 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/smile.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/smile.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/smiling_imp.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/smiling_imp.png index 988f863b67..63794794d3 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/smiling_imp.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/smiling_imp.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/sob.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/sob.png index 7b7b607702..1ddd81f279 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/sob.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/sob.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/stuck_out_tongue.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/stuck_out_tongue.png index 3e650a63e6..92843ef1e9 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/stuck_out_tongue.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/stuck_out_tongue.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/stuck_out_tongue_closed_eyes.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/stuck_out_tongue_closed_eyes.png index a92049bb60..380ab6b8e0 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/stuck_out_tongue_closed_eyes.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/stuck_out_tongue_closed_eyes.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/sunglasses.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/sunglasses.png index 27df566883..0c790e10e1 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/sunglasses.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/sunglasses.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/sweat.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/sweat.png index df5dea9f32..cf40fea206 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/sweat.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/sweat.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/thinking.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/thinking.png index 6be3b18d7f..309caf9c8b 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/thinking.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/thinking.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/thumbsdown.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/thumbsdown.png index 674b5dd659..570187cf73 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/thumbsdown.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/thumbsdown.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/thumbsup.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/thumbsup.png index e52f8364ff..610c3ee976 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/thumbsup.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/thumbsup.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/triumph.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/triumph.png index ee5c6b7ced..71f4927cbe 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/triumph.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/triumph.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/unamused.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/unamused.png index 342dd80e79..5dd59bcc01 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/unamused.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/unamused.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/wave.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/wave.png new file mode 100644 index 0000000000..1a747c8fc7 Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/wave.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/wink.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/wink.png index def8b2775a..b56b3cd5e0 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/wink.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/wink.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/yum.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/yum.png index 29d1bf7761..21bdb0a00f 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/yum.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/yum.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/zipper_mouth.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/zipper_mouth.png index 37e137c0c9..ecad41ede6 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/zipper_mouth.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/zipper_mouth.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/zzz.png b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/zzz.png index 02fc33fe71..3072dfc9f1 100644 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/zzz.png and b/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/zzz.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/air_altar_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/air_altar_icon.png new file mode 100644 index 0000000000..ae281d896c Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/air_altar_icon.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/astral_altar_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/astral_altar_icon.png new file mode 100644 index 0000000000..10b4aeccce Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/astral_altar_icon.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/blood_altar_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/blood_altar_icon.png new file mode 100644 index 0000000000..356557e538 Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/blood_altar_icon.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/body_altar_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/body_altar_icon.png new file mode 100644 index 0000000000..d9c51114d4 Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/body_altar_icon.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/chaos_altar_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/chaos_altar_icon.png new file mode 100644 index 0000000000..91b046d5d4 Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/chaos_altar_icon.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/cosmic_altar_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/cosmic_altar_icon.png new file mode 100644 index 0000000000..3a37733f10 Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/cosmic_altar_icon.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/death_altar_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/death_altar_icon.png new file mode 100644 index 0000000000..19c94eb0e2 Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/death_altar_icon.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/earth_altar_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/earth_altar_icon.png new file mode 100644 index 0000000000..828dffbd1f Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/earth_altar_icon.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/fire_altar_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/fire_altar_icon.png new file mode 100644 index 0000000000..f556a54ce9 Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/fire_altar_icon.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/law_altar_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/law_altar_icon.png new file mode 100644 index 0000000000..3a441635d4 Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/law_altar_icon.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/mind_altar_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/mind_altar_icon.png new file mode 100644 index 0000000000..b0aaeecf2a Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/mind_altar_icon.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/nature_altar_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/nature_altar_icon.png new file mode 100644 index 0000000000..ee53dbd5a3 Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/nature_altar_icon.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/soul_altar_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/soul_altar_icon.png new file mode 100644 index 0000000000..08615a949e Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/soul_altar_icon.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/transportation_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/transportation_icon.png new file mode 100644 index 0000000000..b5648c0ca1 Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/transportation_icon.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/water_altar_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/water_altar_icon.png new file mode 100644 index 0000000000..52200880ad Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/water_altar_icon.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/wrath_altar_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/wrath_altar_icon.png new file mode 100644 index 0000000000..87b77a7395 Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/wrath_altar_icon.png differ diff --git a/runelite-client/src/main/scripts/FakeXPDrops.hash b/runelite-client/src/main/scripts/FakeXpDrop.hash similarity index 100% rename from runelite-client/src/main/scripts/FakeXPDrops.hash rename to runelite-client/src/main/scripts/FakeXpDrop.hash diff --git a/runelite-client/src/main/scripts/FakeXPDrops.rs2asm b/runelite-client/src/main/scripts/FakeXpDrop.rs2asm similarity index 85% rename from runelite-client/src/main/scripts/FakeXPDrops.rs2asm rename to runelite-client/src/main/scripts/FakeXpDrop.rs2asm index e2c097a3f8..93ac905034 100644 --- a/runelite-client/src/main/scripts/FakeXPDrops.rs2asm +++ b/runelite-client/src/main/scripts/FakeXpDrop.rs2asm @@ -3,8 +3,8 @@ .string_stack_count 0 .int_var_count 2 .string_var_count 0 - iload 0 - iload 1 + iload 0 ; stat + iload 1 ; xp sconst "fakeXpDrop" runelite_callback pop_int @@ -13,8 +13,8 @@ iconst 83 iconst 681 get_varc_int 207 - coordx - enum + coordx + enum iload 0 if_icmpeq LABEL9 jump LABEL16 @@ -23,7 +23,7 @@ LABEL9: iconst 0 iconst 0 iload 1 - movecoord + movecoord set_varc_int 207 jump LABEL216 LABEL16: @@ -31,8 +31,8 @@ LABEL16: iconst 83 iconst 681 get_varc_int 208 - coordx - enum + coordx + enum iload 0 if_icmpeq LABEL25 jump LABEL32 @@ -41,7 +41,7 @@ LABEL25: iconst 0 iconst 0 iload 1 - movecoord + movecoord set_varc_int 208 jump LABEL216 LABEL32: @@ -49,8 +49,8 @@ LABEL32: iconst 83 iconst 681 get_varc_int 209 - coordx - enum + coordx + enum iload 0 if_icmpeq LABEL41 jump LABEL48 @@ -59,7 +59,7 @@ LABEL41: iconst 0 iconst 0 iload 1 - movecoord + movecoord set_varc_int 209 jump LABEL216 LABEL48: @@ -67,8 +67,8 @@ LABEL48: iconst 83 iconst 681 get_varc_int 210 - coordx - enum + coordx + enum iload 0 if_icmpeq LABEL57 jump LABEL64 @@ -77,7 +77,7 @@ LABEL57: iconst 0 iconst 0 iload 1 - movecoord + movecoord set_varc_int 210 jump LABEL216 LABEL64: @@ -85,8 +85,8 @@ LABEL64: iconst 83 iconst 681 get_varc_int 211 - coordx - enum + coordx + enum iload 0 if_icmpeq LABEL73 jump LABEL80 @@ -95,7 +95,7 @@ LABEL73: iconst 0 iconst 0 iload 1 - movecoord + movecoord set_varc_int 211 jump LABEL216 LABEL80: @@ -103,8 +103,8 @@ LABEL80: iconst 83 iconst 681 get_varc_int 212 - coordx - enum + coordx + enum iload 0 if_icmpeq LABEL89 jump LABEL96 @@ -113,7 +113,7 @@ LABEL89: iconst 0 iconst 0 iload 1 - movecoord + movecoord set_varc_int 212 jump LABEL216 LABEL96: @@ -121,8 +121,8 @@ LABEL96: iconst 83 iconst 681 get_varc_int 213 - coordx - enum + coordx + enum iload 0 if_icmpeq LABEL105 jump LABEL112 @@ -131,7 +131,7 @@ LABEL105: iconst 0 iconst 0 iload 1 - movecoord + movecoord set_varc_int 213 jump LABEL216 LABEL112: @@ -145,10 +145,10 @@ LABEL116: iconst 105 iconst 81 iload 0 - enum + enum iconst 0 iload 1 - movecoord + movecoord set_varc_int 207 jump LABEL216 LABEL127: @@ -162,10 +162,10 @@ LABEL131: iconst 105 iconst 81 iload 0 - enum + enum iconst 0 iload 1 - movecoord + movecoord set_varc_int 208 jump LABEL216 LABEL142: @@ -179,10 +179,10 @@ LABEL146: iconst 105 iconst 81 iload 0 - enum + enum iconst 0 iload 1 - movecoord + movecoord set_varc_int 209 jump LABEL216 LABEL157: @@ -196,10 +196,10 @@ LABEL161: iconst 105 iconst 81 iload 0 - enum + enum iconst 0 iload 1 - movecoord + movecoord set_varc_int 210 jump LABEL216 LABEL172: @@ -213,10 +213,10 @@ LABEL176: iconst 105 iconst 81 iload 0 - enum + enum iconst 0 iload 1 - movecoord + movecoord set_varc_int 211 jump LABEL216 LABEL187: @@ -230,10 +230,10 @@ LABEL191: iconst 105 iconst 81 iload 0 - enum + enum iconst 0 iload 1 - movecoord + movecoord set_varc_int 212 jump LABEL216 LABEL202: @@ -247,10 +247,10 @@ LABEL206: iconst 105 iconst 81 iload 0 - enum + enum iconst 0 iload 1 - movecoord + movecoord set_varc_int 213 LABEL216: - return + return diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/woodcutting/WoodcuttingPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/woodcutting/WoodcuttingPluginTest.java new file mode 100644 index 0000000000..721cf0f288 --- /dev/null +++ b/runelite-client/src/test/java/net/runelite/client/plugins/woodcutting/WoodcuttingPluginTest.java @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2019, Jordan Zomerlei + * Copyright (c) 2019, Adam + * 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.woodcutting; + +import com.google.inject.Guice; +import com.google.inject.testing.fieldbinder.Bind; +import com.google.inject.testing.fieldbinder.BoundFieldModule; +import java.util.concurrent.ScheduledExecutorService; +import javax.inject.Inject; +import net.runelite.api.ChatMessageType; +import net.runelite.api.Client; +import net.runelite.api.events.ChatMessage; +import net.runelite.client.Notifier; +import net.runelite.client.config.OpenOSRSConfig; +import net.runelite.client.ui.overlay.OverlayManager; +import static org.junit.Assert.assertNotNull; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.when; +import org.mockito.junit.MockitoJUnitRunner; + +@RunWith(MockitoJUnitRunner.class) +public class WoodcuttingPluginTest +{ + private static final String BIRDS_NEST_MESSAGE = "A bird's nest falls out of the tree."; + + @Inject + WoodcuttingPlugin woodcuttingPlugin; + + @Mock + @Bind + WoodcuttingConfig woodcuttingConfig; + + @Mock + @Bind + OpenOSRSConfig openOSRSConfig; + + @Mock + @Bind + ScheduledExecutorService scheduledExecutorService; + + @Mock + @Bind + Notifier notifier; + + @Mock + @Bind + Client client; + + @Mock + @Bind + WoodcuttingOverlay woodcuttingOverlay; + + @Mock + @Bind + WoodcuttingTreesOverlay woodcuttingTreesOverlay; + + @Mock + @Bind + OverlayManager overlayManager; + + @Before + public void before() + { + Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this); + } + + @Test + @Ignore + public void testLogs() + { + ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "You get some logs.", "", 0); + woodcuttingPlugin.onChatMessage(chatMessage); + assertNotNull(woodcuttingPlugin.getSession()); + } + + @Test + @Ignore + public void testOakLogs() + { + ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "You get some oak logs.", "", 0); + woodcuttingPlugin.onChatMessage(chatMessage); + assertNotNull(woodcuttingPlugin.getSession()); + } + + @Test + public void testArcticLogs() + { + ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "You get an arctic log.", "", 0); + woodcuttingPlugin.onChatMessage(chatMessage); + assertNotNull(woodcuttingPlugin.getSession()); + } + + @Test + public void testMushrooms() + { + ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "You get some mushrooms.", "", 0); + woodcuttingPlugin.onChatMessage(chatMessage); + assertNotNull(woodcuttingPlugin.getSession()); + } + + @Test + @Ignore + public void testBirdsNest() + { + ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", BIRDS_NEST_MESSAGE, "", 0); + + when(woodcuttingConfig.showNestNotification()).thenReturn(true); + woodcuttingPlugin.onChatMessage(chatMessage); + verify(notifier).notify("A bird nest has spawned!"); + + when(woodcuttingConfig.showNestNotification()).thenReturn(false); + woodcuttingPlugin.onChatMessage(chatMessage); + verifyNoMoreInteractions(notifier); + } +} \ No newline at end of file diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/RSActorMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/RSActorMixin.java index 3c748ab51e..36cc00f839 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/RSActorMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/RSActorMixin.java @@ -37,7 +37,7 @@ import net.runelite.api.coords.WorldArea; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.AnimationChanged; import net.runelite.api.events.HitsplatApplied; -import net.runelite.api.events.LocalPlayerDeath; +import net.runelite.api.events.PlayerDeath; import net.runelite.api.events.PlayerDeath; import net.runelite.api.events.SpotAnimationChanged; import net.runelite.api.events.InteractingChanged; @@ -248,14 +248,7 @@ public abstract class RSActorMixin implements RSActor { if (healthRatio == 0) { - if (this == client.getLocalPlayer()) - { - client.getLogger().debug("You died!"); - - LocalPlayerDeath event = LocalPlayerDeath.INSTANCE; - client.getCallbacks().post(LocalPlayerDeath.class, event); - } - else if (this != client.getLocalPlayer() && this instanceof Player) + if (this instanceof Player) { final PlayerDeath event = new PlayerDeath((Player) this); client.getCallbacks().post(PlayerDeath.class, event);