Merge remote-tracking branch 'upstream/master' into master

This commit is contained in:
ThatGamerBlue
2021-06-23 13:00:32 +01:00
66 changed files with 1586 additions and 1219 deletions

View File

@@ -395,6 +395,7 @@ public class RuneLite
// Add core overlays
WidgetOverlay.createOverlays(client).forEach(overlayManager::add);
overlayManager.add(worldMapOverlay.get());
eventBus.register(worldMapOverlay.get());
overlayManager.add(tooltipOverlay.get());
playerManager.get();

View File

@@ -165,7 +165,7 @@ public class ChatIconManager
private static int clanRankToIdx(int key)
{
// keys are -5 to 264, with no 0
return key < 0 ? ~key : (key + 4);
// keys are -6 to 265, with no 0
return key < 0 ? ~key : (key + 5);
}
}

View File

@@ -109,7 +109,7 @@ public class LumbridgeDiaryRequirement extends GenericDiaryRequirement
new SkillRequirement(Skill.FARMING, 63));
add("Light your mining helmet in the Lumbridge castle basement.",
new SkillRequirement(Skill.FIREMAKING, 65));
add("Recharge your prayer at Clan Wars with Smite activated.",
add("Recharge your prayer at the Duel Arena with Smite activated.",
new SkillRequirement(Skill.PRAYER, 52));
add("Craft, string and enchant an Amulet of Power in Lumbridge.",
new SkillRequirement(Skill.CRAFTING, 70),

View File

@@ -32,6 +32,7 @@ import net.runelite.api.coords.WorldPoint;
enum Courses
{
GNOME(86.5, 46, 9781),
SHAYZIEN_BASIC(133.2, 92, 6200),
DRAYNOR(120.0, 79, 12338),
AL_KHARID(180.0, 0, 13105, new WorldPoint(3299, 3194, 0)),
PYRAMID(722.0, 0, 13356, new WorldPoint(3364, 2830, 0)),
@@ -40,6 +41,7 @@ enum Courses
BARBARIAN(139.5, 60, 10039),
CANIFIS(240.0, 175, 13878),
APE_ATOLL(580.0, 300, 11050),
SHAYZIEN_ADVANCED(474.3, 382, 5944),
FALADOR(440, 180, 12084),
WILDERNESS(571.0, 499, 11837),
WEREWOLF(730.0, 380, 14234),

View File

@@ -98,7 +98,13 @@ class Obstacles
ROPE_BRIDGE_36233, TIGHTROPE_36234, ROPE_BRIDGE_36235, TIGHTROPE_36236, TIGHTROPE_36237, DARK_HOLE_36238,
// Rellekka Lighthouse
BASALT_ROCK, BASALT_ROCK_4553, BASALT_ROCK_4554, BASALT_ROCK_4556, BASALT_ROCK_4558, ROCKY_SHORE,
BASALT_ROCK_4557, BASALT_ROCK_4555, BASALT_ROCK_4552, BEACH
BASALT_ROCK_4557, BASALT_ROCK_4555, BASALT_ROCK_4552, BEACH,
// Shayzien
LADDER_42209, MONKEYBARS_42211, TIGHTROPE_42212,
// Shayzien basic
BAR_42213, TIGHTROPE_42214, TIGHTROPE_42215, GAP_42216,
// Shayzien hard
BEAM, EDGE_42218, EDGE_42219, BEAM_42220, ZIPLINE
);
static final Set<Integer> PORTAL_OBSTACLE_IDS = ImmutableSet.of(

View File

@@ -31,13 +31,10 @@ import javax.inject.Inject;
import lombok.AllArgsConstructor;
import lombok.Getter;
import net.runelite.api.Client;
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayLayer;
import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
import net.runelite.client.ui.overlay.OverlayMenuEntry;
import net.runelite.client.ui.overlay.OverlayPosition;
class HealerOverlay extends Overlay
@@ -74,7 +71,6 @@ class HealerOverlay extends Overlay
this.client = client;
this.plugin = plugin;
this.config = config;
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "B.A. overlay"));
}
@Override

View File

@@ -29,12 +29,9 @@ import java.awt.Graphics2D;
import java.awt.Rectangle;
import javax.inject.Inject;
import net.runelite.api.Client;
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
import net.runelite.api.widgets.Widget;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayLayer;
import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
import net.runelite.client.ui.overlay.OverlayMenuEntry;
import net.runelite.client.ui.overlay.OverlayPosition;
class TimerOverlay extends Overlay
@@ -52,7 +49,6 @@ class TimerOverlay extends Overlay
this.client = client;
this.plugin = plugin;
this.config = config;
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "B.A. overlay"));
}
@Override

View File

@@ -51,6 +51,7 @@ class ClueScrollWorldMapPoint extends WorldMapPoint
this.plugin = plugin;
this.setSnapToEdge(true);
this.setJumpOnClick(true);
this.setName("Clue Scroll");
this.setImage(clueScrollWorldImage);
this.setImagePoint(clueScrollWorldImagePoint);
}

View File

@@ -126,8 +126,8 @@ public class AnagramClue extends ClueScroll implements TextClueScroll, NpcClueSc
new AnagramClue("O BIRDZ A ZANY EN PC", "Cap'n Izzy No-Beard", new WorldPoint(2807, 3191, 0), "Brimhaven Agility Arena", "How many Banana Trees are there in the plantation?", "33"),
new AnagramClue("OK CO", "Cook", new WorldPoint(3207, 3214, 0), "Ground floor of Lumbridge Castle", "How many cannons does Lumbridge Castle have?", "9"),
new AnagramClue("OR ZINC FUMES WARD", "Wizard Frumscone", new WorldPoint(2594, 3086, 0), "Downstairs in the Wizards' Guild"),
new AnagramClue("OUR OWN NEEDS", "Nurse Wooned", new WorldPoint(1511, 3619, 0), "Shayzien Infirmary", "How many wounded soldiers are in the camp?", "19"),
new AnagramClue("PACINNG A TAIE", "Captain Ginea", new WorldPoint(1561, 3602, 0), "Building east of Shayzien combat ring", "1 soldier can deal with 6 lizardmen. How many soldiers do we need for an army of 678 lizardmen?", "113"),
new AnagramClue("OUR OWN NEEDS", "Nurse Wooned", new WorldPoint(1511, 3619, 0), "Shayzien Infirmary", "How many wounded soldiers are in the camp?", "16"),
new AnagramClue("PACINNG A TAIE", "Captain Ginea", new WorldPoint(1504, 3632, 0), "Tent east of Shayzien Encampment war tent", "1 soldier can deal with 6 lizardmen. How many soldiers do we need for an army of 678 lizardmen?", "113"),
new AnagramClue("PEAK REFLEX", "Flax keeper", new WorldPoint(2744, 3444, 0), "Flax field south of Seers Village", "If I have 1014 flax, and I spin a third of them into bowstring, how many flax do I have left?", "676"),
new AnagramClue("PEATY PERT", "Party Pete", new WorldPoint(3047, 3376, 0), "Falador Party Room"),
new AnagramClue("PROFS LOSE WRONG PIE", "Professor Onglewip", new WorldPoint(3113, 3162, 0), "Ground floor of Wizards Tower"),
@@ -149,7 +149,7 @@ public class AnagramClue extends ClueScroll implements TextClueScroll, NpcClueSc
new AnagramClue("TEN WIGS ON", "Wingstone", new WorldPoint(3389, 2877, 0), "Between Nardah & Agility Pyramid"),
new AnagramClue("THEM CAL CAME", "Cam the Camel", new WorldPoint(3300, 3231, 0), "Just outside of the Duel Arena"),
new AnagramClue("THICKNO", "Hickton", new WorldPoint(2822, 3442, 0), "Catherby fletching shop", "How many ranges are there in Catherby?", "2"),
new AnagramClue("TWENTY CURE IRON", "New recruit Tony", new WorldPoint(1498, 3544, 0), "Shayzien Graveyard"),
new AnagramClue("TWENTY CURE IRON", "New recruit Tony", new WorldPoint(1503, 3553, 0), "Shayzien Graveyard"),
new AnagramClue("UNLEASH NIGHT MIST", "Sigli the Huntsman", new WorldPoint(2660, 3654, 0), "Rellekka", "What is the combined slayer requirement of every monster in the slayer cave?", "302"),
new AnagramClue("VESTE", "Steve", new WorldPoint(2432, 3423, 0), "Upstairs Wyvern Area or Stronghold Slayer Cave", "How many farming patches are there in Gnome stronghold?", "2"),
new AnagramClue("VEIL VEDA", "Evil Dave", new WorldPoint(3079, 9892, 0), "Doris' basement, Edgeville", "What is 333 multiplied by 2?", "666"),
@@ -167,7 +167,8 @@ public class AnagramClue extends ClueScroll implements TextClueScroll, NpcClueSc
new AnagramClue("TAUNT ROOF", "Fortunato", new WorldPoint(3080, 3250, 0), "Draynor Village Market"),
new AnagramClue("HICK JET", "Jethick", new WorldPoint(2541, 3305, 0), "West Ardougne", "How many graves are there in the city graveyard?", "38"),
new AnagramClue("RUE GO", "Goreu", new WorldPoint(2335, 3162, 0), "Lletya"),
new AnagramClue("BRUCIE CATNAP", "Captain Bruce", new WorldPoint(1520, 3558, 0), "Graveyard of Heroes")
new AnagramClue("BRUCIE CATNAP", "Captain Bruce", new WorldPoint(1520, 3558, 0), "Graveyard of Heroes"),
new AnagramClue("UESNKRL NRIEDDO", "Drunken soldier", new WorldPoint(1551, 3565, 0), "Shayzien pub", "If 13 Shayzien Soldiers kill 46 Lizardmen each in a day, how many Lizardmen have they killed in total in a single day?", "598")
);
private final String text;

View File

@@ -111,7 +111,7 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati
.put(new WorldPoint(2363, 3531, 0), new CoordinateClueInfo("North-east of Eagles' Peak (AKQ)."))
.put(new WorldPoint(2919, 3535, 0), new CoordinateClueInfo("East of Burthorpe pub."))
.put(new WorldPoint(3548, 3560, 0), new CoordinateClueInfo("Inside Fenkenstrain's Castle."))
.put(new WorldPoint(1476, 3566, 0), new CoordinateClueInfo("Graveyard of Heroes west of Shayzien (DJR)."))
.put(new WorldPoint(1476, 3566, 0), new CoordinateClueInfo("Graveyard of Heroes in west Shayzien."))
.put(new WorldPoint(2735, 3638, 0), new CoordinateClueInfo("East of Rellekka, north-west of Golden Apple Tree (AJR)."))
.put(new WorldPoint(2681, 3653, 0), new CoordinateClueInfo("Rellekka, in the garden of the south-east house."))
.put(new WorldPoint(2537, 3881, 0), new CoordinateClueInfo("Miscellania (CIP)."))

View File

@@ -324,7 +324,12 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc
new CrypticClue("Observing someone in a swamp, under the telescope lies treasure.", new WorldPoint(2221, 3091, 0), "Dig next to the telescope on Broken Handz's island in the poison wastes. (Accessible only through fairy ring DLR)"),
new CrypticClue("A general who sets a 'shining' example.", "General Hining", new WorldPoint(2186, 3148, 0), "Talk to General Hining in Tyras Camp."),
new CrypticClue("Has no one told you it is rude to ask a lady her age?", "Mawrth", new WorldPoint(2333, 3165, 0), "Talk to Mawrth in Lletya."),
new CrypticClue("Elvish onions.", new WorldPoint(3303, 6092, 0), "Dig in the onion patch east of the Prifddinas allotments.")
new CrypticClue("Elvish onions.", new WorldPoint(3303, 6092, 0), "Dig in the onion patch east of the Prifddinas allotments."),
new CrypticClue("Dig by the Giant's Den entrance, looking out over Lake Molch.", new WorldPoint(1418, 3591, 0), "South-east of Lake Molch in Zeah, outside the cave entrance."),
new CrypticClue("Search the crates in the fruit store just east of the Hosidius town centre.", CRATES_27533, new WorldPoint(1798, 3612, 0), "Search the crates in the back room of the Hosidius fruit store."),
new CrypticClue("A graceful man of many colours, his crates must be full of many delights.", "Hill Giant", CRATE_42067, new WorldPoint(1506, 3591, 2), "Kill any Hill Giant for a medium key. Then search the crate on the top floor of Osten's clothing shop in Shayzien."),
new CrypticClue("Search the basket of apples in an orchard, south of the unknown grave surrounded by white roses.", APPLE_BASKET, new WorldPoint(1718, 3626, 0), "Search the middle apple basket in the apple orchard north of Hosidius."),
new CrypticClue("Dig in the lair of red wings, within the temple of the Sun and Moon.", new WorldPoint(1820, 9935, 0), "Forthos Dungeon. In the center of the red dragons.")
);
private final String text;

View File

@@ -83,7 +83,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu
new EmoteClue("Beckon by a collection of crystalline maple trees. Beware of double agents! Equip Bryophyta's staff and a nature tiara.", "North of Prifddinas", CRYSTALLINE_MAPLE_TREES, new WorldPoint(2211, 3427, 0), DOUBLE_AGENT_141, BECKON, range("Bryophyta's staff", BRYOPHYTAS_STAFF_UNCHARGED, BRYOPHYTAS_STAFF), item(NATURE_TIARA)),
new EmoteClue("Beckon in the Digsite, near the eastern winch. Bow before you talk to me. Equip a green gnome hat, snakeskin boots and an iron pickaxe.", "Digsite", DIGSITE, new WorldPoint(3370, 3425, 0), BECKON, BOW, item(GREEN_HAT), item(SNAKESKIN_BOOTS), item(IRON_PICKAXE)),
new EmoteClue("Beckon in Tai Bwo Wannai. Clap before you talk to me. Equip green dragonhide chaps, a ring of dueling and a mithril medium helmet.", "Tai Bwo Wannai", SOUTH_OF_THE_SHRINE_IN_TAI_BWO_WANNAI_VILLAGE, new WorldPoint(2803, 3073, 0), BECKON, CLAP, item(GREEN_DHIDE_CHAPS), any("Ring of dueling", item(RING_OF_DUELING1), item(RING_OF_DUELING2), item(RING_OF_DUELING3), item(RING_OF_DUELING4), item(RING_OF_DUELING5), item(RING_OF_DUELING6), item(RING_OF_DUELING7), item(RING_OF_DUELING8)), item(MITHRIL_MED_HELM)),
new EmoteClue("Beckon in the combat ring of Shayzien. Show your anger before you talk to me. Equip an adamant platebody, adamant full helm and adamant platelegs.", "Shayzien combat ring", WEST_OF_THE_SHAYZIEN_COMBAT_RING, new WorldPoint(1545, 3594, 0), BECKON, ANGRY, item(ADAMANT_PLATELEGS), item(ADAMANT_PLATEBODY), item(ADAMANT_FULL_HELM)),
new EmoteClue("Beckon in the Shayzien Combat Ring. Show your anger before you talk to me. Equip an adamant platebody, adamant full helm and adamant platelegs.", "Shayzien Combat Ring", WEST_OF_THE_SHAYZIEN_COMBAT_RING, new WorldPoint(1543, 3623, 0), BECKON, ANGRY, item(ADAMANT_PLATELEGS), item(ADAMANT_PLATEBODY), item(ADAMANT_FULL_HELM)),
new EmoteClue("Bow near Lord Iorwerth. Beware of double agents! Equip a charged crystal bow.", "Lord Iorwerth's camp", TENT_IN_LORD_IORWERTHS_ENCAMPMENT, new WorldPoint(2205, 3252, 0), DOUBLE_AGENT_141, BOW, any("Crystal Bow", item(CRYSTAL_BOW), item(CRYSTAL_BOW_24123))),
new EmoteClue("Bow in the Iorwerth Camp. Beware of double agents! Equip a charged crystal bow.", "Lord Iorwerth's camp", TENT_IN_LORD_IORWERTHS_ENCAMPMENT, new WorldPoint(2205, 3252, 0), DOUBLE_AGENT_141, BOW, any("Crystal Bow", item(CRYSTAL_BOW), item(CRYSTAL_BOW_24123))),
new EmoteClue("Bow outside the entrance to the Legends' Guild. Equip iron platelegs, an emerald amulet and an oak longbow.", "Legend's Guild", OUTSIDE_THE_LEGENDS_GUILD_GATES, new WorldPoint(2729, 3349, 0), BOW, item(IRON_PLATELEGS), item(OAK_LONGBOW), item(EMERALD_AMULET)),
@@ -151,7 +151,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu
new EmoteClue("Shrug in the mine near Rimmington. Equip a gold necklace, a gold ring and a bronze spear.", "Rimmington mine", RIMMINGTON_MINE, new WorldPoint(2976, 3238, 0), SHRUG, item(GOLD_NECKLACE), item(GOLD_RING), item(BRONZE_SPEAR)),
new EmoteClue("Shrug in Catherby bank. Yawn before you talk to me. Equip a maple longbow, green d'hide chaps and an iron med helm.", "Catherby", OUTSIDE_CATHERBY_BANK, new WorldPoint(2808, 3440, 0), SHRUG, YAWN, item(MAPLE_LONGBOW), item(GREEN_DHIDE_CHAPS), item(IRON_MED_HELM)),
new EmoteClue("Shrug in the Zamorak temple found in the Eastern Wilderness. Beware of double agents! Equip rune platelegs, an iron platebody and blue dragonhide vambraces.", "Chaos temple", CHAOS_TEMPLE_IN_THE_SOUTHEASTERN_WILDERNESS, new WorldPoint(3239, 3611, 0), DOUBLE_AGENT_65, SHRUG, item(RUNE_PLATELEGS), item(IRON_PLATEBODY), item(BLUE_DHIDE_VAMBRACES)),
new EmoteClue("Shrug in the Shayzien command tent. Equip a blue mystic robe bottom, a rune kiteshield and any bob shirt.", "Shayzien command tent", SHAYZIEN_WAR_TENT, new WorldPoint(1555, 3537, 0), SHRUG, item(MYSTIC_ROBE_BOTTOM), item(RUNE_KITESHIELD), range("Any bob shirt", BOBS_RED_SHIRT, BOBS_PURPLE_SHIRT)),
new EmoteClue("Shrug in the Shayzien war tent. Equip a blue mystic robe bottom, a rune kiteshield and any bob shirt.", "Shayzien war tent", SHAYZIEN_WAR_TENT, new WorldPoint(1487, 3635, 0), SHRUG, item(MYSTIC_ROBE_BOTTOM), item(RUNE_KITESHIELD), range("Any bob shirt", BOBS_RED_SHIRT, BOBS_PURPLE_SHIRT)),
new EmoteClue("Slap your head in the centre of the Kourend catacombs. Beware of double agents! Equip the arclight and the amulet of the damned.", "Kourend catacombs", CENTRE_OF_THE_CATACOMBS_OF_KOUREND, new WorldPoint(1663, 10045, 0), DOUBLE_AGENT_141, SLAP_HEAD, item(ARCLIGHT), any("Amulet of the damned", item(AMULET_OF_THE_DAMNED), item(AMULET_OF_THE_DAMNED_FULL))),
new EmoteClue("Spin at the crossroads north of Rimmington. Equip a green gnome hat, cream gnome top and leather chaps.", "Rimmington", ROAD_JUNCTION_NORTH_OF_RIMMINGTON, new WorldPoint(2981, 3276, 0), SPIN, item(GREEN_HAT), item(CREAM_ROBE_TOP), item(LEATHER_CHAPS)),
new EmoteClue("Spin in Draynor Manor by the fountain. Equip an iron platebody, studded leather chaps and a bronze full helmet.", "Draynor Manor", DRAYNOR_MANOR_BY_THE_FOUNTAIN, new WorldPoint(3088, 3336, 0), SPIN, item(IRON_PLATEBODY), item(STUDDED_CHAPS), item(BRONZE_FULL_HELM)),
@@ -172,14 +172,15 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu
new EmoteClue("Yawn in the Castle Wars lobby. Shrug before you talk to me. Equip a ruby amulet, a mithril scimitar and a Wilderness cape.", "Castle Wars", CASTLE_WARS_BANK, new WorldPoint(2440, 3092, 0), YAWN, SHRUG, item(RUBY_AMULET), item(MITHRIL_SCIMITAR), range("Any team cape", TEAM1_CAPE, TEAM50_CAPE)),
new EmoteClue("Yawn in the rogues' general store. Beware of double agents! Equip an adamant square shield, blue dragon vambraces and a rune pickaxe.", "Rogues general store", NOTERAZZOS_SHOP_IN_THE_WILDERNESS, new WorldPoint(3026, 3701, 0), DOUBLE_AGENT_65, YAWN, item(ADAMANT_SQ_SHIELD), item(BLUE_DHIDE_VAMBRACES), item(RUNE_PICKAXE)),
new EmoteClue("Yawn at the top of Trollheim. Equip a lava battlestaff, black dragonhide vambraces and a mind shield.", "Trollheim Mountain", ON_TOP_OF_TROLLHEIM_MOUNTAIN, new WorldPoint(2887, 3676, 0), YAWN, any("Lava battlestaff", item(LAVA_BATTLESTAFF), item(LAVA_BATTLESTAFF_21198)), item(BLACK_DHIDE_VAMBRACES), item(MIND_SHIELD)),
new EmoteClue("Yawn in the centre of Arceuus library. Nod your head before you talk to me. Equip blue dragonhide vambraces, adamant boots and an adamant dagger.", "Arceuus library", ENTRANCE_OF_THE_ARCEUUS_LIBRARY, new WorldPoint(1632, 3807, 0), YAWN, YES, item(BLUE_DHIDE_VAMBRACES), item(ADAMANT_BOOTS), item(ADAMANT_DAGGER)),
new EmoteClue("Yawn in the centre of the Arceuus Library. Nod your head before you talk to me. Equip blue dragonhide vambraces, adamant boots and an adamant dagger.", "Arceuus library", ENTRANCE_OF_THE_ARCEUUS_LIBRARY, new WorldPoint(1632, 3807, 0), YAWN, YES, item(BLUE_DHIDE_VAMBRACES), item(ADAMANT_BOOTS), item(ADAMANT_DAGGER)),
new EmoteClue("Swing a bullroarer at the top of the Watchtower. Beware of double agents! Equip a dragon plateskirt, climbing boots and a dragon chainbody.", "Yanille Watchtower", TOP_FLOOR_OF_THE_YANILLE_WATCHTOWER, new WorldPoint(2930, 4717, 2), DOUBLE_AGENT_141, BULL_ROARER, any("Dragon plateskirt", item(DRAGON_PLATESKIRT), item(DRAGON_PLATESKIRT_G)), item(CLIMBING_BOOTS), any("Dragon chainbody", item(DRAGON_CHAINBODY_3140), item(DRAGON_CHAINBODY_G)), item(ItemID.BULL_ROARER)),
new EmoteClue("Blow a raspberry at Gypsy Aris in her tent. Equip a gold ring and a gold necklace.", "Varrock", GYPSY_TENT_ENTRANCE, new WorldPoint(3203, 3424, 0), RASPBERRY, item(GOLD_RING), item(GOLD_NECKLACE)),
new EmoteClue("Bow to Brugsen Bursen at the Grand Exchange.", "Grand Exchange", null, new WorldPoint(3164, 3477, 0), BOW),
new EmoteClue("Cheer at Iffie Nitter. Equip a chef hat and a red cape.", "Varrock", FINE_CLOTHES_ENTRANCE, new WorldPoint(3205, 3416, 0), CHEER, item(CHEFS_HAT), item(RED_CAPE)),
new EmoteClue("Clap at Bob's Brilliant Axes. Equip a bronze axe and leather boots.", "Lumbridge", BOB_AXES_ENTRANCE, new WorldPoint(3231, 3203, 0), CLAP, item(BRONZE_AXE), item(LEATHER_BOOTS)),
new EmoteClue("Panic at Al Kharid mine.", "Al Kharid mine", null, new WorldPoint(3300, 3314, 0), PANIC),
new EmoteClue("Spin at Flynn's Mace Shop.", "Falador", null, new WorldPoint(2950, 3387, 0), SPIN));
new EmoteClue("Spin at Flynn's Mace Shop.", "Falador", null, new WorldPoint(2950, 3387, 0), SPIN),
new EmoteClue("Salute by the Charcoal Burners. Equip a Farmer's strawhat, Shayzien platebody (5) and Pyromancer robes.", "Charcoal Burners", CHARCOAL_BURNERS, new WorldPoint(1714, 3467, 0), SALUTE, any("Farmer's strawhat", item(FARMERS_STRAWHAT), item(FARMERS_STRAWHAT_13647)), item(SHAYZIEN_PLATEBODY_5), item(PYROMANCER_ROBE)));
private static final String UNICODE_CHECK_MARK = "\u2713";
private static final String UNICODE_BALLOT_X = "\u2717";

View File

@@ -79,7 +79,7 @@ public enum STASHUnit
OUTSIDE_HARRYS_FISHING_SHOP_IN_CATHERBY(NullObjectID.NULL_29003, new WorldPoint(2837, 3436, 0)),
TZHAAR_WEAPONS_STORE(NullObjectID.NULL_29004, new WorldPoint(2479, 5146, 0)),
NORTH_OF_EVIL_DAVES_HOUSE_IN_EDGEVILLE(NullObjectID.NULL_29005, new WorldPoint(3077, 3503, 0)),
WEST_OF_THE_SHAYZIEN_COMBAT_RING(NullObjectID.NULL_29006, new WorldPoint(1534, 3591, 0)),
WEST_OF_THE_SHAYZIEN_COMBAT_RING(NullObjectID.NULL_29006, new WorldPoint(1541, 3631, 0)),
ENTRANCE_OF_THE_ARCEUUS_LIBRARY(NullObjectID.NULL_29007, new WorldPoint(1642, 3809, 0)),
OUTSIDE_DRAYNOR_VILLAGE_JAIL(NullObjectID.NULL_29008, new WorldPoint(3130, 3250, 0)),
CHAOS_TEMPLE_IN_THE_SOUTHEASTERN_WILDERNESS(NullObjectID.NULL_29009, new WorldPoint(3245, 3609, 0)),
@@ -109,7 +109,7 @@ public enum STASHUnit
FOUNTAIN_OF_HEROES(NullObjectID.NULL_29033, new WorldPoint(2916, 9891, 0)),
ENTRANCE_OF_THE_CAVERN_UNDER_THE_WHIRLPOOL(NullObjectID.NULL_29034, new WorldPoint(1764, 5367, 1), new WorldPoint(1636, 5367, 1)),
HALFWAY_DOWN_TROLLWEISS_MOUNTAIN(NullObjectID.NULL_29035, new WorldPoint(2782, 3787, 0)),
SHAYZIEN_WAR_TENT(NullObjectID.NULL_29036, new WorldPoint(1550, 3541, 0)),
SHAYZIEN_WAR_TENT(NullObjectID.NULL_29036, new WorldPoint(1488, 3637, 0)),
OUTSIDE_THE_LEGENDS_GUILD_DOOR(NullObjectID.NULL_29037, new WorldPoint(2727, 3371, 0)),
NEAR_THE_GEM_STALL_IN_ARDOUGNE_MARKET(NullObjectID.NULL_29038, new WorldPoint(2672, 3302, 0)),
OUTSIDE_THE_BAR_BY_THE_FIGHT_ARENA(NullObjectID.NULL_29039, new WorldPoint(2571, 3150, 0)),
@@ -138,7 +138,9 @@ public enum STASHUnit
GYPSY_TENT_ENTRANCE(NullObjectID.NULL_34736, new WorldPoint(3206, 3422, 0)),
FINE_CLOTHES_ENTRANCE(NullObjectID.NULL_34737, new WorldPoint(3209, 3416, 0)),
BOB_AXES_ENTRANCE(NullObjectID.NULL_34738, new WorldPoint(3233, 3200, 0)),
CRYSTALLINE_MAPLE_TREES(NullObjectID.NULL_34953, new WorldPoint(2213, 3427, 0));
CRYSTALLINE_MAPLE_TREES(NullObjectID.NULL_34953, new WorldPoint(2213, 3427, 0)),
CHARCOAL_BURNERS(NullObjectID.NULL_41758, new WorldPoint(1712, 3469, 0)),
;
private final int objectId;
private final WorldPoint[] worldPoints;

View File

@@ -185,7 +185,7 @@ public enum HotColdLocation
ZEAH_PISCARILUS_MINE(MASTER, new WorldPoint(1768, 3705, 0), ZEAH, "South of the Piscarilius mine.", ANCIENT_WIZARDS),
ZEAH_GOLDEN_FIELD_TAVERN(MASTER, new WorldPoint(1718, 3643, 0), ZEAH, "South of the gravestone in Kingstown.", BRASSICAN_MAGE),
ZEAH_MESS_HALL(MASTER, new WorldPoint(1656, 3621, 0), ZEAH, "East of the Mess hall.", ANCIENT_WIZARDS),
ZEAH_WATSONS_HOUSE(MASTER, new WorldPoint(1653, 3573, 0), ZEAH, "East of Watson's house.", ANCIENT_WIZARDS),
ZEAH_WATSONS_HOUSE(MASTER, new WorldPoint(1653, 3573, 0), ZEAH, "East of Watson's house.", BRASSICAN_MAGE),
ZEAH_VANNAHS_FARM_STORE(MASTER, new WorldPoint(1807, 3523, 0), ZEAH, "North of Tithe Farm, next to the pond.", BRASSICAN_MAGE),
ZEAH_FARMING_GUILD_W(MASTER, new WorldPoint(1208, 3736, 0), ZEAH, "West of the Farming Guild.", BRASSICAN_MAGE),
ZEAH_DAIRY_COW(MASTER, new WorldPoint(1324, 3722, 0), ZEAH, "North-east of the Kebos Lowlands, east of the dairy cow.", BRASSICAN_MAGE),

View File

@@ -29,7 +29,6 @@ import javax.inject.Inject;
import net.runelite.api.Client;
import net.runelite.api.events.GameTick;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetID;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.plugins.crowdsourcing.CrowdsourcingManager;
@@ -44,6 +43,7 @@ public class CrowdsourcingDialogue
@Inject
private CrowdsourcingManager manager;
private boolean inDialogue = false;
private String lastNpcDialogueText = null;
private String lastPlayerDialogueText = null;
private Widget[] dialogueOptions;
@@ -58,6 +58,23 @@ public class CrowdsourcingDialogue
public void onGameTick(GameTick tick)
{
Widget npcDialogueTextWidget = client.getWidget(WidgetInfo.DIALOG_NPC_TEXT);
Widget playerDialogueTextWidget = client.getWidget(WidgetInfo.DIALOG_PLAYER_TEXT);
Widget playerDialogueOptionsWidget = client.getWidget(WidgetInfo.DIALOG_OPTION_OPTIONS);
// If we were not in a conversation, but now one of these widgets is not null, we have started a conversation.
// Else if we were in a conversation, but now there is no widget, we have left the conversation.
if (!inDialogue && (npcDialogueTextWidget != null || playerDialogueTextWidget != null || playerDialogueOptionsWidget != null))
{
inDialogue = true;
manager.storeEvent(new StartEndData(true));
}
else if (inDialogue && npcDialogueTextWidget == null && playerDialogueTextWidget == null
&& playerDialogueOptionsWidget == null)
{
inDialogue = false;
manager.storeEvent(new StartEndData(false));
}
if (npcDialogueTextWidget != null && !npcDialogueTextWidget.getText().equals(lastNpcDialogueText))
{
lastNpcDialogueText = npcDialogueTextWidget.getText();
@@ -66,7 +83,6 @@ public class CrowdsourcingDialogue
manager.storeEvent(data);
}
Widget playerDialogueTextWidget = client.getWidget(WidgetID.DIALOG_PLAYER_GROUP_ID, 4);
if (playerDialogueTextWidget != null && !playerDialogueTextWidget.getText().equals(lastPlayerDialogueText))
{
lastPlayerDialogueText = playerDialogueTextWidget.getText();
@@ -74,7 +90,6 @@ public class CrowdsourcingDialogue
manager.storeEvent(data);
}
Widget playerDialogueOptionsWidget = client.getWidget(WidgetID.DIALOG_OPTION_GROUP_ID, 1);
if (playerDialogueOptionsWidget != null && playerDialogueOptionsWidget.getChildren() != dialogueOptions)
{
dialogueOptions = playerDialogueOptionsWidget.getChildren();

View File

@@ -0,0 +1,36 @@
/*
* Copyright (c) 2021, Weird Gloop <admin@weirdgloop.org>
* 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.crowdsourcing.dialogue;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class StartEndData
{
private final boolean isStart;
}

View File

@@ -79,7 +79,7 @@ class WorldMapRegionOverlay extends Overlay
{
RenderOverview ro = client.getRenderOverview();
Widget map = client.getWidget(WidgetInfo.WORLD_MAP_VIEW);
Float pixelsPerTile = ro.getWorldMapZoom();
float pixelsPerTile = ro.getWorldMapZoom();
if (map == null)
{

View File

@@ -32,7 +32,6 @@ import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;
import javax.inject.Inject;
import javax.inject.Named;
@@ -250,27 +249,16 @@ class DiscordState
final Duration actionTimeout = Duration.ofMinutes(config.actionTimeout());
final Instant now = Instant.now();
final AtomicBoolean updatedAny = new AtomicBoolean();
final boolean removedAny = events.removeAll(events.stream()
// Only include clearable events
.filter(event -> event.getType().isShouldBeCleared())
// Find only events that should time out
.filter(event -> event.getType().isShouldTimeout() && now.isAfter(event.getUpdated().plus(actionTimeout)))
// Reset start times on timed events that should restart
.peek(event ->
{
if (event.getType().isShouldRestart())
{
event.setStart(null);
updatedAny.set(true);
}
})
// Now filter out events that should restart as we do not want to remove them
.filter(event -> !event.getType().isShouldRestart())
.filter(event -> event.getType().isShouldBeCleared())
.collect(Collectors.toList())
);
if (removedAny || updatedAny.get())
if (removedAny)
{
updatePresenceWithLatestEvent();
}

View File

@@ -43,6 +43,7 @@ public enum LoginScreenOverride
MONKEY_MADNESS_2("mm2.jpg"),
PRIFDDINAS("prifddinas.jpg"),
THEATRE_OF_BLOOD("tob.jpg"),
A_KINGDOM_DIVIDED("akd.jpg"),
CUSTOM;
@Getter

View File

@@ -67,6 +67,7 @@ import net.runelite.api.InventoryID;
import net.runelite.api.ItemComposition;
import net.runelite.api.ItemContainer;
import net.runelite.api.ItemID;
import net.runelite.api.MenuAction;
import net.runelite.api.MessageNode;
import net.runelite.api.NPC;
import net.runelite.api.ObjectID;
@@ -817,52 +818,70 @@ public class LootTrackerPlugin extends Plugin
{
// There are some pickpocket targets who show up in the chat box with a different name (e.g. H.A.M. members -> man/woman)
// We use the value selected from the right-click menu as a fallback for the event lookup in those cases.
if (event.getMenuOption().equals("Pickpocket"))
if (isNPCOp(event.getMenuAction()) && event.getMenuOption().equals("Pickpocket"))
{
lastPickpocketTarget = Text.removeTags(event.getMenuTarget());
}
if (event.getMenuOption().equals("Take") && event.getId() == ItemID.SEED_PACK)
{
setEvent(LootRecordType.EVENT, SEEDPACK_EVENT);
takeInventorySnapshot();
}
if (event.getMenuOption().equals("Open") && SHADE_CHEST_OBJECTS.containsKey(event.getId()))
else if (isObjectOp(event.getMenuAction()) && event.getMenuOption().equals("Open") && SHADE_CHEST_OBJECTS.containsKey(event.getId()))
{
setEvent(LootRecordType.EVENT, SHADE_CHEST_OBJECTS.get(event.getId()));
takeInventorySnapshot();
}
if (event.getMenuOption().equals("Search") && BIRDNEST_IDS.contains(event.getId()))
else if (isItemOp(event.getMenuAction()))
{
setEvent(LootRecordType.EVENT, BIRDNEST_EVENT, event.getId());
takeInventorySnapshot();
if (event.getMenuOption().equals("Take") && event.getId() == ItemID.SEED_PACK)
{
setEvent(LootRecordType.EVENT, SEEDPACK_EVENT);
takeInventorySnapshot();
}
else if (event.getMenuOption().equals("Search") && BIRDNEST_IDS.contains(event.getId()))
{
setEvent(LootRecordType.EVENT, BIRDNEST_EVENT, event.getId());
takeInventorySnapshot();
}
else if (event.getMenuOption().equals("Open"))
{
switch (event.getId())
{
case ItemID.CASKET:
setEvent(LootRecordType.EVENT, CASKET_EVENT);
takeInventorySnapshot();
break;
case ItemID.SUPPLY_CRATE:
case ItemID.EXTRA_SUPPLY_CRATE:
setEvent(LootRecordType.EVENT, WINTERTODT_SUPPLY_CRATE_EVENT);
takeInventorySnapshot();
break;
case ItemID.SPOILS_OF_WAR:
setEvent(LootRecordType.EVENT, SPOILS_OF_WAR_EVENT);
takeInventorySnapshot();
break;
case ItemID.CASKET_25590:
setEvent(LootRecordType.EVENT, TEMPOROSS_CASKET_EVENT);
takeInventorySnapshot();
break;
}
}
}
}
if (event.getMenuOption().equals("Open") && event.getId() == ItemID.CASKET)
{
setEvent(LootRecordType.EVENT, CASKET_EVENT);
takeInventorySnapshot();
}
private static boolean isItemOp(MenuAction menuAction)
{
final int id = menuAction.getId();
return id >= MenuAction.ITEM_FIRST_OPTION.getId() && id <= MenuAction.ITEM_FIFTH_OPTION.getId();
}
if (event.getMenuOption().equals("Open") && (event.getId() == ItemID.SUPPLY_CRATE || event.getId() == ItemID.EXTRA_SUPPLY_CRATE))
{
setEvent(LootRecordType.EVENT, WINTERTODT_SUPPLY_CRATE_EVENT);
takeInventorySnapshot();
}
private static boolean isNPCOp(MenuAction menuAction)
{
final int id = menuAction.getId();
return id >= MenuAction.NPC_FIRST_OPTION.getId() && id <= MenuAction.NPC_FIFTH_OPTION.getId();
}
if (event.getMenuOption().equals("Open") && event.getId() == ItemID.SPOILS_OF_WAR)
{
setEvent(LootRecordType.EVENT, SPOILS_OF_WAR_EVENT);
takeInventorySnapshot();
}
if (event.getMenuOption().equals("Open") && event.getId() == ItemID.CASKET_25590)
{
setEvent(LootRecordType.EVENT, TEMPOROSS_CASKET_EVENT);
takeInventorySnapshot();
}
private static boolean isObjectOp(MenuAction menuAction)
{
final int id = menuAction.getId();
return (id >= MenuAction.GAME_OBJECT_FIRST_OPTION.getId() && id <= MenuAction.GAME_OBJECT_FOURTH_OPTION.getId())
|| id == MenuAction.GAME_OBJECT_FIFTH_OPTION.getId();
}
@Schedule(

View File

@@ -283,6 +283,7 @@ public class MenuEntrySwapperPlugin extends Plugin
swap("enter", "the gauntlet", "enter-corrupted", config::swapGauntlet);
swap("enter", "quick-enter", config::swapQuick);
swap("enter-crypt", "quick-enter", config::swapQuick);
swap("ring", "quick-start", config::swapQuick);
swap("pass", "quick-pass", config::swapQuick);
swap("pass", "quick pass", config::swapQuick);

View File

@@ -45,6 +45,7 @@ class PartyWorldMapPoint extends WorldMapPoint
this.member = member;
this.setSnapToEdge(true);
this.setJumpOnClick(true);
this.setName(member.getName());
this.setImagePoint(new Point(
ARROW.getWidth() / 2,
ARROW.getHeight()));

View File

@@ -76,7 +76,16 @@ enum GameTimer
DIVINE_BATTLEMAGE(ItemID.DIVINE_BATTLEMAGE_POTION4, GameTimerImageType.ITEM, "Divine Battlemage", 5, ChronoUnit.MINUTES),
ANTIPOISON(ItemID.ANTIPOISON4, GameTimerImageType.ITEM, "Antipoison", false),
ANTIVENOM(ItemID.ANTIVENOM4, GameTimerImageType.ITEM, "Anti-venom", false),
TELEBLOCK(SpriteID.SPELL_TELE_BLOCK, GameTimerImageType.SPRITE, "Teleblock", true);
TELEBLOCK(SpriteID.SPELL_TELE_BLOCK, GameTimerImageType.SPRITE, "Teleblock", true),
SHADOW_VEIL(SpriteID.SPELL_SHADOW_VEIL, GameTimerImageType.SPRITE, "Shadow veil", true),
RESURRECT_THRALL(SpriteID.SPELL_RESURRECT_SUPERIOR_SKELETON, GameTimerImageType.SPRITE, "Resurrect thrall", false),
WARD_OF_ARCEUUS(SpriteID.SPELL_WARD_OF_ARCEUUS, GameTimerImageType.SPRITE, "Ward of Arceuus", true),
DEATH_CHARGE(SpriteID.SPELL_DEATH_CHARGE, GameTimerImageType.SPRITE, "Death charge", false),
SHADOW_VEIL_COOLDOWN(SpriteID.SPELL_SHADOW_VEIL_DISABLED, GameTimerImageType.SPRITE, "Shadow veil cooldown", 30, ChronoUnit.SECONDS),
RESURRECT_THRALL_COOLDOWN(SpriteID.SPELL_RESURRECT_SUPERIOR_SKELETON_DISABLED, GameTimerImageType.SPRITE, "Resurrect thrall cooldown", 12, GAME_TICKS),
WARD_OF_ARCEUUS_COOLDOWN(SpriteID.SPELL_WARD_OF_ARCEUUS_DISABLED, GameTimerImageType.SPRITE, "Ward of Arceuus cooldown", 30, ChronoUnit.SECONDS),
DEATH_CHARGE_COOLDOWN(SpriteID.SPELL_DEATH_CHARGE_DISABLED, GameTimerImageType.SPRITE, "Death charge cooldown", 60, ChronoUnit.SECONDS),
CORRUPTION_COOLDOWN(SpriteID.SPELL_GREATER_CORRUPTION_DISABLED, GameTimerImageType.SPRITE, "Corruption cooldown", 30, ChronoUnit.SECONDS);
@Nullable
private final Duration duration;

View File

@@ -263,4 +263,24 @@ public interface TimersConfig extends Config
{
return true;
}
@ConfigItem(
keyName = "showArceuus",
name = "Arceuus spells duration",
description = "Whether to show Arceuus spellbook spell timers"
)
default boolean showArceuus()
{
return true;
}
@ConfigItem(
keyName = "showArceuusCooldown",
name = "Arceuus spells cooldown",
description = "Whether to show cooldown timers for Arceuus spellbook spells"
)
default boolean showArceuusCooldown()
{
return false;
}
}

View File

@@ -76,6 +76,7 @@ import net.runelite.client.plugins.PluginDescriptor;
import static net.runelite.client.plugins.timers.GameIndicator.VENGEANCE_ACTIVE;
import static net.runelite.client.plugins.timers.GameTimer.*;
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
import net.runelite.client.util.RSTimeUnit;
import org.apache.commons.lang3.ArrayUtils;
@PluginDescriptor(
@@ -113,6 +114,14 @@ public class TimersPlugin extends Plugin
private static final String KILLED_TELEBLOCK_OPPONENT_TEXT = "Your Tele Block has been removed because you killed ";
private static final String PRAYER_ENHANCE_EXPIRED = "<col=ff0000>Your prayer enhance effect has worn off.</col>";
private static final String ENDURANCE_EFFECT_MESSAGE = "Your Ring of endurance doubles the duration of your stamina potion's effect.";
private static final String SHADOW_VEIL_MESSAGE = ">Your thieving abilities have been enhanced.</col>";
private static final String DEATH_CHARGE_MESSAGE = ">Upon the death of your next foe, some of your special attack energy will be restored.</col>";
private static final String DEATH_CHARGE_ACTIVATE_MESSAGE = ">Some of your special attack energy has been restored.</col>";
private static final String RESURRECT_THRALL_MESSAGE_START = ">You resurrect a ";
private static final String RESURRECT_THRALL_MESSAGE_END = " thrall.</col>";
private static final String RESURRECT_THRALL_DISAPPEAR_MESSAGE_START = ">Your ";
private static final String RESURRECT_THRALL_DISAPPEAR_MESSAGE_END = " thrall returns to the grave.</col>";
private static final String WARD_OF_ARCEUUS_MESSAGE = ">Your defence against Arceuus magic has been strengthened.</col>";
private static final Pattern TELEBLOCK_PATTERN = Pattern.compile("A Tele Block spell has been cast on you(?: by .+)?\\. It will expire in (?<mins>\\d+) minutes?(?:, (?<secs>\\d+) seconds?)?\\.");
private static final Pattern DIVINE_POTION_PATTERN = Pattern.compile("You drink some of your divine (.+) potion\\.");
@@ -138,6 +147,7 @@ public class TimersPlugin extends Plugin
private int lastIsVengeancedVarb;
private int lastPoisonVarp;
private int lastPvpVarb;
private int lastCorruptionVarb;
private int nextPoisonTick;
private WorldPoint lastPoint;
private TeleportWidget lastTeleportClicked;
@@ -202,6 +212,7 @@ public class TimersPlugin extends Plugin
int isVengeancedVarb = client.getVar(Varbits.VENGEANCE_ACTIVE);
int poisonVarp = client.getVar(VarPlayer.POISON);
int pvpVarb = client.getVar(Varbits.PVP_SPEC_ORB);
int corruptionCooldownVarb = client.getVar(Varbits.CORRUPTION_COOLDOWN);
if (lastRaidVarb != raidVarb)
{
@@ -224,6 +235,20 @@ public class TimersPlugin extends Plugin
lastVengCooldownVarb = vengCooldownVarb;
}
if (lastCorruptionVarb != corruptionCooldownVarb && config.showArceuusCooldown())
{
if (corruptionCooldownVarb == 1)
{
createGameTimer(CORRUPTION_COOLDOWN);
}
else
{
removeGameTimer(CORRUPTION_COOLDOWN);
}
lastCorruptionVarb = corruptionCooldownVarb;
}
if (lastIsVengeancedVarb != isVengeancedVarb && config.showVengeanceActive())
{
if (isVengeancedVarb == 1)
@@ -665,6 +690,55 @@ public class TimersPlugin extends Plugin
}
}
if (config.showArceuus())
{
Duration duration = Duration.of(client.getRealSkillLevel(Skill.MAGIC), RSTimeUnit.GAME_TICKS);
if (message.endsWith(SHADOW_VEIL_MESSAGE))
{
createGameTimer(SHADOW_VEIL, duration);
}
else if (message.endsWith(WARD_OF_ARCEUUS_MESSAGE))
{
createGameTimer(WARD_OF_ARCEUUS, duration);
}
else if (message.endsWith(DEATH_CHARGE_MESSAGE))
{
createGameTimer(DEATH_CHARGE, duration);
}
else if (message.endsWith(DEATH_CHARGE_ACTIVATE_MESSAGE))
{
removeGameTimer(DEATH_CHARGE);
}
else if (message.contains(RESURRECT_THRALL_MESSAGE_START) && message.endsWith(RESURRECT_THRALL_MESSAGE_END))
{
createGameTimer(RESURRECT_THRALL, duration);
}
else if (message.contains(RESURRECT_THRALL_DISAPPEAR_MESSAGE_START) && message.endsWith(RESURRECT_THRALL_DISAPPEAR_MESSAGE_END))
{
removeGameTimer(RESURRECT_THRALL);
}
}
if (config.showArceuusCooldown())
{
if (message.endsWith(SHADOW_VEIL_MESSAGE))
{
createGameTimer(SHADOW_VEIL_COOLDOWN);
}
else if (message.endsWith(DEATH_CHARGE_MESSAGE))
{
createGameTimer(DEATH_CHARGE_COOLDOWN);
}
else if (message.endsWith(WARD_OF_ARCEUUS_MESSAGE))
{
createGameTimer(WARD_OF_ARCEUUS_COOLDOWN);
}
else if (message.contains(RESURRECT_THRALL_MESSAGE_START) && message.endsWith(RESURRECT_THRALL_MESSAGE_END))
{
createGameTimer(RESURRECT_THRALL_COOLDOWN);
}
}
if (message.equals(TZHAAR_DEFEATED_MESSAGE) || TZHAAR_COMPLETE_MESSAGE.matcher(message).matches())
{
log.debug("Stopping tzhaar timer");

View File

@@ -46,6 +46,7 @@ enum AgilityCourseLocation
PRIFDDINAS_AGILITY_COURSE("Prifddinas Agility Course", new WorldPoint(3253, 6109, 0)),
RELLEKKA_ROOFTOP_COURSE("Rellekka Rooftop Course", new WorldPoint(2624, 3677, 0)),
SEERS_VILLAGE_ROOFTOP_COURSE("Seers' Village Rooftop Course", new WorldPoint(2728, 3488, 0)),
SHAYZIEN_COURSE("Shayzien Agility Course", new WorldPoint(1551, 3632, 0)),
VARROCK_ROOFTOP_COURSE("Varrock Rooftop Course", new WorldPoint(3219, 3414, 0)),
WEREWOLF_AGILITY_COURSE("Werewolf Agility Course", new WorldPoint(3542, 3463, 0)),
WILDERNESS_AGILITY_COURSE("Wilderness Agility Course", new WorldPoint(2997, 3916, 0));

View File

@@ -62,11 +62,11 @@ enum KourendTaskLocation
PISCARILIUS_SANDWORMS("Piscarilius Task (30%) - Hunting Sandworms", new WorldPoint(1841, 3789, 0)),
PISCARILIUS_STEALING_ARTEFACTS("Piscarilius Task (75%) - Stealing Artefacts", new WorldPoint(1849, 3753, 0)),
SHAYZIEN_HEALING_SOLDIERS("Shayzien Task (0%) - Healing Wounded Soldiers", new WorldPoint(1572, 3581, 0)),
SHAYZIEN_HEALING_SOLDIERS("Shayzien Task (0%) - Healing Wounded Soldiers", new WorldPoint(1528, 3627, 0)),
SHAYZIEN_LIZARDMEN_EAST("Shayzien Task (5%) - Killing Lizardmen", new WorldPoint(1570, 3668, 0)),
SHAYZIEN_LIZARDMEN_WEST("Shayzien Task (5%) - Killing Lizardmen", new WorldPoint(1471, 3686, 0)),
SHAYZIEN_ORGANIZED_CRIME("Shayzien Task (40%) - Organized Crime", new WorldPoint(1565, 3605, 0)),
SHAYZIEN_COMBAT_RING("Shayzien Task (60%) - Combat Ring", new WorldPoint(1539, 3589, 0)),
SHAYZIEN_ORGANIZED_CRIME("Shayzien Task (40%) - Organized Crime", new WorldPoint(1504, 3635, 0)),
SHAYZIEN_COMBAT_RING("Shayzien Task (60%) - Combat Ring", new WorldPoint(1541, 3628, 0)),
SHAYZIEN_LIZARDMAN_SHAMANS("Shayzien Unlock (100%) - Lizardman Shamans", new WorldPoint(1455, 3693, 0));
private final String tooltip;

View File

@@ -187,9 +187,8 @@ enum MiningSiteLocation
new Rock(1, Ore.COPPER), new Rock(1, Ore.TIN), new Rock(5, Ore.IRON), new Rock(2, Ore.SILVER), new Rock(1, Ore.COAL)),
SALT_MINE(new WorldPoint(2835, 10334, 0),
new Rock(7, Ore.BASALT), new Rock(15, Ore.TE_SALT), new Rock(12, Ore.EFH_SALT), new Rock(12, Ore.URT_SALT)),
SHAYZIEN_EAST(new WorldPoint(1597, 3653, 0), new Rock(3, Ore.CLAY), new Rock(1, Ore.MITHRIL), new Rock(1, Ore.ADAMANTITE)),
SHAYZIEN_WEST(new WorldPoint(1586, 3650, 0),
new Rock(4, Ore.IRON), new Rock(4, Ore.COAL), new Rock(1, Ore.MITHRIL), new Rock(1, Ore.ADAMANTITE)),
SHAYZIEN(new WorldPoint(1601, 3645, 0),
new Rock(3, Ore.CLAY), new Rock(3, Ore.IRON), new Rock(4, Ore.COAL), new Rock(2, Ore.MITHRIL), new Rock(2, Ore.ADAMANTITE)),
SHILO_VILLAGE_SURFACE(new WorldPoint(2822, 3001, 0), new Rock(7, Ore.GEM_ROCK)),
SILVAREA(new WorldPoint(3371, 3498, 0), new Rock(7, Ore.LIMESTONE)),
SLEPE_UNDERGROUND(new WorldPoint(3888, 9749, 0), new Rock(6, Ore.IRON), new Rock(14, Ore.COAL)),

View File

@@ -116,6 +116,7 @@ enum QuestStartLocation
ICTHLARINS_LITTLE_HELPER(Quest.ICTHLARINS_LITTLE_HELPER, new WorldPoint(3314, 2849, 0)),
IN_SEARCH_OF_THE_MYREQUE(Quest.IN_SEARCH_OF_THE_MYREQUE, new WorldPoint(3502, 3477, 0)),
JUNGLE_POTION(Quest.JUNGLE_POTION, new WorldPoint(2809, 3086, 0)),
A_KINGDOM_DIVIDED(Quest.A_KINGDOM_DIVIDED, new WorldPoint(1663, 3672, 0)),
KINGS_RANSOM(Quest.KINGS_RANSOM, new WorldPoint(2741, 3554, 0)),
LEGENDS_QUEST(Quest.LEGENDS_QUEST, new WorldPoint(2725, 3367, 0)),
LOST_CITY(Quest.LOST_CITY, new WorldPoint(3149, 3205, 0)),
@@ -130,6 +131,7 @@ enum QuestStartLocation
MURDER_MYSTERY(Quest.MURDER_MYSTERY, new WorldPoint(2740, 3562, 0)),
MY_ARMS_BIG_ADVENTURE(Quest.MY_ARMS_BIG_ADVENTURE, new WorldPoint(2908, 10088, 0)),
NATURE_SPIRIT(Quest.NATURE_SPIRIT, new WorldPoint(3440, 9894, 0)),
A_NIGHT_AT_THE_THEATRE(Quest.A_NIGHT_AT_THE_THEATRE, new WorldPoint(3672, 3224, 0)),
OBSERVATORY_QUEST(Quest.OBSERVATORY_QUEST, new WorldPoint(2438, 3185, 0)),
OLAFS_QUEST(Quest.OLAFS_QUEST, new WorldPoint(2723, 3729, 0)),
ONE_SMALL_FAVOUR(Quest.ONE_SMALL_FAVOUR, new WorldPoint(2834, 2985, 0)),
@@ -153,7 +155,7 @@ enum QuestStartLocation
SWAN_SONG(Quest.SWAN_SONG, new WorldPoint(2345, 3652, 0)),
TAI_BWO_WANNAI_TRIO(Quest.TAI_BWO_WANNAI_TRIO, new WorldPoint(2779, 3087, 0)),
A_TAIL_OF_TWO_CATS(Quest.A_TAIL_OF_TWO_CATS, new WorldPoint(2917, 3557, 0)),
TALE_OF_THE_RIGHTEOUS(Quest.TALE_OF_THE_RIGHTEOUS, new WorldPoint(1511, 3631, 0)),
TALE_OF_THE_RIGHTEOUS(Quest.TALE_OF_THE_RIGHTEOUS, new WorldPoint(1541, 3570, 0)),
A_TASTE_OF_HOPE(Quest.A_TASTE_OF_HOPE, new WorldPoint(3668, 3216, 0)),
TEARS_OF_GUTHIX(Quest.TEARS_OF_GUTHIX, new WorldPoint(3251, 9517, 0)),
TEMPLE_OF_IKOV(Quest.TEMPLE_OF_IKOV, new WorldPoint(2574, 3320, 0)),

View File

@@ -138,6 +138,9 @@ enum RareTreeLocation
new WorldPoint(1642, 3533, 0),
new WorldPoint(1671, 3657, 0),
new WorldPoint(1680, 3657, 0),
new WorldPoint(1572, 3618, 0),
new WorldPoint(1553, 3551, 0),
new WorldPoint(1496, 3582, 0),
// Tirannwn
new WorldPoint(2217, 3141, 0),

View File

@@ -134,7 +134,7 @@ enum TeleportLocationData
TROLL_STRONGHOLD_STONY_BASALT_OUTSIDE(TeleportType.OTHER, "Stony Basalt", "Troll Stronghold", new WorldPoint(2844, 3693, 0), "stony_basalt_teleport_icon.png"),
KHAREDSTS_MEMOIRS_HOSIDIUS(TeleportType.OTHER, "Kharedst's Memoirs", "Lunch by the Lancalliums (Hosidius)", new WorldPoint(1713, 3612, 0), "kharedsts_memoirs_teleport_icon.png"),
KHAREDSTS_MEMOIRS_PISCARILIUS(TeleportType.OTHER, "Kharedst's Memoirs", "The Fisher's Flute (Piscarilius)", new WorldPoint(1802, 3748, 0), "kharedsts_memoirs_teleport_icon.png"),
KHAREDSTS_MEMOIRS_SHAYZIEN(TeleportType.OTHER, "Kharedst's Memoirs", "History and Hearsay (Shayzien)", new WorldPoint(1476, 3580, 0), "kharedsts_memoirs_teleport_icon.png"),
KHAREDSTS_MEMOIRS_SHAYZIEN(TeleportType.OTHER, "Kharedst's Memoirs", "History and Hearsay (Shayzien)", new WorldPoint(1478, 3576, 0), "kharedsts_memoirs_teleport_icon.png"),
KHAREDSTS_MEMOIRS_LOVAKENGJ(TeleportType.OTHER, "Kharedst's Memoirs", "Jewelry of Jubilation (Lovakengj)", new WorldPoint(1544, 3762, 0), "kharedsts_memoirs_teleport_icon.png"),
KHAREDSTS_MEMOIRS_ARCEUUS(TeleportType.OTHER, "Kharedst's Memoirs", "A Dark Disposition (Arceuus)", new WorldPoint(1680, 3746, 0), "kharedsts_memoirs_teleport_icon.png"),
PHARAOHS_SCEPTRE_JALSAVRAH(TeleportType.OTHER, "Pharaoh's Sceptre", "Jalsavrah (Pyramid Plunder)", new WorldPoint(3288, 2795, 0), "pharaohs_sceptre_teleport_icon.png"),

View File

@@ -48,6 +48,7 @@ import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.ui.overlay.worldmap.WorldMapPoint;
import net.runelite.client.ui.overlay.worldmap.WorldMapPointManager;
import net.runelite.client.util.ImageUtil;
import net.runelite.client.util.Text;
@PluginDescriptor(
name = "World Map",
@@ -327,6 +328,7 @@ public class WorldMapPlugin extends Plugin
.image(BLANK_ICON)
.target(l.getTarget())
.jumpOnClick(l.getTarget() != null)
.name(Text.titleCase(l))
.tooltip(l.getTooltip())
.build()
)

View File

@@ -42,15 +42,10 @@ public class WidgetOverlay extends Overlay
return Arrays.asList(
new WidgetOverlay(client, WidgetInfo.RESIZABLE_MINIMAP_WIDGET, OverlayPosition.CANVAS_TOP_RIGHT),
new WidgetOverlay(client, WidgetInfo.RESIZABLE_MINIMAP_STONES_WIDGET, OverlayPosition.CANVAS_TOP_RIGHT),
new WidgetOverlay(client, WidgetInfo.FOSSIL_ISLAND_OXYGENBAR, OverlayPosition.TOP_LEFT),
new XpTrackerWidgetOverlay(client, WidgetInfo.EXPERIENCE_TRACKER_WIDGET, OverlayPosition.TOP_RIGHT),
new WidgetOverlay(client, WidgetInfo.RAIDS_POINTS_INFOBOX, OverlayPosition.TOP_RIGHT),
new WidgetOverlay(client, WidgetInfo.TOB_PARTY_INTERFACE, OverlayPosition.TOP_LEFT),
new WidgetOverlay(client, WidgetInfo.TOB_PARTY_STATS, OverlayPosition.TOP_LEFT),
new WidgetOverlay(client, WidgetInfo.GWD_KC, OverlayPosition.TOP_RIGHT),
new WidgetOverlay(client, WidgetInfo.TITHE_FARM, OverlayPosition.TOP_RIGHT),
new WidgetOverlay(client, WidgetInfo.PEST_CONTROL_BOAT_INFO, OverlayPosition.TOP_LEFT),
new WidgetOverlay(client, WidgetInfo.PEST_CONTROL_INFO, OverlayPosition.TOP_LEFT),
new WidgetOverlay(client, WidgetInfo.ZEAH_MESS_HALL_COOKING_DISPLAY, OverlayPosition.TOP_LEFT),
new WidgetOverlay(client, WidgetInfo.PVP_KILLDEATH_COUNTER, OverlayPosition.TOP_LEFT),
new WidgetOverlay(client, WidgetInfo.SKOTIZO_CONTAINER, OverlayPosition.TOP_LEFT),
@@ -60,10 +55,7 @@ public class WidgetOverlay extends Overlay
new WidgetOverlay(client, WidgetInfo.LMS_KDA, OverlayPosition.TOP_RIGHT),
new WidgetOverlay(client, WidgetInfo.GAUNTLET_TIMER_CONTAINER, OverlayPosition.TOP_LEFT),
new WidgetOverlay(client, WidgetInfo.HALLOWED_SEPULCHRE_TIMER_CONTAINER, OverlayPosition.TOP_LEFT),
new WidgetOverlay(client, WidgetInfo.HEALTH_OVERLAY_BAR, OverlayPosition.TOP_CENTER),
new WidgetOverlay(client, WidgetInfo.NIGHTMARE_PILLAR_HEALTH, OverlayPosition.TOP_LEFT),
new WidgetOverlay(client, WidgetInfo.VOLCANIC_MINE_VENTS_INFOBOX_GROUP, OverlayPosition.BOTTOM_RIGHT),
new WidgetOverlay(client, WidgetInfo.VOLCANIC_MINE_STABILITY_INFOBOX_GROUP, OverlayPosition.BOTTOM_LEFT),
new WidgetOverlay(client, WidgetInfo.MULTICOMBAT_FIXED, OverlayPosition.BOTTOM_RIGHT),
new WidgetOverlay(client, WidgetInfo.MULTICOMBAT_RESIZEABLE_MODERN, OverlayPosition.CANVAS_TOP_RIGHT),
new WidgetOverlay(client, WidgetInfo.MULTICOMBAT_RESIZEABLE_CLASSIC, OverlayPosition.CANVAS_TOP_RIGHT),

View File

@@ -25,33 +25,43 @@
package net.runelite.client.ui.overlay.worldmap;
import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.geom.Area;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.inject.Inject;
import javax.inject.Singleton;
import net.runelite.api.Client;
import net.runelite.api.MenuAction;
import net.runelite.api.MenuEntry;
import net.runelite.api.Point;
import net.runelite.api.RenderOverview;
import net.runelite.api.coords.WorldPoint;
import net.runelite.api.events.MenuOptionClicked;
import net.runelite.api.widgets.JavaScriptCallback;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetID;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.client.input.MouseManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.ui.FontManager;
import net.runelite.client.ui.JagexColors;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayLayer;
import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.OverlayPriority;
import net.runelite.client.util.ColorUtil;
@Singleton
public class WorldMapOverlay extends Overlay
{
private static final String FOCUS_ON = "Focus on";
private static final int TOOLTIP_OFFSET_HEIGHT = 25;
private static final int TOOLTIP_OFFSET_WIDTH = 5;
private static final int TOOLTIP_PADDING_HEIGHT = 1;
@@ -63,12 +73,12 @@ public class WorldMapOverlay extends Overlay
private final WorldMapPointManager worldMapPointManager;
private final Client client;
private final List<MenuEntry> mapMenuEntries = new ArrayList<>();
@Inject
private WorldMapOverlay(
Client client,
WorldMapPointManager worldMapPointManager,
MouseManager mouseManager,
WorldMapOverlayMouseListener worldMapOverlayMouseListener)
WorldMapPointManager worldMapPointManager)
{
this.client = client;
this.worldMapPointManager = worldMapPointManager;
@@ -76,7 +86,6 @@ public class WorldMapOverlay extends Overlay
setPriority(OverlayPriority.HIGHEST);
setLayer(OverlayLayer.MANUAL);
drawAfterInterface(WidgetID.WORLD_MAP_GROUP_ID);
mouseManager.registerMouseListener(worldMapOverlayMouseListener);
}
@Override
@@ -90,17 +99,44 @@ public class WorldMapOverlay extends Overlay
}
Widget widget = client.getWidget(WidgetInfo.WORLD_MAP_VIEW);
if (widget == null)
Widget bottomBar = client.getWidget(WidgetInfo.WORLD_MAP_BOTTOM_BAR);
if (widget == null || bottomBar == null)
{
return null;
}
bottomBar.setOnTimerListener((JavaScriptCallback) ev ->
{
if (client.isMenuOpen() || mapMenuEntries.isEmpty())
{
return;
}
MenuEntry[] entries = client.getMenuEntries();
int end = entries.length;
entries = Arrays.copyOf(entries, end + mapMenuEntries.size());
for (int i = 0; i < mapMenuEntries.size(); i++)
{
entries[end + i] = mapMenuEntries.get(i);
}
client.setMenuEntries(entries);
});
bottomBar.setHasListener(true);
final Rectangle worldMapRectangle = widget.getBounds();
final Area mapViewArea = getWorldMapClipArea(worldMapRectangle);
final Rectangle canvasBounds = new Rectangle(0, 0, client.getCanvasWidth(), client.getCanvasHeight());
final Area canvasViewArea = getWorldMapClipArea(canvasBounds);
Area currentClip = null;
Point mousePos = client.getMouseCanvasPosition();
if (!canvasViewArea.contains(mousePos.getX(), mousePos.getY()))
{
mousePos = null;
}
mapMenuEntries.clear();
WorldMapPoint tooltipPoint = null;
for (WorldMapPoint worldPoint : points)
@@ -111,10 +147,8 @@ public class WorldMapOverlay extends Overlay
if (image != null && point != null)
{
Point drawPoint = mapWorldPointToGraphicsPoint(point);
if (drawPoint == null)
{
worldPoint.setClickbox(null);
continue;
}
@@ -183,15 +217,40 @@ public class WorldMapOverlay extends Overlay
graphics.drawImage(image, drawX, drawY, null);
Rectangle clickbox = new Rectangle(drawX, drawY, image.getWidth(), image.getHeight());
worldPoint.setClickbox(clickbox);
if (worldPoint.isTooltipVisible())
if (mousePos != null && clickbox.contains(mousePos.getX(), mousePos.getY()))
{
tooltipPoint = worldPoint;
if (!Strings.isNullOrEmpty(worldPoint.getTooltip()))
{
tooltipPoint = worldPoint;
}
if (worldPoint.isJumpOnClick())
{
assert worldPoint.getName() != null;
WorldPoint target = worldPoint.getTarget();
if (target == null)
{
target = worldPoint.getWorldPoint();
}
MenuEntry entry = new MenuEntry();
entry.setType(MenuAction.RUNELITE.getId());
entry.setOption(FOCUS_ON);
entry.setTarget(ColorUtil.wrapWithColorTag(worldPoint.getName(), JagexColors.MENU_TARGET));
entry.setIdentifier(target.getPlane() << 28 | target.getX() << 14 | target.getY());
mapMenuEntries.add(entry);
}
}
}
}
final Widget rsTooltip = client.getWidget(WidgetInfo.WORLD_MAP_TOOLTIP);
if (rsTooltip != null)
{
rsTooltip.setHidden(tooltipPoint != null);
}
if (tooltipPoint != null)
{
drawTooltip(graphics, tooltipPoint);
@@ -200,8 +259,24 @@ public class WorldMapOverlay extends Overlay
return null;
}
@Subscribe
private void onMenuOptionClicked(MenuOptionClicked ev)
{
if (ev.getMenuAction() == MenuAction.RUNELITE && FOCUS_ON.equals(ev.getMenuOption()))
{
int pxy = ev.getId();
WorldPoint wp = new WorldPoint(
pxy >> 14 & 0x3fff,
pxy & 0x3fff,
pxy >> 28);
client.getRenderOverview().setWorldMapPositionTarget(wp);
}
}
/**
* Get the screen coordinates for a WorldPoint on the world map
*
* @param worldPoint WorldPoint to get screen coordinates of
* @return Point of screen coordinates of the center of the world point
*/
@@ -214,7 +289,7 @@ public class WorldMapOverlay extends Overlay
return null;
}
Float pixelsPerTile = ro.getWorldMapZoom();
float pixelsPerTile = ro.getWorldMapZoom();
Widget map = client.getWidget(WidgetInfo.WORLD_MAP_VIEW);
if (map != null)

View File

@@ -1,166 +0,0 @@
/*
* Copyright (c) 2018, Morgan Lewis <https://github.com/MESLewis>
* 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.ui.overlay.worldmap;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.util.List;
import javax.inject.Inject;
import javax.inject.Singleton;
import javax.swing.SwingUtilities;
import net.runelite.api.Client;
import net.runelite.api.Point;
import net.runelite.api.RenderOverview;
import net.runelite.api.coords.WorldPoint;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.client.input.MouseAdapter;
@Singleton
public class WorldMapOverlayMouseListener extends MouseAdapter
{
private final Client client;
private final WorldMapPointManager worldMapPointManager;
private WorldMapPoint tooltipPoint = null;
@Inject
private WorldMapOverlayMouseListener(Client client, WorldMapPointManager worldMapPointManager)
{
this.client = client;
this.worldMapPointManager = worldMapPointManager;
}
@Override
public MouseEvent mousePressed(MouseEvent e)
{
final List<WorldMapPoint> worldMapPoints = worldMapPointManager.getWorldMapPoints();
if (SwingUtilities.isLeftMouseButton(e) && !worldMapPoints.isEmpty())
{
Point mousePos = client.getMouseCanvasPosition();
final Widget view = client.getWidget(WidgetInfo.WORLD_MAP_VIEW);
if (view == null)
{
return e;
}
for (WorldMapPoint worldMapPoint : worldMapPoints)
{
Rectangle clickbox = worldMapPoint.getClickbox();
if (clickbox != null && clickbox.contains(mousePos.getX(), mousePos.getY()))
{
if (worldMapPoint.isJumpOnClick())
{
// jump map to target, or position of point
WorldPoint target = worldMapPoint.getTarget();
if (target == null)
{
target = worldMapPoint.getWorldPoint();
}
RenderOverview renderOverview = client.getRenderOverview();
renderOverview.setWorldMapPositionTarget(target);
}
e.consume();
return worldMapPoint.onClick(e);
}
}
}
return e;
}
@Override
public MouseEvent mouseMoved(MouseEvent mouseEvent)
{
final List<WorldMapPoint> worldMapPoints = worldMapPointManager.getWorldMapPoints();
if (worldMapPoints.isEmpty())
{
return mouseEvent;
}
final Point mousePos = client.getMouseCanvasPosition();
final Widget view = client.getWidget(WidgetInfo.WORLD_MAP_VIEW);
if (view == null)
{
return mouseEvent;
}
final Rectangle worldMapDisplay = view.getBounds();
if (worldMapDisplay == null || !worldMapDisplay.contains(mousePos.getX(), mousePos.getY()))
{
if (tooltipPoint != null)
{
tooltipPoint.setTooltipVisible(false);
tooltipPoint = null;
final Widget rsTooltip = client.getWidget(WidgetInfo.WORLD_MAP_TOOLTIP);
if (rsTooltip != null)
{
rsTooltip.setHidden(false);
}
}
return mouseEvent;
}
if (tooltipPoint != null)
{
if (tooltipPoint.getClickbox() != null
&& tooltipPoint.getClickbox().contains(mousePos.getX(), mousePos.getY()))
{
return mouseEvent;
}
else
{
tooltipPoint.setTooltipVisible(false);
tooltipPoint = null;
final Widget rsTooltip = client.getWidget(WidgetInfo.WORLD_MAP_TOOLTIP);
if (rsTooltip != null)
{
rsTooltip.setHidden(false);
}
}
}
for (WorldMapPoint worldMapPoint : worldMapPointManager.getWorldMapPoints())
{
if (worldMapPoint.getClickbox() != null
&& worldMapPoint.getClickbox().contains(mousePos.getX(), mousePos.getY())
&& worldMapPoint.getTooltip() != null)
{
worldMapPoint.setTooltipVisible(true);
tooltipPoint = worldMapPoint;
final Widget rsTooltip = client.getWidget(WidgetInfo.WORLD_MAP_TOOLTIP);
if (rsTooltip != null)
{
rsTooltip.setHidden(true);
}
return mouseEvent;
}
}
return mouseEvent;
}
}

View File

@@ -24,8 +24,6 @@
*/
package net.runelite.client.ui.overlay.worldmap;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import javax.annotation.Nullable;
import lombok.Data;
@@ -53,8 +51,6 @@ public class WorldMapPoint
*/
private Point imagePoint;
private Rectangle clickbox;
private boolean snapToEdge;
private boolean currentlyEdgeSnapped;
@@ -64,7 +60,10 @@ public class WorldMapPoint
*/
private boolean jumpOnClick;
private boolean tooltipVisible;
/**
* Name in menu option when {@link #jumpOnClick} is set
*/
private String name;
private String tooltip;
@@ -74,11 +73,6 @@ public class WorldMapPoint
this.image = image;
}
public MouseEvent onClick(MouseEvent e)
{
return e;
}
public void onEdgeSnap()
{
}