Merge branch 'master' into an-not-taters

This commit is contained in:
Ganom
2019-11-20 16:20:25 -05:00
committed by GitHub
141 changed files with 1064 additions and 608 deletions

View File

@@ -10,12 +10,6 @@ jobs:
steps:
- uses: actions/checkout@v1
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Update Gradle Wrapper
@@ -28,4 +22,4 @@ jobs:
PULL_REQUEST_TITLE: 'project: Update gradle wrapper'
PULL_REQUEST_BODY: This is an auto-generated PR with an updated gradle version
COMMIT_MESSAGE: 'project: Update gradle wrapper'
PULL_REQUEST_LABELS: automated-pull-request, gradle
PULL_REQUEST_LABELS: automated-pull-request, gradle

View File

@@ -10,12 +10,6 @@ jobs:
steps:
- uses: actions/checkout@v1
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
@@ -42,4 +36,4 @@ jobs:
PULL_REQUEST_TITLE: 'Client: Update NPC stats'
PULL_REQUEST_BODY: This is an auto-generated PR with changes from the OSRS wiki
COMMIT_MESSAGE: 'Client: Update NPC stats'
PULL_REQUEST_LABELS: automated-pull-request, NPC stats
PULL_REQUEST_LABELS: automated-pull-request, NPC stats

View File

@@ -1,85 +1,42 @@
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.register
import java.io.File
import org.gradle.kotlin.dsl.*
class BootstrapPlugin : Plugin<Project> {
override fun apply(project: Project) {
project.tasks.register<BootstrapTask>("bootstrapStaging") {
dependsOn("jar")
dependsOn("shadowJar")
type = "staging"
clientJar = project.tasks["jar"].outputs.files.singleFile
dependsOn(project.parent!!.project(":runelite-api").tasks["jar"])
dependsOn(project.parent!!.project(":runescape-api").tasks["jar"])
dependsOn(project.parent!!.project(":http-api").tasks["jar"])
dependsOn(project.parent!!.project(":injected-client").tasks["jar"])
doLast {
project.copy {
from(project.tasks["jar"])
from(project.parent!!.project(":runelite-api").tasks["jar"])
from(project.parent!!.project(":runescape-api").tasks["jar"])
from(project.parent!!.project(":http-api").tasks["jar"])
from(project.parent!!.project(":injected-client").tasks["jar"])
into("${project.buildDir}/bootstrap/${type}/")
}
}
override fun apply(project: Project): Unit = with(project) {
val clientJar by configurations.creating {
isCanBeConsumed = false
isCanBeResolved = true
isTransitive = false
}
val bootstrapDependencies by configurations.creating {
extendsFrom(clientJar)
isCanBeConsumed = false
isCanBeResolved = true
isTransitive = false
}
project.tasks.register<BootstrapTask>("bootstrapStable") {
dependsOn("jar")
dependsOn("shadowJar")
type = "stable"
clientJar = project.tasks["jar"].outputs.files.singleFile
dependsOn(project.parent!!.project(":runelite-api").tasks["jar"])
dependsOn(project.parent!!.project(":runescape-api").tasks["jar"])
dependsOn(project.parent!!.project(":http-api").tasks["jar"])
dependsOn(project.parent!!.project(":injected-client").tasks["jar"])
doLast {
project.copy {
from(project.tasks["jar"])
from(project.parent!!.project(":runelite-api").tasks["jar"])
from(project.parent!!.project(":runescape-api").tasks["jar"])
from(project.parent!!.project(":http-api").tasks["jar"])
from(project.parent!!.project(":injected-client").tasks["jar"])
into("${project.buildDir}/bootstrap/${type}/")
}
}
dependencies {
clientJar(tasks["jar"].outputs.files)
bootstrapDependencies(project(":runelite-api"))
bootstrapDependencies(project(":runescape-api"))
bootstrapDependencies(project(":http-api"))
bootstrapDependencies(project(":injected-client"))
}
project.tasks.register<BootstrapTask>("bootstrapNightly") {
dependsOn("jar")
dependsOn("shadowJar")
tasks.register<BootstrapTask>("bootstrapStaging", "staging")
tasks.register<BootstrapTask>("bootstrapNightly", "nightly")
tasks.register<BootstrapTask>("bootstrapStable", "stable")
type = "nightly"
clientJar = project.tasks["jar"].outputs.files.singleFile
tasks.withType<BootstrapTask> {
dependsOn(bootstrapDependencies)
dependsOn(project.parent!!.project(":runelite-api").tasks["jar"])
dependsOn(project.parent!!.project(":runescape-api").tasks["jar"])
dependsOn(project.parent!!.project(":http-api").tasks["jar"])
dependsOn(project.parent!!.project(":injected-client").tasks["jar"])
this.clientJar = clientJar.singleFile
doLast {
project.copy {
from(project.tasks["jar"])
from(project.parent!!.project(":runelite-api").tasks["jar"])
from(project.parent!!.project(":runescape-api").tasks["jar"])
from(project.parent!!.project(":http-api").tasks["jar"])
from(project.parent!!.project(":injected-client").tasks["jar"])
into("${project.buildDir}/bootstrap/${type}/")
copy {
from(bootstrapDependencies)
into("${buildDir}/bootstrap/${type}/")
}
}
}

View File

@@ -1,7 +1,6 @@
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
import org.gradle.api.tasks.TaskAction
@@ -9,12 +8,9 @@ import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.get
import java.io.File
import java.security.MessageDigest
import javax.inject.Inject
open class BootstrapTask : DefaultTask() {
@Input
@Optional
var type: String? = "stable"
open class BootstrapTask @Inject constructor(@Input val type: String) : DefaultTask() {
@InputFile
@PathSensitive(PathSensitivity.ABSOLUTE)
@@ -42,10 +38,11 @@ open class BootstrapTask : DefaultTask() {
project.configurations["runtimeClasspath"].resolvedConfiguration.resolvedArtifacts.forEach {
val module = it.moduleVersion.id.toString()
val name = module.split(":")[1]
val group = module.split(":")[0]
val version = module.split(":")[2]
var path = ""
val splat = module.split(":")
val name = splat[1]
val group = splat[0]
val version = splat[2]
lateinit var path: String
if (it.file.name.contains(ProjectVersions.rlVersion)) {
path = "https://github.com/open-osrs/hosting/raw/master/${type}/${it.file.name}"
@@ -84,7 +81,7 @@ open class BootstrapTask : DefaultTask() {
}
@TaskAction
fun boostrap() {
fun bootstrap() {
val json = JsonBuilder(
"projectVersion" to ProjectVersions.openosrsVersion,
"minimumLauncherVersion" to ProjectVersions.launcherVersion,

View File

@@ -27,9 +27,9 @@ const val kotlinVersion = "1.3.50"
object ProjectVersions {
const val launcherVersion = "2.0.4"
const val rlVersion = "1.5.41-SNAPSHOT"
const val rlVersion = "1.5.42-SNAPSHOT"
const val openosrsVersion = "2.1.13.0-SNAPSHOT"
const val openosrsVersion = "2.1.15.0-SNAPSHOT"
const val rsversion = 185
const val cacheversion = 165

View File

@@ -35,8 +35,7 @@ public enum HiscoreEndpoint
HARDCORE_IRONMAN("Hardcore Ironman", "https://services.runescape.com/m=hiscore_oldschool_hardcore_ironman/index_lite.ws"),
ULTIMATE_IRONMAN("Ultimate Ironman", "https://services.runescape.com/m=hiscore_oldschool_ultimate/index_lite.ws"),
DEADMAN("Deadman", "https://services.runescape.com/m=hiscore_oldschool_deadman/index_lite.ws"),
SEASONAL_DEADMAN("Seasonal Deadman", "https://services.runescape.com/m=hiscore_oldschool_seasonal/index_lite.ws"),
DEADMAN_TOURNAMENT("Deadman Tournament", "https://services.runescape.com/m=hiscore_oldschool_tournament/index_lite.ws");
LEAGUE("Twisted League", "https://services.runescape.com/m=hiscore_oldschool_seasonal/index_lite.ws");
private final String name;
private final HttpUrl hiscoreURL;

View File

@@ -54,6 +54,7 @@ public class HiscoreResult
private Skill runecraft;
private Skill hunter;
private Skill construction;
private Skill leaguePoints;
private Skill bountyHunterHunter;
private Skill bountyHunterRogue;
private Skill clueScrollAll;
@@ -115,6 +116,8 @@ public class HiscoreResult
return getHunter();
case CONSTRUCTION:
return getConstruction();
case LEAGUE_POINTS:
return getLeaguePoints();
case OVERALL:
return getOverall();
case BOUNTY_HUNTER_HUNTER:

View File

@@ -26,8 +26,6 @@ package net.runelite.http.api.hiscore;
import java.util.ArrayList;
import java.util.List;
import net.runelite.http.api.hiscore.HiscoreResult;
import net.runelite.http.api.hiscore.Skill;
public class HiscoreResultBuilder
{
@@ -77,9 +75,9 @@ public class HiscoreResultBuilder
hiscoreResult.setRunecraft(skills.get(21));
hiscoreResult.setHunter(skills.get(22));
hiscoreResult.setConstruction(skills.get(23));
hiscoreResult.setBountyHunterHunter(skills.get(24));
hiscoreResult.setBountyHunterRogue(skills.get(25));
hiscoreResult.setLastManStanding(skills.get(26));
hiscoreResult.setLeaguePoints(skills.get(24));
hiscoreResult.setBountyHunterHunter(skills.get(25));
hiscoreResult.setBountyHunterRogue(skills.get(26));
hiscoreResult.setClueScrollAll(skills.get(27));
hiscoreResult.setClueScrollBeginner(skills.get(28));
hiscoreResult.setClueScrollEasy(skills.get(29));
@@ -87,6 +85,7 @@ public class HiscoreResultBuilder
hiscoreResult.setClueScrollHard(skills.get(31));
hiscoreResult.setClueScrollElite(skills.get(32));
hiscoreResult.setClueScrollMaster(skills.get(33));
hiscoreResult.setLastManStanding(skills.get(34));
return hiscoreResult;
}
}

View File

@@ -50,16 +50,17 @@ public enum HiscoreSkill
RUNECRAFT("Runecraft"),
HUNTER("Hunter"),
CONSTRUCTION("Construction"),
LEAGUE_POINTS("League Points"),
BOUNTY_HUNTER_HUNTER("Bounty Hunter - Hunter"),
BOUNTY_HUNTER_ROGUE("Bounty Hunter - Rogue"),
LAST_MAN_STANDING("Last Man Standing"),
CLUE_SCROLL_ALL("Clue Scrolls (all)"),
CLUE_SCROLL_BEGINNER("Clue Scrolls (beginner)"),
CLUE_SCROLL_EASY("Clue Scrolls (easy)"),
CLUE_SCROLL_MEDIUM("Clue Scrolls (medium)"),
CLUE_SCROLL_HARD("Clue Scrolls (hard)"),
CLUE_SCROLL_ELITE("Clue Scrolls (elite)"),
CLUE_SCROLL_MASTER("Clue Scrolls (master)");
CLUE_SCROLL_MASTER("Clue Scrolls (master)"),
LAST_MAN_STANDING("Last Man Standing");
private final String name;

View File

@@ -34,6 +34,5 @@ public enum WorldType
LAST_MAN_STANDING,
TOURNAMENT,
DEADMAN,
SEASONAL_DEADMAN,
DEADMAN_TOURNAMENT
LEAGUE;
}

View File

@@ -35,9 +35,8 @@ enum ServiceWorldType
HIGH_RISK(WorldType.HIGH_RISK, 1 << 10),
LAST_MAN_STANDING(WorldType.LAST_MAN_STANDING, 1 << 14),
TOURNAMENT(WorldType.TOURNAMENT, 1 << 25),
DEADMAN_TOURNAMENT(WorldType.DEADMAN_TOURNAMENT, 1 << 26),
DEADMAN(WorldType.DEADMAN, 1 << 29),
SEASONAL_DEADMAN(WorldType.SEASONAL_DEADMAN, 1 << 30);
LEAGUE(WorldType.LEAGUE, 1 << 30);
private final WorldType apiType;
private final int mask;

View File

@@ -60,16 +60,17 @@ public class HiscoreServiceTest
+ "638177,1,0\n"
+ "516239,9,1000\n"
+ "492790,1,0\n"
+ "2,2460\n" // leagues
+ "-1,-1\n"
+ "73,1738\n"
+ "-1,-1\n"
+ "531,1432\n"
+ "324,212\n"
+ "8008,131\n"
+ "1337,911\n"
+ "42,14113\n"
+ "1,777\n"
+ "254,92\n";
+ "254,92\n"
+ "-1,-1\n"; // lms
private final MockWebServer server = new MockWebServer();
@@ -105,6 +106,7 @@ public class HiscoreServiceTest
Assert.assertEquals(777, result.getClueScrollElite().getLevel());
Assert.assertEquals(254, result.getClueScrollMaster().getRank());
Assert.assertEquals(-1, result.getLastManStanding().getLevel());
Assert.assertEquals(2460, result.getLeaguePoints().getLevel());
}
}

View File

@@ -698,7 +698,37 @@ public enum Varbits
WITHDRAW_X_AMOUNT(3960),
IN_PVP_AREA(8121);
IN_PVP_AREA(8121),
/**
* Twisted league
*/
TWISTED_LEAGUE_RELIC_1(10049),
TWISTED_LEAGUE_RELIC_2(10050),
TWISTED_LEAGUE_RELIC_3(10051),
TWISTED_LEAGUE_RELIC_4(10052),
TWISTED_LEAGUE_RELIC_5(10053),
/**
* Value of hotkey varbits can be 0-13
* 0 corresponds to no hotkey set
* 1-12 correspond to F1-F12 respectively
* 13 corresponds to escape
*/
COMBAT_TAB_HOTKEY(4675),
STATS_TAB_HOTKEY(4676),
QUESTS_TAB_HOTKEY(4677),
INVENTORY_TAB_HOTKEY(4678),
EQUIPMENT_TAB_HOTKEY(4679),
PRAYER_TAB_HOTKEY(4680),
SPELLBOOK_TAB_HOTKEY(4682),
FRIENDS_TAB_HOTKEY(4684),
ACCOUNT_MANAGEMENT_TAB_HOTKEY(6517),
LOGOUT_TAB_HOTKEY(4689),
OPTIONS_TAB_HOTKEY(4686),
EMOTES_TAB_HOTKEY(4687),
CLAN_TAB_HOTKEY(4683),
MUSIC_TAB_HOTKEY(4688);
/**
* The raw varbit ID.

View File

@@ -1,3 +1,27 @@
/*
* Copyright (c) 2018, Tomas Slusny <slusnucky@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.api;
import java.util.Collection;
@@ -36,18 +60,14 @@ public enum WorldType
* Tournament world type.
*/
TOURNAMENT(1 << 25),
/**
* Deadman Tournament world type.
*/
DEADMAN_TOURNAMENT(1 << 26),
/**
* Deadman world type.
*/
DEADMAN(1 << 29),
/**
* Seasonal deadman world type.
* League world type
*/
SEASONAL_DEADMAN(1 << 30);
LEAGUE(1 << 30);
private final int mask;
@@ -58,44 +78,34 @@ public enum WorldType
private static final EnumSet<WorldType> PVP_WORLD_TYPES = EnumSet.of(
DEADMAN,
DEADMAN_TOURNAMENT,
PVP,
SEASONAL_DEADMAN
PVP
);
private static final EnumSet<WorldType> DEADMAN_WORLD_TYPES = EnumSet.of(
DEADMAN,
DEADMAN_TOURNAMENT,
SEASONAL_DEADMAN
DEADMAN
);
private static final EnumSet<WorldType> HIGHRISK_WORLD_TYPES = EnumSet.of(
HIGH_RISK
);
private static final EnumSet<WorldType> ALL_HIGHRISK_WORLD_TYPES = EnumSet.of(
HIGH_RISK,
DEADMAN,
DEADMAN_TOURNAMENT,
SEASONAL_DEADMAN
DEADMAN
);
private static final EnumSet<WorldType> ALL_PVP_WORLD_TYPES = EnumSet.of(
HIGH_RISK,
DEADMAN,
DEADMAN_TOURNAMENT,
PVP,
SEASONAL_DEADMAN
PVP
);
private static final EnumSet<WorldType> ALL_PK_WORLD_TYPES = EnumSet.of(
HIGH_RISK,
DEADMAN,
DEADMAN_TOURNAMENT,
PVP,
SEASONAL_DEADMAN,
BOUNTY
);
);
/**
* Create enum set of world types from mask.
@@ -137,10 +147,10 @@ public enum WorldType
}
/**
* Checks whether a world having a {@link Collection} of {@link WorldType}s is a PVP/DEADMAN/HIGHRISK world.
* Checks whether a world having a {@link Collection} of {@link WorldType}s is a PVP world.
*
* @param worldTypes A {@link Collection} of {@link WorldType}s describing the given world.
* @return True if the given worldtypes of the world are a PVP/DEADMAN/HIGHRISK world, false otherwise.
* @return True if the given worldtypes of the world are a PVP world, false otherwise.
* @see Client#getWorldType()
*/
public static boolean isPvpWorld(final Collection<WorldType> worldTypes)
@@ -157,19 +167,19 @@ public enum WorldType
{
return worldTypes.stream().anyMatch(HIGHRISK_WORLD_TYPES::contains);
}
public static boolean isAllHighRiskWorld(final Collection<WorldType> worldTypes)
{
return worldTypes.stream().anyMatch(ALL_HIGHRISK_WORLD_TYPES::contains);
}
public static boolean isAllPvpWorld(final Collection<WorldType> worldTypes)
{
return worldTypes.stream().anyMatch(ALL_PVP_WORLD_TYPES::contains);
}
public static boolean isAllPKWorld(final Collection<WorldType> worldTypes)
{
return worldTypes.stream().anyMatch(ALL_PK_WORLD_TYPES::contains);
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Matthew Steglinski <https://github.com/sainttx>
* Copyright (c) 2019, Adam <Adam@sigterm.info>
* 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;
}

View File

@@ -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,180 @@ public class WidgetID
static final int FILTERED_SPELLS_PARENT = 1;
static final int FILTERED_SPELLS_BOUNDS = 3;
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;
// 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 LUMBRIDGE_HOME_TELEPORT = 5;
static final int WIND_STRIKE = 6;
static final int CONFUSE = 7;
static final int ENCHANT_CROSSBOW_BOLT = 8;
static final int WATER_STRIKE = 9;
static final int LVL_1_ENCHANT = 10;
static final int EARTH_STRIKE = 11;
static final int WEAKEN = 12;
static final int FIRE_STRIKE = 13;
static final int BONES_TO_BANANAS = 14;
static final int WIND_BOLT = 15;
static final int CURSE = 16;
static final int BIND = 17;
static final int LOW_LEVEL_ALCHEMY = 18;
static final int WATER_BOLT = 19;
static final int VARROCK_TELEPORT = 20;
static final int LVL_2_ENCHANT = 21;
static final int EARTH_BOLT = 22;
static final int LUMBRIDGE_TELEPORT = 23;
static final int TELEKINETIC_GRAB = 24;
static final int FIRE_BOLT = 25;
static final int FALADOR_TELEPORT = 26;
static final int CRUMBLE_UNDEAD = 27;
static final int TELEPORT_TO_HOUSE = 28;
static final int WIND_BLAST = 29;
static final int SUPERHEAT_ITEM = 30;
static final int CAMELOT_TELEPORT = 31;
static final int WATER_BLAST = 32;
static final int LVL_3_ENCHANT = 33;
static final int IBAN_BLAST = 34;
static final int SNARE = 35;
static final int MAGIC_DART = 36;
static final int ARDOUGNE_TELEPORT = 37;
static final int EARTH_BLAST = 38;
static final int HIGH_LEVEL_ALCHEMY = 39;
static final int CHARGE_WATER_ORB = 40;
static final int LVL_4_ENCHANT = 41;
static final int WATCHTOWER_TELEPORT = 42;
static final int FIRE_BLAST = 43;
static final int CHARGE_EARTH_ORB = 44;
static final int BONES_TO_PEACHES = 45;
static final int SARADOMIN_STRIKE = 46;
static final int CLAWS_OF_GUTHIX = 47;
static final int FLAMES_OF_ZAMORAK = 48;
static final int TROLLHEIM_TELEPORT = 49;
static final int WIND_WAVE = 50;
static final int CHARGE_FIRE_ORB = 51;
static final int TELEPORT_TO_APE_ATOLL = 52;
static final int WATER_WAVE = 53;
static final int CHARGE_AIR_ORB = 54;
static final int VULNERABILITY = 55;
static final int LVL_5_ENCHANT = 56;
static final int TELEPORT_TO_KOUREND = 57;
static final int EARTH_WAVE = 58;
static final int ENFEEBLE = 59;
static final int TELEOTHER_LUMBRIDGE = 60;
static final int FIRE_WAVE = 61;
static final int ENTANGLE = 62;
static final int STUN = 63;
static final int CHARGE = 64;
static final int WIND_SURGE = 65;
static final int TELEOTHER_FALADOR = 66;
static final int WATER_SURGE = 67;
static final int TELE_BLOCK = 68;
static final int BOUNTY_TARGET_TELEPORT = 69;
static final int LVL_6_ENCHANT = 70;
static final int TELEOTHER_CAMELOT = 71;
static final int EARTH_SURGE = 72;
static final int LVL_7_ENCHANT = 73;
static final int FIRE_SURGE = 74;
// 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 final int ICE_RUSH = 75;
static final int ICE_BLITZ = 76;
static final int ICE_BURST = 77;
static final int ICE_BARRAGE = 78;
static final int BLOOD_RUSH = 79;
static final int BLOOD_BLITZ = 80;
static final int BLOOD_BURST = 81;
static final int BLOOD_BARRAGE = 82;
static final int SMOKE_RUSH = 83;
static final int SMOKE_BLITZ = 84;
static final int SMOKE_BURST = 85;
static final int SMOKE_BARRAGE = 86;
static final int SHADOW_RUSH = 87;
static final int SHADOW_BLITZ = 88;
static final int SHADOW_BURST = 89;
static final int SHADOW_BARRAGE = 90;
static final int PADDEWWA_TELEPORT = 91;
static final int SENNTISTEN_TELEPORT = 92;
static final int KHARYRLL_TELEPORT = 93;
static final int LASSAR_TELEPORT = 94;
static final int DAREEYAK_TELEPORT = 95;
static final int CARRALLANGER_TELEPORT = 96;
static final int ANNAKARL_TELEPORT = 97;
static final int GHORROCK_TELEPORT = 98;
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 final int LUNAR_HOME_TELEPORT = 100;
static final int BAKE_PIE = 101;
static final int CURE_PLANT = 102;
static final int MONSTER_EXAMINE = 103;
static final int NPC_CONTACT = 104;
static final int CURE_OTHER = 105;
static final int HUMIDIFY = 106;
static final int MOONCLAN_TELEPORT = 107;
static final int TELE_GROUP_MOONCLAN = 108;
static final int CURE_ME = 109;
static final int HUNTER_KIT = 110;
static final int WATERBIRTH_TELEPORT = 111;
static final int TELE_GROUP_WATERBIRTH = 112;
static final int CURE_GROUP = 113;
static final int STAT_SPY = 114;
static final int BARBARIAN_TELEPORT = 115;
static final int TELE_GROUP_BARBARIAN = 116;
static final int SUPERGLASS_MAKE = 117;
static final int TAN_LEATHER = 118;
static final int KHAZARD_TELEPORT = 119;
static final int TELE_GROUP_KHAZARD = 120;
static final int DREAM = 121;
static final int STRING_JEWELLERY = 122;
static final int STAT_RESTORE_POT_SHARE = 123;
static final int MAGIC_IMBUE = 124;
static final int FERTILE_SOIL = 125;
static final int BOOST_POTION_SHARE = 126;
static final int FISHING_GUILD_TELEPORT = 127;
static final int TELE_GROUP_FISHING_GUILD = 128;
static final int PLANK_MAKE = 129;
static final int CATHERBY_TELEPORT = 130;
static final int TELE_GROUP_CATHERBY = 131;
static final int RECHARGE_DRAGONSTONE = 132;
static final int ICE_PLATEAU_TELEPORT = 133;
static final int TELE_GROUP_ICE_PLATEAU = 134;
static final int ENERGY_TRANSFER = 135;
static final int HEAL_OTHER = 136;
static final int VENGEANCE_OTHER = 137;
static final int VENGEANCE = 138;
static final int HEAL_GROUP = 139;
static final int SPELLBOOK_SWAP = 140;
static final int GEOMANCY = 141;
static final int SPIN_FLAX = 142;
static final int OURANIA_TELEPORT = 143;
// ARCEUUS SPELLS
static final int ARCEUUS_HOME_TELEPORT = 143;
static final int BATTLEFRONT_TELEPORT = 178;
static final int ARCEUUS_HOME_TELEPORT = 144;
static final int BATTLEFRONT_TELEPORT = 179;
}
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 StandardSpellBook
{
static final int LUMBRIDGE_HOME_TELEPORT = 5;
}
static class AncientSpellBook
{
static final int EDGEVILLE_HOME_TELEPORT = 99;
}
static class LunarSpellBook
{
static final int LUNAR_HOME_TELEPORT = 100;
}
static class ArceuusSpellBook
{
static final int ARCEUUS_HOME_TELEPORT = 144;
}
static class Pvp

View File

@@ -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,7 +526,7 @@ 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*/
/* 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),
@@ -595,7 +597,7 @@ public enum WidgetInfo
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*/
/* END OF STANDARD SPELL BOOK WIDGETS*/
/* ANCIENT SPELL BOOK WIDGETS*/
SPELL_ICE_RUSH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ICE_RUSH),
@@ -624,9 +626,9 @@ public enum WidgetInfo
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*/
/* END OF ANCIENT SPELL BOOK WIDGETS*/
/* LUNAR 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),
@@ -672,18 +674,17 @@ public enum WidgetInfo
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*/
/* END OF LUNAR SPELL BOOK WIDGETS*/
SPELL_TOOLTIP(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TOOLTIP),
/* ARCEUUS SPELL BOOK WIDGETS*/
/* 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*/
/* 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),
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 +695,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 +756,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),

View File

@@ -192,9 +192,9 @@ public class Notifier
case SOLID_UNTIL_CANCELLED:
case FLASH_UNTIL_CANCELLED:
// Any interaction with the client since the notification started will cancel it after the minimum duration
if (client.getMouseIdleTicks() < MINIMUM_FLASH_DURATION_TICKS
if ((client.getMouseIdleTicks() < MINIMUM_FLASH_DURATION_TICKS
|| client.getKeyboardIdleTicks() < MINIMUM_FLASH_DURATION_TICKS
|| client.getMouseLastPressedMillis() > mouseLastPressedMillis)
|| client.getMouseLastPressedMillis() > mouseLastPressedMillis) && clientUI.isFocused())
{
flashStart = null;
}

View File

@@ -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;
@@ -86,6 +87,7 @@ import org.slf4j.LoggerFactory;
public class RuneLite
{
public static final File RUNELITE_DIR = new File(System.getProperty("user.home"), ".runelite");
public static final File CACHE_DIR = new File(RUNELITE_DIR, "cache");
public static final File PROFILES_DIR = new File(RUNELITE_DIR, "profiles");
public static final File PLUGIN_DIR = new File(RUNELITE_DIR, "plugins");
public static final File SCREENSHOT_DIR = new File(RUNELITE_DIR, "screenshots");
@@ -367,6 +369,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);

View File

@@ -75,7 +75,7 @@ public class RuneLiteModule extends AbstractModule
bindConstant().annotatedWith(Names.named("developerMode")).to(developerMode);
bind(ScheduledExecutorService.class).toInstance(new ExecutorServiceExceptionLogger(Executors.newSingleThreadScheduledExecutor()));
bind(OkHttpClient.class).toInstance(RuneLiteAPI.CLIENT.newBuilder()
.cache(new Cache(new File(RuneLite.RUNELITE_DIR, "cache" + File.separator + "okhttp"), MAX_OKHTTP_CACHE_SIZE))
.cache(new Cache(new File(RuneLite.CACHE_DIR, "okhttp"), MAX_OKHTTP_CACHE_SIZE))
.build());
bind(MenuManager.class);
bind(ChatMessageManager.class);

View File

@@ -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);
}
}

View File

@@ -105,7 +105,7 @@ public class AttackStylesPlugin extends Plugin
private boolean warnForRanged;
private boolean warnForMagic;
private boolean hideAutoRetaliate;
private boolean removeWarnedStyles;
boolean removeWarnedStyles;
@Override
protected void startUp() throws Exception
@@ -144,7 +144,7 @@ public class AttackStylesPlugin extends Plugin
hideWidget(client.getWidget(WidgetInfo.COMBAT_AUTO_RETALIATE), false);
}
@Nullable
@Nullable
public AttackStyle getAttackStyle()
{
return attackStyle;
@@ -156,7 +156,7 @@ public class AttackStylesPlugin extends Plugin
}
@Subscribe
private void onWidgetHiddenChanged(WidgetHiddenChanged event)
void onWidgetHiddenChanged(WidgetHiddenChanged event)
{
if (event.getWidget().isSelfHidden() || TO_GROUP(event.getWidget().getId()) != COMBAT_GROUP_ID)
{

View File

@@ -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)),

View File

@@ -28,6 +28,7 @@ package net.runelite.client.plugins.chatcommands;
import com.google.inject.Provides;
import io.reactivex.schedulers.Schedulers;
import java.io.IOException;
import java.util.EnumSet;
import java.util.List;
import java.util.concurrent.ScheduledExecutorService;
import java.util.regex.Matcher;
@@ -42,8 +43,10 @@ import net.runelite.api.Experience;
import net.runelite.api.IconID;
import net.runelite.api.ItemDefinition;
import net.runelite.api.MessageNode;
import net.runelite.api.Player;
import net.runelite.api.VarPlayer;
import net.runelite.api.Varbits;
import net.runelite.api.WorldType;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.GameTick;
import net.runelite.api.events.VarbitChanged;
@@ -1147,31 +1150,28 @@ public class ChatCommandsPlugin extends Plugin
*/
private HiscoreLookup getCorrectLookupFor(final ChatMessage chatMessage)
{
final String player;
final HiscoreEndpoint ironmanStatus;
Player localPlayer = client.getLocalPlayer();
final String player = sanitize(chatMessage.getName());
if (chatMessage.getType().equals(ChatMessageType.PRIVATECHATOUT))
// If we are sending the message then just use the local hiscore endpoint for the world
if (chatMessage.getType().equals(ChatMessageType.PRIVATECHATOUT)
|| player.equals(localPlayer.getName()))
{
player = client.getLocalPlayer().getName();
ironmanStatus = hiscoreEndpoint;
return new HiscoreLookup(localPlayer.getName(), hiscoreEndpoint);
}
else
{
player = sanitize(chatMessage.getName());
if (player.equals(client.getLocalPlayer().getName()))
// Public chat on a leagues world is always league hiscores, regardless of icon
if (chatMessage.getType() == ChatMessageType.PUBLICCHAT || chatMessage.getType() == ChatMessageType.MODCHAT)
{
if (client.getWorldType().contains(WorldType.LEAGUE))
{
// Get ironman status from for the local player
ironmanStatus = hiscoreEndpoint;
}
else
{
// Get ironman status from their icon in chat
ironmanStatus = getHiscoreEndpointByName(chatMessage.getName());
return new HiscoreLookup(player, HiscoreEndpoint.LEAGUE);
}
}
return new HiscoreLookup(player, ironmanStatus);
// Get ironman status from their icon in chat
HiscoreEndpoint endpoint = getHiscoreEndpointByName(chatMessage.getName());
return new HiscoreLookup(player, endpoint);
}
/**
@@ -1210,6 +1210,12 @@ public class ChatCommandsPlugin extends Plugin
*/
private HiscoreEndpoint getLocalHiscoreEndpointType()
{
EnumSet<WorldType> worldType = client.getWorldType();
if (worldType.contains(WorldType.LEAGUE))
{
return HiscoreEndpoint.LEAGUE;
}
return toEndPoint(client.getAccountType());
}

View File

@@ -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.")

View File

@@ -68,6 +68,10 @@ public class HotColdClue extends ClueScroll implements LocationClueScroll, Locat
"Jorral",
"Speak to Jorral to receive a strange device.",
new WorldPoint(2436, 3347, 0));
private static final HotColdClue MASTER_CLUE_LEAGUE = new HotColdClue("Buried beneath the ground, who knows where it's found. Lucky for you, A man called Watson may have a clue.",
"Watson",
"Speak to Watson to receive a strange device.",
new WorldPoint(1645, 3572, 0));
private final String text;
private final String npc;
@@ -89,6 +93,11 @@ public class HotColdClue extends ClueScroll implements LocationClueScroll, Locat
MASTER_CLUE.reset();
return MASTER_CLUE;
}
else if (MASTER_CLUE_LEAGUE.text.equalsIgnoreCase(text))
{
MASTER_CLUE_LEAGUE.reset();
return MASTER_CLUE_LEAGUE;
}
return null;
}
@@ -272,11 +281,11 @@ public class HotColdClue extends ClueScroll implements LocationClueScroll, Locat
final Set<HotColdTemperature> temperatureSet;
if (this.equals(BEGINNER_CLUE))
if (this == BEGINNER_CLUE)
{
temperatureSet = HotColdTemperature.BEGINNER_HOT_COLD_TEMPERATURES;
}
else if (this.equals(MASTER_CLUE))
else if (this == MASTER_CLUE || this == MASTER_CLUE_LEAGUE)
{
temperatureSet = HotColdTemperature.MASTER_HOT_COLD_TEMPERATURES;
}
@@ -300,8 +309,9 @@ public class HotColdClue extends ClueScroll implements LocationClueScroll, Locat
return false;
}
if ((this.equals(BEGINNER_CLUE) && temperature == HotColdTemperature.BEGINNER_VISIBLY_SHAKING)
|| (this.equals(MASTER_CLUE) && temperature == HotColdTemperature.MASTER_VISIBLY_SHAKING))
boolean master = this == MASTER_CLUE || this == MASTER_CLUE_LEAGUE;
if ((this == BEGINNER_CLUE && temperature == HotColdTemperature.BEGINNER_VISIBLY_SHAKING)
|| (master && temperature == HotColdTemperature.MASTER_VISIBLY_SHAKING))
{
markFinalSpot(localWorld);
}
@@ -327,11 +337,11 @@ public class HotColdClue extends ClueScroll implements LocationClueScroll, Locat
{
final boolean isBeginner;
if (this.equals(BEGINNER_CLUE))
if (this == BEGINNER_CLUE)
{
isBeginner = true;
}
else if (this.equals(MASTER_CLUE))
else if (this == MASTER_CLUE || this == MASTER_CLUE_LEAGUE)
{
isBeginner = false;
}

View File

@@ -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)),

View File

@@ -47,7 +47,6 @@ import net.runelite.api.coords.WorldPoint;
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;
@@ -81,6 +80,7 @@ public class DeathIndicatorPlugin extends Plugin
static final int HIJACKED_ITEMID = 0x69696969;
private static final Set<Integer> RESPAWN_REGIONS = ImmutableSet.of(
6457, // Kourend
12850, // Lumbridge
11828, // Falador
12342, // Edgeville
@@ -201,7 +201,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);
@@ -220,9 +219,29 @@ public class DeathIndicatorPlugin extends Plugin
}
}
@Subscribe
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)
@@ -293,25 +312,6 @@ public class DeathIndicatorPlugin extends Plugin
}
}
@Subscribe
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();
}
@Subscribe
private void onGameTick(GameTick event)
{
@@ -543,4 +543,4 @@ public class DeathIndicatorPlugin extends Plugin
{
return itemManager.getImage(ItemID.BONES);
}
}
}

View File

@@ -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);
}

View File

@@ -97,6 +97,11 @@ public class DefaultWorldPlugin extends Plugin
@Subscribe
private void onGameStateChanged(GameStateChanged event)
{
if (event.getGameState() == GameState.LOGGED_IN)
{
config.lastWorld(client.getWorld());
}
applyWorld();
}
@@ -160,7 +165,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);
}
}

View File

@@ -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<String, Emoji> emojiMap;

View File

@@ -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;
@@ -342,56 +343,11 @@ public class XpDropPlugin extends Plugin
}
@Subscribe
private void onScriptCallbackEvent(ScriptCallbackEvent e)
private void onFakeXpDrop(FakeXpDrop fakeXpDrop)
{
if (this.showdamagedrops == XpDropConfig.DamageMode.NONE)
if (fakeXpDrop.getSkill() == Skill.HITPOINTS)
{
return;
}
final String eventName = e.getEventName();
if (eventName.equals("newXpDrop"))
{
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();
final int intStackSize = client.getIntStackSize();
final int exp = intStack[intStackSize - 1];
calculateDamageDealt(exp);
}
else if (eventName.equals("xpDropAddDamage")
&& damageMode == XpDropConfig.DamageMode.IN_XP_DROP
&& damage > 0)
{
final String[] stringStack = client.getStringStack();
final int stringStackSize = client.getStringStackSize();
String builder =
stringStack[stringStackSize - 1]
+ ColorUtil.colorTag(this.damageColor)
+ " ("
+ damage
+ ")";
stringStack[stringStackSize - 1] = builder;
calculateDamageDealt(fakeXpDrop.getXp());
}
}
@@ -442,4 +398,4 @@ public class XpDropPlugin extends Plugin
this.showdamagedrops = config.showdamagedrops();
this.damageColor = config.getDamageColor();
}
}
}

View File

@@ -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.Subscribe;
@@ -196,7 +196,7 @@ public class FreezeTimersPlugin extends Plugin
}
@Subscribe
private void onLocalPlayerDeath(LocalPlayerDeath event)
private void onPlayerDeath(PlayerDeath event)
{
final Player localPlayer = client.getLocalPlayer();
final long currentTime = System.currentTimeMillis();
@@ -272,4 +272,4 @@ public class FreezeTimersPlugin extends Plugin
this.fontStyle = config.fontStyle();
this.textSize = config.textSize();
}
}
}

View File

@@ -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<ItemPrice> result = itemManager.search(lookup);
private void priceLookup(boolean exactMatch)
{
if (!updateSearch())
{
return;
}
List<ItemPrice> 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<ItemPrice> result, String lookup, boolean exactMatch)

View File

@@ -82,6 +82,7 @@ import static net.runelite.http.api.hiscore.HiscoreSkill.HERBLORE;
import static net.runelite.http.api.hiscore.HiscoreSkill.HITPOINTS;
import static net.runelite.http.api.hiscore.HiscoreSkill.HUNTER;
import static net.runelite.http.api.hiscore.HiscoreSkill.LAST_MAN_STANDING;
import static net.runelite.http.api.hiscore.HiscoreSkill.LEAGUE_POINTS;
import static net.runelite.http.api.hiscore.HiscoreSkill.MAGIC;
import static net.runelite.http.api.hiscore.HiscoreSkill.MINING;
import static net.runelite.http.api.hiscore.HiscoreSkill.OVERALL;
@@ -275,6 +276,7 @@ public class HiscorePanel extends PluginPanel
minigamePanel.setBackground(ColorScheme.DARKER_GRAY_COLOR);
minigamePanel.add(makeSkillPanel(CLUE_SCROLL_ALL));
minigamePanel.add(makeSkillPanel(LEAGUE_POINTS));
minigamePanel.add(makeSkillPanel(LAST_MAN_STANDING));
minigamePanel.add(makeSkillPanel(BOUNTY_HUNTER_ROGUE));
minigamePanel.add(makeSkillPanel(BOUNTY_HUNTER_HUNTER));
@@ -470,15 +472,17 @@ public class HiscorePanel extends PluginPanel
case 0:
return null;
case 1:
return HiscoreSkill.OVERALL;
return OVERALL;
case 2:
return HiscoreSkill.CLUE_SCROLL_ALL;
return CLUE_SCROLL_ALL;
case 3:
return HiscoreSkill.LAST_MAN_STANDING;
return LEAGUE_POINTS;
case 4:
return HiscoreSkill.BOUNTY_HUNTER_ROGUE;
return LAST_MAN_STANDING;
case 5:
return HiscoreSkill.BOUNTY_HUNTER_HUNTER;
return BOUNTY_HUNTER_ROGUE;
case 6:
return BOUNTY_HUNTER_HUNTER;
}
return null;
@@ -562,6 +566,12 @@ public class HiscorePanel extends PluginPanel
content += "<p><span style = 'color:white'>Rank:</span> " + rank + "</p>";
break;
}
case LEAGUE_POINTS:
{
String rank = (result.getLeaguePoints().getRank() == -1) ? "Unranked" : QuantityFormatter.formatNumber(result.getLeaguePoints().getRank());
content += "<p><span style = 'color:white'>Rank:</span> " + rank + "</p>";
break;
}
case OVERALL:
{
Skill requestedSkill = result.getSkill(skill);
@@ -651,18 +661,14 @@ public class HiscorePanel extends PluginPanel
{
EnumSet<WorldType> wTypes = client.getWorldType();
if (wTypes.contains(WorldType.DEADMAN_TOURNAMENT))
{
return HiscoreEndpoint.DEADMAN_TOURNAMENT;
}
else if (wTypes.contains(WorldType.SEASONAL_DEADMAN))
{
return HiscoreEndpoint.SEASONAL_DEADMAN;
}
else if (wTypes.contains(WorldType.DEADMAN))
if (wTypes.contains(WorldType.DEADMAN))
{
return HiscoreEndpoint.DEADMAN;
}
else if (wTypes.contains(WorldType.LEAGUE))
{
return HiscoreEndpoint.LEAGUE;
}
}
return HiscoreEndpoint.NORMAL;
}

View File

@@ -956,7 +956,7 @@ public class IdleNotifierPlugin extends Plugin
final Player local = client.getLocalPlayer();
SkullIcon currentTickSkull = local.getSkullIcon();
EnumSet worldTypes = client.getWorldType();
if (!(worldTypes.contains(WorldType.DEADMAN) || worldTypes.contains(WorldType.SEASONAL_DEADMAN)))
if (!(worldTypes.contains(WorldType.DEADMAN)))
{
if (!isFirstTick)
{

View File

@@ -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);

View File

@@ -79,9 +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;
@@ -319,9 +320,9 @@ public class LootTrackerPlugin extends Plugin
}
@Subscribe
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;
@@ -1547,4 +1548,4 @@ public class LootTrackerPlugin extends Plugin
userUuidMap.put(name, user.get(USER.UNIQUEID));
}
}
}
}

View File

@@ -267,7 +267,7 @@ private void initializePaths()
private void findLinesInScene()
{
inDeadman = client.getWorldType().stream().anyMatch(x ->
x == WorldType.DEADMAN || x == WorldType.SEASONAL_DEADMAN);
x == WorldType.DEADMAN);
inPvp = client.getWorldType().stream().anyMatch(x ->
x == WorldType.PVP || x == WorldType.HIGH_RISK);

View File

@@ -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;
}
}

View File

@@ -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;
@@ -559,11 +560,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();
}
}
}

View File

@@ -176,18 +176,14 @@ private void updateMenuSubs()
}
final EnumSet<WorldType> worldType = client.getWorldType();
if (worldType.contains(WorldType.DEADMAN_TOURNAMENT))
{
hiscoreEndpoint = HiscoreEndpoint.DEADMAN_TOURNAMENT;
}
else if (worldType.contains(WorldType.SEASONAL_DEADMAN))
{
hiscoreEndpoint = HiscoreEndpoint.SEASONAL_DEADMAN;
}
else if (worldType.contains(WorldType.DEADMAN))
if (worldType.contains(WorldType.DEADMAN))
{
hiscoreEndpoint = HiscoreEndpoint.DEADMAN;
}
else if (worldType.contains(WorldType.LEAGUE))
{
hiscoreEndpoint = HiscoreEndpoint.LEAGUE;
}
else
{
hiscoreEndpoint = HiscoreEndpoint.NORMAL;

View File

@@ -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;
@@ -225,25 +225,9 @@ public class PerformanceStatsPlugin extends Plugin
}
@Subscribe
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())
@@ -251,7 +235,7 @@ public class PerformanceStatsPlugin extends Plugin
enable();
}
final int exp = intStack[intStackSize - 1];
final int exp = fakeXpDrop.getXp();
performance.addDamageDealt(calculateDamageDealt(exp), client.getTickCount());
}
}
@@ -469,4 +453,4 @@ public class PerformanceStatsPlugin extends Plugin
this.submitTimeout = config.submitTimeout();
}
}
}

View File

@@ -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;
@@ -323,17 +322,13 @@ public class ScreenshotPlugin extends Plugin
}
@Subscribe
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");
}
}
@Subscribe
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()
@@ -704,16 +699,16 @@ public class ScreenshotPlugin extends Plugin
if (client.getLocalPlayer() != null && client.getLocalPlayer().getName() != null)
{
final EnumSet<WorldType> worldTypes = client.getWorldType();
final boolean dmm = worldTypes.contains(WorldType.DEADMAN);
final boolean sdmm = worldTypes.contains(WorldType.SEASONAL_DEADMAN);
final boolean dmmt = worldTypes.contains(WorldType.DEADMAN_TOURNAMENT);
final boolean isDmmWorld = dmm || sdmm || dmmt;
String playerDir = client.getLocalPlayer().getName();
if (isDmmWorld)
if (worldTypes.contains(WorldType.DEADMAN))
{
playerDir += "-Deadman";
}
else if (worldTypes.contains(WorldType.LEAGUE))
{
playerDir += "-League";
}
playerFolder = new File(SCREENSHOT_DIR, playerDir);
}
else
@@ -896,4 +891,4 @@ public class ScreenshotPlugin extends Plugin
this.screenshotUntradeableDrop = config.screenshotUntradeableDrop();
this.hotkey = config.hotkey();
}
}
}

View File

@@ -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));

View File

@@ -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.Subscribe;
@@ -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;
@@ -141,6 +144,25 @@ public class SpecialCounterPlugin extends Plugin
specialUsed = true;
specialHitpointsExperience = client.getSkillExperience(Skill.HITPOINTS);
specialHitpointsGained = -1;
}
@Subscribe
private void onStatChanged(StatChanged statChanged)
{
if (specialUsed && statChanged.getSkill() == Skill.HITPOINTS)
{
specialHitpointsGained = statChanged.getXp() - specialHitpointsExperience;
}
}
@Subscribe
private void onFakeXpDrop(FakeXpDrop fakeXpDrop)
{
if (specialUsed && fakeXpDrop.getSkill() == Skill.HITPOINTS)
{
specialHitpointsGained = fakeXpDrop.getXp();
}
}
@Subscribe
@@ -152,13 +174,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)
{

View File

@@ -80,6 +80,7 @@ public class StatusOrbsPlugin extends Plugin
private static final int SPEC_REGEN_TICKS = 50;
private static final int NORMAL_HP_REGEN_TICKS = 100;
private static final int TWISTED_LEAGUE_ENDLESS_ENDURANCE_RELIC = 2;
@Inject
private Client client;
@@ -248,6 +249,12 @@ public class StatusOrbsPlugin extends Plugin
hpPerMs *= 2;
}
if (client.getVar(Varbits.TWISTED_LEAGUE_RELIC_1) == TWISTED_LEAGUE_ENDLESS_ENDURANCE_RELIC)
{
ticksPerHPRegen /= 4;
hpPerMs *= 4;
}
ticksSinceHPRegen = (ticksSinceHPRegen + 1) % ticksPerHPRegen;
hitpointsPercentage = ticksSinceHPRegen / (double) ticksPerHPRegen;

View File

@@ -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;

View File

@@ -58,7 +58,7 @@ import net.runelite.api.events.ChatMessage;
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;
@@ -563,9 +563,7 @@ public class TimersPlugin extends Plugin
}
else if (HALF_TELEBLOCK_PATTERN.matcher(event.getMessage()).find())
{
if (client.getWorldType().contains(WorldType.DEADMAN)
&& !client.getWorldType().contains(WorldType.SEASONAL_DEADMAN)
&& !client.getWorldType().contains(WorldType.DEADMAN_TOURNAMENT))
if (client.getWorldType().contains(WorldType.DEADMAN))
{
createGameTimer(DMM_FULLTB);
}
@@ -925,9 +923,12 @@ public class TimersPlugin extends Plugin
}
@Subscribe
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());
}
}
@Subscribe

View File

@@ -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;
@@ -356,9 +356,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
@Subscribe
private void onLocalPlayerDeath(LocalPlayerDeath death)
private void onPlayerDeath(PlayerDeath death)
{
if (client.getLocalPlayer() == null)
if (client.getLocalPlayer() == null || death.getPlayer() != client.getLocalPlayer())
{
return;
}
@@ -393,4 +393,4 @@ public class DamageCounterPlugin extends Plugin
.runeLiteFormattedMessage(message)
.build());
}
}
}

View File

@@ -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;
@@ -168,11 +171,11 @@ public class WoodcuttingPlugin extends Plugin
}
@Subscribe
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)
{

View File

@@ -64,6 +64,7 @@ class WorldTableRow extends JPanel
private static final Color TOURNAMENT_WORLD = new Color(79, 145, 255);
private static final Color MEMBERS_WORLD = new Color(210, 193, 53);
private static final Color FREE_WORLD = new Color(200, 200, 200);
private static final Color LEAGUE_WORLD = new Color(157, 237, 1);
static
{
@@ -247,11 +248,14 @@ class WorldTableRow extends JPanel
}
else if (world.getTypes().contains(WorldType.PVP)
|| world.getTypes().contains(WorldType.HIGH_RISK)
|| world.getTypes().contains(WorldType.DEADMAN)
|| world.getTypes().contains(WorldType.SEASONAL_DEADMAN))
|| world.getTypes().contains(WorldType.DEADMAN))
{
activityField.setForeground(DANGEROUS_WORLD);
}
else if (world.getTypes().contains(WorldType.LEAGUE))
{
activityField.setForeground(LEAGUE_WORLD);
}
else if (world.getTypes().contains(WorldType.TOURNAMENT))
{
activityField.setForeground(TOURNAMENT_WORLD);

View File

@@ -0,0 +1,62 @@
/*
* Copyright (c) 2019, Dava96 <https://github.com/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;
}
}

View File

@@ -0,0 +1,39 @@
/*
* Copyright (c) 2019, Dava96 <https://github.com/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());
}
}

View File

@@ -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"),

View File

@@ -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;
}
}

View File

@@ -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
{
@@ -175,6 +176,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;
}
@@ -306,32 +308,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()
@@ -422,4 +430,4 @@ public class WorldMapPlugin extends Plugin
this.rareTreeLevelIcon = config.rareTreeLevelIcon();
this.transportationTeleportTooltips = config.transportationTeleportTooltips();
}
}
}

View File

@@ -31,8 +31,7 @@ enum XpWorldType
NORMAL,
TOURNEY,
DMM,
SDMM,
DMMT;
LEAGUE;
static XpWorldType of(WorldType type)
{
@@ -42,10 +41,8 @@ enum XpWorldType
return TOURNEY;
case DEADMAN:
return DMM;
case SEASONAL_DEADMAN:
return SDMM;
case DEADMAN_TOURNAMENT:
return DMMT;
case LEAGUE:
return LEAGUE;
default:
return NORMAL;
}

View File

@@ -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<ActionEvent> actionEventConsumer)
{
clearButton.addActionListener(actionEventConsumer::accept);
}
public void addKeyListener(Consumer<KeyEvent> keyEventConsumer)
{
addKeyListener(new net.runelite.client.input.KeyListener()

View File

@@ -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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 B

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 304 B

Some files were not shown because too many files have changed in this diff Show More