Merge remote-tracking branch 'upstream/master' into depsdepsdeps
This commit is contained in:
@@ -43,6 +43,7 @@ ext {
|
||||
httpcore = '4.4.12'
|
||||
httpmime = '4.5.9'
|
||||
javassist = '3.25.0-GA'
|
||||
javax = '1.3.2'
|
||||
javaxInject = '1'
|
||||
jbsdiff = '1.0'
|
||||
jclCore = '2.8'
|
||||
|
||||
@@ -11,6 +11,7 @@ description = 'RuneLite Client'
|
||||
dependencies {
|
||||
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombok
|
||||
|
||||
compileOnly group: 'javax.annotation', name: 'javax.annotation-api', version: javax
|
||||
compileOnly group: 'net.runelite', name: 'orange-extensions', version: orangeExtensions
|
||||
compileOnly group: 'org.projectlombok', name: 'lombok', version: lombok
|
||||
|
||||
|
||||
@@ -290,7 +290,7 @@ public class EquipmentInspectorPlugin extends Plugin
|
||||
StringPrice = NumberFormat.getIntegerInstance().format(TotalPrice);
|
||||
}
|
||||
chatMessageManager.queue(QueuedMessage.builder()
|
||||
.type(ChatMessageType.FRIENDSCHATNOTIFICATION)
|
||||
.type(ChatMessageType.CONSOLE)
|
||||
.runeLiteFormattedMessage(new ChatMessageBuilder()
|
||||
.append(ChatColorType.HIGHLIGHT)
|
||||
.append("Risked Value: ")
|
||||
|
||||
@@ -31,9 +31,9 @@ import lombok.Getter;
|
||||
@AllArgsConstructor
|
||||
public enum PlayerSpellEffect
|
||||
{
|
||||
BIND("Bind", 181, 4800, true, 0, TimerType.FREEZE),
|
||||
SNARE("Snare", 180, 9600, true, 1, TimerType.FREEZE),
|
||||
ENTANGLE("Entangle", 179, 14400, true, 2, TimerType.FREEZE),
|
||||
BIND("Bind", 181, 4800, false, 0, TimerType.FREEZE),
|
||||
SNARE("Snare", 180, 9600, false, 1, TimerType.FREEZE),
|
||||
ENTANGLE("Entangle", 179, 14400, false, 2, TimerType.FREEZE),
|
||||
RUSH("Ice Rush", 361, 4800, false, 3, TimerType.FREEZE),
|
||||
BURST("Ice Burst", 363, 9600, false, 4, TimerType.FREEZE),
|
||||
BLITZ("Ice Blitz", 367, 14400, false, 5, TimerType.FREEZE),
|
||||
|
||||
@@ -223,7 +223,7 @@ class GauntletTimer extends Overlay
|
||||
.append(elapsedTime);
|
||||
|
||||
chatMessageManager.queue(QueuedMessage.builder()
|
||||
.type(ChatMessageType.FRIENDSCHATNOTIFICATION)
|
||||
.type(ChatMessageType.CONSOLE)
|
||||
.runeLiteFormattedMessage(prepmessage.build())
|
||||
.build());
|
||||
}
|
||||
@@ -246,7 +246,7 @@ class GauntletTimer extends Overlay
|
||||
.append(elapsedTotalTime);
|
||||
|
||||
chatMessageManager.queue(QueuedMessage.builder()
|
||||
.type(ChatMessageType.FRIENDSCHATNOTIFICATION)
|
||||
.type(ChatMessageType.CONSOLE)
|
||||
.runeLiteFormattedMessage(challengedurationmessage.build())
|
||||
.build());
|
||||
|
||||
@@ -261,7 +261,7 @@ class GauntletTimer extends Overlay
|
||||
.append(elapsedBossTime);
|
||||
|
||||
chatMessageManager.queue(QueuedMessage.builder()
|
||||
.type(ChatMessageType.FRIENDSCHATNOTIFICATION)
|
||||
.type(ChatMessageType.CONSOLE)
|
||||
.runeLiteFormattedMessage(prepdeathmessage.build())
|
||||
.build());
|
||||
}
|
||||
|
||||
@@ -47,7 +47,11 @@ public interface GroundMarkerConfig extends Config
|
||||
FIVE("5"),
|
||||
SIX("6"),
|
||||
SEVEN("7"),
|
||||
EIGHT("8");
|
||||
EIGHT("8"),
|
||||
NINE("9"),
|
||||
TEN("10"),
|
||||
ELEVEN("11"),
|
||||
TWELVE("12");
|
||||
|
||||
private final String name;
|
||||
|
||||
@@ -78,11 +82,11 @@ public interface GroundMarkerConfig extends Config
|
||||
@ConfigItem(
|
||||
position = 1,
|
||||
keyName = "markerColor",
|
||||
name = "Default Marked tile Color",
|
||||
name = "Default tile Color",
|
||||
description = "Configures the default color of marked tiles",
|
||||
hidden = true,
|
||||
unhide = "amount",
|
||||
unhideValue = "1 || 2 || 3 || 4 || 5 || 6 || 7 || 8"
|
||||
unhideValue = "1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 || 11 || 12"
|
||||
)
|
||||
default Color markerColor()
|
||||
{
|
||||
@@ -97,7 +101,7 @@ public interface GroundMarkerConfig extends Config
|
||||
description = "Configures the color of the 2nd group of marked tiles",
|
||||
hidden = true,
|
||||
unhide = "amount",
|
||||
unhideValue = "2 || 3 || 4 || 5 || 6 || 7 || 8"
|
||||
unhideValue = "2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 || 11 || 12"
|
||||
)
|
||||
default Color markerColor2()
|
||||
{
|
||||
@@ -112,7 +116,7 @@ public interface GroundMarkerConfig extends Config
|
||||
description = "Configures the color of the 3rd group of marked tiles",
|
||||
hidden = true,
|
||||
unhide = "amount",
|
||||
unhideValue = "3 || 4 || 5 || 6 || 7 || 8"
|
||||
unhideValue = "3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 || 11 || 12"
|
||||
)
|
||||
default Color markerColor3()
|
||||
{
|
||||
@@ -127,7 +131,7 @@ public interface GroundMarkerConfig extends Config
|
||||
description = "Configures the color of the 4th group of marked tiles",
|
||||
hidden = true,
|
||||
unhide = "amount",
|
||||
unhideValue = "4 || 5 || 6 || 7 || 8"
|
||||
unhideValue = "4 || 5 || 6 || 7 || 8 || 9 || 10 || 11 || 12"
|
||||
)
|
||||
default Color markerColor4()
|
||||
{
|
||||
@@ -142,7 +146,7 @@ public interface GroundMarkerConfig extends Config
|
||||
description = "Configures the color of the 5th group of marked tiles",
|
||||
hidden = true,
|
||||
unhide = "amount",
|
||||
unhideValue = "5 || 6 || 7 || 8"
|
||||
unhideValue = "5 || 6 || 7 || 8 || 9 || 10 || 11 || 12"
|
||||
)
|
||||
default Color markerColor5()
|
||||
{
|
||||
@@ -157,7 +161,7 @@ public interface GroundMarkerConfig extends Config
|
||||
description = "Configures the color of the 6th group of marked tiles",
|
||||
hidden = true,
|
||||
unhide = "amount",
|
||||
unhideValue = "6 || 7 || 8"
|
||||
unhideValue = "6 || 7 || 8 || 9 || 10 || 11 || 12"
|
||||
)
|
||||
default Color markerColor6()
|
||||
{
|
||||
@@ -172,7 +176,7 @@ public interface GroundMarkerConfig extends Config
|
||||
description = "Configures the color of the 7th group of marked tiles",
|
||||
hidden = true,
|
||||
unhide = "amount",
|
||||
unhideValue = "7 || 8"
|
||||
unhideValue = "7 || 8 || 9 || 10 || 11 || 12"
|
||||
)
|
||||
default Color markerColor7()
|
||||
{
|
||||
@@ -187,15 +191,75 @@ public interface GroundMarkerConfig extends Config
|
||||
description = "Configures the color of the 8th group of marked tiles",
|
||||
hidden = true,
|
||||
unhide = "amount",
|
||||
unhideValue = "8"
|
||||
unhideValue = "8 || 9 || 10 || 11 || 12"
|
||||
)
|
||||
default Color markerColor8()
|
||||
{
|
||||
return Color.MAGENTA;
|
||||
}
|
||||
|
||||
@Alpha
|
||||
@ConfigItem(
|
||||
position = 10,
|
||||
keyName = "markerColor9",
|
||||
name = "Group 9 tile color",
|
||||
description = "Configures the color of the 9th group of marked tiles",
|
||||
hidden = true,
|
||||
unhide = "amount",
|
||||
unhideValue = "9 || 10 || 11 || 12"
|
||||
)
|
||||
default Color markerColor9()
|
||||
{
|
||||
return Color.CYAN;
|
||||
}
|
||||
|
||||
@Alpha
|
||||
@ConfigItem(
|
||||
position = 11,
|
||||
keyName = "markerColor10",
|
||||
name = "Group 10 tile color",
|
||||
description = "Configures the color of the 10th group of marked tiles",
|
||||
hidden = true,
|
||||
unhide = "amount",
|
||||
unhideValue = "10 || 11 || 12"
|
||||
)
|
||||
default Color markerColor10()
|
||||
{
|
||||
return Color.ORANGE;
|
||||
}
|
||||
|
||||
@Alpha
|
||||
@ConfigItem(
|
||||
position = 12,
|
||||
keyName = "markerColor11",
|
||||
name = "Group 11 tile color",
|
||||
description = "Configures the color of the 11th group of marked tiles",
|
||||
hidden = true,
|
||||
unhide = "amount",
|
||||
unhideValue = "11 || 12"
|
||||
)
|
||||
default Color markerColor11()
|
||||
{
|
||||
return Color.PINK;
|
||||
}
|
||||
|
||||
@Alpha
|
||||
@ConfigItem(
|
||||
position = 13,
|
||||
keyName = "markerColor12",
|
||||
name = "Group 12 tile color",
|
||||
description = "Configures the color of the 12th group of marked tiles",
|
||||
hidden = true,
|
||||
unhide = "amount",
|
||||
unhideValue = "12"
|
||||
)
|
||||
default Color markerColor12()
|
||||
{
|
||||
return Color.LIGHT_GRAY;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = 14,
|
||||
keyName = "showMinimap",
|
||||
name = "Show on minimap",
|
||||
description = "Shows marked tiles on the minimap"
|
||||
@@ -210,7 +274,7 @@ public interface GroundMarkerConfig extends Config
|
||||
max = 100
|
||||
)
|
||||
@ConfigItem(
|
||||
position = 11,
|
||||
position = 15,
|
||||
keyName = "minimapOpacity",
|
||||
name = "Minimap opacity",
|
||||
description = "The opacity of the minimap markers"
|
||||
|
||||
@@ -101,6 +101,18 @@ class GroundMarkerMinimapOverlay extends Overlay
|
||||
break;
|
||||
case 8:
|
||||
color = plugin.getMarkerColor8();
|
||||
break;
|
||||
case 9:
|
||||
color = plugin.getMarkerColor9();
|
||||
break;
|
||||
case 10:
|
||||
color = plugin.getMarkerColor10();
|
||||
break;
|
||||
case 11:
|
||||
color = plugin.getMarkerColor11();
|
||||
break;
|
||||
case 12:
|
||||
color = plugin.getMarkerColor12();
|
||||
}
|
||||
|
||||
int opacity = (int) floor(plugin.getMinimapOverlayOpacity() * 2.55);
|
||||
@@ -129,4 +141,4 @@ class GroundMarkerMinimapOverlay extends Overlay
|
||||
|
||||
OverlayUtil.renderMinimapRect(client, graphics, posOnMinimap, TILE_WIDTH, TILE_HEIGHT, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,19 @@ public class GroundMarkerOverlay extends Overlay
|
||||
break;
|
||||
case 8:
|
||||
color = plugin.getMarkerColor8();
|
||||
break;
|
||||
case 9:
|
||||
color = plugin.getMarkerColor9();
|
||||
break;
|
||||
case 10:
|
||||
color = plugin.getMarkerColor10();
|
||||
break;
|
||||
case 11:
|
||||
color = plugin.getMarkerColor11();
|
||||
break;
|
||||
case 12:
|
||||
color = plugin.getMarkerColor12();
|
||||
}
|
||||
OverlayUtil.renderPolygon(graphics, poly, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -162,6 +162,14 @@ public class GroundMarkerPlugin extends Plugin
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private Color markerColor8;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private Color markerColor9;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private Color markerColor10;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private Color markerColor11;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private Color markerColor12;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private boolean showMinimap;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private int minimapOverlayOpacity;
|
||||
@@ -459,6 +467,18 @@ public class GroundMarkerPlugin extends Plugin
|
||||
break;
|
||||
case 8:
|
||||
color = this.markerColor8;
|
||||
break;
|
||||
case 9:
|
||||
color = this.markerColor9;
|
||||
break;
|
||||
case 10:
|
||||
color = this.markerColor10;
|
||||
break;
|
||||
case 11:
|
||||
color = this.markerColor11;
|
||||
break;
|
||||
case 12:
|
||||
color = this.markerColor12;
|
||||
}
|
||||
|
||||
return color;
|
||||
@@ -483,7 +503,11 @@ public class GroundMarkerPlugin extends Plugin
|
||||
this.markerColor6 = config.markerColor6();
|
||||
this.markerColor7 = config.markerColor7();
|
||||
this.markerColor8 = config.markerColor8();
|
||||
this.markerColor9 = config.markerColor9();
|
||||
this.markerColor10 = config.markerColor10();
|
||||
this.markerColor11 = config.markerColor11();
|
||||
this.markerColor12 = config.markerColor12();
|
||||
this.showMinimap = config.showMinimap();
|
||||
this.minimapOverlayOpacity = config.minimapOverlayOpacity();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -160,7 +160,10 @@ public class PlayerIndicatorsOverlay extends Overlay
|
||||
|
||||
if (plugin.getAgilityFormat() == PlayerIndicatorsPlugin.AgilityFormats.ICONS)
|
||||
{
|
||||
final int width = graphics.getFontMetrics().stringWidth(name);
|
||||
|
||||
final int width = plugin.isShowCombatLevel() ? graphics.getFontMetrics().stringWidth(name)
|
||||
+ ACTOR_HORIZONTAL_TEXT_MARGIN : graphics.getFontMetrics().stringWidth(name);
|
||||
|
||||
final int height = graphics.getFontMetrics().getHeight();
|
||||
if (level >= plugin.getAgilityFirstThreshold())
|
||||
{
|
||||
|
||||
@@ -60,25 +60,26 @@ public class PlayerIndicatorsService
|
||||
|
||||
self = (player) -> Objects.equals(client.getLocalPlayer(), player);
|
||||
friend = (player) -> (!player.equals(client.getLocalPlayer()) && client.isFriended(player.getName(), false));
|
||||
clan = Player::isClanMember;
|
||||
clan = (player) -> (player.isClanMember() && !client.isFriended(player.getName(), false));
|
||||
team = (player) -> (Objects.requireNonNull(client.getLocalPlayer()).getTeam() != 0 &&
|
||||
client.getLocalPlayer().getTeam() == player.getTeam());
|
||||
target = (player) -> PvPUtil.isAttackable(client, player);
|
||||
target = (player ->
|
||||
{
|
||||
if (nonFriendly(player))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return plugin.isHighlightTargets() && PvPUtil.isAttackable(client, player);
|
||||
});
|
||||
caller = plugin::isCaller;
|
||||
callerTarget = piles::contains;
|
||||
other = (player ->
|
||||
{
|
||||
if (player == null
|
||||
|| (plugin.isHighlightClan() && player.isClanMember())
|
||||
|| (plugin.isHighlightFriends() && client.isFriended(player.getName(), false))
|
||||
|| (plugin.isHighlightCallers() && plugin.isCaller(player))
|
||||
|| (plugin.isHighlightCallerTargets() && piles.contains(player))
|
||||
|| (plugin.isHighlightTeam() && Objects.requireNonNull(client.getLocalPlayer()).getTeam() != 0
|
||||
&& client.getLocalPlayer().getTeam() == player.getTeam()))
|
||||
if (nonFriendly(player))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return !plugin.isHighlightTargets() || PvPUtil.isAttackable(client, player);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -141,4 +142,15 @@ public class PlayerIndicatorsService
|
||||
|| plugin.isHighlightFriends() || plugin.isHighlightOther() || plugin.isHighlightTargets()
|
||||
|| plugin.isHighlightCallers() || plugin.isHighlightTeam() || plugin.isHighlightCallerTargets();
|
||||
}
|
||||
|
||||
private boolean nonFriendly(Player player)
|
||||
{
|
||||
return player == null
|
||||
|| (plugin.isHighlightClan() && player.isClanMember())
|
||||
|| (plugin.isHighlightFriends() && client.isFriended(player.getName(), false))
|
||||
|| (plugin.isHighlightCallers() && plugin.isCaller(player))
|
||||
|| (plugin.isHighlightCallerTargets() && piles.contains(player))
|
||||
|| (plugin.isHighlightTeam() && Objects.requireNonNull(client.getLocalPlayer()).getTeam() != 0
|
||||
&& client.getLocalPlayer().getTeam() == player.getTeam());
|
||||
}
|
||||
}
|
||||
@@ -120,6 +120,9 @@ class ProfilesPanel extends PluginPanel
|
||||
txtDecryptPassword.setEchoChar((char) 0);
|
||||
txtDecryptPassword.setForeground(ColorScheme.LIGHT_GRAY_COLOR);
|
||||
txtDecryptPassword.setToolTipText(UNLOCK_PASSWORD);
|
||||
|
||||
txtDecryptPassword.addActionListener(e -> decryptAccounts());
|
||||
|
||||
txtDecryptPassword.addFocusListener(new FocusListener()
|
||||
{
|
||||
@Override
|
||||
@@ -156,27 +159,7 @@ class ProfilesPanel extends PluginPanel
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e)
|
||||
{
|
||||
boolean error = false;
|
||||
try
|
||||
{
|
||||
redrawProfiles();
|
||||
}
|
||||
catch (InvalidKeySpecException | NoSuchAlgorithmException | IllegalBlockSizeException | InvalidKeyException | BadPaddingException | NoSuchPaddingException ex)
|
||||
{
|
||||
error = true;
|
||||
showErrorMessage("Unable to load data", "Incorrect password!");
|
||||
}
|
||||
|
||||
if (error)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
remove(loginPanel);
|
||||
add(accountPanel, BorderLayout.CENTER);
|
||||
|
||||
profilesPanel.setLayout(new DynamicGridLayout(0, 1, 0, 3));
|
||||
add(profilesPanel, BorderLayout.SOUTH);
|
||||
decryptAccounts();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -386,6 +369,38 @@ class ProfilesPanel extends PluginPanel
|
||||
// addAccounts(config.profilesData());
|
||||
}
|
||||
|
||||
private void decryptAccounts()
|
||||
{
|
||||
if (txtDecryptPassword.getPassword().length == 0 || String.valueOf(txtDecryptPassword.getPassword()).equals(UNLOCK_PASSWORD))
|
||||
{
|
||||
showErrorMessage("Unable to load data", "Please enter a password!");
|
||||
return;
|
||||
}
|
||||
|
||||
boolean error = false;
|
||||
try
|
||||
{
|
||||
redrawProfiles();
|
||||
}
|
||||
catch (InvalidKeySpecException | NoSuchAlgorithmException | IllegalBlockSizeException | InvalidKeyException | BadPaddingException | NoSuchPaddingException ex)
|
||||
{
|
||||
error = true;
|
||||
showErrorMessage("Unable to load data", "Incorrect password!");
|
||||
txtDecryptPassword.setText("");
|
||||
}
|
||||
|
||||
if (error)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
remove(loginPanel);
|
||||
add(accountPanel, BorderLayout.CENTER);
|
||||
|
||||
profilesPanel.setLayout(new DynamicGridLayout(0, 1, 0, 3));
|
||||
add(profilesPanel, BorderLayout.SOUTH);
|
||||
}
|
||||
|
||||
private void redrawProfiles() throws InvalidKeySpecException, NoSuchAlgorithmException, IllegalBlockSizeException, InvalidKeyException, BadPaddingException, NoSuchPaddingException
|
||||
{
|
||||
profilesPanel.removeAll();
|
||||
@@ -462,11 +477,6 @@ class ProfilesPanel extends PluginPanel
|
||||
String tmp = profilesConfig.profilesData();
|
||||
if (tmp.startsWith("¬"))
|
||||
{
|
||||
if (txtDecryptPassword.getPassword().length == 0 || String.valueOf(txtDecryptPassword.getPassword()).equals(UNLOCK_PASSWORD))
|
||||
{
|
||||
showErrorMessage("Unable to load data", "Please enter a password!");
|
||||
return tmp;
|
||||
}
|
||||
tmp = tmp.substring(1);
|
||||
return decryptText(base64Decode(tmp), getAesKey());
|
||||
}
|
||||
|
||||
@@ -19,17 +19,6 @@ public interface SafeSpotConfig extends Config
|
||||
{
|
||||
@ConfigItem(
|
||||
position = 1,
|
||||
keyName = "playerSafeSpots",
|
||||
name = "Render for Players",
|
||||
description = "Renders 1 way safe spots vs other players"
|
||||
)
|
||||
default boolean playerSafeSpots()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = 2,
|
||||
keyName = "npcSafeSpots",
|
||||
name = "Render for NPCs",
|
||||
description = "Renders 1 way safe spots vs NPCs"
|
||||
@@ -40,7 +29,7 @@ public interface SafeSpotConfig extends Config
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = 3,
|
||||
position = 2,
|
||||
keyName = "tileColor",
|
||||
name = "Tile Color",
|
||||
description = "Color of safe spot tile"
|
||||
|
||||
@@ -21,7 +21,6 @@ import net.runelite.api.Actor;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.CollisionDataFlag;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.Tile;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.coords.WorldArea;
|
||||
@@ -38,10 +37,10 @@ import net.runelite.client.plugins.PluginType;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "1 Way Safe Spots",
|
||||
name = "NPC Safe Spots",
|
||||
description = "Renders tile overlays for one way safe spots",
|
||||
tags = {"safe spot", "pvp", "safespots", "pklite"},
|
||||
type = PluginType.UTILITY,
|
||||
tags = {"safe spot", "safespots", "pvm"},
|
||||
type = PluginType.PVM,
|
||||
enabledByDefault = false
|
||||
)
|
||||
@Singleton
|
||||
@@ -71,7 +70,6 @@ public class SafeSpotPlugin extends Plugin
|
||||
private SafeSpotOverlay safeSpotOverlay;
|
||||
private int tickCount = 0;
|
||||
|
||||
private boolean playerSafeSpots;
|
||||
private boolean npcSafeSpots;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private Color tileColor;
|
||||
@@ -113,7 +111,7 @@ public class SafeSpotPlugin extends Plugin
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (event.getTarget() == null && (this.npcSafeSpots || this.playerSafeSpots))
|
||||
if (event.getTarget() == null && this.npcSafeSpots)
|
||||
{
|
||||
tickCount = 10;
|
||||
}
|
||||
@@ -123,11 +121,6 @@ public class SafeSpotPlugin extends Plugin
|
||||
{
|
||||
if (client.getLocalPlayer().getInteracting() != null)
|
||||
{
|
||||
if (client.getLocalPlayer().getInteracting() instanceof Player && this.playerSafeSpots)
|
||||
{
|
||||
safeSpotsRenderable = true;
|
||||
updateSafeSpots();
|
||||
}
|
||||
if (client.getLocalPlayer().getInteracting() instanceof NPC && this.npcSafeSpots)
|
||||
{
|
||||
if (npcManager.getStats(((NPC) client.getLocalPlayer().getInteracting()).getId()) != null)
|
||||
@@ -215,7 +208,6 @@ public class SafeSpotPlugin extends Plugin
|
||||
|
||||
private void updateConfig()
|
||||
{
|
||||
this.playerSafeSpots = config.playerSafeSpots();
|
||||
this.npcSafeSpots = config.npcSafeSpots();
|
||||
this.tileColor = config.tileColor();
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import static net.runelite.api.AnimationID.*;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
import static net.runelite.api.GameState.LOADING;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemContainer;
|
||||
@@ -50,7 +49,6 @@ import net.runelite.api.events.AnimationChanged;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.ItemContainerChanged;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.client.Notifier;
|
||||
@@ -116,8 +114,6 @@ public class WintertodtPlugin extends Plugin
|
||||
private WintertodtNotifyMode notifyCondition;
|
||||
private Color damageNotificationColor;
|
||||
|
||||
private boolean subscribed;
|
||||
|
||||
@Provides
|
||||
WintertodtConfig getConfig(ConfigManager configManager)
|
||||
{
|
||||
@@ -134,15 +130,12 @@ public class WintertodtPlugin extends Plugin
|
||||
|
||||
reset();
|
||||
overlayManager.add(overlay);
|
||||
|
||||
handleWintertodtRegion();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
eventBus.unregister("inside-wintertodt");
|
||||
super.shutDown();
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
reset();
|
||||
@@ -151,23 +144,11 @@ public class WintertodtPlugin extends Plugin
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(VarbitChanged.class, this, this::onVarbitChanged);
|
||||
}
|
||||
|
||||
private void wintertodtSubscriptions(boolean subscribe)
|
||||
{
|
||||
if (subscribe)
|
||||
{
|
||||
eventBus.subscribe(GameTick.class, "inside-wintertodt", this::onGameTick);
|
||||
eventBus.subscribe(ChatMessage.class, "inside-wintertodt", this::onChatMessage);
|
||||
eventBus.subscribe(AnimationChanged.class, "inside-wintertodt", this::onAnimationChanged);
|
||||
eventBus.subscribe(ItemContainerChanged.class, "inside-wintertodt", this::onItemContainerChanged);
|
||||
}
|
||||
else
|
||||
{
|
||||
eventBus.unregister("inside-wintertodt");
|
||||
}
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
eventBus.subscribe(AnimationChanged.class, this, this::onAnimationChanged);
|
||||
eventBus.subscribe(ItemContainerChanged.class, this, this::onItemContainerChanged);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
@@ -199,24 +180,9 @@ public class WintertodtPlugin extends Plugin
|
||||
return false;
|
||||
}
|
||||
|
||||
private void handleWintertodtRegion()
|
||||
private void onGameTick(GameTick gameTick)
|
||||
{
|
||||
if (isInWintertodtRegion())
|
||||
{
|
||||
if (!isInWintertodt)
|
||||
{
|
||||
reset();
|
||||
log.debug("Entered Wintertodt!");
|
||||
}
|
||||
isInWintertodt = true;
|
||||
|
||||
if (!subscribed)
|
||||
{
|
||||
wintertodtSubscriptions(true);
|
||||
subscribed = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!isInWintertodtRegion())
|
||||
{
|
||||
if (isInWintertodt)
|
||||
{
|
||||
@@ -225,25 +191,16 @@ public class WintertodtPlugin extends Plugin
|
||||
}
|
||||
|
||||
isInWintertodt = false;
|
||||
|
||||
if (subscribed)
|
||||
{
|
||||
wintertodtSubscriptions(false);
|
||||
subscribed = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
if (event.getGameState() == LOADING)
|
||||
if (!isInWintertodt)
|
||||
{
|
||||
handleWintertodtRegion();
|
||||
reset();
|
||||
log.debug("Entered Wintertodt!");
|
||||
}
|
||||
}
|
||||
isInWintertodt = true;
|
||||
|
||||
private void onGameTick(GameTick gameTick)
|
||||
{
|
||||
checkActionTimeout();
|
||||
}
|
||||
|
||||
@@ -295,6 +252,11 @@ public class WintertodtPlugin extends Plugin
|
||||
|
||||
private void onChatMessage(ChatMessage chatMessage)
|
||||
{
|
||||
if (!isInWintertodt)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ChatMessageType chatMessageType = chatMessage.getType();
|
||||
|
||||
if (chatMessageType != ChatMessageType.GAMEMESSAGE && chatMessageType != ChatMessageType.SPAM)
|
||||
@@ -433,6 +395,11 @@ public class WintertodtPlugin extends Plugin
|
||||
|
||||
private void onAnimationChanged(final AnimationChanged event)
|
||||
{
|
||||
if (!isInWintertodt)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final Player local = client.getLocalPlayer();
|
||||
|
||||
if (event.getActor() != local)
|
||||
@@ -479,7 +446,7 @@ public class WintertodtPlugin extends Plugin
|
||||
{
|
||||
final ItemContainer container = event.getItemContainer();
|
||||
|
||||
if (container != client.getItemContainer(InventoryID.INVENTORY))
|
||||
if (!isInWintertodt || container != client.getItemContainer(InventoryID.INVENTORY))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user