Merge branch 'master' into in-v-trans-avec
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,4 @@ import java.lang.annotation.Target;
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
@Documented
|
||||
public @interface Alpha
|
||||
{
|
||||
}
|
||||
public @interface Alpha {}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
package net.runelite.client.config;
|
||||
|
||||
public class Button
|
||||
{
|
||||
}
|
||||
public class Button {}
|
||||
|
||||
@@ -24,6 +24,4 @@
|
||||
*/
|
||||
package net.runelite.client.config;
|
||||
|
||||
public interface Config
|
||||
{
|
||||
}
|
||||
public interface Config {}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
package net.runelite.client.config;
|
||||
|
||||
public class Title
|
||||
{
|
||||
}
|
||||
public class Title {}
|
||||
|
||||
@@ -35,7 +35,4 @@ import net.runelite.api.events.Event;
|
||||
* it has nothing to do with whether an account is being logged out.
|
||||
*/
|
||||
@Data
|
||||
public class SessionClose implements Event
|
||||
{
|
||||
|
||||
}
|
||||
public class SessionClose implements Event {}
|
||||
|
||||
@@ -35,7 +35,4 @@ import net.runelite.api.events.Event;
|
||||
* it has nothing to do with whether an account is being logged in.
|
||||
*/
|
||||
@Data
|
||||
public class SessionOpen implements Event
|
||||
{
|
||||
|
||||
}
|
||||
public class SessionOpen implements Event {}
|
||||
|
||||
@@ -24,6 +24,4 @@
|
||||
*/
|
||||
package net.runelite.client.input;
|
||||
|
||||
public interface KeyListener extends java.awt.event.KeyListener
|
||||
{
|
||||
}
|
||||
public interface KeyListener extends java.awt.event.KeyListener {}
|
||||
|
||||
@@ -24,6 +24,4 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.achievementdiary;
|
||||
|
||||
public interface Requirement
|
||||
{
|
||||
}
|
||||
public interface Requirement {}
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.aoewarnings;
|
||||
|
||||
|
||||
import com.google.inject.Provides;
|
||||
import java.awt.Color;
|
||||
import java.time.Instant;
|
||||
|
||||
@@ -70,8 +70,11 @@ public class AttackStylesPlugin extends Plugin
|
||||
private int attackStyleVarbit = -1;
|
||||
private int equippedWeaponTypeVarbit = -1;
|
||||
private int castingModeVarbit = -1;
|
||||
@Getter
|
||||
@Nullable
|
||||
private AttackStyle attackStyle;
|
||||
private final Set<Skill> warnedSkills = new HashSet<>();
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private boolean warnedSkillSelected = false;
|
||||
private final Table<WeaponType, WidgetInfo, Boolean> widgetsToHide = HashBasedTable.create();
|
||||
|
||||
@@ -108,7 +111,8 @@ public class AttackStylesPlugin extends Plugin
|
||||
private boolean warnForRanged;
|
||||
private boolean warnForMagic;
|
||||
private boolean hideAutoRetaliate;
|
||||
private boolean removeWarnedStyles;
|
||||
@VisibleForTesting
|
||||
boolean removeWarnedStyles;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
@@ -159,18 +163,8 @@ public class AttackStylesPlugin extends Plugin
|
||||
eventBus.subscribe(VarbitChanged.class, this, this::onVarbitChanged);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public AttackStyle getAttackStyle()
|
||||
{
|
||||
return attackStyle;
|
||||
}
|
||||
|
||||
boolean isWarnedSkillSelected()
|
||||
{
|
||||
return warnedSkillSelected;
|
||||
}
|
||||
|
||||
private void onWidgetHiddenChanged(WidgetHiddenChanged event)
|
||||
@VisibleForTesting
|
||||
void onWidgetHiddenChanged(WidgetHiddenChanged event)
|
||||
{
|
||||
if (event.getWidget().isSelfHidden() || TO_GROUP(event.getWidget().getId()) != COMBAT_GROUP_ID)
|
||||
{
|
||||
@@ -215,6 +209,7 @@ public class AttackStylesPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void onVarbitChanged(VarbitChanged event)
|
||||
{
|
||||
int currentAttackStyleVarbit = client.getVar(VarPlayer.ATTACK_STYLE);
|
||||
@@ -240,6 +235,7 @@ public class AttackStylesPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("attackIndicator"))
|
||||
|
||||
@@ -27,6 +27,13 @@
|
||||
package net.runelite.client.plugins.barbarianassault;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Stroke;
|
||||
import java.util.Map;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Perspective;
|
||||
@@ -39,14 +46,6 @@ import net.runelite.client.ui.overlay.OverlayLayer;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.OverlayUtil;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Stroke;
|
||||
import java.awt.BasicStroke;
|
||||
import java.util.Map;
|
||||
|
||||
@Singleton
|
||||
class AboveSceneOverlay extends Overlay
|
||||
{
|
||||
|
||||
@@ -31,7 +31,6 @@ import java.awt.Graphics2D;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.image.BufferedImage;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Point;
|
||||
|
||||
@@ -26,18 +26,17 @@
|
||||
package net.runelite.client.plugins.barbarianassault;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.runelite.client.menus.AbstractComparableEntry;
|
||||
import net.runelite.client.menus.MenuManager;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
class BarbarianAssaultMenu
|
||||
{
|
||||
private final MenuManager menuManager;
|
||||
|
||||
@@ -26,15 +26,14 @@
|
||||
package net.runelite.client.plugins.barbarianassault;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.NPC;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
class Healer
|
||||
|
||||
@@ -27,7 +27,6 @@ package net.runelite.client.plugins.barbarianassault;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
|
||||
@@ -24,13 +24,12 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.barbarianassault;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
|
||||
class Timer
|
||||
{
|
||||
|
||||
@@ -25,14 +25,13 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.barbarianassault;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.image.BufferedImage;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBox;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class TimerBox extends InfoBox
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
package net.runelite.client.plugins.barbarianassault;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.awt.Color;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
@@ -35,8 +36,6 @@ import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.chat.ChatMessageBuilder;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
@Data
|
||||
public class Wave
|
||||
{
|
||||
|
||||
@@ -24,14 +24,13 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.bosstimetracker;
|
||||
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBox;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.Color;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBox;
|
||||
|
||||
public class BossTimeTracker extends InfoBox
|
||||
{
|
||||
|
||||
@@ -24,29 +24,27 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.bosstimetracker;
|
||||
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.Arrays;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
import static net.runelite.api.ItemID.FIRE_CAPE;
|
||||
import static net.runelite.api.ItemID.INFERNAL_CAPE;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Boss Time Tracker",
|
||||
|
||||
@@ -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)),
|
||||
|
||||
@@ -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;
|
||||
@@ -1157,31 +1160,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);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1220,6 +1220,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());
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ package net.runelite.client.plugins.chatnotifications;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.inject.Provides;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -41,17 +40,17 @@ import javax.inject.Singleton;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.MessageNode;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.RuneLiteProperties;
|
||||
import net.runelite.client.chat.ChatColorType;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.api.util.Text;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Chat Notifications",
|
||||
|
||||
@@ -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.")
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)),
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package net.runelite.client.plugins.combatcounter;
|
||||
|
||||
import java.awt.Color;
|
||||
import net.runelite.client.config.Alpha;
|
||||
import net.runelite.client.config.Config;
|
||||
import net.runelite.client.config.ConfigGroup;
|
||||
import net.runelite.client.config.ConfigItem;
|
||||
|
||||
import java.awt.*;
|
||||
import net.runelite.client.config.ConfigTitleSection;
|
||||
import net.runelite.client.config.Title;
|
||||
|
||||
@@ -57,7 +56,7 @@ public interface CombatCounterConfig extends Config
|
||||
{
|
||||
return new Title();
|
||||
}
|
||||
|
||||
|
||||
@Alpha
|
||||
@ConfigItem(
|
||||
keyName = "selfColor",
|
||||
@@ -70,7 +69,7 @@ public interface CombatCounterConfig extends Config
|
||||
{
|
||||
return Color.green;
|
||||
}
|
||||
|
||||
|
||||
@Alpha
|
||||
@ConfigItem(
|
||||
keyName = "totalColor",
|
||||
@@ -83,7 +82,7 @@ public interface CombatCounterConfig extends Config
|
||||
{
|
||||
return Color.RED;
|
||||
}
|
||||
|
||||
|
||||
@Alpha
|
||||
@ConfigItem(
|
||||
keyName = "otherColor",
|
||||
@@ -96,7 +95,7 @@ public interface CombatCounterConfig extends Config
|
||||
{
|
||||
return Color.white;
|
||||
}
|
||||
|
||||
|
||||
@Alpha
|
||||
@ConfigItem(
|
||||
keyName = "bgColor",
|
||||
@@ -109,7 +108,7 @@ public interface CombatCounterConfig extends Config
|
||||
{
|
||||
return new Color(70, 61, 50, 156);
|
||||
}
|
||||
|
||||
|
||||
@Alpha
|
||||
@ConfigItem(
|
||||
keyName = "titleColor",
|
||||
|
||||
@@ -48,7 +48,6 @@ import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.ItemDespawned;
|
||||
import net.runelite.api.events.LocalPlayerDeath;
|
||||
import net.runelite.api.events.MenuEntryAdded;
|
||||
import net.runelite.api.events.MenuOpened;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
@@ -80,6 +79,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
|
||||
@@ -197,7 +197,7 @@ public class DeathIndicatorPlugin extends Plugin
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(LocalPlayerDeath.class, this, this::onLocalPlayerDeath);
|
||||
eventBus.subscribe(PlayerDeath.class, this, this::onPlayerDeath);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
if (config.permaBones())
|
||||
@@ -209,7 +209,6 @@ public class DeathIndicatorPlugin extends Plugin
|
||||
private void addBoneSubs()
|
||||
{
|
||||
eventBus.subscribe(ItemDespawned.class, BONES, this::onItemDespawn);
|
||||
eventBus.subscribe(PlayerDeath.class, BONES, this::onPlayerDeath);
|
||||
eventBus.subscribe(MenuEntryAdded.class, BONES, this::onMenuEntryAdded);
|
||||
eventBus.subscribe(MenuOptionClicked.class, BONES, this::onMenuOptionClicked);
|
||||
eventBus.subscribe(MenuOpened.class, BONES, this::onMenuOpened);
|
||||
@@ -230,7 +229,26 @@ public class DeathIndicatorPlugin extends Plugin
|
||||
|
||||
private void onPlayerDeath(PlayerDeath death)
|
||||
{
|
||||
newBoneFor(death.getPlayer());
|
||||
if (client.isInInstancedRegion())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Player player = death.getPlayer();
|
||||
|
||||
if (config.permaBones() && player.getWorldLocation().getRegionID() != 13362)
|
||||
{
|
||||
newBoneFor(player);
|
||||
}
|
||||
|
||||
if (player != client.getLocalPlayer())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
lastDeath = player.getWorldLocation();
|
||||
lastDeathWorld = client.getWorld();
|
||||
lastDeathTime = Instant.now();
|
||||
}
|
||||
|
||||
private void newBoneFor(Player player)
|
||||
@@ -301,24 +319,6 @@ public class DeathIndicatorPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
private void onLocalPlayerDeath(LocalPlayerDeath death)
|
||||
{
|
||||
if (client.isInInstancedRegion())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Player lp = client.getLocalPlayer();
|
||||
if (config.permaBones())
|
||||
{
|
||||
newBoneFor(lp);
|
||||
}
|
||||
|
||||
lastDeath = lp.getWorldLocation();
|
||||
lastDeathWorld = client.getWorld();
|
||||
lastDeathTime = Instant.now();
|
||||
}
|
||||
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
// Check if player respawned in a death respawn location
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -107,6 +107,11 @@ public class DefaultWorldPlugin extends Plugin
|
||||
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
if (event.getGameState() == GameState.LOGGED_IN)
|
||||
{
|
||||
config.lastWorld(client.getWorld());
|
||||
}
|
||||
|
||||
applyWorld();
|
||||
}
|
||||
|
||||
@@ -170,7 +175,7 @@ public class DefaultWorldPlugin extends Plugin
|
||||
log.debug("Stored old world {}", worldCache);
|
||||
}
|
||||
|
||||
final int newWorld = config.getWorld();
|
||||
final int newWorld = !config.useLastWorld() ? config.getWorld() : config.lastWorld();
|
||||
changeWorld(newWorld);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.equipmentinspector;
|
||||
|
||||
|
||||
import com.google.inject.Provides;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
@@ -43,6 +43,7 @@ import net.runelite.api.Skill;
|
||||
import net.runelite.api.SpriteID;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.WorldType;
|
||||
import net.runelite.api.events.FakeXpDrop;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.ScriptCallbackEvent;
|
||||
@@ -145,6 +146,7 @@ public class XpDropPlugin extends Plugin
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(XpDropEvent.class, this, this::onXpDropEvent);
|
||||
eventBus.subscribe(ScriptCallbackEvent.class, this, this::onScriptCallbackEvent);
|
||||
eventBus.subscribe(FakeXpDrop.class, this, this::onFakeXpDrop);
|
||||
}
|
||||
|
||||
private void onXpDropEvent(XpDropEvent event)
|
||||
@@ -351,6 +353,14 @@ public class XpDropPlugin extends Plugin
|
||||
client.runScript(XPDROP_DISABLED, lastSkill.ordinal(), previousExpGained);
|
||||
}
|
||||
|
||||
private void onFakeXpDrop(FakeXpDrop fakeXpDrop)
|
||||
{
|
||||
if (fakeXpDrop.getSkill() == Skill.HITPOINTS)
|
||||
{
|
||||
calculateDamageDealt(fakeXpDrop.getXp());
|
||||
}
|
||||
}
|
||||
|
||||
private void onScriptCallbackEvent(ScriptCallbackEvent e)
|
||||
{
|
||||
if (this.showdamagedrops == XpDropConfig.DamageMode.NONE)
|
||||
@@ -364,21 +374,6 @@ public class XpDropPlugin extends Plugin
|
||||
{
|
||||
damage = 0;
|
||||
}
|
||||
// Handles Fake XP drops (Ironman, DMM Cap, 200m xp, etc)
|
||||
else if (eventName.equals("fakeXpDrop"))
|
||||
{
|
||||
final int[] intStack = client.getIntStack();
|
||||
final int intStackSize = client.getIntStackSize();
|
||||
|
||||
final int skillId = intStack[intStackSize - 2];
|
||||
final Skill skill = Skill.values()[skillId];
|
||||
|
||||
if (skill.equals(Skill.HITPOINTS))
|
||||
{
|
||||
final int exp = intStack[intStackSize - 1];
|
||||
calculateDamageDealt(exp);
|
||||
}
|
||||
}
|
||||
else if (eventName.equals("hpXpGained"))
|
||||
{
|
||||
final int[] intStack = client.getIntStack();
|
||||
|
||||
@@ -40,8 +40,8 @@ import net.runelite.api.WorldType;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.LocalPlayerDeath;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.PlayerDeath;
|
||||
import net.runelite.api.events.SpotAnimationChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
@@ -125,7 +125,7 @@ public class FreezeTimersPlugin extends Plugin
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(SpotAnimationChanged.class, this, this::onSpotAnimationChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(LocalPlayerDeath.class, this, this::onLocalPlayerDeath);
|
||||
eventBus.subscribe(PlayerDeath.class, this, this::onPlayerDeath);
|
||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
}
|
||||
@@ -207,7 +207,7 @@ public class FreezeTimersPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
private void onLocalPlayerDeath(LocalPlayerDeath event)
|
||||
private void onPlayerDeath(PlayerDeath event)
|
||||
{
|
||||
final Player localPlayer = client.getLocalPlayer();
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
|
||||
@@ -108,9 +108,7 @@ public class GrandExchangePlugin extends Plugin
|
||||
private static final OSBGrandExchangeClient CLIENT = new OSBGrandExchangeClient();
|
||||
private static final String OSB_GE_TEXT = "<br>OSBuddy Actively traded price: ";
|
||||
private static final String BUY_LIMIT_GE_TEXT = "<br>Buy limit: ";
|
||||
private static final TypeToken<Map<Integer, Integer>> BUY_LIMIT_TOKEN = new TypeToken<Map<Integer, Integer>>()
|
||||
{
|
||||
};
|
||||
private static final TypeToken<Map<Integer, Integer>> BUY_LIMIT_TOKEN = new TypeToken<Map<Integer, Integer>>() {};
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private NavigationButton button;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -24,20 +24,19 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.grotesqueguardians;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.NPC;
|
||||
import static net.runelite.api.NpcID.DUSK_7888;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import java.util.ArrayList;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.NPC;
|
||||
import javax.annotation.Nullable;
|
||||
import net.runelite.api.Client;
|
||||
|
||||
import static net.runelite.api.NpcID.DUSK_7888;
|
||||
|
||||
|
||||
@PluginDescriptor(
|
||||
|
||||
@@ -28,7 +28,6 @@ import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
import java.util.Objects;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
@@ -140,9 +140,7 @@ public class GroundMarkerPlugin extends Plugin
|
||||
return GSON.fromJson(json, new GroundMarkerListTypeToken().getType());
|
||||
}
|
||||
|
||||
private static class GroundMarkerListTypeToken extends TypeToken<List<GroundMarkerPoint>>
|
||||
{
|
||||
}
|
||||
private static class GroundMarkerListTypeToken extends TypeToken<List<GroundMarkerPoint>> {}
|
||||
|
||||
private GroundMarkerConfig.amount amount;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -950,7 +950,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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -301,10 +301,7 @@ public class InventorySetupPlugin extends Plugin
|
||||
{
|
||||
// TODO add last resort?, serialize exception just make empty map
|
||||
final Gson gson = new Gson();
|
||||
Type type = new TypeToken<HashMap<String, InventorySetup>>()
|
||||
{
|
||||
|
||||
}.getType();
|
||||
Type type = new TypeToken<HashMap<String, InventorySetup>>() {}.getType();
|
||||
inventorySetups.clear();
|
||||
inventorySetups.putAll(gson.fromJson(json, type));
|
||||
}
|
||||
@@ -371,7 +368,7 @@ public class InventorySetupPlugin extends Plugin
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
final String setupName = panel.getSelectedInventorySetup();
|
||||
if (!setupName.isEmpty())
|
||||
{
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
package net.runelite.client.plugins.loottracker;
|
||||
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.RuntimeMXBean;
|
||||
import java.time.Duration;
|
||||
|
||||
@@ -79,10 +79,10 @@ import net.runelite.api.Varbits;
|
||||
import net.runelite.api.WorldType;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.PlayerDeath;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.ItemContainerChanged;
|
||||
import net.runelite.api.events.LocalPlayerDeath;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
import net.runelite.api.events.PlayerSpawned;
|
||||
import net.runelite.api.events.WidgetLoaded;
|
||||
@@ -318,9 +318,9 @@ public class LootTrackerPlugin extends Plugin
|
||||
lootTrackerClient = null;
|
||||
}
|
||||
|
||||
private void onLocalPlayerDeath(LocalPlayerDeath event)
|
||||
private void onPlayerDeath(PlayerDeath event)
|
||||
{
|
||||
if (client.getVar(Varbits.IN_WILDERNESS) == 1 || WorldType.isPvpWorld(client.getWorldType()))
|
||||
if ((client.getVar(Varbits.IN_WILDERNESS) == 1 || WorldType.isPvpWorld(client.getWorldType())) && event.getPlayer() == client.getLocalPlayer())
|
||||
{
|
||||
deathInventorySnapshot();
|
||||
pvpDeath = true;
|
||||
@@ -497,7 +497,7 @@ public class LootTrackerPlugin extends Plugin
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(SessionOpen.class, this, this::onSessionOpen);
|
||||
eventBus.subscribe(SessionClose.class, this, this::onSessionClose);
|
||||
eventBus.subscribe(LocalPlayerDeath.class, this, this::onLocalPlayerDeath);
|
||||
eventBus.subscribe(PlayerDeath.class, this, this::onPlayerDeath);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(NpcLootReceived.class, this, this::onNpcLootReceived);
|
||||
eventBus.subscribe(PlayerSpawned.class, this, this::onPlayerSpawned);
|
||||
@@ -1451,9 +1451,7 @@ public class LootTrackerPlugin extends Plugin
|
||||
try
|
||||
{
|
||||
Collection<LootRecord> lootRecords = new ArrayList<>(RuneLiteAPI.GSON.fromJson(new FileReader(LOOT_RECORDS_FILE),
|
||||
new TypeToken<ArrayList<LootRecord>>()
|
||||
{
|
||||
}.getType()));
|
||||
new TypeToken<ArrayList<LootRecord>>() {}.getType()));
|
||||
|
||||
DSLContext dslContext = databaseManager.getDsl();
|
||||
|
||||
|
||||
@@ -26,6 +26,4 @@ package net.runelite.client.plugins.loottracker.localstorage.events;
|
||||
|
||||
import net.runelite.api.events.Event;
|
||||
|
||||
public class LTNameChange implements Event
|
||||
{
|
||||
}
|
||||
public class LTNameChange implements Event {}
|
||||
@@ -17,9 +17,7 @@ public class GrimyHerbLookup
|
||||
{
|
||||
final InputStream herbFile = GrimyHerbLookup.class.getResourceAsStream("/herbs.json");
|
||||
Gson gson = new Gson();
|
||||
mapping = gson.fromJson(new InputStreamReader(herbFile), new TypeToken<Map<String, HerbInfo>>()
|
||||
{
|
||||
}.getType());
|
||||
mapping = gson.fromJson(new InputStreamReader(herbFile), new TypeToken<Map<String, HerbInfo>>() {}.getType());
|
||||
}
|
||||
|
||||
public int getCleanLevel(int itemId)
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
package net.runelite.client.plugins.menuentryswapper.util;
|
||||
|
||||
public class HerbNotFoundException extends RuntimeException
|
||||
{
|
||||
}
|
||||
public class HerbNotFoundException extends RuntimeException {}
|
||||
|
||||
@@ -279,7 +279,7 @@ public class MultiIndicatorsPlugin extends Plugin
|
||||
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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,7 @@ import lombok.Setter;
|
||||
import net.runelite.api.Actor;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.ScriptID;
|
||||
import net.runelite.api.SoundEffectID;
|
||||
@@ -567,11 +568,26 @@ public class MusicPlugin extends Plugin
|
||||
private void onAreaSoundEffectPlayed(AreaSoundEffectPlayed areaSoundEffectPlayed)
|
||||
{
|
||||
Actor source = areaSoundEffectPlayed.getSource();
|
||||
if (source != client.getLocalPlayer()
|
||||
if (source == client.getLocalPlayer()
|
||||
&& musicConfig.muteOwnAreaSounds())
|
||||
{
|
||||
areaSoundEffectPlayed.consume();
|
||||
}
|
||||
else if (source != client.getLocalPlayer()
|
||||
&& source instanceof Player
|
||||
&& musicConfig.muteOtherAreaSounds())
|
||||
{
|
||||
areaSoundEffectPlayed.consume();
|
||||
}
|
||||
else if (source instanceof NPC
|
||||
&& musicConfig.muteNpcAreaSounds())
|
||||
{
|
||||
areaSoundEffectPlayed.consume();
|
||||
}
|
||||
else if (source == null
|
||||
&& musicConfig.muteEnvironmentAreaSounds())
|
||||
{
|
||||
areaSoundEffectPlayed.consume();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,30 +25,29 @@
|
||||
package net.runelite.client.plugins.nightmarezone;
|
||||
|
||||
import com.google.inject.Provides;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.Arrays;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import lombok.AccessLevel;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.api.util.Text;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Nightmare Zone",
|
||||
@@ -81,7 +80,7 @@ public class NightmareZonePlugin extends Plugin
|
||||
|
||||
@Getter
|
||||
private int pointsPerHour;
|
||||
|
||||
|
||||
private Instant nmzSessionStartTime;
|
||||
|
||||
// This starts as true since you need to get
|
||||
|
||||
@@ -62,9 +62,7 @@ public class NotesManager
|
||||
if (!Strings.isNullOrEmpty(configJson))
|
||||
{
|
||||
final Gson gson = new Gson();
|
||||
notes = gson.fromJson(configJson, new TypeToken<ArrayList<String>>()
|
||||
{
|
||||
}.getType());
|
||||
notes = gson.fromJson(configJson, new TypeToken<ArrayList<String>>() {}.getType());
|
||||
}
|
||||
|
||||
if (notes == null)
|
||||
|
||||
@@ -503,9 +503,7 @@ public class ObjectIndicatorsPlugin extends Plugin implements KeyListener
|
||||
return null;
|
||||
}
|
||||
|
||||
Set<ObjectPoint> points = GSON.fromJson(json, new TypeToken<Set<ObjectPoint>>()
|
||||
{
|
||||
}.getType());
|
||||
Set<ObjectPoint> points = GSON.fromJson(json, new TypeToken<Set<ObjectPoint>>() {}.getType());
|
||||
// Prior to multiloc support the plugin would mark objects named "null", which breaks
|
||||
// in most cases due to the specific object being identified being ambiguous, so remove
|
||||
// them
|
||||
|
||||
@@ -184,18 +184,14 @@ public class OpponentInfoPlugin extends Plugin
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@@ -41,10 +41,10 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.WorldType;
|
||||
import net.runelite.api.events.FakeXpDrop;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.HitsplatApplied;
|
||||
import net.runelite.api.events.ScriptCallbackEvent;
|
||||
import net.runelite.api.events.StatChanged;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.client.chat.ChatColorType;
|
||||
@@ -166,13 +166,13 @@ public class PerformanceStatsPlugin extends Plugin
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(HitsplatApplied.class, this, this::onHitsplatApplied);
|
||||
eventBus.subscribe(StatChanged.class, this, this::onStatChanged);
|
||||
eventBus.subscribe(ScriptCallbackEvent.class, this, this::onScriptCallbackEvent);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(OverlayMenuClicked.class, this, this::onOverlayMenuClicked);
|
||||
eventBus.subscribe(Performance.class, this, this::onPerformance);
|
||||
eventBus.subscribe(UserSync.class, this, this::onUserSync);
|
||||
eventBus.subscribe(UserPart.class, this, this::onUserPart);
|
||||
eventBus.subscribe(PartyChanged.class, this, this::onPartyChanged);
|
||||
eventBus.subscribe(FakeXpDrop.class, this, this::onFakeXpDrop);
|
||||
}
|
||||
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
@@ -242,25 +242,9 @@ public class PerformanceStatsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
private void onScriptCallbackEvent(ScriptCallbackEvent e)
|
||||
private void onFakeXpDrop(FakeXpDrop fakeXpDrop)
|
||||
{
|
||||
// Handles Fake XP drops (Ironman in PvP, DMM Cap, 200m xp, etc)
|
||||
if (isPaused())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!"fakeXpDrop".equals(e.getEventName()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int[] intStack = client.getIntStack();
|
||||
final int intStackSize = client.getIntStackSize();
|
||||
|
||||
final int skillId = intStack[intStackSize - 2];
|
||||
final Skill skill = Skill.values()[skillId];
|
||||
if (skill.equals(Skill.HITPOINTS))
|
||||
if (fakeXpDrop.getSkill().equals(Skill.HITPOINTS))
|
||||
{
|
||||
// Auto enables when player would have received hp exp
|
||||
if (!isEnabled())
|
||||
@@ -268,7 +252,7 @@ public class PerformanceStatsPlugin extends Plugin
|
||||
enable();
|
||||
}
|
||||
|
||||
final int exp = intStack[intStackSize - 1];
|
||||
final int exp = fakeXpDrop.getXp();
|
||||
performance.addDamageDealt(calculateDamageDealt(exp), client.getTickCount());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,34 +24,13 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.runepouch;
|
||||
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.Map;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import static net.runelite.api.ItemID.AIR_RUNE;
|
||||
import static net.runelite.api.ItemID.ASTRAL_RUNE;
|
||||
import static net.runelite.api.ItemID.BLOOD_RUNE;
|
||||
import static net.runelite.api.ItemID.BODY_RUNE;
|
||||
import static net.runelite.api.ItemID.CHAOS_RUNE;
|
||||
import static net.runelite.api.ItemID.COSMIC_RUNE;
|
||||
import static net.runelite.api.ItemID.DEATH_RUNE;
|
||||
import static net.runelite.api.ItemID.DUST_RUNE;
|
||||
import static net.runelite.api.ItemID.EARTH_RUNE;
|
||||
import static net.runelite.api.ItemID.FIRE_RUNE;
|
||||
import static net.runelite.api.ItemID.LAVA_RUNE;
|
||||
import static net.runelite.api.ItemID.LAW_RUNE;
|
||||
import static net.runelite.api.ItemID.MIND_RUNE;
|
||||
import static net.runelite.api.ItemID.MIST_RUNE;
|
||||
import static net.runelite.api.ItemID.MUD_RUNE;
|
||||
import static net.runelite.api.ItemID.NATURE_RUNE;
|
||||
import static net.runelite.api.ItemID.SMOKE_RUNE;
|
||||
import static net.runelite.api.ItemID.SOUL_RUNE;
|
||||
import static net.runelite.api.ItemID.STEAM_RUNE;
|
||||
import static net.runelite.api.ItemID.WATER_RUNE;
|
||||
import static net.runelite.api.ItemID.WRATH_RUNE;
|
||||
import static net.runelite.api.ItemID.*;
|
||||
|
||||
public enum Runes
|
||||
{
|
||||
|
||||
@@ -258,9 +258,7 @@ public class ScreenMarkerPlugin extends Plugin
|
||||
}
|
||||
|
||||
final Gson gson = new Gson();
|
||||
final List<ScreenMarker> screenMarkerData = gson.fromJson(json, new TypeToken<ArrayList<ScreenMarker>>()
|
||||
{
|
||||
}.getType());
|
||||
final List<ScreenMarker> screenMarkerData = gson.fromJson(json, new TypeToken<ArrayList<ScreenMarker>>() {}.getType());
|
||||
|
||||
return screenMarkerData.stream().map(ScreenMarkerOverlay::new);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,6 @@ import net.runelite.api.WorldType;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.LocalPlayerDeath;
|
||||
import net.runelite.api.events.PlayerDeath;
|
||||
import net.runelite.api.events.WidgetLoaded;
|
||||
import net.runelite.api.util.Text;
|
||||
@@ -291,7 +290,6 @@ public class ScreenshotPlugin extends Plugin
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(LocalPlayerDeath.class, this, this::onLocalPlayerDeath);
|
||||
eventBus.subscribe(PlayerDeath.class, this, this::onPlayerDeath);
|
||||
eventBus.subscribe(PlayerLootReceived.class, this, this::onPlayerLootReceived);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
@@ -338,16 +336,13 @@ public class ScreenshotPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
private void onLocalPlayerDeath(LocalPlayerDeath event)
|
||||
private void onPlayerDeath(PlayerDeath event)
|
||||
{
|
||||
if (this.screenshotPlayerDeath && client.getLocalPlayer().getName() != null)
|
||||
if (event.getPlayer() == client.getLocalPlayer() && config.screenshotPlayerDeath())
|
||||
{
|
||||
takeScreenshot(client.getLocalPlayer().getName() + " dead " + format(new Date()), "Deaths");
|
||||
}
|
||||
}
|
||||
|
||||
private void onPlayerDeath(PlayerDeath event)
|
||||
{
|
||||
int tob = client.getVar(Varbits.THEATRE_OF_BLOOD);
|
||||
if (this.screenshotFriendDeath && event.getPlayer().getName() != null
|
||||
&& (event.getPlayer().isFriend() || event.getPlayer().isClanMember()
|
||||
@@ -714,16 +709,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
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -44,9 +44,7 @@ class SlayerXpDropLookup
|
||||
try (final InputStream xpFile = getClass().getResourceAsStream("/slayer_xp.json"))
|
||||
{
|
||||
Gson gson = new Gson();
|
||||
xpMap = gson.fromJson(new InputStreamReader(xpFile), new TypeToken<Map<String, List<Double>>>()
|
||||
{
|
||||
}.getType());
|
||||
xpMap = gson.fromJson(new InputStreamReader(xpFile), new TypeToken<Map<String, List<Double>>>() {}.getType());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,9 +41,11 @@ import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.events.FakeXpDrop;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.StatChanged;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
@@ -67,6 +69,7 @@ public class SpecialCounterPlugin extends Plugin
|
||||
private int currentWorld = -1;
|
||||
private int specialPercentage = -1;
|
||||
private int specialHitpointsExperience = -1;
|
||||
private int specialHitpointsGained = -1;
|
||||
private boolean specialUsed;
|
||||
private double modifier = 1d;
|
||||
|
||||
@@ -119,6 +122,8 @@ public class SpecialCounterPlugin extends Plugin
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||
eventBus.subscribe(SpecialCounterUpdate.class, this, this::onSpecialCounterUpdate);
|
||||
eventBus.subscribe(StatChanged.class, this, this::onStatChanged);
|
||||
eventBus.subscribe(FakeXpDrop.class, this, this::onFakeXpDrop);
|
||||
}
|
||||
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
@@ -154,6 +159,23 @@ public class SpecialCounterPlugin extends Plugin
|
||||
|
||||
specialUsed = true;
|
||||
specialHitpointsExperience = client.getSkillExperience(Skill.HITPOINTS);
|
||||
specialHitpointsGained = -1;
|
||||
}
|
||||
|
||||
private void onStatChanged(StatChanged statChanged)
|
||||
{
|
||||
if (specialUsed && statChanged.getSkill() == Skill.HITPOINTS)
|
||||
{
|
||||
specialHitpointsGained = statChanged.getXp() - specialHitpointsExperience;
|
||||
}
|
||||
}
|
||||
|
||||
private void onFakeXpDrop(FakeXpDrop fakeXpDrop)
|
||||
{
|
||||
if (specialUsed && fakeXpDrop.getSkill() == Skill.HITPOINTS)
|
||||
{
|
||||
specialHitpointsGained = fakeXpDrop.getXp();
|
||||
}
|
||||
}
|
||||
|
||||
private void onGameTick(GameTick tick)
|
||||
@@ -164,13 +186,11 @@ public class SpecialCounterPlugin extends Plugin
|
||||
}
|
||||
|
||||
int interactingId = checkInteracting();
|
||||
|
||||
if (interactingId > -1 && specialHitpointsExperience != -1 && specialUsed)
|
||||
if (interactingId > -1 && specialUsed)
|
||||
{
|
||||
int deltaExperience = specialHitpointsGained;
|
||||
|
||||
specialUsed = false;
|
||||
int hpXp = client.getSkillExperience(Skill.HITPOINTS);
|
||||
int deltaExperience = hpXp - specialHitpointsExperience;
|
||||
specialHitpointsExperience = -1;
|
||||
|
||||
if (deltaExperience > 0 && specialWeapon != null)
|
||||
{
|
||||
|
||||
@@ -479,12 +479,7 @@ public class SpellbookPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
// CHECKSTYLE:OFF
|
||||
final Collection<Spell> gson = GSON.fromJson(cfg, new TypeToken<List<Spell>>()
|
||||
{
|
||||
}
|
||||
.getType());
|
||||
// CHECKSTYLE:ON
|
||||
final Collection<Spell> gson = GSON.fromJson(cfg, new TypeToken<List<Spell>>() {}.getType());
|
||||
|
||||
for (final Spell s : gson)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
@@ -258,6 +259,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;
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.suppliestracker;
|
||||
|
||||
|
||||
import com.google.inject.Provides;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.ArrayDeque;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -59,7 +59,7 @@ import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.ItemContainerChanged;
|
||||
import net.runelite.api.events.LocalPlayerDeath;
|
||||
import net.runelite.api.events.PlayerDeath;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.SpotAnimationChanged;
|
||||
@@ -220,7 +220,7 @@ public class TimersPlugin extends Plugin
|
||||
eventBus.subscribe(SpotAnimationChanged.class, this, this::onSpotAnimationChanged);
|
||||
eventBus.subscribe(ItemContainerChanged.class, this, this::onItemContainerChanged);
|
||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||
eventBus.subscribe(LocalPlayerDeath.class, this, this::onLocalPlayerDeath);
|
||||
eventBus.subscribe(PlayerDeath.class, this, this::onPlayerDeath);
|
||||
eventBus.subscribe(StatChanged.class, this, this::onStatChanged);
|
||||
}
|
||||
|
||||
@@ -582,9 +582,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);
|
||||
}
|
||||
@@ -937,9 +935,12 @@ public class TimersPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
private void onLocalPlayerDeath(LocalPlayerDeath event)
|
||||
private void onPlayerDeath(PlayerDeath playerDeath)
|
||||
{
|
||||
infoBoxManager.removeIf(t -> t instanceof TimerTimer && ((TimerTimer) t).getTimer().isRemovedOnDeath());
|
||||
if (playerDeath.getPlayer() == client.getLocalPlayer())
|
||||
{
|
||||
infoBoxManager.removeIf(t -> t instanceof TimerTimer && ((TimerTimer) t).getTimer().isRemovedOnDeath());
|
||||
}
|
||||
}
|
||||
|
||||
private void onStatChanged(StatChanged event)
|
||||
|
||||
@@ -153,9 +153,7 @@ public class ClockManager
|
||||
if (!Strings.isNullOrEmpty(timersJson))
|
||||
{
|
||||
final Gson gson = new Gson();
|
||||
final List<Timer> timers = gson.fromJson(timersJson, new TypeToken<ArrayList<Timer>>()
|
||||
{
|
||||
}.getType());
|
||||
final List<Timer> timers = gson.fromJson(timersJson, new TypeToken<ArrayList<Timer>>() {}.getType());
|
||||
|
||||
this.timers.clear();
|
||||
this.timers.addAll(timers);
|
||||
@@ -170,9 +168,7 @@ public class ClockManager
|
||||
if (!Strings.isNullOrEmpty(stopwatchesJson))
|
||||
{
|
||||
final Gson gson = new Gson();
|
||||
final List<Stopwatch> stopwatches = gson.fromJson(stopwatchesJson, new TypeToken<ArrayList<Stopwatch>>()
|
||||
{
|
||||
}.getType());
|
||||
final List<Stopwatch> stopwatches = gson.fromJson(stopwatchesJson, new TypeToken<ArrayList<Stopwatch>>() {}.getType());
|
||||
|
||||
this.stopwatches.clear();
|
||||
this.stopwatches.addAll(stopwatches);
|
||||
|
||||
@@ -41,7 +41,7 @@ import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.HitsplatApplied;
|
||||
import net.runelite.api.events.LocalPlayerDeath;
|
||||
import net.runelite.api.events.PlayerDeath;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.client.chat.ChatColorType;
|
||||
import net.runelite.client.chat.ChatMessageBuilder;
|
||||
@@ -116,7 +116,7 @@ public class DamageCounterPlugin extends Plugin
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(HitsplatApplied.class, this, this::onHitsplatApplied);
|
||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||
eventBus.subscribe(LocalPlayerDeath.class, this, this::onLocalPlayerDeath);
|
||||
eventBus.subscribe(PlayerDeath.class, this, this::onPlayerDeath);
|
||||
}
|
||||
|
||||
|
||||
@@ -359,9 +359,9 @@ public class DamageCounterPlugin extends Plugin
|
||||
|
||||
//whenever you have died in tob you will get a death message with damage
|
||||
// made sure the message works at ToB area or else it will message every where
|
||||
private void onLocalPlayerDeath(LocalPlayerDeath death)
|
||||
private void onPlayerDeath(PlayerDeath death)
|
||||
{
|
||||
if (client.getLocalPlayer() == null)
|
||||
if (client.getLocalPlayer() == null || death.getPlayer() != client.getLocalPlayer())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -136,9 +136,7 @@ public class WikiSearchChatboxTextInput extends ChatboxTextInput
|
||||
try
|
||||
{
|
||||
JsonArray jar = new JsonParser().parse(body).getAsJsonArray();
|
||||
List<String> apredictions = gson.fromJson(jar.get(1), new TypeToken<List<String>>()
|
||||
{
|
||||
}.getType());
|
||||
List<String> apredictions = gson.fromJson(jar.get(1), new TypeToken<List<String>>() {}.getType());
|
||||
|
||||
if (apredictions.size() > MAX_NUM_PREDICTIONS)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
package net.runelite.client.plugins.wildernesslocations;
|
||||
|
||||
|
||||
import com.google.inject.Provides;
|
||||
import java.awt.Color;
|
||||
import javax.inject.Inject;
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import lombok.AccessLevel;
|
||||
@@ -69,6 +70,8 @@ import net.runelite.client.ui.overlay.OverlayMenuEntry;
|
||||
@PluginDependency(XpTrackerPlugin.class)
|
||||
public class WoodcuttingPlugin extends Plugin
|
||||
{
|
||||
private static final Pattern WOOD_CUT_PATTERN = Pattern.compile("You get (?:some|an)[\\w ]+(?:logs?|mushrooms)\\.");
|
||||
|
||||
@Inject
|
||||
private Notifier notifier;
|
||||
|
||||
@@ -184,11 +187,11 @@ public class WoodcuttingPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
private void onChatMessage(ChatMessage event)
|
||||
void onChatMessage(ChatMessage event)
|
||||
{
|
||||
if (event.getType() == ChatMessageType.SPAM || event.getType() == ChatMessageType.GAMEMESSAGE)
|
||||
{
|
||||
if (event.getMessage().startsWith("You get some") && (event.getMessage().endsWith("logs.") || event.getMessage().endsWith("mushrooms.")))
|
||||
if (WOOD_CUT_PATTERN.matcher(event.getMessage()).matches())
|
||||
{
|
||||
if (session == null)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
@@ -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"),
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -35,13 +35,13 @@ import net.runelite.api.GameState;
|
||||
import net.runelite.api.Quest;
|
||||
import net.runelite.api.QuestState;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.StatChanged;
|
||||
import net.runelite.api.events.WidgetLoaded;
|
||||
import net.runelite.api.widgets.WidgetID;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.game.AgilityShortcut;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -80,6 +80,7 @@ public class WorldMapPlugin extends Plugin
|
||||
static final String CONFIG_KEY_RARE_TREE_TOOLTIPS = "rareTreeTooltips";
|
||||
static final String CONFIG_KEY_RARE_TREE_LEVEL_ICON = "rareTreeIcon";
|
||||
static final String CONFIG_KEY_TRANSPORATION_TELEPORT_TOOLTIPS = "transportationTooltips";
|
||||
static final String CONFIG_KEY_RUNECRAFTING_ALTAR_ICON = "runecraftingAltarIcon";
|
||||
|
||||
static
|
||||
{
|
||||
@@ -181,6 +182,7 @@ public class WorldMapPlugin extends Plugin
|
||||
worldMapPointManager.removeIf(MinigamePoint.class::isInstance);
|
||||
worldMapPointManager.removeIf(FarmingPatchPoint.class::isInstance);
|
||||
worldMapPointManager.removeIf(RareTreePoint.class::isInstance);
|
||||
worldMapPointManager.removeIf(RunecraftingAltarPoint.class::isInstance);
|
||||
agilityLevel = 0;
|
||||
woodcuttingLevel = 0;
|
||||
}
|
||||
@@ -316,32 +318,38 @@ public class WorldMapPlugin extends Plugin
|
||||
|
||||
worldMapPointManager.removeIf(TeleportPoint.class::isInstance);
|
||||
// This next part gets 142 icons from disk, and does so on the EDT (at first run)
|
||||
executor.submit(() ->
|
||||
Arrays.stream(TeleportLocationData.values())
|
||||
.filter(data ->
|
||||
Arrays.stream(TeleportLocationData.values())
|
||||
.filter(data ->
|
||||
{
|
||||
switch (data.getType())
|
||||
{
|
||||
switch (data.getType())
|
||||
{
|
||||
case NORMAL_MAGIC:
|
||||
return this.normalTeleportIcon;
|
||||
case ANCIENT_MAGICKS:
|
||||
return this.ancientTeleportIcon;
|
||||
case LUNAR_MAGIC:
|
||||
return this.lunarTeleportIcon;
|
||||
case ARCEUUS_MAGIC:
|
||||
return this.arceuusTeleportIcon;
|
||||
case JEWELLERY:
|
||||
return this.jewelleryTeleportIcon;
|
||||
case SCROLL:
|
||||
return this.scrollTeleportIcon;
|
||||
case OTHER:
|
||||
return this.miscellaneousTeleportIcon;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}).map(TeleportPoint::new)
|
||||
.forEach(worldMapPointManager::add)
|
||||
);
|
||||
case NORMAL_MAGIC:
|
||||
return this.normalTeleportIcon;
|
||||
case ANCIENT_MAGICKS:
|
||||
return this.ancientTeleportIcon;
|
||||
case LUNAR_MAGIC:
|
||||
return this.lunarTeleportIcon;
|
||||
case ARCEUUS_MAGIC:
|
||||
return this.arceuusTeleportIcon;
|
||||
case JEWELLERY:
|
||||
return this.jewelleryTeleportIcon;
|
||||
case SCROLL:
|
||||
return this.scrollTeleportIcon;
|
||||
case OTHER:
|
||||
return this.miscellaneousTeleportIcon;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}).map(TeleportPoint::new)
|
||||
.forEach(worldMapPointManager::add);
|
||||
|
||||
worldMapPointManager.removeIf(RunecraftingAltarPoint.class::isInstance);
|
||||
if (config.runecraftingAltarIcon())
|
||||
{
|
||||
Arrays.stream(RunecraftingAltarLocation.values())
|
||||
.map(RunecraftingAltarPoint::new)
|
||||
.forEach(worldMapPointManager::add);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateQuestStartPointIcons()
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ import java.awt.Graphics2D;
|
||||
import java.awt.Polygon;
|
||||
import java.awt.Shape;
|
||||
import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.AnimationID;
|
||||
import net.runelite.api.Client;
|
||||
@@ -40,8 +41,6 @@ import net.runelite.api.GraphicsObject;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user