Fix up client. (#815)
* Aoe Warnings Fix-Up * Freeze Timers NPE Fix * Slayer Chat Lookup NPE && Fixing up Access levels. * Raids Thieving NPE Fix && Fixing up Access levels. * Revert "Fix copy paste error" This reverts commit 26c88101b682eb76b98a8a0d88fc8a47c9f104d3. * Revert "Fix checkstyle" This reverts commit abf7fec004148897585bc0389bb5e0420e3d03cb. * Revert "Convert game thread events to singletons" This reverts commit b33048d7ee0481b17c5849d2d862e75c91e5a36c. * Various Fixes
This commit is contained in:
@@ -51,6 +51,7 @@ public class GraphicID
|
|||||||
public static final int IMBUED_HEART = 1316;
|
public static final int IMBUED_HEART = 1316;
|
||||||
public static final int FLYING_FISH = 1387;
|
public static final int FLYING_FISH = 1387;
|
||||||
public static final int OLM_BURN = 1351;
|
public static final int OLM_BURN = 1351;
|
||||||
|
public static final int OLM_LIGHTNING = 1356;
|
||||||
public static final int OLM_TELEPORT = 1359;
|
public static final int OLM_TELEPORT = 1359;
|
||||||
public static final int OLM_HEAL = 1363;
|
public static final int OLM_HEAL = 1363;
|
||||||
public static final int OLM_CRYSTAL = 1447;
|
public static final int OLM_CRYSTAL = 1447;
|
||||||
|
|||||||
@@ -20,13 +20,6 @@ import net.runelite.api.Actor;
|
|||||||
@Data
|
@Data
|
||||||
public class AnimationChanged
|
public class AnimationChanged
|
||||||
{
|
{
|
||||||
public static final AnimationChanged INSTANCE = new AnimationChanged();
|
|
||||||
|
|
||||||
private AnimationChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The actor that has entered a new animation.
|
* The actor that has entered a new animation.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -29,13 +29,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class AreaSoundEffectPlayed
|
public class AreaSoundEffectPlayed
|
||||||
{
|
{
|
||||||
public static final AreaSoundEffectPlayed INSTANCE = new AreaSoundEffectPlayed();
|
|
||||||
|
|
||||||
private AreaSoundEffectPlayed()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
private int soundId;
|
private int soundId;
|
||||||
private int sceneX;
|
private int sceneX;
|
||||||
private int sceneY;
|
private int sceneY;
|
||||||
|
|||||||
@@ -29,13 +29,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class BeforeMenuRender
|
public class BeforeMenuRender
|
||||||
{
|
{
|
||||||
public static final BeforeMenuRender INSTANCE = new BeforeMenuRender();
|
|
||||||
|
|
||||||
private BeforeMenuRender()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean consumed;
|
private boolean consumed;
|
||||||
|
|
||||||
public void consume()
|
public void consume()
|
||||||
|
|||||||
@@ -29,10 +29,4 @@ package net.runelite.api.events;
|
|||||||
*/
|
*/
|
||||||
public class BeforeRender
|
public class BeforeRender
|
||||||
{
|
{
|
||||||
public static final BeforeRender INSTANCE = new BeforeRender();
|
|
||||||
|
|
||||||
private BeforeRender()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,13 +44,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class BoostedLevelChanged
|
public class BoostedLevelChanged
|
||||||
{
|
{
|
||||||
public static final BoostedLevelChanged INSTANCE = new BoostedLevelChanged();
|
|
||||||
|
|
||||||
private BoostedLevelChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The skill that has had its level modified.
|
* The skill that has had its level modified.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -29,10 +29,4 @@ package net.runelite.api.events;
|
|||||||
*/
|
*/
|
||||||
public class CannonballFired
|
public class CannonballFired
|
||||||
{
|
{
|
||||||
public static final CannonballFired INSTANCE = new CannonballFired();
|
|
||||||
|
|
||||||
private CannonballFired()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import net.runelite.api.ChatMessageType;
|
|||||||
import net.runelite.api.MessageNode;
|
import net.runelite.api.MessageNode;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event where a new chat message is received.
|
* An event where a new chat message is received.
|
||||||
@@ -39,15 +40,9 @@ import lombok.Data;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class ChatMessage
|
public class ChatMessage
|
||||||
{
|
{
|
||||||
public static final ChatMessage INSTANCE = new ChatMessage();
|
|
||||||
|
|
||||||
private ChatMessage()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The underlying MessageNode for the message.
|
* The underlying MessageNode for the message.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -24,21 +24,14 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event where the client has joined or left a clan chat.
|
* An event where the client has joined or left a clan chat.
|
||||||
*/
|
*/
|
||||||
@Data
|
@Value
|
||||||
public class ClanChanged
|
public class ClanChanged
|
||||||
{
|
{
|
||||||
public static final ClanChanged INSTANCE = new ClanChanged();
|
|
||||||
|
|
||||||
private ClanChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether or not the client is now in a clan chat.
|
* Whether or not the client is now in a clan chat.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -25,18 +25,11 @@
|
|||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
import net.runelite.api.ClanMember;
|
import net.runelite.api.ClanMember;
|
||||||
import lombok.Data;
|
import lombok.Value;
|
||||||
|
|
||||||
@Data
|
@Value
|
||||||
public class ClanMemberJoined
|
public class ClanMemberJoined
|
||||||
{
|
{
|
||||||
public static final ClanMemberJoined INSTANCE = new ClanMemberJoined();
|
|
||||||
|
|
||||||
private ClanMemberJoined()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ClanMember that joined
|
* The ClanMember that joined
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -25,18 +25,11 @@
|
|||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
import net.runelite.api.ClanMember;
|
import net.runelite.api.ClanMember;
|
||||||
import lombok.Data;
|
import lombok.Value;
|
||||||
|
|
||||||
@Data
|
@Value
|
||||||
public class ClanMemberLeft
|
public class ClanMemberLeft
|
||||||
{
|
{
|
||||||
public static final ClanMemberLeft INSTANCE = new ClanMemberLeft();
|
|
||||||
|
|
||||||
private ClanMemberLeft()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ClanMember that left
|
* The ClanMember that left
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -29,10 +29,4 @@ package net.runelite.api.events;
|
|||||||
*/
|
*/
|
||||||
public class ClientTick
|
public class ClientTick
|
||||||
{
|
{
|
||||||
public static final ClientTick INSTANCE = new ClientTick();
|
|
||||||
|
|
||||||
private ClientTick()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event where a command has been used in the chat.
|
* An event where a command has been used in the chat.
|
||||||
@@ -41,16 +41,9 @@ import lombok.Data;
|
|||||||
* set the command field to an empty string. For example, the message ":: hello world!"
|
* set the command field to an empty string. For example, the message ":: hello world!"
|
||||||
* will set command to "" and arguments to ["hello", "world!"].
|
* will set command to "" and arguments to ["hello", "world!"].
|
||||||
*/
|
*/
|
||||||
@Data
|
@Value
|
||||||
public class CommandExecuted
|
public class CommandExecuted
|
||||||
{
|
{
|
||||||
public static final CommandExecuted INSTANCE = new CommandExecuted();
|
|
||||||
|
|
||||||
private CommandExecuted()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the command entered.
|
* The name of the command entered.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -35,13 +35,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class DecorativeObjectChanged
|
public class DecorativeObjectChanged
|
||||||
{
|
{
|
||||||
public static final DecorativeObjectChanged INSTANCE = new DecorativeObjectChanged();
|
|
||||||
|
|
||||||
private DecorativeObjectChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The affected tile.
|
* The affected tile.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -35,13 +35,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class DecorativeObjectDespawned
|
public class DecorativeObjectDespawned
|
||||||
{
|
{
|
||||||
public static final DecorativeObjectDespawned INSTANCE = new DecorativeObjectDespawned();
|
|
||||||
|
|
||||||
private DecorativeObjectDespawned()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The affected tile.
|
* The affected tile.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -34,13 +34,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class DecorativeObjectSpawned
|
public class DecorativeObjectSpawned
|
||||||
{
|
{
|
||||||
public static final DecorativeObjectSpawned INSTANCE = new DecorativeObjectSpawned();
|
|
||||||
|
|
||||||
private DecorativeObjectSpawned()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The affected tile.
|
* The affected tile.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -33,13 +33,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class DraggingWidgetChanged
|
public class DraggingWidgetChanged
|
||||||
{
|
{
|
||||||
public static final DraggingWidgetChanged INSTANCE = new DraggingWidgetChanged();
|
|
||||||
|
|
||||||
private DraggingWidgetChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether a widget is currently being dragged.
|
* Whether a widget is currently being dragged.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -34,13 +34,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class ExperienceChanged
|
public class ExperienceChanged
|
||||||
{
|
{
|
||||||
public static final ExperienceChanged INSTANCE = new ExperienceChanged();
|
|
||||||
|
|
||||||
private ExperienceChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The modified skill.
|
* The modified skill.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -34,13 +34,6 @@ import net.runelite.api.Tile;
|
|||||||
@Data
|
@Data
|
||||||
public class GameObjectChanged
|
public class GameObjectChanged
|
||||||
{
|
{
|
||||||
public static final GameObjectChanged INSTANCE = new GameObjectChanged();
|
|
||||||
|
|
||||||
private GameObjectChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The affected tile.
|
* The affected tile.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -34,13 +34,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class GameObjectDespawned
|
public class GameObjectDespawned
|
||||||
{
|
{
|
||||||
public static final GameObjectDespawned INSTANCE = new GameObjectDespawned();
|
|
||||||
|
|
||||||
private GameObjectDespawned()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The affected tile.
|
* The affected tile.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -34,13 +34,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class GameObjectSpawned
|
public class GameObjectSpawned
|
||||||
{
|
{
|
||||||
public static final GameObjectSpawned INSTANCE = new GameObjectSpawned();
|
|
||||||
|
|
||||||
private GameObjectSpawned()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The affected tile.
|
* The affected tile.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -33,13 +33,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class GameStateChanged
|
public class GameStateChanged
|
||||||
{
|
{
|
||||||
public static final GameStateChanged INSTANCE = new GameStateChanged();
|
|
||||||
|
|
||||||
private GameStateChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The new game state.
|
* The new game state.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
// The NPC update event seem to run every server tick,
|
// The NPC update event seem to run every server tick,
|
||||||
// but having the game tick event after all packets
|
// but having the game tick event after all packets
|
||||||
// have been processed is typically more useful.
|
// have been processed is typically more useful.
|
||||||
@@ -41,12 +43,7 @@ package net.runelite.api.events;
|
|||||||
* Note that occurrences that take place purely on the client, such as right
|
* Note that occurrences that take place purely on the client, such as right
|
||||||
* click menus, are independent of the game tick.
|
* click menus, are independent of the game tick.
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
public class GameTick
|
public class GameTick
|
||||||
{
|
{
|
||||||
public static final GameTick INSTANCE = new GameTick();
|
|
||||||
|
|
||||||
private GameTick()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,13 +44,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class GrandExchangeOfferChanged
|
public class GrandExchangeOfferChanged
|
||||||
{
|
{
|
||||||
public static final GrandExchangeOfferChanged INSTANCE = new GrandExchangeOfferChanged();
|
|
||||||
|
|
||||||
private GrandExchangeOfferChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The offer that has been modified.
|
* The offer that has been modified.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -25,24 +25,16 @@
|
|||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
import net.runelite.api.GraphicsObject;
|
import net.runelite.api.GraphicsObject;
|
||||||
|
import lombok.Value;
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event where a new {@link GraphicsObject} has been created.
|
* An event where a new {@link GraphicsObject} has been created.
|
||||||
*/
|
*/
|
||||||
@Data
|
@Value
|
||||||
public class GraphicsObjectCreated
|
public class GraphicsObjectCreated
|
||||||
{
|
{
|
||||||
public static final GraphicsObjectCreated INSTANCE = new GraphicsObjectCreated();
|
|
||||||
|
|
||||||
private GraphicsObjectCreated()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The newly created graphics object.
|
* The newly created graphics object.
|
||||||
*/
|
*/
|
||||||
private GraphicsObject graphicsObject;
|
private final GraphicsObject graphicsObject;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,13 +34,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class GroundObjectChanged
|
public class GroundObjectChanged
|
||||||
{
|
{
|
||||||
public static final GroundObjectChanged INSTANCE = new GroundObjectChanged();
|
|
||||||
|
|
||||||
private GroundObjectChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The affected tile.
|
* The affected tile.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -34,13 +34,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class GroundObjectDespawned
|
public class GroundObjectDespawned
|
||||||
{
|
{
|
||||||
public static final GroundObjectDespawned INSTANCE = new GroundObjectDespawned();
|
|
||||||
|
|
||||||
private GroundObjectDespawned()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The affected tile.
|
* The affected tile.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -34,13 +34,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class GroundObjectSpawned
|
public class GroundObjectSpawned
|
||||||
{
|
{
|
||||||
public static final GroundObjectSpawned INSTANCE = new GroundObjectSpawned();
|
|
||||||
|
|
||||||
private GroundObjectSpawned()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The affected tile.
|
* The affected tile.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -38,13 +38,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class HitsplatApplied
|
public class HitsplatApplied
|
||||||
{
|
{
|
||||||
public static final HitsplatApplied INSTANCE = new HitsplatApplied();
|
|
||||||
|
|
||||||
private HitsplatApplied()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The actor the hitsplat was applied to.
|
* The actor the hitsplat was applied to.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -30,12 +30,5 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class InteractChanged
|
public class InteractChanged
|
||||||
{
|
{
|
||||||
public static final InteractChanged INSTANCE = new InteractChanged();
|
|
||||||
|
|
||||||
private InteractChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
private Actor actor;
|
private Actor actor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +1,18 @@
|
|||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
import net.runelite.api.Actor;
|
import net.runelite.api.Actor;
|
||||||
|
import lombok.Value;
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event called when the actor an actor is interacting with changes
|
* An event called when the actor an actor is interacting with changes
|
||||||
*/
|
*/
|
||||||
@Data
|
@Value
|
||||||
public class InteractingChanged
|
public class InteractingChanged
|
||||||
{
|
{
|
||||||
public static final InteractingChanged INSTANCE = new InteractingChanged();
|
private final Actor source;
|
||||||
|
|
||||||
private InteractingChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
private Actor source;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Target actor, may be null
|
* Target actor, may be null
|
||||||
*/
|
*/
|
||||||
private Actor target;
|
private final Actor target;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,8 +25,7 @@
|
|||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
import net.runelite.api.ItemContainer;
|
import net.runelite.api.ItemContainer;
|
||||||
|
import lombok.Value;
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event called whenever the stack size of an {@link api.Item}
|
* An event called whenever the stack size of an {@link api.Item}
|
||||||
@@ -39,18 +38,11 @@ import lombok.Data;
|
|||||||
* <li>Dropping an item</li>
|
* <li>Dropping an item</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
@Data
|
@Value
|
||||||
public class ItemContainerChanged
|
public class ItemContainerChanged
|
||||||
{
|
{
|
||||||
public static final ItemContainerChanged INSTANCE = new ItemContainerChanged();
|
|
||||||
|
|
||||||
private ItemContainerChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The modified item container.
|
* The modified item container.
|
||||||
*/
|
*/
|
||||||
private ItemContainer itemContainer;
|
private final ItemContainer itemContainer;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,23 +26,15 @@ package net.runelite.api.events;
|
|||||||
|
|
||||||
import net.runelite.api.Item;
|
import net.runelite.api.Item;
|
||||||
import net.runelite.api.Tile;
|
import net.runelite.api.Tile;
|
||||||
|
import lombok.Value;
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when an item pile despawns from the ground. When the client loads a new scene,
|
* Called when an item pile despawns from the ground. When the client loads a new scene,
|
||||||
* all item piles are implicitly despawned, and despawn events will not be sent.
|
* all item piles are implicitly despawned, and despawn events will not be sent.
|
||||||
*/
|
*/
|
||||||
@Data
|
@Value
|
||||||
public class ItemDespawned
|
public class ItemDespawned
|
||||||
{
|
{
|
||||||
public static final ItemDespawned INSTANCE = new ItemDespawned();
|
private final Tile tile;
|
||||||
|
private final Item item;
|
||||||
private ItemDespawned()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
private Tile tile;
|
|
||||||
private Item item;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,23 +26,16 @@ package net.runelite.api.events;
|
|||||||
|
|
||||||
import net.runelite.api.Item;
|
import net.runelite.api.Item;
|
||||||
import net.runelite.api.Tile;
|
import net.runelite.api.Tile;
|
||||||
import lombok.Data;
|
import lombok.Value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the quantity of an item pile changes.
|
* Called when the quantity of an item pile changes.
|
||||||
*/
|
*/
|
||||||
@Data
|
@Value
|
||||||
public class ItemQuantityChanged
|
public class ItemQuantityChanged
|
||||||
{
|
{
|
||||||
public static final ItemQuantityChanged INSTANCE = new ItemQuantityChanged();
|
private final Item item;
|
||||||
|
private final Tile tile;
|
||||||
private ItemQuantityChanged()
|
private final int oldQuantity;
|
||||||
{
|
private final int newQuantity;
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
private Item item;
|
|
||||||
private Tile tile;
|
|
||||||
private int oldQuantity;
|
|
||||||
private int newQuantity;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,22 +26,15 @@ package net.runelite.api.events;
|
|||||||
|
|
||||||
import net.runelite.api.Item;
|
import net.runelite.api.Item;
|
||||||
import net.runelite.api.Tile;
|
import net.runelite.api.Tile;
|
||||||
import lombok.Data;
|
import lombok.Value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when an item pile spawns on the ground. When the client loads a new scene,
|
* Called when an item pile spawns on the ground. When the client loads a new scene,
|
||||||
* all item piles are implicitly reset and a new spawn event will be sent.
|
* all item piles are implicitly reset and a new spawn event will be sent.
|
||||||
*/
|
*/
|
||||||
@Data
|
@Value
|
||||||
public class ItemSpawned
|
public class ItemSpawned
|
||||||
{
|
{
|
||||||
public static final ItemSpawned INSTANCE = new ItemSpawned();
|
private final Tile tile;
|
||||||
|
private final Item item;
|
||||||
private ItemSpawned()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
private Tile tile;
|
|
||||||
private Item item;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,10 +29,4 @@ package net.runelite.api.events;
|
|||||||
*/
|
*/
|
||||||
public class LocalPlayerDeath
|
public class LocalPlayerDeath
|
||||||
{
|
{
|
||||||
public static final LocalPlayerDeath INSTANCE = new LocalPlayerDeath();
|
|
||||||
|
|
||||||
private LocalPlayerDeath()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,17 +35,10 @@ import net.runelite.api.MenuEntry;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class MenuEntryAdded
|
public class MenuEntryAdded
|
||||||
{
|
{
|
||||||
public static final MenuEntryAdded INSTANCE = new MenuEntryAdded();
|
|
||||||
|
|
||||||
private MenuEntryAdded()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The MenuEntry object that was actually added
|
* The MenuEntry object that was actually added
|
||||||
*/
|
*/
|
||||||
private MenuEntry menuEntry;
|
private final MenuEntry menuEntry;
|
||||||
|
|
||||||
public String getOption()
|
public String getOption()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,13 +33,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class MenuOpened
|
public class MenuOpened
|
||||||
{
|
{
|
||||||
public static final MenuOpened INSTANCE = new MenuOpened();
|
|
||||||
|
|
||||||
private MenuOpened()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The menu entries in the newly opened menu.
|
* The menu entries in the newly opened menu.
|
||||||
* <p>
|
* <p>
|
||||||
|
|||||||
@@ -42,13 +42,6 @@ import net.runelite.api.MenuEntry;
|
|||||||
@Data
|
@Data
|
||||||
public class MenuOptionClicked
|
public class MenuOptionClicked
|
||||||
{
|
{
|
||||||
public static final MenuOptionClicked INSTANCE = new MenuOptionClicked();
|
|
||||||
|
|
||||||
private MenuOptionClicked()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
public MenuOptionClicked(MenuEntry entry)
|
public MenuOptionClicked(MenuEntry entry)
|
||||||
{
|
{
|
||||||
menuEntry = entry;
|
menuEntry = entry;
|
||||||
|
|||||||
@@ -33,13 +33,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class MenuShouldLeftClick
|
public class MenuShouldLeftClick
|
||||||
{
|
{
|
||||||
public static final MenuShouldLeftClick INSTANCE = new MenuShouldLeftClick();
|
|
||||||
|
|
||||||
private MenuShouldLeftClick()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If set to true, the menu will open on left click.
|
* If set to true, the menu will open on left click.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -25,23 +25,16 @@
|
|||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
import net.runelite.api.Nameable;
|
import net.runelite.api.Nameable;
|
||||||
import lombok.Data;
|
import lombok.Value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event where a {@link Nameable} has had their name changed.
|
* An event where a {@link Nameable} has had their name changed.
|
||||||
*/
|
*/
|
||||||
@Data
|
@Value
|
||||||
public class NameableNameChanged
|
public class NameableNameChanged
|
||||||
{
|
{
|
||||||
public static final NameableNameChanged INSTANCE = new NameableNameChanged();
|
|
||||||
|
|
||||||
private NameableNameChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The nameable that changed names.
|
* The nameable that changed names.
|
||||||
*/
|
*/
|
||||||
private Nameable nameable;
|
private final Nameable nameable;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,13 +33,6 @@ import net.runelite.api.NPCDefinition;
|
|||||||
@Data
|
@Data
|
||||||
public class NpcActionChanged
|
public class NpcActionChanged
|
||||||
{
|
{
|
||||||
public static final NpcActionChanged INSTANCE = new NpcActionChanged();
|
|
||||||
|
|
||||||
private NpcActionChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The NPC composition that has been changed.
|
* The NPC composition that has been changed.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -26,25 +26,18 @@ package net.runelite.api.events;
|
|||||||
|
|
||||||
import net.runelite.api.Actor;
|
import net.runelite.api.Actor;
|
||||||
import net.runelite.api.NPC;
|
import net.runelite.api.NPC;
|
||||||
import lombok.Data;
|
import lombok.Value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event where an {@link NPC} has despawned.
|
* An event where an {@link NPC} has despawned.
|
||||||
*/
|
*/
|
||||||
@Data
|
@Value
|
||||||
public class NpcDespawned
|
public class NpcDespawned
|
||||||
{
|
{
|
||||||
public static final NpcDespawned INSTANCE = new NpcDespawned();
|
|
||||||
|
|
||||||
private NpcDespawned()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The despawned NPC.
|
* The despawned NPC.
|
||||||
*/
|
*/
|
||||||
private NPC npc;
|
private final NPC npc;
|
||||||
|
|
||||||
public Actor getActor()
|
public Actor getActor()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,25 +26,18 @@ package net.runelite.api.events;
|
|||||||
|
|
||||||
import net.runelite.api.Actor;
|
import net.runelite.api.Actor;
|
||||||
import net.runelite.api.NPC;
|
import net.runelite.api.NPC;
|
||||||
import lombok.Data;
|
import lombok.Value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event where an {@link NPC} has spawned.
|
* An event where an {@link NPC} has spawned.
|
||||||
*/
|
*/
|
||||||
@Data
|
@Value
|
||||||
public class NpcSpawned
|
public class NpcSpawned
|
||||||
{
|
{
|
||||||
public static final NpcSpawned INSTANCE = new NpcSpawned();
|
|
||||||
|
|
||||||
private NpcSpawned()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The spawned NPC.
|
* The spawned NPC.
|
||||||
*/
|
*/
|
||||||
private NPC npc;
|
private final NPC npc;
|
||||||
|
|
||||||
public Actor getActor()
|
public Actor getActor()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,19 +1,12 @@
|
|||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
import net.runelite.api.Actor;
|
import net.runelite.api.Actor;
|
||||||
import lombok.Data;
|
import lombok.Value;
|
||||||
|
|
||||||
@Data
|
@Value
|
||||||
public class OverheadTextChanged
|
public class OverheadTextChanged
|
||||||
{
|
{
|
||||||
public static final OverheadTextChanged INSTANCE = new OverheadTextChanged();
|
private final Actor actor;
|
||||||
|
|
||||||
private OverheadTextChanged()
|
private final String overheadText;
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
private Actor actor;
|
|
||||||
|
|
||||||
private String overheadText;
|
|
||||||
}
|
}
|
||||||
@@ -26,27 +26,20 @@ package net.runelite.api.events;
|
|||||||
|
|
||||||
import net.runelite.api.Actor;
|
import net.runelite.api.Actor;
|
||||||
import net.runelite.api.Player;
|
import net.runelite.api.Player;
|
||||||
import lombok.Data;
|
import lombok.Value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event where a {@link Player} has despawned.
|
* An event where a {@link Player} has despawned.
|
||||||
* <p>
|
* <p>
|
||||||
* Note: This event does not get called for the local player.
|
* Note: This event does not get called for the local player.
|
||||||
*/
|
*/
|
||||||
@Data
|
@Value
|
||||||
public class PlayerDespawned
|
public class PlayerDespawned
|
||||||
{
|
{
|
||||||
public static final PlayerDespawned INSTANCE = new PlayerDespawned();
|
|
||||||
|
|
||||||
private PlayerDespawned()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The despawned player.
|
* The despawned player.
|
||||||
*/
|
*/
|
||||||
private Player player;
|
private final Player player;
|
||||||
|
|
||||||
public Actor getActor()
|
public Actor getActor()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,13 +33,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class PlayerMenuOptionClicked
|
public class PlayerMenuOptionClicked
|
||||||
{
|
{
|
||||||
public static final PlayerMenuOptionClicked INSTANCE = new PlayerMenuOptionClicked();
|
|
||||||
|
|
||||||
private PlayerMenuOptionClicked()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The menu option clicked.
|
* The menu option clicked.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -29,13 +29,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class PlayerMenuOptionsChanged
|
public class PlayerMenuOptionsChanged
|
||||||
{
|
{
|
||||||
public static final PlayerMenuOptionsChanged INSTANCE = new PlayerMenuOptionsChanged();
|
|
||||||
|
|
||||||
private PlayerMenuOptionsChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Index in playerOptions which changed.
|
* Index in playerOptions which changed.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -26,25 +26,18 @@ package net.runelite.api.events;
|
|||||||
|
|
||||||
import net.runelite.api.Actor;
|
import net.runelite.api.Actor;
|
||||||
import net.runelite.api.Player;
|
import net.runelite.api.Player;
|
||||||
import lombok.Data;
|
import lombok.Value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event where a {@link Player} has spawned.
|
* An event where a {@link Player} has spawned.
|
||||||
*/
|
*/
|
||||||
@Data
|
@Value
|
||||||
public class PlayerSpawned
|
public class PlayerSpawned
|
||||||
{
|
{
|
||||||
public static final PlayerSpawned INSTANCE = new PlayerSpawned();
|
|
||||||
|
|
||||||
private PlayerSpawned()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The spawned player.
|
* The spawned player.
|
||||||
*/
|
*/
|
||||||
private Player player;
|
private final Player player;
|
||||||
|
|
||||||
public Actor getActor()
|
public Actor getActor()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,12 +30,5 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class PostHealthBar
|
public class PostHealthBar
|
||||||
{
|
{
|
||||||
public static final PostHealthBar INSTANCE = new PostHealthBar();
|
|
||||||
|
|
||||||
private PostHealthBar()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
private HealthBar healthBar;
|
private HealthBar healthBar;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,13 +34,6 @@ import net.runelite.api.ItemDefinition;
|
|||||||
@Data
|
@Data
|
||||||
public class PostItemDefinition
|
public class PostItemDefinition
|
||||||
{
|
{
|
||||||
public static final PostItemDefinition INSTANCE = new PostItemDefinition();
|
|
||||||
|
|
||||||
private PostItemDefinition()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The newly created item.
|
* The newly created item.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -37,13 +37,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class ProjectileMoved
|
public class ProjectileMoved
|
||||||
{
|
{
|
||||||
public static final ProjectileMoved INSTANCE = new ProjectileMoved();
|
|
||||||
|
|
||||||
private ProjectileMoved()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The projectile being moved.
|
* The projectile being moved.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -34,13 +34,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class ProjectileSpawned
|
public class ProjectileSpawned
|
||||||
{
|
{
|
||||||
public static final ProjectileSpawned INSTANCE = new ProjectileSpawned();
|
|
||||||
|
|
||||||
private ProjectileSpawned()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The spawned projectile.
|
* The spawned projectile.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -24,23 +24,16 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event where a request to remove a friend is sent to the server.
|
* An event where a request to remove a friend is sent to the server.
|
||||||
*/
|
*/
|
||||||
@Data
|
@Value
|
||||||
public class RemovedFriend
|
public class RemovedFriend
|
||||||
{
|
{
|
||||||
public static final RemovedFriend INSTANCE = new RemovedFriend();
|
|
||||||
|
|
||||||
private RemovedFriend()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the removed friend.
|
* The name of the removed friend.
|
||||||
*/
|
*/
|
||||||
private String name;
|
private final String name;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,13 +34,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class ResizeableChanged
|
public class ResizeableChanged
|
||||||
{
|
{
|
||||||
public static final ResizeableChanged INSTANCE = new ResizeableChanged();
|
|
||||||
|
|
||||||
private ResizeableChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the game is in resizable mode.
|
* Whether the game is in resizable mode.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -33,13 +33,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class ScriptCallbackEvent
|
public class ScriptCallbackEvent
|
||||||
{
|
{
|
||||||
public static final ScriptCallbackEvent INSTANCE = new ScriptCallbackEvent();
|
|
||||||
|
|
||||||
private ScriptCallbackEvent()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The script being called.
|
* The script being called.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -29,13 +29,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class SoundEffectPlayed
|
public class SoundEffectPlayed
|
||||||
{
|
{
|
||||||
public static final SoundEffectPlayed INSTANCE = new SoundEffectPlayed();
|
|
||||||
|
|
||||||
private SoundEffectPlayed()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
private int soundId;
|
private int soundId;
|
||||||
private int delay;
|
private int delay;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,13 +21,6 @@ import net.runelite.api.Actor;
|
|||||||
@Data
|
@Data
|
||||||
public class SpotAnimationChanged
|
public class SpotAnimationChanged
|
||||||
{
|
{
|
||||||
public static final SpotAnimationChanged INSTANCE = new SpotAnimationChanged();
|
|
||||||
|
|
||||||
private SpotAnimationChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The actor that has had their graphic changed.
|
* The actor that has had their graphic changed.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -32,10 +32,4 @@ package net.runelite.api.events;
|
|||||||
*/
|
*/
|
||||||
public class UsernameChanged
|
public class UsernameChanged
|
||||||
{
|
{
|
||||||
public static final UsernameChanged INSTANCE = new UsernameChanged();
|
|
||||||
|
|
||||||
private UsernameChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,20 +25,13 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event where a varbit integer has changed.
|
* An event where a varbit integer has changed.
|
||||||
*/
|
*/
|
||||||
@Data
|
@Value
|
||||||
public class VarClientIntChanged
|
public class VarClientIntChanged
|
||||||
{
|
{
|
||||||
public static final VarClientIntChanged INSTANCE = new VarClientIntChanged();
|
|
||||||
|
|
||||||
private VarClientIntChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
private int index;
|
private int index;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,20 +25,13 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event where a varbit string has changed.
|
* An event where a varbit string has changed.
|
||||||
*/
|
*/
|
||||||
@Data
|
@Value
|
||||||
public class VarClientStrChanged
|
public class VarClientStrChanged
|
||||||
{
|
{
|
||||||
public static final VarClientStrChanged INSTANCE = new VarClientStrChanged();
|
|
||||||
|
|
||||||
private VarClientStrChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
private int index;
|
private int index;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,13 +34,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class VarbitChanged
|
public class VarbitChanged
|
||||||
{
|
{
|
||||||
public static final VarbitChanged INSTANCE = new VarbitChanged();
|
|
||||||
|
|
||||||
private VarbitChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Index in the varp array that was changed.
|
* Index in the varp array that was changed.
|
||||||
* For varplayer, this is the varplayer id.
|
* For varplayer, this is the varplayer id.
|
||||||
|
|||||||
@@ -34,13 +34,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class WallObjectChanged
|
public class WallObjectChanged
|
||||||
{
|
{
|
||||||
public static final WallObjectChanged INSTANCE = new WallObjectChanged();
|
|
||||||
|
|
||||||
private WallObjectChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The affected tile.
|
* The affected tile.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -34,13 +34,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class WallObjectDespawned
|
public class WallObjectDespawned
|
||||||
{
|
{
|
||||||
public static final WallObjectDespawned INSTANCE = new WallObjectDespawned();
|
|
||||||
|
|
||||||
private WallObjectDespawned()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The affected tile.
|
* The affected tile.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -34,13 +34,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class WallObjectSpawned
|
public class WallObjectSpawned
|
||||||
{
|
{
|
||||||
public static final WallObjectSpawned INSTANCE = new WallObjectSpawned();
|
|
||||||
|
|
||||||
private WallObjectSpawned()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The affected tile.
|
* The affected tile.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -33,13 +33,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class WidgetHiddenChanged
|
public class WidgetHiddenChanged
|
||||||
{
|
{
|
||||||
public static final WidgetHiddenChanged INSTANCE = new WidgetHiddenChanged();
|
|
||||||
|
|
||||||
private WidgetHiddenChanged()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The affected widget.
|
* The affected widget.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -32,13 +32,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class WidgetLoaded
|
public class WidgetLoaded
|
||||||
{
|
{
|
||||||
public static final WidgetLoaded INSTANCE = new WidgetLoaded();
|
|
||||||
|
|
||||||
private WidgetLoaded()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The group ID of the loaded widget.
|
* The group ID of the loaded widget.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -33,13 +33,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class WidgetMenuOptionClicked
|
public class WidgetMenuOptionClicked
|
||||||
{
|
{
|
||||||
public static final WidgetMenuOptionClicked INSTANCE = new WidgetMenuOptionClicked();
|
|
||||||
|
|
||||||
private WidgetMenuOptionClicked()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The clicked menu option.
|
* The clicked menu option.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -24,16 +24,13 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
|
import lombok.Value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event where the position of a {@link net.runelite.api.widgets.Widget}
|
* An event where the position of a {@link net.runelite.api.widgets.Widget}
|
||||||
* relative to its parent has changed.
|
* relative to its parent has changed.
|
||||||
*/
|
*/
|
||||||
|
@Value
|
||||||
public class WidgetPositioned
|
public class WidgetPositioned
|
||||||
{
|
{
|
||||||
public static final WidgetPositioned INSTANCE = new WidgetPositioned();
|
|
||||||
|
|
||||||
private WidgetPositioned()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,20 +25,13 @@
|
|||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
import net.runelite.api.World;
|
import net.runelite.api.World;
|
||||||
import lombok.Data;
|
import lombok.Value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event when the world list is loaded for the world switcher
|
* Event when the world list is loaded for the world switcher
|
||||||
*/
|
*/
|
||||||
@Data
|
@Value
|
||||||
public class WorldListLoad
|
public class WorldListLoad
|
||||||
{
|
{
|
||||||
public static final WorldListLoad INSTANCE = new WorldListLoad();
|
private final World[] worlds;
|
||||||
|
|
||||||
private WorldListLoad()
|
|
||||||
{
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
|
|
||||||
private World[] worlds;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,6 +87,9 @@ public class Hooks implements Callbacks
|
|||||||
private static final OverlayRenderer renderer = injector.getInstance(OverlayRenderer.class);
|
private static final OverlayRenderer renderer = injector.getInstance(OverlayRenderer.class);
|
||||||
private static final OverlayManager overlayManager = injector.getInstance(OverlayManager.class);
|
private static final OverlayManager overlayManager = injector.getInstance(OverlayManager.class);
|
||||||
|
|
||||||
|
private static final GameTick GAME_TICK = new GameTick();
|
||||||
|
private static final BeforeRender BEFORE_RENDER = new BeforeRender();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private EventBus eventBus;
|
private EventBus eventBus;
|
||||||
|
|
||||||
@@ -148,13 +151,13 @@ public class Hooks implements Callbacks
|
|||||||
|
|
||||||
deferredEventBus.replay();
|
deferredEventBus.replay();
|
||||||
|
|
||||||
eventBus.post(GameTick.INSTANCE);
|
eventBus.post(GAME_TICK);
|
||||||
|
|
||||||
int tick = client.getTickCount();
|
int tick = client.getTickCount();
|
||||||
client.setTickCount(tick + 1);
|
client.setTickCount(tick + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
eventBus.post(BeforeRender.INSTANCE);
|
eventBus.post(BEFORE_RENDER);
|
||||||
|
|
||||||
clientThread.invoke();
|
clientThread.invoke();
|
||||||
|
|
||||||
@@ -508,7 +511,7 @@ public class Hooks implements Callbacks
|
|||||||
|
|
||||||
public static boolean drawMenu()
|
public static boolean drawMenu()
|
||||||
{
|
{
|
||||||
BeforeMenuRender event = BeforeMenuRender.INSTANCE;
|
BeforeMenuRender event = new BeforeMenuRender();
|
||||||
client.getCallbacks().post(event);
|
client.getCallbacks().post(event);
|
||||||
return event.isConsumed();
|
return event.isConsumed();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,9 +114,7 @@ public class CommandManager
|
|||||||
String command = split[0];
|
String command = split[0];
|
||||||
String[] args = Arrays.copyOfRange(split, 1, split.length);
|
String[] args = Arrays.copyOfRange(split, 1, split.length);
|
||||||
|
|
||||||
CommandExecuted commandExecuted = CommandExecuted.INSTANCE;
|
CommandExecuted commandExecuted = new CommandExecuted(command, args);
|
||||||
commandExecuted.setCommand(command);
|
|
||||||
commandExecuted.setArguments(args);
|
|
||||||
eventBus.post(commandExecuted);
|
eventBus.post(commandExecuted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -429,7 +429,7 @@ public class MenuManager
|
|||||||
if (curMenuOption.getMenuTarget().equals(event.getTarget())
|
if (curMenuOption.getMenuTarget().equals(event.getTarget())
|
||||||
&& curMenuOption.getMenuOption().equals(event.getOption()))
|
&& curMenuOption.getMenuOption().equals(event.getOption()))
|
||||||
{
|
{
|
||||||
WidgetMenuOptionClicked customMenu = WidgetMenuOptionClicked.INSTANCE;
|
WidgetMenuOptionClicked customMenu = new WidgetMenuOptionClicked();
|
||||||
customMenu.setMenuOption(event.getOption());
|
customMenu.setMenuOption(event.getOption());
|
||||||
customMenu.setMenuTarget(event.getTarget());
|
customMenu.setMenuTarget(event.getTarget());
|
||||||
customMenu.setWidget(curMenuOption.getWidget());
|
customMenu.setWidget(curMenuOption.getWidget());
|
||||||
@@ -444,7 +444,7 @@ public class MenuManager
|
|||||||
// <col=ffffff>username<col=40ff00> (level-42) or <col=ffffff><img=2>username</col>
|
// <col=ffffff>username<col=40ff00> (level-42) or <col=ffffff><img=2>username</col>
|
||||||
String username = Text.removeTags(target).split("[(]")[0].trim();
|
String username = Text.removeTags(target).split("[(]")[0].trim();
|
||||||
|
|
||||||
PlayerMenuOptionClicked playerMenuOptionClicked = PlayerMenuOptionClicked.INSTANCE;
|
PlayerMenuOptionClicked playerMenuOptionClicked = new PlayerMenuOptionClicked();
|
||||||
playerMenuOptionClicked.setMenuOption(event.getOption());
|
playerMenuOptionClicked.setMenuOption(event.getOption());
|
||||||
playerMenuOptionClicked.setMenuTarget(username);
|
playerMenuOptionClicked.setMenuTarget(username);
|
||||||
|
|
||||||
|
|||||||
@@ -27,10 +27,8 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.aoewarnings;
|
package net.runelite.client.plugins.aoewarnings;
|
||||||
|
|
||||||
import java.awt.BasicStroke;
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Polygon;
|
import java.awt.Polygon;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
@@ -38,13 +36,11 @@ import java.time.Duration;
|
|||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.Perspective;
|
import net.runelite.api.Perspective;
|
||||||
import net.runelite.api.Point;
|
import net.runelite.api.Point;
|
||||||
import net.runelite.api.Projectile;
|
import net.runelite.api.Projectile;
|
||||||
import net.runelite.api.coords.LocalPoint;
|
|
||||||
import net.runelite.api.coords.WorldPoint;
|
import net.runelite.api.coords.WorldPoint;
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||||
@@ -62,7 +58,7 @@ public class AoeWarningOverlay extends Overlay
|
|||||||
private final AoeWarningConfig config;
|
private final AoeWarningConfig config;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public AoeWarningOverlay(@Nullable Client client, AoeWarningPlugin plugin, AoeWarningConfig config)
|
public AoeWarningOverlay(Client client, AoeWarningPlugin plugin, AoeWarningConfig config)
|
||||||
{
|
{
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
setLayer(OverlayLayer.UNDER_WIDGETS);
|
setLayer(OverlayLayer.UNDER_WIDGETS);
|
||||||
@@ -74,24 +70,25 @@ public class AoeWarningOverlay extends Overlay
|
|||||||
@Override
|
@Override
|
||||||
public Dimension render(Graphics2D graphics)
|
public Dimension render(Graphics2D graphics)
|
||||||
{
|
{
|
||||||
|
WorldPoint lp = client.getLocalPlayer().getWorldLocation();
|
||||||
for (WorldPoint point : plugin.getLightningTrail())
|
for (WorldPoint point : plugin.getLightningTrail())
|
||||||
{
|
{
|
||||||
drawTile(graphics, point, new Color(0, 150, 200), 2, 150, 50);
|
OverlayUtil.drawTile(graphics, client, point, lp, new Color(0, 150, 200), 2, 150, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (WorldPoint point : plugin.getAcidTrail())
|
for (WorldPoint point : plugin.getAcidTrail())
|
||||||
{
|
{
|
||||||
drawTile(graphics, point, new Color(69, 241, 44), 2, 150, 50);
|
OverlayUtil.drawTile(graphics, client, point, lp, new Color(69, 241, 44), 2, 150, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (WorldPoint point : plugin.getCrystalSpike())
|
for (WorldPoint point : plugin.getCrystalSpike())
|
||||||
{
|
{
|
||||||
drawTile(graphics, point, new Color(255, 0, 84), 2, 150, 50);
|
OverlayUtil.drawTile(graphics, client, point, lp, new Color(255, 0, 84), 2, 150, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (WorldPoint point : plugin.getWintertodtSnowFall())
|
for (WorldPoint point : plugin.getWintertodtSnowFall())
|
||||||
{
|
{
|
||||||
drawTile(graphics, point, new Color(255, 0, 84), 2, 150, 50);
|
OverlayUtil.drawTile(graphics, client, point, lp, new Color(255, 0, 84), 2, 150, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
Instant now = Instant.now();
|
Instant now = Instant.now();
|
||||||
@@ -164,7 +161,8 @@ public class AoeWarningOverlay extends Overlay
|
|||||||
{
|
{
|
||||||
if (tickProgress >= 0)
|
if (tickProgress >= 0)
|
||||||
{
|
{
|
||||||
renderTextLocation(graphics, Integer.toString(tickProgress), config.textSize(), config.fontStyle().getFont(), color, centerPoint(tilePoly.getBounds()));
|
OverlayUtil.renderTextLocation(graphics, Integer.toString(tickProgress), plugin.getTextSize(),
|
||||||
|
plugin.getFontStyle(), color, centerPoint(tilePoly.getBounds()), plugin.isShadows(), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
graphics.setColor(new Color(setAlphaComponent(config.overlayColor().getRGB(), fillAlpha), true));
|
graphics.setColor(new Color(setAlphaComponent(config.overlayColor().getRGB(), fillAlpha), true));
|
||||||
@@ -173,50 +171,6 @@ public class AoeWarningOverlay extends Overlay
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawTile(Graphics2D graphics, WorldPoint point, Color color, int strokeWidth, int outlineAlpha, int fillAlpha)
|
|
||||||
{
|
|
||||||
WorldPoint playerLocation = client.getLocalPlayer().getWorldLocation();
|
|
||||||
if (point.distanceTo(playerLocation) >= 32)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
LocalPoint lp = LocalPoint.fromWorld(client, point);
|
|
||||||
if (lp == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Polygon poly = Perspective.getCanvasTilePoly(client, lp);
|
|
||||||
if (poly == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), outlineAlpha));
|
|
||||||
graphics.setStroke(new BasicStroke(strokeWidth));
|
|
||||||
graphics.draw(poly);
|
|
||||||
graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), fillAlpha));
|
|
||||||
graphics.fill(poly);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void renderTextLocation(Graphics2D graphics, String txtString, int fontSize, int fontStyle, Color fontColor, Point canvasPoint)
|
|
||||||
{
|
|
||||||
graphics.setFont(new Font("Arial", fontStyle, fontSize));
|
|
||||||
if (canvasPoint != null)
|
|
||||||
{
|
|
||||||
final Point canvasCenterPoint = new Point(
|
|
||||||
canvasPoint.getX(),
|
|
||||||
canvasPoint.getY());
|
|
||||||
final Point canvasCenterPoint_shadow = new Point(
|
|
||||||
canvasPoint.getX() + 1,
|
|
||||||
canvasPoint.getY() + 1);
|
|
||||||
if (config.shadows())
|
|
||||||
{
|
|
||||||
OverlayUtil.renderTextLocation(graphics, canvasCenterPoint_shadow, txtString, Color.BLACK);
|
|
||||||
}
|
|
||||||
OverlayUtil.renderTextLocation(graphics, canvasCenterPoint, txtString, fontColor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Point centerPoint(Rectangle rect)
|
private Point centerPoint(Rectangle rect)
|
||||||
{
|
{
|
||||||
int x = (int) (rect.getX() + rect.getWidth() / 2);
|
int x = (int) (rect.getX() + rect.getWidth() / 2);
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.GameObject;
|
import net.runelite.api.GameObject;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
|
import net.runelite.api.GraphicID;
|
||||||
import net.runelite.api.GraphicsObject;
|
import net.runelite.api.GraphicsObject;
|
||||||
import net.runelite.api.NullObjectID;
|
import net.runelite.api.NullObjectID;
|
||||||
import net.runelite.api.ObjectID;
|
import net.runelite.api.ObjectID;
|
||||||
@@ -48,6 +49,7 @@ import net.runelite.api.Projectile;
|
|||||||
import net.runelite.api.Tile;
|
import net.runelite.api.Tile;
|
||||||
import net.runelite.api.coords.LocalPoint;
|
import net.runelite.api.coords.LocalPoint;
|
||||||
import net.runelite.api.coords.WorldPoint;
|
import net.runelite.api.coords.WorldPoint;
|
||||||
|
import net.runelite.api.events.ConfigChanged;
|
||||||
import net.runelite.api.events.GameObjectDespawned;
|
import net.runelite.api.events.GameObjectDespawned;
|
||||||
import net.runelite.api.events.GameObjectSpawned;
|
import net.runelite.api.events.GameObjectSpawned;
|
||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
@@ -72,40 +74,35 @@ import net.runelite.client.ui.overlay.OverlayManager;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class AoeWarningPlugin extends Plugin
|
public class AoeWarningPlugin extends Plugin
|
||||||
{
|
{
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final Map<WorldPoint, CrystalBomb> bombs = new HashMap<>();
|
private final Map<WorldPoint, CrystalBomb> bombs = new HashMap<>();
|
||||||
private final Map<Projectile, AoeProjectile> projectiles = new HashMap<>();
|
private final Map<Projectile, AoeProjectile> projectiles = new HashMap<>();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public AoeWarningConfig config;
|
public AoeWarningConfig config;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private Notifier notifier;
|
private Notifier notifier;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private OverlayManager overlayManager;
|
private OverlayManager overlayManager;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private AoeWarningOverlay coreOverlay;
|
private AoeWarningOverlay coreOverlay;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private BombOverlay bombOverlay;
|
private BombOverlay bombOverlay;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private Client client;
|
private Client client;
|
||||||
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private List<WorldPoint> LightningTrail = new ArrayList<>();
|
private List<WorldPoint> LightningTrail = new ArrayList<>();
|
||||||
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private List<WorldPoint> AcidTrail = new ArrayList<>();
|
private List<WorldPoint> AcidTrail = new ArrayList<>();
|
||||||
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private List<WorldPoint> CrystalSpike = new ArrayList<>();
|
private List<WorldPoint> CrystalSpike = new ArrayList<>();
|
||||||
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private List<WorldPoint> WintertodtSnowFall = new ArrayList<>();
|
private List<WorldPoint> WintertodtSnowFall = new ArrayList<>();
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean shadows;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private int textSize;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private int fontStyle;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
AoeWarningConfig getConfig(ConfigManager configManager)
|
AoeWarningConfig getConfig(ConfigManager configManager)
|
||||||
@@ -123,10 +120,7 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
overlayManager.add(coreOverlay);
|
overlayManager.add(coreOverlay);
|
||||||
overlayManager.add(bombOverlay);
|
overlayManager.add(bombOverlay);
|
||||||
LightningTrail.clear();
|
reset(true);
|
||||||
AcidTrail.clear();
|
|
||||||
CrystalSpike.clear();
|
|
||||||
WintertodtSnowFall.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -134,10 +128,29 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
overlayManager.remove(coreOverlay);
|
overlayManager.remove(coreOverlay);
|
||||||
overlayManager.remove(bombOverlay);
|
overlayManager.remove(bombOverlay);
|
||||||
LightningTrail.clear();
|
reset(false);
|
||||||
AcidTrail.clear();
|
}
|
||||||
CrystalSpike.clear();
|
|
||||||
WintertodtSnowFall.clear();
|
@Subscribe
|
||||||
|
public void onConfigChanged(ConfigChanged event)
|
||||||
|
{
|
||||||
|
if (!event.getGroup().equals("aoe"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (event.getKey())
|
||||||
|
{
|
||||||
|
case "fontStyle":
|
||||||
|
fontStyle = config.fontStyle().getFont();
|
||||||
|
break;
|
||||||
|
case "textSize":
|
||||||
|
textSize = config.textSize();
|
||||||
|
break;
|
||||||
|
case "shadows":
|
||||||
|
shadows = config.shadows();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
@@ -172,12 +185,12 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
public void onGameObjectSpawned(GameObjectSpawned event)
|
public void onGameObjectSpawned(GameObjectSpawned event)
|
||||||
{
|
{
|
||||||
final GameObject gameObject = event.getGameObject();
|
final GameObject gameObject = event.getGameObject();
|
||||||
final WorldPoint bombLocation = gameObject.getWorldLocation();
|
final WorldPoint wp = gameObject.getWorldLocation();
|
||||||
|
|
||||||
switch (gameObject.getId())
|
switch (gameObject.getId())
|
||||||
{
|
{
|
||||||
case ObjectID.CRYSTAL_BOMB:
|
case ObjectID.CRYSTAL_BOMB:
|
||||||
bombs.put(bombLocation, new CrystalBomb(gameObject, client.getTickCount()));
|
bombs.put(wp, new CrystalBomb(gameObject, client.getTickCount()));
|
||||||
|
|
||||||
if (config.aoeNotifyAll() || config.bombDisplayNotifyEnabled())
|
if (config.aoeNotifyAll() || config.bombDisplayNotifyEnabled())
|
||||||
{
|
{
|
||||||
@@ -185,17 +198,16 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ObjectID.ACID_POOL:
|
case ObjectID.ACID_POOL:
|
||||||
AcidTrail.add(bombLocation);
|
AcidTrail.add(wp);
|
||||||
break;
|
break;
|
||||||
case ObjectID.SMALL_CRYSTALS:
|
case ObjectID.SMALL_CRYSTALS:
|
||||||
//todo
|
CrystalSpike.add(wp);
|
||||||
CrystalSpike.add(bombLocation);
|
|
||||||
break;
|
break;
|
||||||
case NullObjectID.NULL_26690:
|
case NullObjectID.NULL_26690:
|
||||||
//Wintertodt Snowfall
|
//Wintertodt Snowfall
|
||||||
if (config.isWintertodtEnabled())
|
if (config.isWintertodtEnabled())
|
||||||
{
|
{
|
||||||
WintertodtSnowFall.add(bombLocation);
|
WintertodtSnowFall.add(wp);
|
||||||
|
|
||||||
if (config.aoeNotifyAll() || config.isWintertodtNotifyEnabled())
|
if (config.aoeNotifyAll() || config.isWintertodtNotifyEnabled())
|
||||||
{
|
{
|
||||||
@@ -210,25 +222,23 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
public void onGameObjectDespawned(GameObjectDespawned event)
|
public void onGameObjectDespawned(GameObjectDespawned event)
|
||||||
{
|
{
|
||||||
GameObject gameObject = event.getGameObject();
|
GameObject gameObject = event.getGameObject();
|
||||||
WorldPoint bombLocation = gameObject.getWorldLocation();
|
WorldPoint wp = gameObject.getWorldLocation();
|
||||||
switch (gameObject.getId())
|
switch (gameObject.getId())
|
||||||
{
|
{
|
||||||
case ObjectID.CRYSTAL_BOMB:
|
case ObjectID.CRYSTAL_BOMB:
|
||||||
//might as well check the ObjectID to save some time.
|
|
||||||
purgeBombs(bombs);
|
purgeBombs(bombs);
|
||||||
break;
|
break;
|
||||||
case ObjectID.ACID_POOL:
|
case ObjectID.ACID_POOL:
|
||||||
AcidTrail.remove(bombLocation);
|
AcidTrail.remove(wp);
|
||||||
break;
|
break;
|
||||||
case ObjectID.SMALL_CRYSTALS:
|
case ObjectID.SMALL_CRYSTALS:
|
||||||
//todo
|
CrystalSpike.remove(wp);
|
||||||
CrystalSpike.remove(bombLocation);
|
|
||||||
break;
|
break;
|
||||||
case NullObjectID.NULL_26690:
|
case NullObjectID.NULL_26690:
|
||||||
//Wintertodt Snowfall
|
//Wintertodt Snowfall
|
||||||
if (config.isWintertodtEnabled())
|
if (config.isWintertodtEnabled())
|
||||||
{
|
{
|
||||||
WintertodtSnowFall.remove(bombLocation);
|
WintertodtSnowFall.remove(wp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -251,7 +261,7 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
LightningTrail.clear();
|
LightningTrail.clear();
|
||||||
for (GraphicsObject o : client.getGraphicsObjects())
|
for (GraphicsObject o : client.getGraphicsObjects())
|
||||||
{
|
{
|
||||||
if (o.getId() == 1356)
|
if (o.getId() == GraphicID.OLM_LIGHTNING)
|
||||||
{
|
{
|
||||||
LightningTrail.add(WorldPoint.fromLocal(client, o.getLocation()));
|
LightningTrail.add(WorldPoint.fromLocal(client, o.getLocation()));
|
||||||
|
|
||||||
@@ -281,6 +291,12 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
Map.Entry<WorldPoint, CrystalBomb> entry = it.next();
|
Map.Entry<WorldPoint, CrystalBomb> entry = it.next();
|
||||||
WorldPoint world = entry.getKey();
|
WorldPoint world = entry.getKey();
|
||||||
LocalPoint local = LocalPoint.fromWorld(client, world);
|
LocalPoint local = LocalPoint.fromWorld(client, world);
|
||||||
|
|
||||||
|
if (local == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Tile tile = tiles[world.getPlane()][local.getSceneX()][local.getSceneY()];
|
Tile tile = tiles[world.getPlane()][local.getSceneX()][local.getSceneY()];
|
||||||
GameObject[] objects = tile.getGameObjects();
|
GameObject[] objects = tile.getGameObjects();
|
||||||
boolean containsObjects = false;
|
boolean containsObjects = false;
|
||||||
@@ -391,4 +407,20 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void reset(boolean setConfig)
|
||||||
|
{
|
||||||
|
LightningTrail.clear();
|
||||||
|
AcidTrail.clear();
|
||||||
|
CrystalSpike.clear();
|
||||||
|
WintertodtSnowFall.clear();
|
||||||
|
bombs.clear();
|
||||||
|
projectiles.clear();
|
||||||
|
if (setConfig)
|
||||||
|
{
|
||||||
|
fontStyle = config.fontStyle().getFont();
|
||||||
|
textSize = config.textSize();
|
||||||
|
shadows = config.shadows();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -121,6 +121,10 @@ public class BombOverlay extends Overlay
|
|||||||
{
|
{
|
||||||
final Player localPlayer = client.getLocalPlayer();
|
final Player localPlayer = client.getLocalPlayer();
|
||||||
LocalPoint localLoc = LocalPoint.fromWorld(client, bomb.getWorldLocation());
|
LocalPoint localLoc = LocalPoint.fromWorld(client, bomb.getWorldLocation());
|
||||||
|
if (localLoc == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
double distance_x = Math.abs(bomb.getWorldLocation().getX() - localPlayer.getWorldLocation().getX());
|
double distance_x = Math.abs(bomb.getWorldLocation().getX() - localPlayer.getWorldLocation().getX());
|
||||||
double distance_y = Math.abs(bomb.getWorldLocation().getY() - localPlayer.getWorldLocation().getY());
|
double distance_y = Math.abs(bomb.getWorldLocation().getY() - localPlayer.getWorldLocation().getY());
|
||||||
Color color_code = Color.decode(SAFE);
|
Color color_code = Color.decode(SAFE);
|
||||||
@@ -142,7 +146,7 @@ public class BombOverlay extends Overlay
|
|||||||
{
|
{
|
||||||
color_code = Color.decode(CAUTION);
|
color_code = Color.decode(CAUTION);
|
||||||
}
|
}
|
||||||
LocalPoint CenterPoint = new LocalPoint(localLoc.getX() + 0, localLoc.getY() + 0);
|
LocalPoint CenterPoint = new LocalPoint(localLoc.getX(), localLoc.getY());
|
||||||
Polygon poly = Perspective.getCanvasTileAreaPoly(client, CenterPoint, BOMB_AOE);
|
Polygon poly = Perspective.getCanvasTileAreaPoly(client, CenterPoint, BOMB_AOE);
|
||||||
|
|
||||||
if (poly != null)
|
if (poly != null)
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ public class DevToolsPlugin extends Plugin
|
|||||||
int value = Integer.parseInt(args[1]);
|
int value = Integer.parseInt(args[1]);
|
||||||
client.setVarpValue(client.getVarps(), varp, value);
|
client.setVarpValue(client.getVarps(), varp, value);
|
||||||
client.addChatMessage(ChatMessageType.GAMEMESSAGE, "", "Set VarPlayer " + varp + " to " + value, null);
|
client.addChatMessage(ChatMessageType.GAMEMESSAGE, "", "Set VarPlayer " + varp + " to " + value, null);
|
||||||
VarbitChanged varbitChanged = VarbitChanged.INSTANCE;
|
VarbitChanged varbitChanged = new VarbitChanged();
|
||||||
varbitChanged.setIndex(varp);
|
varbitChanged.setIndex(varp);
|
||||||
eventBus.post(varbitChanged); // fake event
|
eventBus.post(varbitChanged); // fake event
|
||||||
break;
|
break;
|
||||||
@@ -276,7 +276,7 @@ public class DevToolsPlugin extends Plugin
|
|||||||
int value = Integer.parseInt(args[1]);
|
int value = Integer.parseInt(args[1]);
|
||||||
client.setVarbitValue(client.getVarps(), varbit, value);
|
client.setVarbitValue(client.getVarps(), varbit, value);
|
||||||
client.addChatMessage(ChatMessageType.GAMEMESSAGE, "", "Set varbit " + varbit + " to " + value, null);
|
client.addChatMessage(ChatMessageType.GAMEMESSAGE, "", "Set varbit " + varbit + " to " + value, null);
|
||||||
eventBus.post(VarbitChanged.INSTANCE); // fake event
|
eventBus.post(new VarbitChanged()); // fake event
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "addxp":
|
case "addxp":
|
||||||
@@ -293,7 +293,7 @@ public class DevToolsPlugin extends Plugin
|
|||||||
|
|
||||||
client.queueChangedSkill(skill);
|
client.queueChangedSkill(skill);
|
||||||
|
|
||||||
ExperienceChanged experienceChanged = ExperienceChanged.INSTANCE;
|
ExperienceChanged experienceChanged = new ExperienceChanged();
|
||||||
experienceChanged.setSkill(skill);
|
experienceChanged.setSkill(skill);
|
||||||
eventBus.post(experienceChanged);
|
eventBus.post(experienceChanged);
|
||||||
break;
|
break;
|
||||||
@@ -312,11 +312,11 @@ public class DevToolsPlugin extends Plugin
|
|||||||
|
|
||||||
client.queueChangedSkill(skill);
|
client.queueChangedSkill(skill);
|
||||||
|
|
||||||
ExperienceChanged experienceChanged = ExperienceChanged.INSTANCE;
|
ExperienceChanged experienceChanged = new ExperienceChanged();
|
||||||
experienceChanged.setSkill(skill);
|
experienceChanged.setSkill(skill);
|
||||||
eventBus.post(experienceChanged);
|
eventBus.post(experienceChanged);
|
||||||
|
|
||||||
BoostedLevelChanged boostedLevelChanged = BoostedLevelChanged.INSTANCE;
|
BoostedLevelChanged boostedLevelChanged = new BoostedLevelChanged();
|
||||||
boostedLevelChanged.setSkill(skill);
|
boostedLevelChanged.setSkill(skill);
|
||||||
eventBus.post(boostedLevelChanged);
|
eventBus.post(boostedLevelChanged);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -54,17 +54,17 @@ public class FreezeTimersOverlay extends Overlay
|
|||||||
private final BufferedImage FREEZE_IMAGE = ImageUtil.getResourceStreamFromClass(getClass(), "freeze.png");
|
private final BufferedImage FREEZE_IMAGE = ImageUtil.getResourceStreamFromClass(getClass(), "freeze.png");
|
||||||
private final BufferedImage TB_IMAGE = ImageUtil.getResourceStreamFromClass(getClass(), "teleblock.png");
|
private final BufferedImage TB_IMAGE = ImageUtil.getResourceStreamFromClass(getClass(), "teleblock.png");
|
||||||
private final BufferedImage VENG_IMAGE = ImageUtil.getResourceStreamFromClass(getClass(), "veng.png");
|
private final BufferedImage VENG_IMAGE = ImageUtil.getResourceStreamFromClass(getClass(), "veng.png");
|
||||||
@Inject
|
|
||||||
private Timers timers;
|
private Timers timers;
|
||||||
private boolean lock;
|
private boolean lock;
|
||||||
private long finishedAtTest;
|
private long finishedAtTest;
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public FreezeTimersOverlay(FreezeTimersConfig config, Client client)
|
public FreezeTimersOverlay(FreezeTimersConfig config, Client client, Timers timers)
|
||||||
{
|
{
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.client = client;
|
this.client = client;
|
||||||
|
this.timers = timers;
|
||||||
setPriority(OverlayPriority.HIGHEST);
|
setPriority(OverlayPriority.HIGHEST);
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
setLayer(OverlayLayer.UNDER_WIDGETS);
|
setLayer(OverlayLayer.UNDER_WIDGETS);
|
||||||
@@ -119,24 +119,23 @@ public class FreezeTimersOverlay extends Overlay
|
|||||||
String text = processTickCounter(finishedAt);
|
String text = processTickCounter(finishedAt);
|
||||||
int test = Integer.parseInt(text);
|
int test = Integer.parseInt(text);
|
||||||
Point poi = actor.getCanvasTextLocation(g, text, 0);
|
Point poi = actor.getCanvasTextLocation(g, text, 0);
|
||||||
|
|
||||||
if (poi == null)
|
if (poi == null)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int xpoi = poi.getX();
|
Point FixedPoint = new Point(poi.getX(), poi.getY());
|
||||||
int ypoi = poi.getY();
|
|
||||||
Point FixedPoint = new Point(xpoi, ypoi);
|
|
||||||
|
|
||||||
if (config.noImage())
|
if (config.noImage())
|
||||||
{
|
{
|
||||||
if (test > 3)
|
if (test > 3)
|
||||||
{
|
{
|
||||||
renderTextLocation(g, text, config.textSize(), config.fontStyle().getFont(), Color.WHITE, FixedPoint);
|
OverlayUtil.renderTextLocation(g, text, config.textSize(), config.fontStyle().getFont(), Color.WHITE, FixedPoint, false, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
renderTextLocation(g, text, config.textSize(), config.fontStyle().getFont(), Color.YELLOW, FixedPoint);
|
OverlayUtil.renderTextLocation(g, text, config.textSize(), config.fontStyle().getFont(), Color.YELLOW, FixedPoint, false, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -161,23 +160,26 @@ public class FreezeTimersOverlay extends Overlay
|
|||||||
|
|
||||||
String text = processTickCounter(finishedAt);
|
String text = processTickCounter(finishedAt);
|
||||||
Point poi = actor.getCanvasTextLocation(g, text, 0);
|
Point poi = actor.getCanvasTextLocation(g, text, 0);
|
||||||
int xpoi = poi.getX() + 20;
|
|
||||||
int ypoi = poi.getY();
|
|
||||||
Point FixedPoint = new Point(xpoi, ypoi);
|
|
||||||
|
|
||||||
|
if (poi == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Point FixedPoint = new Point(poi.getX() + 20, poi.getY());
|
||||||
if (config.noImage())
|
if (config.noImage())
|
||||||
{
|
{
|
||||||
if (timers.getTimerEnd(actor, TimerType.FREEZE) <= currentTick)
|
if (timers.getTimerEnd(actor, TimerType.FREEZE) <= currentTick)
|
||||||
{
|
{
|
||||||
renderTextLocation(g, text, config.textSize(), config.fontStyle().getFont(), Color.CYAN, poi);
|
OverlayUtil.renderTextLocation(g, text, config.textSize(), config.fontStyle().getFont(), Color.CYAN, poi, false, 0);
|
||||||
}
|
}
|
||||||
if (timers.getTimerEnd(actor, TimerType.FREEZE) >= currentTick)
|
if (timers.getTimerEnd(actor, TimerType.FREEZE) >= currentTick)
|
||||||
{
|
{
|
||||||
renderTextLocation(g, " | " + text, config.textSize(), config.fontStyle().getFont(), Color.CYAN, FixedPoint);
|
OverlayUtil.renderTextLocation(g, " | " + text, config.textSize(), config.fontStyle().getFont(), Color.CYAN, FixedPoint, false, 0);
|
||||||
}
|
}
|
||||||
if (timers.getTimerEnd(actor, TimerType.VENG) >= currentTick)
|
if (timers.getTimerEnd(actor, TimerType.VENG) >= currentTick)
|
||||||
{
|
{
|
||||||
renderTextLocation(g, " | " + text, config.textSize(), config.fontStyle().getFont(), Color.CYAN, FixedPoint);
|
OverlayUtil.renderTextLocation(g, " | " + text, config.textSize(), config.fontStyle().getFont(), Color.CYAN, FixedPoint, false, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -202,22 +204,26 @@ public class FreezeTimersOverlay extends Overlay
|
|||||||
|
|
||||||
String text = processTickCounter(finishedAt);
|
String text = processTickCounter(finishedAt);
|
||||||
Point poi = actor.getCanvasTextLocation(g, text, 0);
|
Point poi = actor.getCanvasTextLocation(g, text, 0);
|
||||||
int xpoi = poi.getX() - 20;
|
|
||||||
int ypoi = poi.getY();
|
if (poi == null)
|
||||||
Point FixedPoint = new Point(xpoi, ypoi);
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Point FixedPoint = new Point(poi.getX() - 20, poi.getY());
|
||||||
if (config.noImage())
|
if (config.noImage())
|
||||||
{
|
{
|
||||||
if (timers.getTimerEnd(actor, TimerType.FREEZE) <= currentTick)
|
if (timers.getTimerEnd(actor, TimerType.FREEZE) <= currentTick)
|
||||||
{
|
{
|
||||||
renderTextLocation(g, text, config.textSize(), config.fontStyle().getFont(), Color.RED, poi);
|
OverlayUtil.renderTextLocation(g, text, config.textSize(), config.fontStyle().getFont(), Color.RED, poi, false, 0);
|
||||||
}
|
}
|
||||||
if (timers.getTimerEnd(actor, TimerType.FREEZE) >= currentTick)
|
if (timers.getTimerEnd(actor, TimerType.FREEZE) >= currentTick)
|
||||||
{
|
{
|
||||||
renderTextLocation(g, text + " | ", config.textSize(), config.fontStyle().getFont(), Color.RED, FixedPoint);
|
OverlayUtil.renderTextLocation(g, text + " | ", config.textSize(), config.fontStyle().getFont(), Color.RED, FixedPoint, false, 0);
|
||||||
}
|
}
|
||||||
if (timers.getTimerEnd(actor, TimerType.TELEBLOCK) >= currentTick)
|
if (timers.getTimerEnd(actor, TimerType.TELEBLOCK) >= currentTick)
|
||||||
{
|
{
|
||||||
renderTextLocation(g, text + " | ", config.textSize(), config.fontStyle().getFont(), Color.RED, FixedPoint);
|
OverlayUtil.renderTextLocation(g, text + " | ", config.textSize(), config.fontStyle().getFont(), Color.RED, FixedPoint, false, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -229,10 +235,13 @@ public class FreezeTimersOverlay extends Overlay
|
|||||||
|
|
||||||
g.setColor(RED);
|
g.setColor(RED);
|
||||||
Polygon poly = actor.getCanvasTilePoly();
|
Polygon poly = actor.getCanvasTilePoly();
|
||||||
if (poly != null)
|
|
||||||
|
if (poly == null)
|
||||||
{
|
{
|
||||||
OverlayUtil.renderPolygon(g, poly, RED);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OverlayUtil.renderPolygon(g, poly, RED);
|
||||||
OverlayUtil.renderTextLocation(g, new Point((int) poly.getBounds2D().getCenterX(),
|
OverlayUtil.renderTextLocation(g, new Point((int) poly.getBounds2D().getCenterX(),
|
||||||
(int) poly.getBounds2D().getCenterY()), actor.getName(), RED);
|
(int) poly.getBounds2D().getCenterY()), actor.getName(), RED);
|
||||||
}
|
}
|
||||||
@@ -249,22 +258,6 @@ public class FreezeTimersOverlay extends Overlay
|
|||||||
xOffset);
|
xOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderTextLocation(Graphics2D graphics, String txtString, int fontSize, int fontStyle, Color fontColor, Point canvasPoint)
|
|
||||||
{
|
|
||||||
graphics.setFont(new Font("Arial", fontStyle, fontSize));
|
|
||||||
if (canvasPoint != null)
|
|
||||||
{
|
|
||||||
final Point canvasCenterPoint = new Point(
|
|
||||||
canvasPoint.getX(),
|
|
||||||
canvasPoint.getY());
|
|
||||||
final Point canvasCenterPoint_shadow = new Point(
|
|
||||||
canvasPoint.getX() + 1,
|
|
||||||
canvasPoint.getY() + 1);
|
|
||||||
OverlayUtil.renderTextLocation(graphics, canvasCenterPoint_shadow, txtString, Color.BLACK);
|
|
||||||
OverlayUtil.renderTextLocation(graphics, canvasCenterPoint, txtString, fontColor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void renderImageLocation(Graphics2D graphics, Point imgLoc, BufferedImage image)
|
public void renderImageLocation(Graphics2D graphics, Point imgLoc, BufferedImage image)
|
||||||
{
|
{
|
||||||
int x = imgLoc.getX();
|
int x = imgLoc.getX();
|
||||||
@@ -273,12 +266,9 @@ public class FreezeTimersOverlay extends Overlay
|
|||||||
graphics.drawImage(image, x, y, null);
|
graphics.drawImage(image, x, y, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderActorTextAndImage(Graphics2D graphics, Actor actor, String text, Color color,
|
private void renderActorTextAndImage(Graphics2D graphics, Actor actor, String text, Color color, BufferedImage image, int yOffset, int xOffset)
|
||||||
BufferedImage image, int yOffset, int xOffset)
|
|
||||||
{
|
{
|
||||||
Point textLocation = new Point(actor.getCanvasImageLocation(image, 0).getX() + xOffset,
|
Point textLocation = new Point(actor.getCanvasImageLocation(image, 0).getX() + xOffset, actor.getCanvasImageLocation(image, 0).getY() + yOffset);
|
||||||
actor.getCanvasImageLocation(image, 0).getY() + yOffset);
|
|
||||||
|
|
||||||
renderImageLocation(graphics, textLocation, image);
|
renderImageLocation(graphics, textLocation, image);
|
||||||
xOffset = image.getWidth() + 1;
|
xOffset = image.getWidth() + 1;
|
||||||
yOffset = (image.getHeight() - (int) graphics.getFontMetrics().getStringBounds(text, graphics).getHeight());
|
yOffset = (image.getHeight() - (int) graphics.getFontMetrics().getStringBounds(text, graphics).getHeight());
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ public class FreezeTimersPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (prayerTracker.getSpotanimLastTick(actor) != actor.getSpotAnimation())
|
if (prayerTracker.getSpotanimLastTick(actor) != actor.getSpotAnimation())
|
||||||
{
|
{
|
||||||
SpotAnimationChanged callback = SpotAnimationChanged.INSTANCE;
|
SpotAnimationChanged callback = new SpotAnimationChanged();
|
||||||
callback.setActor(actor);
|
callback.setActor(actor);
|
||||||
client.getCallbacks().post(callback);
|
client.getCallbacks().post(callback);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,14 +30,13 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.HashMap;
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
import net.runelite.api.NPC;
|
import net.runelite.api.NPC;
|
||||||
import net.runelite.api.events.GameTick;
|
|
||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
|
import net.runelite.api.events.GameTick;
|
||||||
import net.runelite.api.events.NpcDespawned;
|
import net.runelite.api.events.NpcDespawned;
|
||||||
import net.runelite.api.events.NpcSpawned;
|
import net.runelite.api.events.NpcSpawned;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
@@ -119,6 +118,11 @@ public class ImplingsPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
Impling impling = Impling.findImpling(npc.getId());
|
Impling impling = Impling.findImpling(npc.getId());
|
||||||
|
|
||||||
|
if (impling == null || impling.getImplingType() == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
ImplingType type = impling.getImplingType();
|
ImplingType type = impling.getImplingType();
|
||||||
if (implingCounterMap.containsKey(type))
|
if (implingCounterMap.containsKey(type))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ public class BatSolver
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void calculateChanceOfPoison()
|
private void calculateChanceOfPoison()
|
||||||
{
|
{
|
||||||
if (getType() == null)
|
if (getType() == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ import lombok.Getter;
|
|||||||
// e.g. if there is an empty chest in L room chest 1, the other empty chests could be 16, 17, 38, 54, 55
|
// e.g. if there is an empty chest in L room chest 1, the other empty chests could be 16, 17, 38, 54, 55
|
||||||
// See https://dikkenoob.github.io/ for more information
|
// See https://dikkenoob.github.io/ for more information
|
||||||
|
|
||||||
public class SolutionSet
|
class SolutionSet
|
||||||
{
|
{
|
||||||
public static final SolutionSet[] SOLUTION_SETS =
|
static final SolutionSet[] SOLUTION_SETS =
|
||||||
{
|
{
|
||||||
new SolutionSet(ThievingRoomType.LEFT_TURN, 1, 16, 17, 55),
|
new SolutionSet(ThievingRoomType.LEFT_TURN, 1, 16, 17, 55),
|
||||||
new SolutionSet(ThievingRoomType.LEFT_TURN, 1, 17, 38, 54),
|
new SolutionSet(ThievingRoomType.LEFT_TURN, 1, 17, 38, 54),
|
||||||
@@ -147,12 +147,12 @@ public class SolutionSet
|
|||||||
this.emptyChests = new HashSet<>(Arrays.asList(emptyChests));
|
this.emptyChests = new HashSet<>(Arrays.asList(emptyChests));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addEmptyChest(int chestId)
|
void addEmptyChest(int chestId)
|
||||||
{
|
{
|
||||||
emptyChests.add(chestId);
|
emptyChests.add(chestId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean containsChest(int chestId)
|
boolean containsChest(int chestId)
|
||||||
{
|
{
|
||||||
return emptyChests.contains(chestId);
|
return emptyChests.contains(chestId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class InstancePoint
|
|||||||
private static final int CHUNK_SIZE = 8;
|
private static final int CHUNK_SIZE = 8;
|
||||||
private static final double CHUNK_OFFSET = 3.5;
|
private static final double CHUNK_OFFSET = 3.5;
|
||||||
|
|
||||||
public InstancePoint(int x, int y, int rot)
|
private InstancePoint(int x, int y, int rot)
|
||||||
{
|
{
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
@@ -29,7 +29,7 @@ public class InstancePoint
|
|||||||
this.rot = 0;
|
this.rot = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static InstancePoint buildFromPoint(WorldPoint worldPoint, Client client)
|
static InstancePoint buildFromPoint(WorldPoint worldPoint, Client client)
|
||||||
{
|
{
|
||||||
Point point = new Point(worldPoint.getX(), worldPoint.getY());
|
Point point = new Point(worldPoint.getX(), worldPoint.getY());
|
||||||
Point base = new Point(client.getBaseX(), client.getBaseY());
|
Point base = new Point(client.getBaseX(), client.getBaseY());
|
||||||
@@ -48,7 +48,7 @@ public class InstancePoint
|
|||||||
return buildFromTile(base, point, rotation, new Point(x, y));
|
return buildFromTile(base, point, rotation, new Point(x, y));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static InstancePoint buildFromTile(Point base, Point tile, int rot, Point chunkOrigin)
|
private static InstancePoint buildFromTile(Point base, Point tile, int rot, Point chunkOrigin)
|
||||||
{
|
{
|
||||||
int deltaX = tile.getX() - base.getX();
|
int deltaX = tile.getX() - base.getX();
|
||||||
int deltaY = tile.getY() - base.getY();
|
int deltaY = tile.getY() - base.getY();
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ package net.runelite.client.plugins.raidsthieving;
|
|||||||
|
|
||||||
public class RaidsThievingConstants
|
public class RaidsThievingConstants
|
||||||
{
|
{
|
||||||
public static final int CLOSED_CHEST_ID = 29742;
|
static final int CLOSED_CHEST_ID = 29742;
|
||||||
public static final int OPEN_EMPTY_CHEST = 29743;
|
static final int OPEN_EMPTY_CHEST = 29743;
|
||||||
public static final int OPEN_FULL_CHEST_1 = 29744;
|
static final int OPEN_FULL_CHEST_1 = 29744;
|
||||||
public static final int OPEN_FULL_CHEST_2 = 29745;
|
static final int OPEN_FULL_CHEST_2 = 29745;
|
||||||
public static final int EMPTY_TROUGH = 29746;
|
static final int EMPTY_TROUGH = 29746;
|
||||||
public static final int[] STORAGE = {29769, 29770, 29771, 29772};
|
public static final int[] STORAGE = {29769, 29770, 29771, 29772};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,6 +201,12 @@ public class RaidsThievingPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
log.debug("Found poison splat");
|
log.debug("Found poison splat");
|
||||||
WorldPoint loc = WorldPoint.fromLocal(client, obj.getLocation());
|
WorldPoint loc = WorldPoint.fromLocal(client, obj.getLocation());
|
||||||
|
|
||||||
|
if (chests.get(loc) == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
chests.get(loc).setPoison(true);
|
chests.get(loc).setPoison(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -235,7 +241,7 @@ public class RaidsThievingPlugin extends Plugin
|
|||||||
mapper = null;
|
mapper = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int numberOfEmptyChestsFound()
|
int numberOfEmptyChestsFound()
|
||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
for (ThievingChest chest : chests.values())
|
for (ThievingChest chest : chests.values())
|
||||||
@@ -248,7 +254,6 @@ public class RaidsThievingPlugin extends Plugin
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private boolean checkForBats()
|
private boolean checkForBats()
|
||||||
{
|
{
|
||||||
for (ThievingChest chest : chests.values())
|
for (ThievingChest chest : chests.values())
|
||||||
@@ -266,7 +271,7 @@ public class RaidsThievingPlugin extends Plugin
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getChestId(WorldPoint worldPoint)
|
int getChestId(WorldPoint worldPoint)
|
||||||
{
|
{
|
||||||
return chests.get(worldPoint).getChestId();
|
return chests.get(worldPoint).getChestId();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ package net.runelite.client.plugins.slayer;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class KnapsackSolver
|
class KnapsackSolver
|
||||||
{
|
{
|
||||||
|
|
||||||
private List<Integer> reconstructItemsInSack(int[][] sackMatrix, List<Integer> items, int i, int w)
|
private List<Integer> reconstructItemsInSack(int[][] sackMatrix, List<Integer> items, int i, int w)
|
||||||
@@ -49,7 +49,7 @@ public class KnapsackSolver
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int howMuchFitsInSack(List<Integer> items, int maxWeight)
|
int howMuchFitsInSack(List<Integer> items, int maxWeight)
|
||||||
{
|
{
|
||||||
int itemCount = items.size();
|
int itemCount = items.size();
|
||||||
|
|
||||||
|
|||||||
@@ -29,17 +29,17 @@ public class NPCPresence
|
|||||||
return name + "[" + combatLevel + "]";
|
return name + "[" + combatLevel + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean shouldExist()
|
boolean shouldExist()
|
||||||
{
|
{
|
||||||
return fadeTimer > 0;
|
return fadeTimer > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void tickExistence()
|
void tickExistence()
|
||||||
{
|
{
|
||||||
fadeTimer--;
|
fadeTimer--;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static NPCPresence buildPresence(NPC npc)
|
static NPCPresence buildPresence(NPC npc)
|
||||||
{
|
{
|
||||||
return new NPCPresence(npc.getName(), npc.getCombatLevel());
|
return new NPCPresence(npc.getName(), npc.getCombatLevel());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -390,7 +390,7 @@ public class SlayerPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int estimateKillCount(List<NPCPresence> potentialKills, int gains)
|
private int estimateKillCount(List<NPCPresence> potentialKills, int gains)
|
||||||
{
|
{
|
||||||
// failsafe to avoid calculating kill count if there were no slayer monsters around that could be killed on task
|
// failsafe to avoid calculating kill count if there were no slayer monsters around that could be killed on task
|
||||||
// this failsafe *WILL FAIL* if someone decides to lamp their slayer in the middle of a task next to on task creatures
|
// this failsafe *WILL FAIL* if someone decides to lamp their slayer in the middle of a task next to on task creatures
|
||||||
@@ -751,7 +751,7 @@ public class SlayerPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
void killedOne()
|
private void killedOne()
|
||||||
{
|
{
|
||||||
if (currentTask.getAmount() == 0)
|
if (currentTask.getAmount() == 0)
|
||||||
{
|
{
|
||||||
@@ -788,7 +788,7 @@ public class SlayerPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// checks if any contiguous subsequence of seq0 exactly matches the String toMatch
|
// checks if any contiguous subsequence of seq0 exactly matches the String toMatch
|
||||||
boolean contiguousSubsequenceMatches(String[] seq0, String toMatch)
|
private boolean contiguousSubsequenceMatches(String[] seq0, String toMatch)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < seq0.length; i++)
|
for (int i = 0; i < seq0.length; i++)
|
||||||
{
|
{
|
||||||
@@ -962,7 +962,7 @@ public class SlayerPlugin extends Plugin
|
|||||||
rebuildTargetList();
|
rebuildTargetList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public AsyncBufferedImage getImageForTask(Task task)
|
AsyncBufferedImage getImageForTask(Task task)
|
||||||
{
|
{
|
||||||
int itemSpriteId = ItemID.ENCHANTED_GEM;
|
int itemSpriteId = ItemID.ENCHANTED_GEM;
|
||||||
if (task != null)
|
if (task != null)
|
||||||
@@ -1048,6 +1048,11 @@ public class SlayerPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (task == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (TASK_STRING_VALIDATION.matcher(task.getTask()).find() || task.getTask().length() > TASK_STRING_MAX_LENGTH ||
|
if (TASK_STRING_VALIDATION.matcher(task.getTask()).find() || task.getTask().length() > TASK_STRING_MAX_LENGTH ||
|
||||||
TASK_STRING_VALIDATION.matcher(task.getLocation()).find() || task.getLocation().length() > TASK_STRING_MAX_LENGTH)
|
TASK_STRING_VALIDATION.matcher(task.getLocation()).find() || task.getLocation().length() > TASK_STRING_MAX_LENGTH)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -343,7 +343,7 @@ public class SlayerTaskPanel extends PluginPanel
|
|||||||
changePauseState(paused);
|
changePauseState(paused);
|
||||||
}
|
}
|
||||||
|
|
||||||
static String htmlLabel(String key, long timeMillis)
|
private static String htmlLabel(String key, long timeMillis)
|
||||||
{
|
{
|
||||||
if (timeMillis == Long.MAX_VALUE)
|
if (timeMillis == Long.MAX_VALUE)
|
||||||
{
|
{
|
||||||
@@ -363,7 +363,7 @@ public class SlayerTaskPanel extends PluginPanel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static String htmlLabel(String key, int value)
|
private static String htmlLabel(String key, int value)
|
||||||
{
|
{
|
||||||
String valueStr = StackFormatter.quantityToRSDecimalStack(value);
|
String valueStr = StackFormatter.quantityToRSDecimalStack(value);
|
||||||
return String.format(HTML_LABEL_TEMPLATE, ColorUtil.toHexColor(ColorScheme.LIGHT_GRAY_COLOR),
|
return String.format(HTML_LABEL_TEMPLATE, ColorUtil.toHexColor(ColorScheme.LIGHT_GRAY_COLOR),
|
||||||
|
|||||||
@@ -31,14 +31,14 @@ import java.io.InputStreamReader;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class SlayerXpDropLookup
|
class SlayerXpDropLookup
|
||||||
{
|
{
|
||||||
private Map<String, List<Double>> xpMap;
|
private Map<String, List<Double>> xpMap;
|
||||||
|
|
||||||
// floating point math equality
|
// floating point math equality
|
||||||
private static final double EPSILON = 1e-6;
|
private static final double EPSILON = 1e-6;
|
||||||
|
|
||||||
void loadXpJson()
|
private void loadXpJson()
|
||||||
{
|
{
|
||||||
final InputStream xpFile = getClass().getResourceAsStream("/slayer_xp.json");
|
final InputStream xpFile = getClass().getResourceAsStream("/slayer_xp.json");
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
@@ -76,7 +76,7 @@ public class SlayerXpDropLookup
|
|||||||
* @param npc the npc we are estimating slayer xp for
|
* @param npc the npc we are estimating slayer xp for
|
||||||
* @return our best guess for the slayer xp for this npc
|
* @return our best guess for the slayer xp for this npc
|
||||||
*/
|
*/
|
||||||
public double findXpForNpc(NPCPresence npc)
|
double findXpForNpc(NPCPresence npc)
|
||||||
{
|
{
|
||||||
List<Double> xpCombatLevel = xpMap.get(npc.getName());
|
List<Double> xpCombatLevel = xpMap.get(npc.getName());
|
||||||
if (xpCombatLevel == null)
|
if (xpCombatLevel == null)
|
||||||
@@ -127,7 +127,7 @@ public class SlayerXpDropLookup
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SlayerXpDropLookup()
|
SlayerXpDropLookup()
|
||||||
{
|
{
|
||||||
loadXpJson();
|
loadXpJson();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import net.runelite.client.ui.overlay.OverlayMenuEntry;
|
|||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
import net.runelite.client.ui.overlay.OverlayPriority;
|
import net.runelite.client.ui.overlay.OverlayPriority;
|
||||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||||
|
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||||
import net.runelite.client.util.ColorUtil;
|
import net.runelite.client.util.ColorUtil;
|
||||||
|
|
||||||
@@ -102,6 +103,7 @@ class NyloOverlay extends Overlay
|
|||||||
|
|
||||||
panelComponent.getChildren().clear();
|
panelComponent.getChildren().clear();
|
||||||
TableComponent tableComponent = new TableComponent();
|
TableComponent tableComponent = new TableComponent();
|
||||||
|
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||||
|
|
||||||
int nyloCount = (hagios + toxobolos + ischyros);
|
int nyloCount = (hagios + toxobolos + ischyros);
|
||||||
if (nylohandler.getWave() < 21)
|
if (nylohandler.getWave() < 21)
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import net.runelite.client.ui.overlay.OverlayMenuEntry;
|
|||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||||
|
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||||
|
|
||||||
public class XarpusCounter extends Overlay
|
public class XarpusCounter extends Overlay
|
||||||
@@ -60,6 +61,7 @@ public class XarpusCounter extends Overlay
|
|||||||
));
|
));
|
||||||
|
|
||||||
TableComponent tableComponent = new TableComponent();
|
TableComponent tableComponent = new TableComponent();
|
||||||
|
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||||
tableComponent.addRow("Exhumes", String.valueOf(xarpusHandler.getExhumesCount()));
|
tableComponent.addRow("Exhumes", String.valueOf(xarpusHandler.getExhumesCount()));
|
||||||
|
|
||||||
panelComponent.getChildren().add(tableComponent);
|
panelComponent.getChildren().add(tableComponent);
|
||||||
|
|||||||
@@ -118,9 +118,7 @@ public class GameEventManager
|
|||||||
|
|
||||||
if (itemContainer != null)
|
if (itemContainer != null)
|
||||||
{
|
{
|
||||||
ItemContainerChanged event = ItemContainerChanged.INSTANCE;
|
eventBus.post(new ItemContainerChanged(itemContainer));
|
||||||
event.setItemContainer(itemContainer);
|
|
||||||
eventBus.post(event);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,8 +126,7 @@ public class GameEventManager
|
|||||||
{
|
{
|
||||||
if (npc != null)
|
if (npc != null)
|
||||||
{
|
{
|
||||||
final NpcSpawned npcSpawned = NpcSpawned.INSTANCE;
|
final NpcSpawned npcSpawned = new NpcSpawned(npc);
|
||||||
npcSpawned.setNpc(npc);
|
|
||||||
eventBus.post(npcSpawned);
|
eventBus.post(npcSpawned);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -138,8 +135,7 @@ public class GameEventManager
|
|||||||
{
|
{
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
final PlayerSpawned playerSpawned = PlayerSpawned.INSTANCE;
|
final PlayerSpawned playerSpawned = new PlayerSpawned(player);
|
||||||
playerSpawned.setPlayer(player);
|
|
||||||
eventBus.post(playerSpawned);
|
eventBus.post(playerSpawned);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -148,7 +144,7 @@ public class GameEventManager
|
|||||||
{
|
{
|
||||||
Optional.ofNullable(tile.getWallObject()).ifPresent(object ->
|
Optional.ofNullable(tile.getWallObject()).ifPresent(object ->
|
||||||
{
|
{
|
||||||
final WallObjectSpawned objectSpawned = WallObjectSpawned.INSTANCE;
|
final WallObjectSpawned objectSpawned = new WallObjectSpawned();
|
||||||
objectSpawned.setTile(tile);
|
objectSpawned.setTile(tile);
|
||||||
objectSpawned.setWallObject(object);
|
objectSpawned.setWallObject(object);
|
||||||
eventBus.post(objectSpawned);
|
eventBus.post(objectSpawned);
|
||||||
@@ -156,7 +152,7 @@ public class GameEventManager
|
|||||||
|
|
||||||
Optional.ofNullable(tile.getDecorativeObject()).ifPresent(object ->
|
Optional.ofNullable(tile.getDecorativeObject()).ifPresent(object ->
|
||||||
{
|
{
|
||||||
final DecorativeObjectSpawned objectSpawned = DecorativeObjectSpawned.INSTANCE;
|
final DecorativeObjectSpawned objectSpawned = new DecorativeObjectSpawned();
|
||||||
objectSpawned.setTile(tile);
|
objectSpawned.setTile(tile);
|
||||||
objectSpawned.setDecorativeObject(object);
|
objectSpawned.setDecorativeObject(object);
|
||||||
eventBus.post(objectSpawned);
|
eventBus.post(objectSpawned);
|
||||||
@@ -164,7 +160,7 @@ public class GameEventManager
|
|||||||
|
|
||||||
Optional.ofNullable(tile.getGroundObject()).ifPresent(object ->
|
Optional.ofNullable(tile.getGroundObject()).ifPresent(object ->
|
||||||
{
|
{
|
||||||
final GroundObjectSpawned objectSpawned = GroundObjectSpawned.INSTANCE;
|
final GroundObjectSpawned objectSpawned = new GroundObjectSpawned();
|
||||||
objectSpawned.setTile(tile);
|
objectSpawned.setTile(tile);
|
||||||
objectSpawned.setGroundObject(object);
|
objectSpawned.setGroundObject(object);
|
||||||
eventBus.post(objectSpawned);
|
eventBus.post(objectSpawned);
|
||||||
@@ -174,7 +170,7 @@ public class GameEventManager
|
|||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.forEach(object ->
|
.forEach(object ->
|
||||||
{
|
{
|
||||||
final GameObjectSpawned objectSpawned = GameObjectSpawned.INSTANCE;
|
final GameObjectSpawned objectSpawned = new GameObjectSpawned();
|
||||||
objectSpawned.setTile(tile);
|
objectSpawned.setTile(tile);
|
||||||
objectSpawned.setGameObject(object);
|
objectSpawned.setGameObject(object);
|
||||||
eventBus.post(objectSpawned);
|
eventBus.post(objectSpawned);
|
||||||
@@ -190,9 +186,7 @@ public class GameEventManager
|
|||||||
|
|
||||||
current = current.getNext();
|
current = current.getNext();
|
||||||
|
|
||||||
final ItemSpawned itemSpawned = ItemSpawned.INSTANCE;
|
final ItemSpawned itemSpawned = new ItemSpawned(tile, item);
|
||||||
itemSpawned.setItem(item);
|
|
||||||
itemSpawned.setTile(tile);
|
|
||||||
eventBus.post(itemSpawned);
|
eventBus.post(itemSpawned);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -93,14 +93,14 @@ public class AttackStylesPluginTest
|
|||||||
when(client.getVar(VarPlayer.ATTACK_STYLE)).thenReturn(AttackStyle.ACCURATE.ordinal());
|
when(client.getVar(VarPlayer.ATTACK_STYLE)).thenReturn(AttackStyle.ACCURATE.ordinal());
|
||||||
|
|
||||||
// verify that earning xp in a warned skill will display red text on the widget
|
// verify that earning xp in a warned skill will display red text on the widget
|
||||||
attackPlugin.onVarbitChanged(VarbitChanged.INSTANCE);
|
attackPlugin.onVarbitChanged(new VarbitChanged());
|
||||||
assertTrue(attackPlugin.isWarnedSkillSelected());
|
assertTrue(attackPlugin.isWarnedSkillSelected());
|
||||||
|
|
||||||
// Switch to attack style that doesn't give attack xp
|
// Switch to attack style that doesn't give attack xp
|
||||||
when(client.getVar(VarPlayer.ATTACK_STYLE)).thenReturn(AttackStyle.AGGRESSIVE.ordinal());
|
when(client.getVar(VarPlayer.ATTACK_STYLE)).thenReturn(AttackStyle.AGGRESSIVE.ordinal());
|
||||||
|
|
||||||
// Verify the widget will now display white text
|
// Verify the widget will now display white text
|
||||||
attackPlugin.onVarbitChanged(VarbitChanged.INSTANCE);
|
attackPlugin.onVarbitChanged(new VarbitChanged());
|
||||||
warnedSkills = attackPlugin.getWarnedSkills();
|
warnedSkills = attackPlugin.getWarnedSkills();
|
||||||
assertTrue(warnedSkills.contains(Skill.ATTACK));
|
assertTrue(warnedSkills.contains(Skill.ATTACK));
|
||||||
assertFalse(attackPlugin.isWarnedSkillSelected());
|
assertFalse(attackPlugin.isWarnedSkillSelected());
|
||||||
@@ -129,7 +129,7 @@ public class AttackStylesPluginTest
|
|||||||
|
|
||||||
// equip type_4 weapon type on player
|
// equip type_4 weapon type on player
|
||||||
when(client.getVar(Varbits.EQUIPPED_WEAPON_TYPE)).thenReturn(WeaponType.TYPE_4.ordinal());
|
when(client.getVar(Varbits.EQUIPPED_WEAPON_TYPE)).thenReturn(WeaponType.TYPE_4.ordinal());
|
||||||
attackPlugin.onVarbitChanged(VarbitChanged.INSTANCE);
|
attackPlugin.onVarbitChanged(new VarbitChanged());
|
||||||
|
|
||||||
// Verify there is a warned skill
|
// Verify there is a warned skill
|
||||||
Set<Skill> warnedSkills = attackPlugin.getWarnedSkills();
|
Set<Skill> warnedSkills = attackPlugin.getWarnedSkills();
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public class CerberusPluginTest
|
|||||||
mockNpc(new LocalPoint(2, 5)),
|
mockNpc(new LocalPoint(2, 5)),
|
||||||
mockNpc(new LocalPoint(1, 5))
|
mockNpc(new LocalPoint(1, 5))
|
||||||
));
|
));
|
||||||
cerberusPlugin.onGameTick(GameTick.INSTANCE);
|
cerberusPlugin.onGameTick(new GameTick());
|
||||||
|
|
||||||
// Expected sort is by lowest y first, then by lowest x
|
// Expected sort is by lowest y first, then by lowest x
|
||||||
assertEquals(ghosts.get(0).getLocalLocation(), new LocalPoint(0, 0));
|
assertEquals(ghosts.get(0).getLocalLocation(), new LocalPoint(0, 0));
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public class ChatNotificationsPluginTest
|
|||||||
MessageNode messageNode = mock(MessageNode.class);
|
MessageNode messageNode = mock(MessageNode.class);
|
||||||
when(messageNode.getValue()).thenReturn("Deathbeam, Deathbeam OSRS");
|
when(messageNode.getValue()).thenReturn("Deathbeam, Deathbeam OSRS");
|
||||||
|
|
||||||
ChatMessage chatMessage = ChatMessage.INSTANCE;
|
ChatMessage chatMessage = new ChatMessage();
|
||||||
chatMessage.setType(ChatMessageType.PUBLICCHAT);
|
chatMessage.setType(ChatMessageType.PUBLICCHAT);
|
||||||
chatMessage.setMessageNode(messageNode);
|
chatMessage.setMessageNode(messageNode);
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public class CookingPluginTest
|
|||||||
when(config.fermentTimer()).thenReturn(true);
|
when(config.fermentTimer()).thenReturn(true);
|
||||||
when(client.getLocalPlayer()).thenReturn(player);
|
when(client.getLocalPlayer()).thenReturn(player);
|
||||||
|
|
||||||
SpotAnimationChanged graphicChanged = SpotAnimationChanged.INSTANCE;
|
SpotAnimationChanged graphicChanged = new SpotAnimationChanged();
|
||||||
graphicChanged.setActor(player);
|
graphicChanged.setActor(player);
|
||||||
cookingPlugin.onSpotAnimationChanged(graphicChanged);
|
cookingPlugin.onSpotAnimationChanged(graphicChanged);
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class EmojiPluginTest
|
|||||||
when(client.createIndexedSprite()).thenReturn(mock(IndexedSprite.class));
|
when(client.createIndexedSprite()).thenReturn(mock(IndexedSprite.class));
|
||||||
|
|
||||||
// Trip emoji loading
|
// Trip emoji loading
|
||||||
GameStateChanged gameStateChanged = GameStateChanged.INSTANCE;
|
GameStateChanged gameStateChanged = new GameStateChanged();
|
||||||
gameStateChanged.setGameState(GameState.LOGGED_IN);
|
gameStateChanged.setGameState(GameState.LOGGED_IN);
|
||||||
emojiPlugin.onGameStateChanged(gameStateChanged);
|
emojiPlugin.onGameStateChanged(gameStateChanged);
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ public class EmojiPluginTest
|
|||||||
// With chat recolor, message may be wrapped in col tags
|
// With chat recolor, message may be wrapped in col tags
|
||||||
when(messageNode.getValue()).thenReturn("<col=ff0000>:) :) :)</col>");
|
when(messageNode.getValue()).thenReturn("<col=ff0000>:) :) :)</col>");
|
||||||
|
|
||||||
ChatMessage chatMessage = ChatMessage.INSTANCE;
|
ChatMessage chatMessage = new ChatMessage();
|
||||||
chatMessage.setType(ChatMessageType.PUBLICCHAT);
|
chatMessage.setType(ChatMessageType.PUBLICCHAT);
|
||||||
chatMessage.setMessageNode(messageNode);
|
chatMessage.setMessageNode(messageNode);
|
||||||
|
|
||||||
@@ -98,14 +98,14 @@ public class EmojiPluginTest
|
|||||||
when(client.createIndexedSprite()).thenReturn(mock(IndexedSprite.class));
|
when(client.createIndexedSprite()).thenReturn(mock(IndexedSprite.class));
|
||||||
|
|
||||||
// Trip emoji loading
|
// Trip emoji loading
|
||||||
GameStateChanged gameStateChanged = GameStateChanged.INSTANCE;
|
GameStateChanged gameStateChanged = new GameStateChanged();
|
||||||
gameStateChanged.setGameState(GameState.LOGGED_IN);
|
gameStateChanged.setGameState(GameState.LOGGED_IN);
|
||||||
emojiPlugin.onGameStateChanged(gameStateChanged);
|
emojiPlugin.onGameStateChanged(gameStateChanged);
|
||||||
|
|
||||||
MessageNode messageNode = mock(MessageNode.class);
|
MessageNode messageNode = mock(MessageNode.class);
|
||||||
when(messageNode.getValue()).thenReturn("<gt>:D<lt>");
|
when(messageNode.getValue()).thenReturn("<gt>:D<lt>");
|
||||||
|
|
||||||
ChatMessage chatMessage = ChatMessage.INSTANCE;
|
ChatMessage chatMessage = new ChatMessage();
|
||||||
chatMessage.setType(ChatMessageType.PUBLICCHAT);
|
chatMessage.setType(ChatMessageType.PUBLICCHAT);
|
||||||
chatMessage.setMessageNode(messageNode);
|
chatMessage.setMessageNode(messageNode);
|
||||||
|
|
||||||
|
|||||||
@@ -132,13 +132,13 @@ public class IdleNotifierPluginTest
|
|||||||
public void checkAnimationIdle()
|
public void checkAnimationIdle()
|
||||||
{
|
{
|
||||||
when(player.getAnimation()).thenReturn(AnimationID.WOODCUTTING_BRONZE);
|
when(player.getAnimation()).thenReturn(AnimationID.WOODCUTTING_BRONZE);
|
||||||
AnimationChanged animationChanged = AnimationChanged.INSTANCE;
|
AnimationChanged animationChanged = new AnimationChanged();
|
||||||
animationChanged.setActor(player);
|
animationChanged.setActor(player);
|
||||||
plugin.onAnimationChanged(animationChanged);
|
plugin.onAnimationChanged(animationChanged);
|
||||||
plugin.onGameTick(GameTick.INSTANCE);
|
plugin.onGameTick(new GameTick());
|
||||||
when(player.getAnimation()).thenReturn(AnimationID.IDLE);
|
when(player.getAnimation()).thenReturn(AnimationID.IDLE);
|
||||||
plugin.onAnimationChanged(animationChanged);
|
plugin.onAnimationChanged(animationChanged);
|
||||||
plugin.onGameTick(GameTick.INSTANCE);
|
plugin.onGameTick(new GameTick());
|
||||||
verify(notifier).notify("[" + PLAYER_NAME + "] is now idle!");
|
verify(notifier).notify("[" + PLAYER_NAME + "] is now idle!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,16 +146,16 @@ public class IdleNotifierPluginTest
|
|||||||
public void checkAnimationReset()
|
public void checkAnimationReset()
|
||||||
{
|
{
|
||||||
when(player.getAnimation()).thenReturn(AnimationID.WOODCUTTING_BRONZE);
|
when(player.getAnimation()).thenReturn(AnimationID.WOODCUTTING_BRONZE);
|
||||||
AnimationChanged animationChanged = AnimationChanged.INSTANCE;
|
AnimationChanged animationChanged = new AnimationChanged();
|
||||||
animationChanged.setActor(player);
|
animationChanged.setActor(player);
|
||||||
plugin.onAnimationChanged(animationChanged);
|
plugin.onAnimationChanged(animationChanged);
|
||||||
plugin.onGameTick(GameTick.INSTANCE);
|
plugin.onGameTick(new GameTick());
|
||||||
when(player.getAnimation()).thenReturn(AnimationID.LOOKING_INTO);
|
when(player.getAnimation()).thenReturn(AnimationID.LOOKING_INTO);
|
||||||
plugin.onAnimationChanged(animationChanged);
|
plugin.onAnimationChanged(animationChanged);
|
||||||
plugin.onGameTick(GameTick.INSTANCE);
|
plugin.onGameTick(new GameTick());
|
||||||
when(player.getAnimation()).thenReturn(AnimationID.IDLE);
|
when(player.getAnimation()).thenReturn(AnimationID.IDLE);
|
||||||
plugin.onAnimationChanged(animationChanged);
|
plugin.onAnimationChanged(animationChanged);
|
||||||
plugin.onGameTick(GameTick.INSTANCE);
|
plugin.onGameTick(new GameTick());
|
||||||
verify(notifier, times(0)).notify(any());
|
verify(notifier, times(0)).notify(any());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,14 +163,14 @@ public class IdleNotifierPluginTest
|
|||||||
public void checkAnimationLogout()
|
public void checkAnimationLogout()
|
||||||
{
|
{
|
||||||
when(player.getAnimation()).thenReturn(AnimationID.WOODCUTTING_BRONZE);
|
when(player.getAnimation()).thenReturn(AnimationID.WOODCUTTING_BRONZE);
|
||||||
AnimationChanged animationChanged = AnimationChanged.INSTANCE;
|
AnimationChanged animationChanged = new AnimationChanged();
|
||||||
animationChanged.setActor(player);
|
animationChanged.setActor(player);
|
||||||
plugin.onAnimationChanged(animationChanged);
|
plugin.onAnimationChanged(animationChanged);
|
||||||
plugin.onGameTick(GameTick.INSTANCE);
|
plugin.onGameTick(new GameTick());
|
||||||
|
|
||||||
// Logout
|
// Logout
|
||||||
when(client.getGameState()).thenReturn(GameState.LOGIN_SCREEN);
|
when(client.getGameState()).thenReturn(GameState.LOGIN_SCREEN);
|
||||||
GameStateChanged gameStateChanged = GameStateChanged.INSTANCE;
|
GameStateChanged gameStateChanged = new GameStateChanged();
|
||||||
gameStateChanged.setGameState(GameState.LOGIN_SCREEN);
|
gameStateChanged.setGameState(GameState.LOGIN_SCREEN);
|
||||||
plugin.onGameStateChanged(gameStateChanged);
|
plugin.onGameStateChanged(gameStateChanged);
|
||||||
|
|
||||||
@@ -182,7 +182,7 @@ public class IdleNotifierPluginTest
|
|||||||
// Tick
|
// Tick
|
||||||
when(player.getAnimation()).thenReturn(AnimationID.IDLE);
|
when(player.getAnimation()).thenReturn(AnimationID.IDLE);
|
||||||
plugin.onAnimationChanged(animationChanged);
|
plugin.onAnimationChanged(animationChanged);
|
||||||
plugin.onGameTick(GameTick.INSTANCE);
|
plugin.onGameTick(new GameTick());
|
||||||
verify(notifier, times(0)).notify(any());
|
verify(notifier, times(0)).notify(any());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,16 +190,11 @@ public class IdleNotifierPluginTest
|
|||||||
public void checkCombatIdle()
|
public void checkCombatIdle()
|
||||||
{
|
{
|
||||||
when(player.getInteracting()).thenReturn(monster);
|
when(player.getInteracting()).thenReturn(monster);
|
||||||
InteractingChanged event = InteractingChanged.INSTANCE;
|
plugin.onInteractingChanged(new InteractingChanged(player, monster));
|
||||||
event.setSource(player);
|
plugin.onGameTick(new GameTick());
|
||||||
event.setTarget(monster);
|
|
||||||
plugin.onInteractingChanged(event);
|
|
||||||
plugin.onGameTick(GameTick.INSTANCE);
|
|
||||||
when(player.getInteracting()).thenReturn(null);
|
when(player.getInteracting()).thenReturn(null);
|
||||||
event.setSource(player);
|
plugin.onInteractingChanged(new InteractingChanged(player, null));
|
||||||
event.setTarget(null);
|
plugin.onGameTick(new GameTick());
|
||||||
plugin.onInteractingChanged(event);
|
|
||||||
plugin.onGameTick(GameTick.INSTANCE);
|
|
||||||
verify(notifier).notify("[" + PLAYER_NAME + "] is now out of combat!");
|
verify(notifier).notify("[" + PLAYER_NAME + "] is now out of combat!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,37 +202,27 @@ public class IdleNotifierPluginTest
|
|||||||
public void checkCombatReset()
|
public void checkCombatReset()
|
||||||
{
|
{
|
||||||
when(player.getInteracting()).thenReturn(monster);
|
when(player.getInteracting()).thenReturn(monster);
|
||||||
InteractingChanged event = InteractingChanged.INSTANCE;
|
plugin.onInteractingChanged(new InteractingChanged(player, monster));
|
||||||
event.setSource(player);
|
plugin.onGameTick(new GameTick());
|
||||||
event.setTarget(monster);
|
|
||||||
plugin.onInteractingChanged(event);
|
|
||||||
plugin.onGameTick(GameTick.INSTANCE);
|
|
||||||
when(player.getInteracting()).thenReturn(randomEvent);
|
when(player.getInteracting()).thenReturn(randomEvent);
|
||||||
event.setSource(player);
|
plugin.onInteractingChanged(new InteractingChanged(player, randomEvent));
|
||||||
event.setTarget(randomEvent);
|
plugin.onGameTick(new GameTick());
|
||||||
plugin.onInteractingChanged(event);
|
|
||||||
plugin.onGameTick(GameTick.INSTANCE);
|
|
||||||
when(player.getInteracting()).thenReturn(null);
|
when(player.getInteracting()).thenReturn(null);
|
||||||
event.setSource(player);
|
plugin.onInteractingChanged(new InteractingChanged(player, null));
|
||||||
event.setTarget(null);
|
plugin.onGameTick(new GameTick());
|
||||||
plugin.onInteractingChanged(event);
|
|
||||||
plugin.onGameTick(GameTick.INSTANCE);
|
|
||||||
verify(notifier, times(0)).notify(any());
|
verify(notifier, times(0)).notify(any());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void checkCombatLogout()
|
public void checkCombatLogout()
|
||||||
{
|
{
|
||||||
InteractingChanged event = InteractingChanged.INSTANCE;
|
plugin.onInteractingChanged(new InteractingChanged(player, monster));
|
||||||
event.setSource(player);
|
|
||||||
event.setTarget(monster);
|
|
||||||
plugin.onInteractingChanged(event);
|
|
||||||
when(player.getInteracting()).thenReturn(monster);
|
when(player.getInteracting()).thenReturn(monster);
|
||||||
plugin.onGameTick(GameTick.INSTANCE);
|
plugin.onGameTick(new GameTick());
|
||||||
|
|
||||||
// Logout
|
// Logout
|
||||||
when(client.getGameState()).thenReturn(GameState.LOGIN_SCREEN);
|
when(client.getGameState()).thenReturn(GameState.LOGIN_SCREEN);
|
||||||
GameStateChanged gameStateChanged = GameStateChanged.INSTANCE;
|
GameStateChanged gameStateChanged = new GameStateChanged();
|
||||||
gameStateChanged.setGameState(GameState.LOGIN_SCREEN);
|
gameStateChanged.setGameState(GameState.LOGIN_SCREEN);
|
||||||
plugin.onGameStateChanged(gameStateChanged);
|
plugin.onGameStateChanged(gameStateChanged);
|
||||||
|
|
||||||
@@ -248,10 +233,8 @@ public class IdleNotifierPluginTest
|
|||||||
|
|
||||||
// Tick
|
// Tick
|
||||||
when(player.getInteracting()).thenReturn(null);
|
when(player.getInteracting()).thenReturn(null);
|
||||||
event.setSource(player);
|
plugin.onInteractingChanged(new InteractingChanged(player, null));
|
||||||
event.setTarget(null);
|
plugin.onGameTick(new GameTick());
|
||||||
plugin.onInteractingChanged(event);
|
|
||||||
plugin.onGameTick(GameTick.INSTANCE);
|
|
||||||
verify(notifier, times(0)).notify(any());
|
verify(notifier, times(0)).notify(any());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,11 +245,11 @@ public class IdleNotifierPluginTest
|
|||||||
when(client.getMouseIdleTicks()).thenReturn(80_000);
|
when(client.getMouseIdleTicks()).thenReturn(80_000);
|
||||||
|
|
||||||
// But player is being damaged (is in combat)
|
// But player is being damaged (is in combat)
|
||||||
final HitsplatApplied hitsplatApplied = HitsplatApplied.INSTANCE;
|
final HitsplatApplied hitsplatApplied = new HitsplatApplied();
|
||||||
hitsplatApplied.setActor(player);
|
hitsplatApplied.setActor(player);
|
||||||
hitsplatApplied.setHitsplat(new Hitsplat(Hitsplat.HitsplatType.DAMAGE, 0, 0));
|
hitsplatApplied.setHitsplat(new Hitsplat(Hitsplat.HitsplatType.DAMAGE, 0, 0));
|
||||||
plugin.onHitsplatApplied(hitsplatApplied);
|
plugin.onHitsplatApplied(hitsplatApplied);
|
||||||
plugin.onGameTick(GameTick.INSTANCE);
|
plugin.onGameTick(new GameTick());
|
||||||
verify(notifier, times(0)).notify(any());
|
verify(notifier, times(0)).notify(any());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,8 +262,8 @@ public class IdleNotifierPluginTest
|
|||||||
when(client.getKeyboardIdleTicks()).thenReturn(80_000);
|
when(client.getKeyboardIdleTicks()).thenReturn(80_000);
|
||||||
when(client.getMouseIdleTicks()).thenReturn(14_500);
|
when(client.getMouseIdleTicks()).thenReturn(14_500);
|
||||||
|
|
||||||
plugin.onGameTick(GameTick.INSTANCE);
|
plugin.onGameTick(new GameTick());
|
||||||
plugin.onGameTick(GameTick.INSTANCE);
|
plugin.onGameTick(new GameTick());
|
||||||
verify(notifier, times(1)).notify(any());
|
verify(notifier, times(1)).notify(any());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,11 +273,11 @@ public class IdleNotifierPluginTest
|
|||||||
when(config.getSpecEnergyThreshold()).thenReturn(50);
|
when(config.getSpecEnergyThreshold()).thenReturn(50);
|
||||||
|
|
||||||
when(client.getVar(Matchers.eq(VarPlayer.SPECIAL_ATTACK_PERCENT))).thenReturn(400); // 40%
|
when(client.getVar(Matchers.eq(VarPlayer.SPECIAL_ATTACK_PERCENT))).thenReturn(400); // 40%
|
||||||
plugin.onGameTick(GameTick.INSTANCE); // once to set lastSpecEnergy to 400
|
plugin.onGameTick(new GameTick()); // once to set lastSpecEnergy to 400
|
||||||
verify(notifier, never()).notify(any());
|
verify(notifier, never()).notify(any());
|
||||||
|
|
||||||
when(client.getVar(Matchers.eq(VarPlayer.SPECIAL_ATTACK_PERCENT))).thenReturn(500); // 50%
|
when(client.getVar(Matchers.eq(VarPlayer.SPECIAL_ATTACK_PERCENT))).thenReturn(500); // 50%
|
||||||
plugin.onGameTick(GameTick.INSTANCE);
|
plugin.onGameTick(new GameTick());
|
||||||
verify(notifier).notify(Matchers.eq("[" + PLAYER_NAME + "] has restored spec energy!"));
|
verify(notifier).notify(Matchers.eq("[" + PLAYER_NAME + "] has restored spec energy!"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -115,13 +115,13 @@ public class MotherlodePluginTest
|
|||||||
public void testOreCounter()
|
public void testOreCounter()
|
||||||
{
|
{
|
||||||
// set inMlm
|
// set inMlm
|
||||||
GameStateChanged gameStateChanged = GameStateChanged.INSTANCE;
|
GameStateChanged gameStateChanged = new GameStateChanged();
|
||||||
gameStateChanged.setGameState(GameState.LOGGED_IN);
|
gameStateChanged.setGameState(GameState.LOGGED_IN);
|
||||||
motherlodePlugin.onGameStateChanged(gameStateChanged);
|
motherlodePlugin.onGameStateChanged(gameStateChanged);
|
||||||
|
|
||||||
// Initial sack count
|
// Initial sack count
|
||||||
when(client.getVar(Varbits.SACK_NUMBER)).thenReturn(42);
|
when(client.getVar(Varbits.SACK_NUMBER)).thenReturn(42);
|
||||||
motherlodePlugin.onVarbitChanged(VarbitChanged.INSTANCE);
|
motherlodePlugin.onVarbitChanged(new VarbitChanged());
|
||||||
|
|
||||||
// Create before inventory
|
// Create before inventory
|
||||||
ItemContainer inventory = mock(ItemContainer.class);
|
ItemContainer inventory = mock(ItemContainer.class);
|
||||||
@@ -140,7 +140,7 @@ public class MotherlodePluginTest
|
|||||||
|
|
||||||
// Withdraw 20
|
// Withdraw 20
|
||||||
when(client.getVar(Varbits.SACK_NUMBER)).thenReturn(22);
|
when(client.getVar(Varbits.SACK_NUMBER)).thenReturn(22);
|
||||||
motherlodePlugin.onVarbitChanged(VarbitChanged.INSTANCE);
|
motherlodePlugin.onVarbitChanged(new VarbitChanged());
|
||||||
|
|
||||||
inventory = mock(ItemContainer.class);
|
inventory = mock(ItemContainer.class);
|
||||||
// +1 rune, +4 nugget, +2 coal, +1 addy
|
// +1 rune, +4 nugget, +2 coal, +1 addy
|
||||||
@@ -162,9 +162,7 @@ public class MotherlodePluginTest
|
|||||||
when(client.getItemContainer(InventoryID.INVENTORY)).thenReturn(inventory);
|
when(client.getItemContainer(InventoryID.INVENTORY)).thenReturn(inventory);
|
||||||
|
|
||||||
// Trigger comparison
|
// Trigger comparison
|
||||||
ItemContainerChanged event = ItemContainerChanged.INSTANCE;
|
motherlodePlugin.onItemContainerChanged(new ItemContainerChanged(inventory));
|
||||||
event.setItemContainer(inventory);
|
|
||||||
motherlodePlugin.onItemContainerChanged(event);
|
|
||||||
|
|
||||||
verify(motherlodeSession).updateOreFound(ItemID.RUNITE_ORE, 1);
|
verify(motherlodeSession).updateOreFound(ItemID.RUNITE_ORE, 1);
|
||||||
verify(motherlodeSession).updateOreFound(ItemID.GOLDEN_NUGGET, 4);
|
verify(motherlodeSession).updateOreFound(ItemID.GOLDEN_NUGGET, 4);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user