Convert plugins to new eventbus
This commit is contained in:
@@ -32,7 +32,7 @@ import javax.swing.JOptionPane;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.client.account.AccountSession;
|
||||
import net.runelite.client.account.SessionManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.SessionClose;
|
||||
import net.runelite.client.events.SessionOpen;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -60,6 +60,9 @@ public class AccountPlugin extends Plugin
|
||||
@Inject
|
||||
private ScheduledExecutorService executor;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private NavigationButton loginButton;
|
||||
private NavigationButton logoutButton;
|
||||
|
||||
@@ -74,6 +77,8 @@ public class AccountPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
addSubscriptions();
|
||||
|
||||
loginButton = NavigationButton.builder()
|
||||
.tab(false)
|
||||
.icon(LOGIN_IMAGE)
|
||||
@@ -103,10 +108,18 @@ public class AccountPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
clientToolbar.removeNavigation(loginButton);
|
||||
clientToolbar.removeNavigation(logoutButton);
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(SessionClose.class, this, this::onSessionClose);
|
||||
eventBus.subscribe(SessionOpen.class, this, this::onSessionOpen);
|
||||
}
|
||||
|
||||
private void loginClick()
|
||||
{
|
||||
executor.execute(sessionManager::login);
|
||||
@@ -122,14 +135,12 @@ public class AccountPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onSessionClose(SessionClose e)
|
||||
private void onSessionClose(SessionClose e)
|
||||
{
|
||||
addAndRemoveButtons();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onSessionOpen(SessionOpen sessionOpen)
|
||||
private void onSessionOpen(SessionOpen sessionOpen)
|
||||
{
|
||||
AccountSession session = sessionManager.getAccountSession();
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetID;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.achievementdiary.diaries.ArdougneDiaryRequirement;
|
||||
@@ -79,8 +79,22 @@ public class DiaryRequirementsPlugin extends Plugin
|
||||
@Inject
|
||||
private ClientThread clientThread;
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetLoaded(final WidgetLoaded event)
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
eventBus.subscribe(WidgetLoaded.class, this, this::onWidgetLoaded);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
}
|
||||
|
||||
private void onWidgetLoaded(final WidgetLoaded event)
|
||||
{
|
||||
if (event.getGroupId() == WidgetID.DIARY_QUEST_GROUP_ID)
|
||||
{
|
||||
|
||||
@@ -70,7 +70,7 @@ import net.runelite.api.events.WallObjectDespawned;
|
||||
import net.runelite.api.events.WallObjectSpawned;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.AgilityShortcut;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -120,6 +120,9 @@ public class AgilityPlugin extends Plugin
|
||||
@Inject
|
||||
private ItemManager itemManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private AgilitySession session;
|
||||
|
||||
@@ -166,6 +169,7 @@ public class AgilityPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(agilityOverlay);
|
||||
overlayManager.add(lapCounterOverlay);
|
||||
@@ -175,6 +179,8 @@ public class AgilityPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(agilityOverlay);
|
||||
overlayManager.remove(lapCounterOverlay);
|
||||
marksOfGrace.clear();
|
||||
@@ -183,8 +189,31 @@ public class AgilityPlugin extends Plugin
|
||||
agilityLevel = 0;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(ExperienceChanged.class, this, this::onExperienceChanged);
|
||||
eventBus.subscribe(BoostedLevelChanged.class, this, this::onBoostedLevelChanged);
|
||||
eventBus.subscribe(ItemSpawned.class, this, this::onItemSpawned);
|
||||
eventBus.subscribe(ItemDespawned.class, this, this::onItemDespawned);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(GameObjectSpawned.class, this, this::onGameObjectSpawned);
|
||||
eventBus.subscribe(GameObjectChanged.class, this, this::onGameObjectChanged);
|
||||
eventBus.subscribe(GameObjectDespawned.class, this, this::onGameObjectDespawned);
|
||||
eventBus.subscribe(GroundObjectSpawned.class, this, this::onGroundObjectSpawned);
|
||||
eventBus.subscribe(GroundObjectChanged.class, this, this::onGroundObjectChanged);
|
||||
eventBus.subscribe(GroundObjectDespawned.class, this, this::onGroundObjectDespawned);
|
||||
eventBus.subscribe(WallObjectSpawned.class, this, this::onWallObjectSpawned);
|
||||
eventBus.subscribe(WallObjectChanged.class, this, this::onWallObjectChanged);
|
||||
eventBus.subscribe(WallObjectDespawned.class, this, this::onWallObjectDespawned);
|
||||
eventBus.subscribe(DecorativeObjectSpawned.class, this, this::onDecorativeObjectSpawned);
|
||||
eventBus.subscribe(DecorativeObjectChanged.class, this, this::onDecorativeObjectChanged);
|
||||
eventBus.subscribe(DecorativeObjectDespawned.class, this, this::onDecorativeObjectDespawned);
|
||||
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
|
||||
}
|
||||
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
switch (event.getGameState())
|
||||
{
|
||||
@@ -208,8 +237,7 @@ public class AgilityPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!event.getGroup().equals("agility"))
|
||||
{
|
||||
@@ -242,8 +270,7 @@ public class AgilityPlugin extends Plugin
|
||||
this.showShortcutLevel = config.showShortcutLevel();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onExperienceChanged(ExperienceChanged event)
|
||||
private void onExperienceChanged(ExperienceChanged event)
|
||||
{
|
||||
if (event.getSkill() != AGILITY || !this.showLapCount)
|
||||
{
|
||||
@@ -278,9 +305,7 @@ public class AgilityPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Subscribe
|
||||
public void onBoostedLevelChanged(BoostedLevelChanged boostedLevelChanged)
|
||||
private void onBoostedLevelChanged(BoostedLevelChanged boostedLevelChanged)
|
||||
{
|
||||
Skill skill = boostedLevelChanged.getSkill();
|
||||
if (skill == AGILITY)
|
||||
@@ -289,8 +314,7 @@ public class AgilityPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onItemSpawned(ItemSpawned itemSpawned)
|
||||
private void onItemSpawned(ItemSpawned itemSpawned)
|
||||
{
|
||||
if (obstacles.isEmpty())
|
||||
{
|
||||
@@ -306,15 +330,13 @@ public class AgilityPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onItemDespawned(ItemDespawned itemDespawned)
|
||||
private void onItemDespawned(ItemDespawned itemDespawned)
|
||||
{
|
||||
final Tile tile = itemDespawned.getTile();
|
||||
marksOfGrace.remove(tile);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick tick)
|
||||
private void onGameTick(GameTick tick)
|
||||
{
|
||||
if (isInAgilityArena())
|
||||
{
|
||||
@@ -365,74 +387,62 @@ public class AgilityPlugin extends Plugin
|
||||
infoBoxManager.addInfoBox(new AgilityArenaTimer(this, itemManager.getImage(AGILITY_ARENA_TICKET)));
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameObjectSpawned(GameObjectSpawned event)
|
||||
private void onGameObjectSpawned(GameObjectSpawned event)
|
||||
{
|
||||
onTileObject(event.getTile(), null, event.getGameObject());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameObjectChanged(GameObjectChanged event)
|
||||
private void onGameObjectChanged(GameObjectChanged event)
|
||||
{
|
||||
onTileObject(event.getTile(), event.getPrevious(), event.getGameObject());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameObjectDespawned(GameObjectDespawned event)
|
||||
private void onGameObjectDespawned(GameObjectDespawned event)
|
||||
{
|
||||
onTileObject(event.getTile(), event.getGameObject(), null);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGroundObjectSpawned(GroundObjectSpawned event)
|
||||
private void onGroundObjectSpawned(GroundObjectSpawned event)
|
||||
{
|
||||
onTileObject(event.getTile(), null, event.getGroundObject());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGroundObjectChanged(GroundObjectChanged event)
|
||||
private void onGroundObjectChanged(GroundObjectChanged event)
|
||||
{
|
||||
onTileObject(event.getTile(), event.getPrevious(), event.getGroundObject());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGroundObjectDespawned(GroundObjectDespawned event)
|
||||
private void onGroundObjectDespawned(GroundObjectDespawned event)
|
||||
{
|
||||
onTileObject(event.getTile(), event.getGroundObject(), null);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWallObjectSpawned(WallObjectSpawned event)
|
||||
private void onWallObjectSpawned(WallObjectSpawned event)
|
||||
{
|
||||
onTileObject(event.getTile(), null, event.getWallObject());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWallObjectChanged(WallObjectChanged event)
|
||||
private void onWallObjectChanged(WallObjectChanged event)
|
||||
{
|
||||
onTileObject(event.getTile(), event.getPrevious(), event.getWallObject());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWallObjectDespawned(WallObjectDespawned event)
|
||||
private void onWallObjectDespawned(WallObjectDespawned event)
|
||||
{
|
||||
onTileObject(event.getTile(), event.getWallObject(), null);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onDecorativeObjectSpawned(DecorativeObjectSpawned event)
|
||||
private void onDecorativeObjectSpawned(DecorativeObjectSpawned event)
|
||||
{
|
||||
onTileObject(event.getTile(), null, event.getDecorativeObject());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onDecorativeObjectChanged(DecorativeObjectChanged event)
|
||||
private void onDecorativeObjectChanged(DecorativeObjectChanged event)
|
||||
{
|
||||
onTileObject(event.getTile(), event.getPrevious(), event.getDecorativeObject());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onDecorativeObjectDespawned(DecorativeObjectDespawned event)
|
||||
private void onDecorativeObjectDespawned(DecorativeObjectDespawned event)
|
||||
{
|
||||
onTileObject(event.getTile(), event.getDecorativeObject(), null);
|
||||
}
|
||||
@@ -484,8 +494,7 @@ public class AgilityPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||
private void onMenuEntryAdded(MenuEntryAdded event)
|
||||
{
|
||||
if (!this.showShortcutLevel)
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.api.events.ProjectileMoved;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
@@ -89,9 +89,14 @@ public class HydraPlugin extends Plugin
|
||||
@Inject
|
||||
private HydraSceneOverlay poisonOverlay;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Override
|
||||
protected void startUp()
|
||||
{
|
||||
addSubscriptions();
|
||||
|
||||
inHydraInstance = checkArea();
|
||||
lastAttackTick = -1;
|
||||
poisonProjectiles.clear();
|
||||
@@ -100,6 +105,8 @@ public class HydraPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
inHydraInstance = false;
|
||||
hydra = null;
|
||||
poisonProjectiles.clear();
|
||||
@@ -107,7 +114,15 @@ public class HydraPlugin extends Plugin
|
||||
lastAttackTick = -1;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(NpcSpawned.class, this, this::onNpcSpawned);
|
||||
eventBus.subscribe(AnimationChanged.class, this, this::onAnimationChanged);
|
||||
eventBus.subscribe(ProjectileMoved.class, this, this::onProjectileMoved);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
}
|
||||
|
||||
private void onGameStateChanged(GameStateChanged state)
|
||||
{
|
||||
if (state.getGameState() != GameState.LOGGED_IN)
|
||||
@@ -140,7 +155,6 @@ public class HydraPlugin extends Plugin
|
||||
addOverlays();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
private void onNpcSpawned(NpcSpawned event)
|
||||
{
|
||||
if (!inHydraInstance || event.getNpc().getId() != NpcID.ALCHEMICAL_HYDRA)
|
||||
@@ -152,8 +166,7 @@ public class HydraPlugin extends Plugin
|
||||
addOverlays();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onAnimationChanged(AnimationChanged animationChanged)
|
||||
private void onAnimationChanged(AnimationChanged animationChanged)
|
||||
{
|
||||
Actor actor = animationChanged.getActor();
|
||||
|
||||
@@ -215,8 +228,7 @@ public class HydraPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onProjectileMoved(ProjectileMoved event)
|
||||
private void onProjectileMoved(ProjectileMoved event)
|
||||
{
|
||||
if (!inHydraInstance || hydra == null
|
||||
|| client.getGameCycle() >= event.getProjectile().getStartMovementCycle())
|
||||
@@ -245,8 +257,7 @@ public class HydraPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage event)
|
||||
private void onChatMessage(ChatMessage event)
|
||||
{
|
||||
if (!event.getMessage().equals("The chemicals neutralise the Alchemical Hydra's defences!"))
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.events.ItemContainerChanged;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -61,11 +61,16 @@ public class AmmoPlugin extends Plugin
|
||||
@Inject
|
||||
private ItemManager itemManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private AmmoCounter counterBox;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
eventBus.subscribe(ItemContainerChanged.class, this, this::onItemContainerChanged);
|
||||
|
||||
clientThread.invokeLater(() ->
|
||||
{
|
||||
final ItemContainer container = client.getItemContainer(InventoryID.EQUIPMENT);
|
||||
@@ -80,12 +85,13 @@ public class AmmoPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
infoBoxManager.removeInfoBox(counterBox);
|
||||
counterBox = null;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onItemContainerChanged(ItemContainerChanged event)
|
||||
private void onItemContainerChanged(ItemContainerChanged event)
|
||||
{
|
||||
if (event.getItemContainer() != client.getItemContainer(InventoryID.EQUIPMENT))
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ import javax.inject.Singleton;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
|
||||
@@ -51,6 +51,9 @@ public class AnimationSmoothingPlugin extends Plugin
|
||||
@Inject
|
||||
private AnimationSmoothingConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Provides
|
||||
AnimationSmoothingConfig getConfig(ConfigManager configManager)
|
||||
{
|
||||
@@ -60,20 +63,23 @@ public class AnimationSmoothingPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
client.setInterpolatePlayerAnimations(false);
|
||||
client.setInterpolateNpcAnimations(false);
|
||||
client.setInterpolateObjectAnimations(false);
|
||||
client.setInterpolateWidgetAnimations(false);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals(CONFIG_GROUP))
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.FocusChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.config.Keybind;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.input.KeyManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -81,6 +81,9 @@ public class AntiDragPlugin extends Plugin
|
||||
@Inject
|
||||
private KeyManager keyManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Provides
|
||||
AntiDragConfig getConfig(ConfigManager configManager)
|
||||
{
|
||||
@@ -103,6 +106,8 @@ public class AntiDragPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
if (this.keybind)
|
||||
{
|
||||
keyManager.registerKeyListener(hotkeyListener);
|
||||
@@ -113,14 +118,21 @@ public class AntiDragPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
client.setInventoryDragDelay(DEFAULT_DELAY);
|
||||
keyManager.unregisterKeyListener(hotkeyListener);
|
||||
toggleDrag = false;
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(FocusChanged.class, this, this::onFocusChanged);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("antiDrag"))
|
||||
{
|
||||
@@ -157,8 +169,7 @@ public class AntiDragPlugin extends Plugin
|
||||
this.selectedCursor = config.selectedCursor();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onFocusChanged(FocusChanged focusChanged)
|
||||
private void onFocusChanged(FocusChanged focusChanged)
|
||||
{
|
||||
if (!this.alwaysOn && !focusChanged.isFocused() && this.reqfocus)
|
||||
{
|
||||
|
||||
@@ -182,7 +182,7 @@ public class AoeWarningPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
super.shutDown();
|
||||
eventbus.unregister(this);
|
||||
|
||||
overlayManager.remove(coreOverlay);
|
||||
overlayManager.remove(bombOverlay);
|
||||
|
||||
@@ -50,7 +50,7 @@ import net.runelite.api.widgets.WidgetInfo;
|
||||
import static net.runelite.api.widgets.WidgetInfo.TO_GROUP;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import static net.runelite.client.plugins.attackstyles.AttackStyle.CASTING;
|
||||
@@ -89,6 +89,9 @@ public class AttackStylesPlugin extends Plugin
|
||||
@Inject
|
||||
private AttackStylesOverlay overlay;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Provides
|
||||
AttackStylesConfig provideConfig(ConfigManager configManager)
|
||||
{
|
||||
@@ -110,6 +113,7 @@ public class AttackStylesPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(overlay);
|
||||
|
||||
@@ -140,12 +144,23 @@ public class AttackStylesPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
hideWarnedStyles(false);
|
||||
processWidgets();
|
||||
hideWidget(client.getWidget(WidgetInfo.COMBAT_AUTO_RETALIATE), false);
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(WidgetHiddenChanged.class, this, this::onWidgetHiddenChanged);
|
||||
eventBus.subscribe(WidgetLoaded.class, this, this::onWidgetLoaded);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(VarbitChanged.class, this, this::onVarbitChanged);
|
||||
}
|
||||
|
||||
public AttackStyle getAttackStyle()
|
||||
{
|
||||
return attackStyle;
|
||||
@@ -156,8 +171,7 @@ public class AttackStylesPlugin extends Plugin
|
||||
return warnedSkillSelected;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetHiddenChanged(WidgetHiddenChanged event)
|
||||
private void onWidgetHiddenChanged(WidgetHiddenChanged event)
|
||||
{
|
||||
if (event.getWidget().isSelfHidden() || TO_GROUP(event.getWidget().getId()) != COMBAT_GROUP_ID)
|
||||
{
|
||||
@@ -167,8 +181,7 @@ public class AttackStylesPlugin extends Plugin
|
||||
processWidgets();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetLoaded(WidgetLoaded event)
|
||||
private void onWidgetLoaded(WidgetLoaded event)
|
||||
{
|
||||
if (event.getGroupId() != COMBAT_GROUP_ID)
|
||||
{
|
||||
@@ -195,8 +208,7 @@ public class AttackStylesPlugin extends Plugin
|
||||
hideWidget(client.getWidget(WidgetInfo.COMBAT_AUTO_RETALIATE), this.hideAutoRetaliate);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
if (event.getGameState() == GameState.LOGGED_IN)
|
||||
{
|
||||
@@ -208,8 +220,7 @@ public class AttackStylesPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onVarbitChanged(VarbitChanged event)
|
||||
private void onVarbitChanged(VarbitChanged event)
|
||||
{
|
||||
if (attackStyleVarbit == -1 || attackStyleVarbit != client.getVar(VarPlayer.ATTACK_STYLE))
|
||||
{
|
||||
@@ -236,8 +247,7 @@ public class AttackStylesPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("attackIndicator"))
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ import net.runelite.api.events.MenuShouldLeftClick;
|
||||
import net.runelite.api.events.ScriptCallbackEvent;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.banktags.tabs.BankSearch;
|
||||
@@ -72,6 +72,9 @@ public class BankPlugin extends Plugin
|
||||
@Inject
|
||||
private BankSearch bankSearch;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private boolean forceRightClickFlag;
|
||||
|
||||
@Provides
|
||||
@@ -93,17 +96,26 @@ public class BankPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
clientThread.invokeLater(() -> bankSearch.reset(false));
|
||||
forceRightClickFlag = false;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuShouldLeftClick(MenuShouldLeftClick event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(MenuShouldLeftClick.class, this, this::onMenuShouldLeftClick);
|
||||
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
|
||||
eventBus.subscribe(ScriptCallbackEvent.class, this, this::onScriptCallbackEvent);
|
||||
}
|
||||
|
||||
private void onMenuShouldLeftClick(MenuShouldLeftClick event)
|
||||
{
|
||||
if (!forceRightClickFlag)
|
||||
{
|
||||
@@ -124,8 +136,7 @@ public class BankPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||
private void onMenuEntryAdded(MenuEntryAdded event)
|
||||
{
|
||||
if ((event.getOption().equals(DEPOSIT_WORN) && this.rightClickBankEquip)
|
||||
|| (event.getOption().equals(DEPOSIT_INVENTORY) && this.rightClickBankInventory)
|
||||
@@ -135,8 +146,7 @@ public class BankPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onScriptCallbackEvent(ScriptCallbackEvent event)
|
||||
private void onScriptCallbackEvent(ScriptCallbackEvent event)
|
||||
{
|
||||
if (!event.getEventName().equals("setBankTitle"))
|
||||
{
|
||||
@@ -192,8 +202,7 @@ public class BankPlugin extends Plugin
|
||||
stringStack[stringStackSize - 1] += strCurrentTab;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!event.getGroup().equals("bank"))
|
||||
{
|
||||
|
||||
@@ -60,7 +60,7 @@ import net.runelite.api.widgets.WidgetID;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.game.SpriteManager;
|
||||
import net.runelite.client.game.chatbox.ChatboxPanelManager;
|
||||
@@ -132,6 +132,9 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
|
||||
@Inject
|
||||
private SpriteManager spriteManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private boolean shiftPressed = false;
|
||||
private int nextRowIndex = 0;
|
||||
|
||||
@@ -144,6 +147,8 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
|
||||
@Override
|
||||
public void startUp()
|
||||
{
|
||||
addSubscriptions();
|
||||
|
||||
keyManager.registerKeyListener(this);
|
||||
mouseManager.registerMouseWheelListener(this);
|
||||
clientThread.invokeLater(tabInterface::init);
|
||||
@@ -153,6 +158,8 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
|
||||
@Override
|
||||
public void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
keyManager.unregisterKeyListener(this);
|
||||
mouseManager.unregisterMouseWheelListener(this);
|
||||
clientThread.invokeLater(tabInterface::destroy);
|
||||
@@ -161,6 +168,18 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
|
||||
shiftPressed = false;
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(ScriptCallbackEvent.class, this, this::onScriptCallbackEvent);
|
||||
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
|
||||
eventBus.subscribe(MenuOptionClicked.class, this, this::onMenuOptionClicked);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(DraggingWidgetChanged.class, this, this::onDraggingWidgetChanged);
|
||||
eventBus.subscribe(WidgetLoaded.class, this, this::onWidgetLoaded);
|
||||
eventBus.subscribe(FocusChanged.class, this, this::onFocusChanged);
|
||||
}
|
||||
|
||||
private boolean isSearching()
|
||||
{
|
||||
return client.getVar(VarClientInt.INPUT_TYPE) == InputType.SEARCH.getType()
|
||||
@@ -168,8 +187,7 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
|
||||
&& client.getVar(VarClientStr.INPUT_TEXT) != null && client.getVar(VarClientStr.INPUT_TEXT).length() > 0);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onScriptCallbackEvent(ScriptCallbackEvent event)
|
||||
private void onScriptCallbackEvent(ScriptCallbackEvent event)
|
||||
{
|
||||
String eventName = event.getEventName();
|
||||
|
||||
@@ -284,8 +302,7 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||
private void onMenuEntryAdded(MenuEntryAdded event)
|
||||
{
|
||||
MenuEntry[] entries = client.getMenuEntries();
|
||||
|
||||
@@ -318,8 +335,7 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
|
||||
tabInterface.handleAdd(event);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuOptionClicked(MenuOptionClicked event)
|
||||
private void onMenuOptionClicked(MenuOptionClicked event)
|
||||
{
|
||||
if (event.getActionParam1() == WidgetInfo.BANK_ITEM_CONTAINER.getId()
|
||||
&& event.getMenuAction() == MenuAction.RUNELITE
|
||||
@@ -393,8 +409,7 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged configChanged)
|
||||
private void onConfigChanged(ConfigChanged configChanged)
|
||||
{
|
||||
if (configChanged.getGroup().equals("banktags") && configChanged.getKey().equals("useTabs"))
|
||||
{
|
||||
@@ -409,20 +424,17 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
tabInterface.update();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onDraggingWidgetChanged(DraggingWidgetChanged event)
|
||||
private void onDraggingWidgetChanged(DraggingWidgetChanged event)
|
||||
{
|
||||
tabInterface.handleDrag(event.isDraggingWidget(), shiftPressed);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetLoaded(WidgetLoaded event)
|
||||
private void onWidgetLoaded(WidgetLoaded event)
|
||||
{
|
||||
if (event.getGroupId() == WidgetID.BANK_GROUP_ID)
|
||||
{
|
||||
@@ -430,8 +442,7 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onFocusChanged(FocusChanged event)
|
||||
private void onFocusChanged(FocusChanged event)
|
||||
{
|
||||
if (!event.isFocused())
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ import net.runelite.client.chat.ChatMessageBuilder;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.chat.QueuedMessage;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
@@ -91,6 +91,8 @@ public class BanListPlugin extends Plugin
|
||||
private BanListConfig config;
|
||||
@Inject
|
||||
private ChatMessageManager chatMessageManager;
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
private String tobNames = "";
|
||||
private boolean enableWDRScam;
|
||||
private boolean enableWDRToxic;
|
||||
@@ -108,6 +110,7 @@ public class BanListPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
List<String> bannedPlayers = Splitter
|
||||
.on(",")
|
||||
.trimResults()
|
||||
@@ -120,14 +123,24 @@ public class BanListPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
|
||||
eventBus.unregister(this);
|
||||
wdrScamSet.clear();
|
||||
wdrToxicSet.clear();
|
||||
runeWatchSet.clear();
|
||||
manualBans.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(WidgetHiddenChanged.class, this, this::onWidgetHiddenChanged);
|
||||
eventBus.subscribe(ClanMemberJoined.class, this, this::onClanMemberJoined);
|
||||
eventBus.subscribe(WidgetLoaded.class, this, this::onWidgetLoaded);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("banlist") && event.getKey().equals("bannedPlayers"))
|
||||
{
|
||||
@@ -159,8 +172,7 @@ public class BanListPlugin extends Plugin
|
||||
/**
|
||||
* Event to keep making sure player names are highlighted red in clan chat, since the red name goes away frequently
|
||||
*/
|
||||
@Subscribe
|
||||
public void onWidgetHiddenChanged(WidgetHiddenChanged widgetHiddenChanged)
|
||||
private void onWidgetHiddenChanged(WidgetHiddenChanged widgetHiddenChanged)
|
||||
{
|
||||
if (client.getGameState() != GameState.LOGGED_IN
|
||||
|| client.getWidget(WidgetInfo.LOGIN_CLICK_TO_PLAY_SCREEN) != null
|
||||
@@ -180,9 +192,7 @@ public class BanListPlugin extends Plugin
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Subscribe
|
||||
public void onClanMemberJoined(ClanMemberJoined event)
|
||||
private void onClanMemberJoined(ClanMemberJoined event)
|
||||
{
|
||||
ClanMember member = event.getMember();
|
||||
String memberUsername = Text.standardize(member.getUsername().toLowerCase());
|
||||
@@ -212,8 +222,7 @@ public class BanListPlugin extends Plugin
|
||||
/**
|
||||
* If a trade window is opened and the person trading us is on the list, modify "trading with"
|
||||
*/
|
||||
@Subscribe
|
||||
public void onWidgetLoaded(WidgetLoaded widgetLoaded)
|
||||
private void onWidgetLoaded(WidgetLoaded widgetLoaded)
|
||||
{
|
||||
if (this.highlightInTrade && widgetLoaded.getGroupId() == TRADING_SCREEN)
|
||||
{ //if trading window was loaded
|
||||
@@ -233,9 +242,7 @@ public class BanListPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
|
||||
if (client.getWidget(WidgetInfo.THEATRE_OF_BLOOD_RAIDING_PARTY) == null)
|
||||
|
||||
@@ -82,7 +82,7 @@ import net.runelite.client.chat.ChatMessageBuilder;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.chat.QueuedMessage;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.input.KeyListener;
|
||||
import net.runelite.client.input.KeyManager;
|
||||
@@ -155,6 +155,9 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||
@Inject
|
||||
private KeyManager keyManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter
|
||||
private boolean inGame = false;
|
||||
|
||||
@@ -306,6 +309,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
font = FontManager.getRunescapeFont().deriveFont(Font.BOLD, 24);
|
||||
torsoImage = itemManager.getImage(ItemID.FIGHTER_TORSO);
|
||||
@@ -323,6 +327,8 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(widgetsOverlay);
|
||||
overlayManager.remove(sceneOverlay);
|
||||
keyManager.unregisterKeyListener(this);
|
||||
@@ -343,6 +349,24 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||
menu.clearHiddenMenus();
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(WidgetLoaded.class, this, this::onWidgetLoaded);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
eventBus.subscribe(ItemSpawned.class, this, this::onItemSpawned);
|
||||
eventBus.subscribe(ItemDespawned.class, this, this::onItemDespawned);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(NpcSpawned.class, this, this::onNpcSpawned);
|
||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||
eventBus.subscribe(BeforeRender.class, this, this::onBeforeRender);
|
||||
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
|
||||
eventBus.subscribe(MenuOptionClicked.class, this, this::onMenuOptionClicked);
|
||||
eventBus.subscribe(InteractingChanged.class, this, this::onInteractingChanged);
|
||||
eventBus.subscribe(ProjectileSpawned.class, this, this::onProjectileSpawned);
|
||||
eventBus.subscribe(VarbitChanged.class, this, this::onVarbitChanged);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyTyped(KeyEvent e)
|
||||
{
|
||||
@@ -376,8 +400,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged configChanged)
|
||||
private void onConfigChanged(ConfigChanged configChanged)
|
||||
{
|
||||
//not client thread be careful
|
||||
if (!configChanged.getGroup().equals("barbarianAssault"))
|
||||
@@ -487,8 +510,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||
this.showEggCountOverlay = config.showEggCountOverlay();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetLoaded(WidgetLoaded event)
|
||||
private void onWidgetLoaded(WidgetLoaded event)
|
||||
{
|
||||
switch (event.getGroupId())
|
||||
{
|
||||
@@ -558,8 +580,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage chatMessage)
|
||||
private void onChatMessage(ChatMessage chatMessage)
|
||||
{
|
||||
if (!chatMessage.getType().equals(ChatMessageType.GAMEMESSAGE))
|
||||
{
|
||||
@@ -578,6 +599,11 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||
}
|
||||
else if (isInGame())
|
||||
{
|
||||
if (scorecard != null)
|
||||
{
|
||||
scorecard.onChatMessage(chatMessage);
|
||||
}
|
||||
|
||||
if (message.contains("exploded") && wave != null)
|
||||
{
|
||||
wave.setWrongEggs(wave.getWrongEggs() + 1);
|
||||
@@ -637,8 +663,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onItemSpawned(ItemSpawned itemSpawned)
|
||||
private void onItemSpawned(ItemSpawned itemSpawned)
|
||||
{
|
||||
if (!isInGame())
|
||||
{
|
||||
@@ -657,8 +682,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onItemDespawned(ItemDespawned itemDespawned)
|
||||
private void onItemDespawned(ItemDespawned itemDespawned)
|
||||
{
|
||||
if (!isInGame())
|
||||
{
|
||||
@@ -708,8 +732,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
// Keep in mind isInGame is delayed by a tick when a wave ends
|
||||
if (!isInGame() || getRole() == null)
|
||||
@@ -740,8 +763,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcSpawned(NpcSpawned event)
|
||||
private void onNpcSpawned(NpcSpawned event)
|
||||
{
|
||||
if (!isInGame())
|
||||
{
|
||||
@@ -763,8 +785,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcDespawned(NpcDespawned event)
|
||||
private void onNpcDespawned(NpcDespawned event)
|
||||
{
|
||||
if (!isInGame())
|
||||
{
|
||||
@@ -779,8 +800,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||
// This was almost certainly a waste of time to get working, because almost nobody
|
||||
// actually uses the horn of glory. At least now there shouldn't be anyone complaining
|
||||
// about the horn of glory breaking anything and everything that should never break.
|
||||
@Subscribe
|
||||
public void onBeforeRender(BeforeRender event)
|
||||
private void onBeforeRender(BeforeRender event)
|
||||
{
|
||||
if (!isInGame())
|
||||
{
|
||||
@@ -953,8 +973,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||
// onMenuEntryAdded is being used for conditional entry changes that are not
|
||||
// easily achievable using MenuManager, all other changes use MenuManager in
|
||||
// the BarbarianAssaultMenu/Menus classes
|
||||
@Subscribe
|
||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||
private void onMenuEntryAdded(MenuEntryAdded event)
|
||||
{
|
||||
if (!isInGame())
|
||||
{
|
||||
@@ -1144,8 +1163,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||
client.setMenuEntries(menu.toArray(new MenuEntry[0]));
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuOptionClicked(MenuOptionClicked event)
|
||||
private void onMenuOptionClicked(MenuOptionClicked event)
|
||||
{
|
||||
if (!isInGame() && getRole() != null)
|
||||
{
|
||||
@@ -1177,8 +1195,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||
}
|
||||
|
||||
// Interacting changed has a slight delay until after the hitsplat is applied
|
||||
@Subscribe
|
||||
public void onInteractingChanged(InteractingChanged event)
|
||||
private void onInteractingChanged(InteractingChanged event)
|
||||
{
|
||||
if (!isInGame() || getRole() != Role.HEALER)
|
||||
{
|
||||
@@ -1213,8 +1230,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onProjectileSpawned(ProjectileSpawned event)
|
||||
private void onProjectileSpawned(ProjectileSpawned event)
|
||||
{
|
||||
if (!isInGame())
|
||||
{
|
||||
@@ -1234,8 +1250,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onVarbitChanged(VarbitChanged event)
|
||||
private void onVarbitChanged(VarbitChanged event)
|
||||
{
|
||||
int newInGameBit = client.getVar(Varbits.IN_GAME_BA);
|
||||
|
||||
|
||||
@@ -64,7 +64,6 @@ public class Scorecard
|
||||
this.game = game;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage chatMessage)
|
||||
{
|
||||
if (chatMessage.getMessage().startsWith("---- Points:") && game.getStage() == 1)
|
||||
|
||||
@@ -63,7 +63,7 @@ import net.runelite.client.chat.ChatMessageBuilder;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.chat.QueuedMessage;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.game.SpriteManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -141,6 +141,9 @@ public class BarrowsPlugin extends Plugin
|
||||
@Inject
|
||||
private BarrowsConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Provides
|
||||
BarrowsConfig provideConfig(ConfigManager configManager)
|
||||
{
|
||||
@@ -164,6 +167,8 @@ public class BarrowsPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(barrowsOverlay);
|
||||
overlayManager.add(brotherOverlay);
|
||||
}
|
||||
@@ -171,6 +176,8 @@ public class BarrowsPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(barrowsOverlay);
|
||||
overlayManager.remove(brotherOverlay);
|
||||
walls.clear();
|
||||
@@ -193,8 +200,20 @@ public class BarrowsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(WallObjectSpawned.class, this, this::onWallObjectSpawned);
|
||||
eventBus.subscribe(WallObjectChanged.class, this, this::onWallObjectChanged);
|
||||
eventBus.subscribe(WallObjectDespawned.class, this, this::onWallObjectDespawned);
|
||||
eventBus.subscribe(GameObjectSpawned.class, this, this::onGameObjectSpawned);
|
||||
eventBus.subscribe(GameObjectChanged.class, this, this::onGameObjectChanged);
|
||||
eventBus.subscribe(GameObjectDespawned.class, this, this::onGameObjectDespawned);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(WidgetLoaded.class, this, this::onWidgetLoaded);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("barrows"))
|
||||
{
|
||||
@@ -218,8 +237,7 @@ public class BarrowsPlugin extends Plugin
|
||||
this.showPrayerDrainTimer = config.showPrayerDrainTimer();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWallObjectSpawned(WallObjectSpawned event)
|
||||
private void onWallObjectSpawned(WallObjectSpawned event)
|
||||
{
|
||||
WallObject wallObject = event.getWallObject();
|
||||
if (BARROWS_WALLS.contains(wallObject.getId()))
|
||||
@@ -228,8 +246,7 @@ public class BarrowsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWallObjectChanged(WallObjectChanged event)
|
||||
private void onWallObjectChanged(WallObjectChanged event)
|
||||
{
|
||||
WallObject previous = event.getPrevious();
|
||||
WallObject wallObject = event.getWallObject();
|
||||
@@ -241,15 +258,13 @@ public class BarrowsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWallObjectDespawned(WallObjectDespawned event)
|
||||
private void onWallObjectDespawned(WallObjectDespawned event)
|
||||
{
|
||||
WallObject wallObject = event.getWallObject();
|
||||
walls.remove(wallObject);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameObjectSpawned(GameObjectSpawned event)
|
||||
private void onGameObjectSpawned(GameObjectSpawned event)
|
||||
{
|
||||
GameObject gameObject = event.getGameObject();
|
||||
if (BARROWS_LADDERS.contains(gameObject.getId()))
|
||||
@@ -258,8 +273,7 @@ public class BarrowsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameObjectChanged(GameObjectChanged event)
|
||||
private void onGameObjectChanged(GameObjectChanged event)
|
||||
{
|
||||
GameObject previous = event.getPrevious();
|
||||
GameObject gameObject = event.getGameObject();
|
||||
@@ -271,15 +285,13 @@ public class BarrowsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameObjectDespawned(GameObjectDespawned event)
|
||||
private void onGameObjectDespawned(GameObjectDespawned event)
|
||||
{
|
||||
GameObject gameObject = event.getGameObject();
|
||||
ladders.remove(gameObject);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
if (event.getGameState() == GameState.LOADING)
|
||||
{
|
||||
@@ -303,8 +315,7 @@ public class BarrowsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetLoaded(WidgetLoaded event)
|
||||
private void onWidgetLoaded(WidgetLoaded event)
|
||||
{
|
||||
if (event.getGroupId() == WidgetID.BARROWS_REWARD_GROUP_ID && this.showChestValue)
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.MenuEntryAdded;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
@@ -68,6 +68,8 @@ public class BlackjackPlugin extends Plugin
|
||||
private Client client;
|
||||
@Inject
|
||||
private BlackjackConfig config;
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private boolean pickpocketOnAggro;
|
||||
|
||||
@@ -80,11 +82,25 @@ public class BlackjackPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
addSubscriptions();
|
||||
|
||||
this.pickpocketOnAggro = config.pickpocketOnAggro();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("blackjack"))
|
||||
{
|
||||
@@ -92,8 +108,7 @@ public class BlackjackPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||
private void onMenuEntryAdded(MenuEntryAdded event)
|
||||
{
|
||||
if (client.getGameState() != GameState.LOGGED_IN ||
|
||||
client.getVar(Varbits.QUEST_THE_FEUD) < 13 ||
|
||||
@@ -114,8 +129,7 @@ public class BlackjackPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage event)
|
||||
private void onChatMessage(ChatMessage event)
|
||||
{
|
||||
if (event.getType() == ChatMessageType.SPAM && event.getMessage().equals(SUCCESS_BLACKJACK) ^ (event.getMessage().equals(FAILED_BLACKJACK) && this.pickpocketOnAggro))
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -97,6 +97,9 @@ public class BlastFurnacePlugin extends Plugin
|
||||
@Inject
|
||||
private BlastFurnaceConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private boolean showConveyorBelt;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@@ -106,6 +109,7 @@ public class BlastFurnacePlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(cofferOverlay);
|
||||
@@ -115,6 +119,8 @@ public class BlastFurnacePlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
infoBoxManager.removeIf(ForemanTimer.class::isInstance);
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(cofferOverlay);
|
||||
@@ -124,14 +130,22 @@ public class BlastFurnacePlugin extends Plugin
|
||||
foremanTimer = null;
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameObjectSpawned.class, this, this::onGameObjectSpawned);
|
||||
eventBus.subscribe(GameObjectDespawned.class, this, this::onGameObjectDespawned);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
}
|
||||
|
||||
@Provides
|
||||
BlastFurnaceConfig provideConfig(ConfigManager configManager)
|
||||
{
|
||||
return configManager.getConfig(BlastFurnaceConfig.class);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("blastfurnace"))
|
||||
{
|
||||
@@ -139,8 +153,7 @@ public class BlastFurnacePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameObjectSpawned(GameObjectSpawned event)
|
||||
private void onGameObjectSpawned(GameObjectSpawned event)
|
||||
{
|
||||
GameObject gameObject = event.getGameObject();
|
||||
|
||||
@@ -156,8 +169,7 @@ public class BlastFurnacePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameObjectDespawned(GameObjectDespawned event)
|
||||
private void onGameObjectDespawned(GameObjectDespawned event)
|
||||
{
|
||||
GameObject gameObject = event.getGameObject();
|
||||
|
||||
@@ -173,8 +185,7 @@ public class BlastFurnacePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
if (event.getGameState() == GameState.LOADING)
|
||||
{
|
||||
@@ -183,8 +194,7 @@ public class BlastFurnacePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
Widget npcDialog = client.getWidget(WidgetInfo.DIALOG_NPC_TEXT);
|
||||
if (npcDialog == null)
|
||||
|
||||
@@ -42,7 +42,7 @@ import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
@@ -73,6 +73,9 @@ public class BlastMinePlugin extends Plugin
|
||||
@Inject
|
||||
private BlastMinePluginConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Provides
|
||||
BlastMinePluginConfig getConfig(ConfigManager configManager)
|
||||
{
|
||||
@@ -96,6 +99,7 @@ public class BlastMinePlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(blastMineRockOverlay);
|
||||
overlayManager.add(blastMineOreCountOverlay);
|
||||
@@ -104,6 +108,8 @@ public class BlastMinePlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(blastMineRockOverlay);
|
||||
overlayManager.remove(blastMineOreCountOverlay);
|
||||
final Widget blastMineWidget = client.getWidget(WidgetInfo.BLAST_MINE);
|
||||
@@ -114,8 +120,14 @@ public class BlastMinePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameObjectSpawned(GameObjectSpawned event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(GameObjectSpawned.class, this, this::onGameObjectSpawned);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
}
|
||||
|
||||
private void onGameObjectSpawned(GameObjectSpawned event)
|
||||
{
|
||||
final GameObject gameObject = event.getGameObject();
|
||||
BlastMineRockType blastMineRockType = BlastMineRockType.getRockType(gameObject.getId());
|
||||
@@ -133,8 +145,7 @@ public class BlastMinePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
if (event.getGameState() == GameState.LOADING)
|
||||
{
|
||||
@@ -142,8 +153,7 @@ public class BlastMinePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick gameTick)
|
||||
private void onGameTick(GameTick gameTick)
|
||||
{
|
||||
if (rocks.isEmpty())
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@ import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.SkillIconManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -98,6 +98,8 @@ public class BoostsPlugin extends Plugin
|
||||
private SkillIconManager skillIconManager;
|
||||
@Inject
|
||||
private CombatIconsOverlay combatIconsOverlay;
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private boolean isChangedDown = false;
|
||||
private boolean isChangedUp = false;
|
||||
@@ -133,6 +135,7 @@ public class BoostsPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(boostsOverlay);
|
||||
overlayManager.add(combatIconsOverlay);
|
||||
@@ -156,6 +159,7 @@ public class BoostsPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
overlayManager.remove(boostsOverlay);
|
||||
overlayManager.remove(combatIconsOverlay);
|
||||
infoBoxManager.removeIf(t -> t instanceof BoostIndicator || t instanceof StatChangeIndicator);
|
||||
@@ -166,8 +170,15 @@ public class BoostsPlugin extends Plugin
|
||||
isChangedDown = false;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(BoostedLevelChanged.class, this, this::onBoostedLevelChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
}
|
||||
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
switch (event.getGameState())
|
||||
{
|
||||
@@ -179,8 +190,7 @@ public class BoostsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!event.getGroup().equals("boosts"))
|
||||
{
|
||||
@@ -201,8 +211,7 @@ public class BoostsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onBoostedLevelChanged(BoostedLevelChanged boostedLevelChanged)
|
||||
private void onBoostedLevelChanged(BoostedLevelChanged boostedLevelChanged)
|
||||
{
|
||||
Skill skill = boostedLevelChanged.getSkill();
|
||||
|
||||
@@ -251,8 +260,7 @@ public class BoostsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
lastTickMillis = System.currentTimeMillis();
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import javax.inject.Singleton;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -51,14 +51,23 @@ public class BossTimersPlugin extends Plugin
|
||||
@Inject
|
||||
private ItemManager itemManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
infoBoxManager.removeIf(t -> t instanceof RespawnTimer);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcDespawned(NpcDespawned npcDespawned)
|
||||
private void onNpcDespawned(NpcDespawned npcDespawned)
|
||||
{
|
||||
NPC npc = npcDespawned.getNpc();
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ public class CannonPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
super.shutDown();
|
||||
eventbus.unregister(this);
|
||||
|
||||
cannonSpotOverlay.setHidden(true);
|
||||
overlayManager.remove(cannonOverlay);
|
||||
|
||||
@@ -37,7 +37,7 @@ import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
@@ -59,21 +59,34 @@ public class CerberusPlugin extends Plugin
|
||||
@Inject
|
||||
private CerberusOverlay overlay;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
addSubscriptions();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
ghosts.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(NpcSpawned.class, this, this::onNpcSpawned);
|
||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
}
|
||||
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
GameState gameState = event.getGameState();
|
||||
if (gameState == GameState.LOGIN_SCREEN || gameState == GameState.HOPPING || gameState == GameState.CONNECTION_LOST)
|
||||
@@ -82,21 +95,18 @@ public class CerberusPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcSpawned(final NpcSpawned event)
|
||||
private void onNpcSpawned(final NpcSpawned event)
|
||||
{
|
||||
final NPC npc = event.getNpc();
|
||||
CerberusGhost.fromNPC(npc).ifPresent(ghost -> ghosts.add(npc));
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcDespawned(final NpcDespawned event)
|
||||
private void onNpcDespawned(final NpcDespawned event)
|
||||
{
|
||||
ghosts.remove(event.getNpc());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick gameTick)
|
||||
private void onGameTick(GameTick gameTick)
|
||||
{
|
||||
if (ghosts.isEmpty())
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.api.widgets.WidgetPositionMode;
|
||||
import net.runelite.api.widgets.WidgetSizeMode;
|
||||
import net.runelite.api.widgets.WidgetType;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
|
||||
@@ -47,8 +47,22 @@ public class ChatboxPerformancePlugin extends Plugin
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetPositioned(WidgetPositioned event)
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
eventBus.subscribe(WidgetPositioned.class, this, this::onWidgetPositioned);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
}
|
||||
|
||||
private void onWidgetPositioned(WidgetPositioned event)
|
||||
{
|
||||
if (!areWidgetsFixed())
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ import net.runelite.client.chat.ChatCommandManager;
|
||||
import net.runelite.client.chat.ChatMessageBuilder;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ChatInput;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.input.KeyManager;
|
||||
@@ -140,9 +140,14 @@ public class ChatCommandsPlugin extends Plugin
|
||||
@Inject
|
||||
private ChatKeyboardListener chatKeyboardListener;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Override
|
||||
public void startUp()
|
||||
{
|
||||
addSubscriptions();
|
||||
|
||||
keyManager.registerKeyListener(chatKeyboardListener);
|
||||
|
||||
chatCommandManager.registerCommandAsync(TOTAL_LEVEL_COMMAND_STRING, this::playerSkillLookup);
|
||||
@@ -160,6 +165,8 @@ public class ChatCommandsPlugin extends Plugin
|
||||
@Override
|
||||
public void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
lastBossKill = null;
|
||||
|
||||
keyManager.unregisterKeyListener(chatKeyboardListener);
|
||||
@@ -176,6 +183,14 @@ public class ChatCommandsPlugin extends Plugin
|
||||
chatCommandManager.unregisterCommand(DUEL_ARENA_COMMAND);
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(WidgetLoaded.class, this, this::onWidgetLoaded);
|
||||
eventBus.subscribe(VarbitChanged.class, this, this::onVarbitChanged);
|
||||
}
|
||||
|
||||
@Provides
|
||||
ChatCommandsConfig provideConfig(ConfigManager configManager)
|
||||
{
|
||||
@@ -208,8 +223,7 @@ public class ChatCommandsPlugin extends Plugin
|
||||
return personalBest == null ? 0 : personalBest;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage chatMessage)
|
||||
private void onChatMessage(ChatMessage chatMessage)
|
||||
{
|
||||
if (chatMessage.getType() != ChatMessageType.TRADE
|
||||
&& chatMessage.getType() != ChatMessageType.GAMEMESSAGE
|
||||
@@ -324,8 +338,7 @@ public class ChatCommandsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
if (!logKills)
|
||||
{
|
||||
@@ -361,8 +374,7 @@ public class ChatCommandsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetLoaded(WidgetLoaded widget)
|
||||
private void onWidgetLoaded(WidgetLoaded widget)
|
||||
{
|
||||
// don't load kc if in an instance, if the player is in another players poh
|
||||
// and reading their boss log
|
||||
@@ -374,8 +386,7 @@ public class ChatCommandsPlugin extends Plugin
|
||||
logKills = true;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onVarbitChanged(VarbitChanged varbitChanged)
|
||||
private void onVarbitChanged(VarbitChanged varbitChanged)
|
||||
{
|
||||
hiscoreEndpoint = getLocalHiscoreEndpointType();
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.OverheadTextChanged;
|
||||
import net.runelite.api.events.ScriptCallbackEvent;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.util.Text;
|
||||
@@ -75,6 +75,9 @@ public class ChatFilterPlugin extends Plugin
|
||||
@Inject
|
||||
private ChatFilterConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Setter(AccessLevel.PACKAGE)
|
||||
private ChatFilterType filterType;
|
||||
@Setter(AccessLevel.PACKAGE)
|
||||
@@ -96,6 +99,8 @@ public class ChatFilterPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
updateFilteredPatterns();
|
||||
client.refreshChat();
|
||||
}
|
||||
@@ -103,12 +108,20 @@ public class ChatFilterPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
filteredPatterns.clear();
|
||||
client.refreshChat();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onScriptCallbackEvent(ScriptCallbackEvent event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(ScriptCallbackEvent.class, this, this::onScriptCallbackEvent);
|
||||
eventBus.subscribe(OverheadTextChanged.class, this, this::onOverheadTextChanged);
|
||||
}
|
||||
|
||||
private void onScriptCallbackEvent(ScriptCallbackEvent event)
|
||||
{
|
||||
if (!"chatFilterCheck".equals(event.getEventName()))
|
||||
{
|
||||
@@ -171,8 +184,7 @@ public class ChatFilterPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onOverheadTextChanged(OverheadTextChanged event)
|
||||
private void onOverheadTextChanged(OverheadTextChanged event)
|
||||
{
|
||||
if (!(event.getActor() instanceof Player) || !shouldFilterPlayerMessage(event.getActor().getName()))
|
||||
{
|
||||
@@ -254,8 +266,7 @@ public class ChatFilterPlugin extends Plugin
|
||||
.forEach(filteredPatterns::add);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!"chatfilter".equals(event.getGroup()))
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.chat.QueuedMessage;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.input.KeyListener;
|
||||
import net.runelite.client.input.KeyManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -85,6 +85,9 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener
|
||||
@Inject
|
||||
private ChatMessageManager chatMessageManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private boolean retainChatHistory;
|
||||
private boolean pmTargetCycling;
|
||||
|
||||
@@ -98,6 +101,7 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener
|
||||
protected void startUp()
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
messageQueue = EvictingQueue.create(100);
|
||||
friends = new ArrayDeque<>(FRIENDS_MAX_SIZE + 1);
|
||||
@@ -107,6 +111,8 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
messageQueue.clear();
|
||||
messageQueue = null;
|
||||
friends.clear();
|
||||
@@ -114,8 +120,14 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener
|
||||
keyManager.unregisterKeyListener(this);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage chatMessage)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
eventBus.subscribe(MenuOptionClicked.class, this, this::onMenuOptionClicked);
|
||||
}
|
||||
|
||||
private void onChatMessage(ChatMessage chatMessage)
|
||||
{
|
||||
// Start sending old messages right after the welcome message, as that is most reliable source
|
||||
// of information that chat history was reset
|
||||
@@ -171,8 +183,7 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuOptionClicked(MenuOptionClicked event)
|
||||
private void onMenuOptionClicked(MenuOptionClicked event)
|
||||
{
|
||||
String menuOption = event.getOption();
|
||||
|
||||
@@ -269,8 +280,7 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener
|
||||
return friends.getLast();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!"chathistory".equals(event.getGroup()))
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ import net.runelite.client.RuneLiteProperties;
|
||||
import net.runelite.client.chat.ChatColorType;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.util.Text;
|
||||
@@ -76,6 +76,9 @@ public class ChatNotificationsPlugin extends Plugin
|
||||
@Inject
|
||||
private RuneLiteProperties runeLiteProperties;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
//Custom Highlights
|
||||
private Pattern usernameMatcher = null;
|
||||
private String usernameReplacer = "";
|
||||
@@ -102,17 +105,27 @@ public class ChatNotificationsPlugin extends Plugin
|
||||
public void startUp()
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
updateHighlights();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
this.privateMessageHashes.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
}
|
||||
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
switch (event.getGameState())
|
||||
{
|
||||
@@ -123,8 +136,7 @@ public class ChatNotificationsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("chatnotification"))
|
||||
{
|
||||
@@ -150,8 +162,7 @@ public class ChatNotificationsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage chatMessage)
|
||||
private void onChatMessage(ChatMessage chatMessage)
|
||||
{
|
||||
MessageNode messageNode = chatMessage.getMessageNode();
|
||||
boolean update = false;
|
||||
|
||||
@@ -26,7 +26,7 @@ import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.input.KeyListener;
|
||||
import net.runelite.client.input.KeyManager;
|
||||
import net.runelite.client.menus.MenuManager;
|
||||
@@ -74,6 +74,9 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
|
||||
@Inject
|
||||
private ChatTranslationConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private boolean translateOptionVisable;
|
||||
private boolean publicChat;
|
||||
private String getPlayerNames;
|
||||
@@ -91,6 +94,7 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
if (client != null && this.translateOptionVisable)
|
||||
{
|
||||
@@ -104,6 +108,7 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
if (client != null && this.translateOptionVisable)
|
||||
{
|
||||
menuManager.get().removePlayerMenuItem(TRANSLATE);
|
||||
@@ -113,8 +118,15 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
|
||||
playerNames.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
|
||||
eventBus.subscribe(PlayerMenuOptionClicked.class, this, this::onPlayerMenuOptionClicked);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("chattranslation"))
|
||||
{
|
||||
@@ -132,8 +144,7 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||
private void onMenuEntryAdded(MenuEntryAdded event)
|
||||
{
|
||||
if (!this.translateOptionVisable)
|
||||
{
|
||||
@@ -165,8 +176,7 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onPlayerMenuOptionClicked(PlayerMenuOptionClicked event)
|
||||
private void onPlayerMenuOptionClicked(PlayerMenuOptionClicked event)
|
||||
{
|
||||
if (event.getMenuOption().equals(TRANSLATE))
|
||||
{
|
||||
@@ -181,8 +191,7 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage chatMessage)
|
||||
private void onChatMessage(ChatMessage chatMessage)
|
||||
{
|
||||
if (client.getGameState() != GameState.LOADING && client.getGameState() != GameState.LOGGED_IN)
|
||||
{
|
||||
|
||||
@@ -70,7 +70,7 @@ import net.runelite.api.widgets.WidgetType;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.chat.ChatMessageBuilder;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ClanManager;
|
||||
import net.runelite.client.game.SpriteManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -114,6 +114,9 @@ public class ClanChatPlugin extends Plugin
|
||||
@Inject
|
||||
private ClientThread clientThread;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private List<String> chats = new ArrayList<>();
|
||||
|
||||
public static CopyOnWriteArrayList<Player> getClanMembers()
|
||||
@@ -151,19 +154,37 @@ public class ClanChatPlugin extends Plugin
|
||||
public void startUp()
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
chats = new ArrayList<>(Text.fromCSV(this.chatsData));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
clanMembers.clear();
|
||||
removeClanCounter();
|
||||
resetClanChats();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged configChanged)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(ClanMemberJoined.class, this, this::onClanMemberJoined);
|
||||
eventBus.subscribe(ClanMemberLeft.class, this, this::onClanMemberLeft);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(VarClientStrChanged.class, this, this::onVarClientStrChanged);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(PlayerSpawned.class, this, this::onPlayerSpawned);
|
||||
eventBus.subscribe(PlayerDespawned.class, this, this::onPlayerDespawned);
|
||||
eventBus.subscribe(ClanChanged.class, this, this::onClanChanged);
|
||||
eventBus.subscribe(ScriptCallbackEvent.class, this, this::onScriptCallbackEvent);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged configChanged)
|
||||
{
|
||||
if (configChanged.getGroup().equals("clanchat"))
|
||||
{
|
||||
@@ -185,8 +206,7 @@ public class ClanChatPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onClanMemberJoined(ClanMemberJoined event)
|
||||
private void onClanMemberJoined(ClanMemberJoined event)
|
||||
{
|
||||
final ClanMember member = event.getMember();
|
||||
|
||||
@@ -231,8 +251,7 @@ public class ClanChatPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onClanMemberLeft(ClanMemberLeft event)
|
||||
private void onClanMemberLeft(ClanMemberLeft event)
|
||||
{
|
||||
final ClanMember member = event.getMember();
|
||||
|
||||
@@ -275,8 +294,7 @@ public class ClanChatPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick gameTick)
|
||||
private void onGameTick(GameTick gameTick)
|
||||
{
|
||||
if (client.getGameState() != GameState.LOGGED_IN)
|
||||
{
|
||||
@@ -414,8 +432,7 @@ public class ClanChatPlugin extends Plugin
|
||||
clanJoinMessages.addLast(clanJoinMessage);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onVarClientStrChanged(VarClientStrChanged strChanged)
|
||||
private void onVarClientStrChanged(VarClientStrChanged strChanged)
|
||||
{
|
||||
if (strChanged.getIndex() == VarClientStr.RECENT_CLAN_CHAT.getIndex() && this.recentChats)
|
||||
{
|
||||
@@ -423,8 +440,7 @@ public class ClanChatPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage chatMessage)
|
||||
private void onChatMessage(ChatMessage chatMessage)
|
||||
{
|
||||
if (client.getGameState() != GameState.LOADING && client.getGameState() != GameState.LOGGED_IN)
|
||||
{
|
||||
@@ -465,8 +481,7 @@ public class ClanChatPlugin extends Plugin
|
||||
insertClanRankIcon(chatMessage);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged state)
|
||||
private void onGameStateChanged(GameStateChanged state)
|
||||
{
|
||||
GameState gameState = state.getGameState();
|
||||
|
||||
@@ -479,8 +494,7 @@ public class ClanChatPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onPlayerSpawned(PlayerSpawned event)
|
||||
private void onPlayerSpawned(PlayerSpawned event)
|
||||
{
|
||||
final Player local = client.getLocalPlayer();
|
||||
final Player player = event.getPlayer();
|
||||
@@ -492,8 +506,7 @@ public class ClanChatPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onPlayerDespawned(PlayerDespawned event)
|
||||
private void onPlayerDespawned(PlayerDespawned event)
|
||||
{
|
||||
if (clanMembers.remove(event.getPlayer()) && clanMembers.isEmpty())
|
||||
{
|
||||
@@ -501,8 +514,7 @@ public class ClanChatPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onClanChanged(ClanChanged event)
|
||||
private void onClanChanged(ClanChanged event)
|
||||
{
|
||||
if (event.isJoined())
|
||||
{
|
||||
@@ -517,8 +529,7 @@ public class ClanChatPlugin extends Plugin
|
||||
activityBuffer.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onScriptCallbackEvent(ScriptCallbackEvent scriptCallbackEvent)
|
||||
private void onScriptCallbackEvent(ScriptCallbackEvent scriptCallbackEvent)
|
||||
{
|
||||
if (!scriptCallbackEvent.getEventName().equalsIgnoreCase("clanchatInput"))
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
@@ -52,6 +52,9 @@ public class ClanManModePlugin extends Plugin
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private boolean highlightAttackable;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@@ -100,6 +103,7 @@ public class ClanManModePlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(ClanManModeOverlay);
|
||||
overlayManager.add(ClanManModeTileOverlay);
|
||||
@@ -109,6 +113,8 @@ public class ClanManModePlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(ClanManModeOverlay);
|
||||
overlayManager.remove(ClanManModeTileOverlay);
|
||||
overlayManager.remove(ClanManModeMinimapOverlay);
|
||||
@@ -120,7 +126,13 @@ public class ClanManModePlugin extends Plugin
|
||||
inwildy = 0;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!"clanmanmode".equals(event.getGroup()))
|
||||
@@ -131,8 +143,7 @@ public class ClanManModePlugin extends Plugin
|
||||
updateConfig();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||
private void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||
{
|
||||
if (gameStateChanged.getGameState() == GameState.LOGIN_SCREEN || gameStateChanged.getGameState() == GameState.HOPPING)
|
||||
{
|
||||
@@ -140,8 +151,7 @@ public class ClanManModePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
ticks++;
|
||||
final Player localPlayer = client.getLocalPlayer();
|
||||
|
||||
@@ -72,7 +72,7 @@ import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetID;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -158,6 +158,9 @@ public class ClueScrollPlugin extends Plugin
|
||||
@Inject
|
||||
private WorldMapPointManager worldMapPointManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private BufferedImage emoteImage;
|
||||
private BufferedImage mapArrow;
|
||||
private Integer clueItemId;
|
||||
@@ -182,6 +185,8 @@ public class ClueScrollPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
addSubscriptions();
|
||||
|
||||
this.displayHintArrows = config.displayHintArrows();
|
||||
overlayManager.add(clueScrollOverlay);
|
||||
overlayManager.add(clueScrollEmoteOverlay);
|
||||
@@ -192,6 +197,8 @@ public class ClueScrollPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(clueScrollOverlay);
|
||||
overlayManager.remove(clueScrollEmoteOverlay);
|
||||
overlayManager.remove(clueScrollWorldOverlay);
|
||||
@@ -202,8 +209,20 @@ public class ClueScrollPlugin extends Plugin
|
||||
resetClue(true);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
eventBus.subscribe(MenuOptionClicked.class, this, this::onMenuOptionClicked);
|
||||
eventBus.subscribe(ItemContainerChanged.class, this, this::onItemContainerChanged);
|
||||
eventBus.subscribe(NpcSpawned.class, this, this::onNpcSpawned);
|
||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(WidgetLoaded.class, this, this::onWidgetLoaded);
|
||||
}
|
||||
|
||||
private void onChatMessage(ChatMessage event)
|
||||
{
|
||||
if (event.getType() != ChatMessageType.GAMEMESSAGE && event.getType() != ChatMessageType.SPAM)
|
||||
{
|
||||
@@ -224,8 +243,7 @@ public class ClueScrollPlugin extends Plugin
|
||||
resetClue(true);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuOptionClicked(final MenuOptionClicked event)
|
||||
private void onMenuOptionClicked(final MenuOptionClicked event)
|
||||
{
|
||||
if ("read".equalsIgnoreCase(event.getOption()))
|
||||
{
|
||||
@@ -239,8 +257,7 @@ public class ClueScrollPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onItemContainerChanged(final ItemContainerChanged event)
|
||||
private void onItemContainerChanged(final ItemContainerChanged event)
|
||||
{
|
||||
if (event.getItemContainer() == client.getItemContainer(InventoryID.EQUIPMENT))
|
||||
{
|
||||
@@ -280,15 +297,13 @@ public class ClueScrollPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcSpawned(final NpcSpawned event)
|
||||
private void onNpcSpawned(final NpcSpawned event)
|
||||
{
|
||||
final NPC npc = event.getNpc();
|
||||
checkClueNPCs(clue, npc);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcDespawned(final NpcDespawned event)
|
||||
private void onNpcDespawned(final NpcDespawned event)
|
||||
{
|
||||
final boolean removed = npcsToMark.remove(event.getNpc());
|
||||
|
||||
@@ -306,8 +321,7 @@ public class ClueScrollPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("cluescroll"))
|
||||
{
|
||||
@@ -319,8 +333,7 @@ public class ClueScrollPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(final GameStateChanged event)
|
||||
private void onGameStateChanged(final GameStateChanged event)
|
||||
{
|
||||
if (event.getGameState() == GameState.LOGIN_SCREEN)
|
||||
{
|
||||
@@ -328,8 +341,7 @@ public class ClueScrollPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(final GameTick event)
|
||||
private void onGameTick(final GameTick event)
|
||||
{
|
||||
objectsToMark.clear();
|
||||
|
||||
@@ -392,8 +404,7 @@ public class ClueScrollPlugin extends Plugin
|
||||
updateClue(findClueScroll());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetLoaded(WidgetLoaded event)
|
||||
private void onWidgetLoaded(WidgetLoaded event)
|
||||
{
|
||||
if (event.getGroupId() < WidgetID.BEGINNER_CLUE_MAP_CHAMPIONS_GUILD
|
||||
|| event.getGroupId() > WidgetID.BEGINNER_CLUE_MAP_WIZARDS_TOWER)
|
||||
|
||||
@@ -56,7 +56,7 @@ import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.HitsplatApplied;
|
||||
import net.runelite.api.kit.KitType;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
@@ -89,6 +89,9 @@ public class CombatCounter extends Plugin
|
||||
@Inject
|
||||
private CombatCounterConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private boolean instanced = false;
|
||||
@Setter(AccessLevel.PACKAGE)
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@@ -236,6 +239,7 @@ public class CombatCounter extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(tickOverlay);
|
||||
overlayManager.add(damageOverlay);
|
||||
@@ -249,6 +253,8 @@ public class CombatCounter extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(tickOverlay);
|
||||
overlayManager.remove(damageOverlay);
|
||||
|
||||
@@ -258,8 +264,15 @@ public class CombatCounter extends Plugin
|
||||
this.playerDamage.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onAnimationChanged(AnimationChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(AnimationChanged.class, this, this::onAnimationChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(HitsplatApplied.class, this, this::onHitsplatApplied);
|
||||
}
|
||||
|
||||
private void onAnimationChanged(AnimationChanged event)
|
||||
{
|
||||
Actor actor = event.getActor();
|
||||
|
||||
@@ -403,8 +416,7 @@ public class CombatCounter extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
if (this.resetOnNewInstance)
|
||||
{
|
||||
@@ -554,9 +566,7 @@ public class CombatCounter extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Subscribe
|
||||
public void onHitsplatApplied(HitsplatApplied event)
|
||||
private void onHitsplatApplied(HitsplatApplied event)
|
||||
{
|
||||
Actor actor = event.getActor();
|
||||
|
||||
@@ -644,8 +654,7 @@ public class CombatCounter extends Plugin
|
||||
return 2 + (int) Math.floor((3d + distance) / 6d);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("combatcounter"))
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@ import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
@@ -84,6 +84,9 @@ public class CombatLevelPlugin extends Plugin
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private boolean showLevelsUntil;
|
||||
private boolean wildernessAttackLevelRange;
|
||||
@@ -98,6 +101,7 @@ public class CombatLevelPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(overlay);
|
||||
|
||||
@@ -110,6 +114,8 @@ public class CombatLevelPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
Widget combatLevelWidget = client.getWidget(WidgetInfo.COMBAT_LEVEL);
|
||||
|
||||
@@ -126,8 +132,14 @@ public class CombatLevelPlugin extends Plugin
|
||||
shutDownAttackLevelRange();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(ScriptCallbackEvent.class, this, this::onScriptCallbackEvent);
|
||||
}
|
||||
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
if (client.getGameState() != GameState.LOGGED_IN)
|
||||
{
|
||||
@@ -153,8 +165,7 @@ public class CombatLevelPlugin extends Plugin
|
||||
combatLevelWidget.setText("Combat Lvl: " + DECIMAL_FORMAT.format(combatLevelPrecise));
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!CONFIG_GROUP.equals(event.getGroup()) || !ATTACK_RANGE_CONFIG_KEY.equals(event.getKey()))
|
||||
{
|
||||
@@ -173,8 +184,7 @@ public class CombatLevelPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onScriptCallbackEvent(ScriptCallbackEvent event)
|
||||
private void onScriptCallbackEvent(ScriptCallbackEvent event)
|
||||
{
|
||||
if (this.wildernessAttackLevelRange
|
||||
&& "wildernessWidgetTextSet".equals(event.getEventName()))
|
||||
|
||||
@@ -37,7 +37,7 @@ import net.runelite.client.config.ChatColorConfig;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.config.RuneLiteConfig;
|
||||
import net.runelite.client.config.RuneLitePlusConfig;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.OverlayMenuClicked;
|
||||
import net.runelite.client.events.PluginChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -80,12 +80,17 @@ public class ConfigPlugin extends Plugin
|
||||
@Inject
|
||||
private ChatColorConfig chatColorConfig;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private ConfigPanel configPanel;
|
||||
private NavigationButton navButton;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
addSubscriptions();
|
||||
|
||||
configPanel = new ConfigPanel(pluginManager, configManager, executorService, runeLiteConfig, runeLitePlusConfig, chatColorConfig);
|
||||
|
||||
final BufferedImage icon = ImageUtil.getResourceStreamFromClass(getClass(), "config_icon.png");
|
||||
@@ -103,6 +108,8 @@ public class ConfigPlugin extends Plugin
|
||||
@Override
|
||||
public void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
clientToolbar.removeNavigation(navButton);
|
||||
RuneLite.getInjector().getInstance(ClientThread.class).invokeLater(() ->
|
||||
{
|
||||
@@ -122,14 +129,18 @@ public class ConfigPlugin extends Plugin
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onPluginChanged(PluginChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(PluginChanged.class, this, this::onPluginChanged);
|
||||
eventBus.subscribe(OverlayMenuClicked.class, this, this::onOverlayMenuClicked);
|
||||
}
|
||||
|
||||
private void onPluginChanged(PluginChanged event)
|
||||
{
|
||||
SwingUtilities.invokeLater(configPanel::refreshPluginList);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onOverlayMenuClicked(OverlayMenuClicked overlayMenuClicked)
|
||||
private void onOverlayMenuClicked(OverlayMenuClicked overlayMenuClicked)
|
||||
{
|
||||
OverlayMenuEntry overlayMenuEntry = overlayMenuClicked.getEntry();
|
||||
if (overlayMenuEntry.getMenuAction() == MenuAction.RUNELITE_OVERLAY_CONFIG)
|
||||
|
||||
@@ -44,7 +44,7 @@ import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.SpotAnimationChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDependency;
|
||||
@@ -80,6 +80,9 @@ public class CookingPlugin extends Plugin
|
||||
@Inject
|
||||
private ItemManager itemManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private CookingSession session;
|
||||
|
||||
@@ -97,6 +100,8 @@ public class CookingPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
session = null;
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
@@ -104,13 +109,22 @@ public class CookingPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
infoBoxManager.removeIf(FermentTimer.class::isInstance);
|
||||
overlayManager.remove(overlay);
|
||||
session = null;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick gameTick)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(SpotAnimationChanged.class, this, this::onSpotAnimationChanged);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
}
|
||||
|
||||
private void onGameTick(GameTick gameTick)
|
||||
{
|
||||
if (session == null || this.statTimeout == 0)
|
||||
{
|
||||
@@ -126,8 +140,7 @@ public class CookingPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onSpotAnimationChanged(SpotAnimationChanged graphicChanged)
|
||||
private void onSpotAnimationChanged(SpotAnimationChanged graphicChanged)
|
||||
{
|
||||
Player player = client.getLocalPlayer();
|
||||
|
||||
@@ -156,8 +169,7 @@ public class CookingPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage event)
|
||||
private void onChatMessage(ChatMessage event)
|
||||
{
|
||||
if (event.getType() != ChatMessageType.SPAM)
|
||||
{
|
||||
@@ -194,8 +206,7 @@ public class CookingPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged configChanged)
|
||||
private void onConfigChanged(ConfigChanged configChanged)
|
||||
{
|
||||
if (configChanged.getGroup().equals("cooking"))
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ import net.runelite.client.chat.ChatMessageBuilder;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.chat.QueuedMessage;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
@@ -102,6 +102,9 @@ public class CorpPlugin extends Plugin
|
||||
@Inject
|
||||
private CorpConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private boolean leftClickCore;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private boolean showDamage;
|
||||
@@ -116,6 +119,7 @@ public class CorpPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(corpOverlay);
|
||||
overlayManager.add(coreOverlay);
|
||||
@@ -124,6 +128,8 @@ public class CorpPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(corpOverlay);
|
||||
overlayManager.remove(coreOverlay);
|
||||
|
||||
@@ -133,8 +139,18 @@ public class CorpPlugin extends Plugin
|
||||
players.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(NpcSpawned.class, this, this::onNpcSpawned);
|
||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||
eventBus.subscribe(HitsplatApplied.class, this, this::onHitsplatApplied);
|
||||
eventBus.subscribe(InteractingChanged.class, this, this::onInteractingChanged);
|
||||
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
|
||||
}
|
||||
|
||||
private void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||
{
|
||||
if (gameStateChanged.getGameState() == GameState.LOADING)
|
||||
{
|
||||
@@ -142,8 +158,7 @@ public class CorpPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcSpawned(NpcSpawned npcSpawned)
|
||||
private void onNpcSpawned(NpcSpawned npcSpawned)
|
||||
{
|
||||
NPC npc = npcSpawned.getNpc();
|
||||
|
||||
@@ -162,8 +177,7 @@ public class CorpPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcDespawned(NpcDespawned npcDespawned)
|
||||
private void onNpcDespawned(NpcDespawned npcDespawned)
|
||||
{
|
||||
NPC npc = npcDespawned.getNpc();
|
||||
|
||||
@@ -199,8 +213,7 @@ public class CorpPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onHitsplatApplied(HitsplatApplied hitsplatApplied)
|
||||
private void onHitsplatApplied(HitsplatApplied hitsplatApplied)
|
||||
{
|
||||
Actor actor = hitsplatApplied.getActor();
|
||||
|
||||
@@ -218,8 +231,7 @@ public class CorpPlugin extends Plugin
|
||||
totalDamage += hitsplatApplied.getHitsplat().getAmount();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onInteractingChanged(InteractingChanged interactingChanged)
|
||||
private void onInteractingChanged(InteractingChanged interactingChanged)
|
||||
{
|
||||
Actor source = interactingChanged.getSource();
|
||||
Actor target = interactingChanged.getTarget();
|
||||
@@ -232,8 +244,7 @@ public class CorpPlugin extends Plugin
|
||||
players.add(source);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuEntryAdded(MenuEntryAdded menuEntryAdded)
|
||||
private void onMenuEntryAdded(MenuEntryAdded menuEntryAdded)
|
||||
{
|
||||
if (menuEntryAdded.getType() != NPC_SECTION_ACTION
|
||||
|| !this.leftClickCore || !menuEntryAdded.getOption().equals(ATTACK))
|
||||
@@ -256,8 +267,7 @@ public class CorpPlugin extends Plugin
|
||||
client.setMenuEntries(menuEntries);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged configChanged)
|
||||
private void onConfigChanged(ConfigChanged configChanged)
|
||||
{
|
||||
if (configChanged.getGroup().equals("corp"))
|
||||
{
|
||||
|
||||
@@ -63,7 +63,7 @@ import net.runelite.api.events.ProjectileMoved;
|
||||
import net.runelite.api.events.SpotAnimationChanged;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
@@ -105,6 +105,8 @@ public class CoxPlugin extends Plugin
|
||||
private CoxConfig config;
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private boolean HandCripple;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@@ -207,6 +209,7 @@ public class CoxPlugin extends Plugin
|
||||
protected void startUp()
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(coxOverlay);
|
||||
overlayManager.add(coxInfoBox);
|
||||
@@ -227,12 +230,24 @@ public class CoxPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(coxOverlay);
|
||||
overlayManager.remove(coxInfoBox);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage chatMessage)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
eventBus.subscribe(ProjectileMoved.class, this, this::onProjectileMoved);
|
||||
eventBus.subscribe(SpotAnimationChanged.class, this, this::onSpotAnimationChanged);
|
||||
eventBus.subscribe(NpcSpawned.class, this, this::onNpcSpawned);
|
||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
}
|
||||
|
||||
private void onChatMessage(ChatMessage chatMessage)
|
||||
{
|
||||
if (inRaid())
|
||||
{
|
||||
@@ -305,8 +320,7 @@ public class CoxPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onProjectileMoved(ProjectileMoved event)
|
||||
private void onProjectileMoved(ProjectileMoved event)
|
||||
{
|
||||
if (inRaid())
|
||||
{
|
||||
@@ -328,8 +342,7 @@ public class CoxPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onSpotAnimationChanged(SpotAnimationChanged graphicChanged)
|
||||
private void onSpotAnimationChanged(SpotAnimationChanged graphicChanged)
|
||||
{
|
||||
if (inRaid())
|
||||
{
|
||||
@@ -344,8 +357,7 @@ public class CoxPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcSpawned(NpcSpawned npcSpawned)
|
||||
private void onNpcSpawned(NpcSpawned npcSpawned)
|
||||
{
|
||||
if (inRaid())
|
||||
{
|
||||
@@ -384,8 +396,7 @@ public class CoxPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcDespawned(NpcDespawned event)
|
||||
private void onNpcDespawned(NpcDespawned event)
|
||||
{
|
||||
if (inRaid())
|
||||
{
|
||||
@@ -429,8 +440,7 @@ public class CoxPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
if (!inRaid())
|
||||
{
|
||||
@@ -696,8 +706,7 @@ public class CoxPlugin extends Plugin
|
||||
return client.getVar(Varbits.IN_RAID) == 1;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged configChanged)
|
||||
private void onConfigChanged(ConfigChanged configChanged)
|
||||
{
|
||||
if (configChanged.getGroup().equals("Cox"))
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ import net.runelite.api.Player;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
@@ -64,12 +64,27 @@ public class CrystalMathLabs extends Plugin
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private String lastUsername;
|
||||
private boolean fetchXp;
|
||||
private long lastXp;
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
}
|
||||
|
||||
private void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||
{
|
||||
GameState state = gameStateChanged.getGameState();
|
||||
if (state == GameState.LOGGED_IN)
|
||||
@@ -98,8 +113,7 @@ public class CrystalMathLabs extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick gameTick)
|
||||
private void onGameTick(GameTick gameTick)
|
||||
{
|
||||
if (fetchXp)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.ClientUI;
|
||||
@@ -48,6 +48,9 @@ public class CustomCursorPlugin extends Plugin
|
||||
@Inject
|
||||
private CustomCursorConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Provides
|
||||
CustomCursorConfig provideConfig(ConfigManager configManager)
|
||||
{
|
||||
@@ -57,17 +60,19 @@ public class CustomCursorPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
updateCursor();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
clientUI.resetCursor();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("customcursor") && event.getKey().equals("cursorStyle"))
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ import net.runelite.client.chat.ChatMessageBuilder;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.chat.QueuedMessage;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
|
||||
@@ -80,6 +80,9 @@ public class DailyTasksPlugin extends Plugin
|
||||
@Inject
|
||||
private ChatMessageManager chatMessageManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private long lastReset;
|
||||
private boolean loggingIn;
|
||||
|
||||
@@ -103,6 +106,9 @@ public class DailyTasksPlugin extends Plugin
|
||||
public void startUp()
|
||||
{
|
||||
updateConfig();
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
|
||||
addSubscriptions();
|
||||
|
||||
loggingIn = true;
|
||||
}
|
||||
@@ -110,11 +116,19 @@ public class DailyTasksPlugin extends Plugin
|
||||
@Override
|
||||
public void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
eventBus.unregister(this);
|
||||
lastReset = 0L;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
}
|
||||
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
if (event.getGameState() == GameState.LOGGING_IN)
|
||||
{
|
||||
@@ -122,8 +136,7 @@ public class DailyTasksPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
long currentTime = System.currentTimeMillis();
|
||||
boolean dailyReset = !loggingIn && currentTime - lastReset > ONE_DAY;
|
||||
@@ -298,8 +311,7 @@ public class DailyTasksPlugin extends Plugin
|
||||
.build());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged configChanged)
|
||||
private void onConfigChanged(ConfigChanged configChanged)
|
||||
{
|
||||
if (configChanged.getGroup().equals("dailytaskindicators"))
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.LocalPlayerDeath;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -83,6 +83,9 @@ public class DeathIndicatorPlugin extends Plugin
|
||||
@Inject
|
||||
private ItemManager itemManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private BufferedImage mapArrow;
|
||||
|
||||
private Timer deathTimer;
|
||||
@@ -100,6 +103,8 @@ public class DeathIndicatorPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp()
|
||||
{
|
||||
addSubscriptions();
|
||||
|
||||
if (!hasDied())
|
||||
{
|
||||
return;
|
||||
@@ -127,6 +132,8 @@ public class DeathIndicatorPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
if (client.hasHintArrow())
|
||||
{
|
||||
client.clearHintArrow();
|
||||
@@ -141,8 +148,15 @@ public class DeathIndicatorPlugin extends Plugin
|
||||
worldMapPointManager.removeIf(DeathWorldMapPoint.class::isInstance);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onLocalPlayerDeath(LocalPlayerDeath death)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(LocalPlayerDeath.class, this, this::onLocalPlayerDeath);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
}
|
||||
|
||||
private void onLocalPlayerDeath(LocalPlayerDeath death)
|
||||
{
|
||||
if (client.isInInstancedRegion())
|
||||
{
|
||||
@@ -154,8 +168,7 @@ public class DeathIndicatorPlugin extends Plugin
|
||||
lastDeathTime = Instant.now();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
// Check if player respawned in a death respawn location
|
||||
if (lastDeath != null && !client.getLocalPlayer().getWorldLocation().equals(lastDeath))
|
||||
@@ -219,8 +232,7 @@ public class DeathIndicatorPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("deathIndicator"))
|
||||
{
|
||||
@@ -251,8 +263,7 @@ public class DeathIndicatorPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
if (!hasDied())
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.SessionOpen;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -57,6 +57,9 @@ public class DefaultWorldPlugin extends Plugin
|
||||
@Inject
|
||||
private DefaultWorldConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private final WorldClient worldClient = new WorldClient();
|
||||
private int worldCache;
|
||||
private boolean worldChangeRequired;
|
||||
@@ -64,6 +67,8 @@ public class DefaultWorldPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
addSubscriptions();
|
||||
|
||||
worldChangeRequired = true;
|
||||
applyWorld();
|
||||
}
|
||||
@@ -71,25 +76,31 @@ public class DefaultWorldPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
worldChangeRequired = true;
|
||||
changeWorld(worldCache);
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(SessionOpen.class, this, this::onSessionOpen);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
}
|
||||
|
||||
@Provides
|
||||
DefaultWorldConfig getConfig(ConfigManager configManager)
|
||||
{
|
||||
return configManager.getConfig(DefaultWorldConfig.class);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onSessionOpen(SessionOpen event)
|
||||
private void onSessionOpen(SessionOpen event)
|
||||
{
|
||||
worldChangeRequired = true;
|
||||
applyWorld();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
applyWorld();
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ import net.runelite.api.events.PlayerDespawned;
|
||||
import net.runelite.api.events.PlayerSpawned;
|
||||
import net.runelite.api.events.ProjectileMoved;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
@@ -81,6 +81,9 @@ public class DemonicGorillaPlugin extends Plugin
|
||||
@Inject
|
||||
private ClientThread clientThread;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private Map<NPC, DemonicGorilla> gorillas;
|
||||
|
||||
@@ -93,6 +96,7 @@ public class DemonicGorillaPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
addSubscriptions();
|
||||
overlayManager.add(overlay);
|
||||
gorillas = new HashMap<>();
|
||||
recentBoulders = new ArrayList<>();
|
||||
@@ -104,6 +108,7 @@ public class DemonicGorillaPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
overlayManager.remove(overlay);
|
||||
gorillas = null;
|
||||
recentBoulders = null;
|
||||
@@ -111,6 +116,18 @@ public class DemonicGorillaPlugin extends Plugin
|
||||
memorizedPlayers = null;
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ProjectileMoved.class, this, this::onProjectileMoved);
|
||||
eventBus.subscribe(HitsplatApplied.class, this, this::onHitsplatApplied);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(PlayerSpawned.class, this, this::onPlayerSpawned);
|
||||
eventBus.subscribe(PlayerDespawned.class, this, this::onPlayerDespawned);
|
||||
eventBus.subscribe(NpcSpawned.class, this, this::onNpcSpawned);
|
||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
}
|
||||
|
||||
private void clear()
|
||||
{
|
||||
recentBoulders.clear();
|
||||
@@ -528,8 +545,7 @@ public class DemonicGorillaPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onProjectileMoved(ProjectileMoved event)
|
||||
private void onProjectileMoved(ProjectileMoved event)
|
||||
{
|
||||
Projectile projectile = event.getProjectile();
|
||||
int projectileId = projectile.getId();
|
||||
@@ -616,8 +632,7 @@ public class DemonicGorillaPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onHitsplatApplied(HitsplatApplied event)
|
||||
private void onHitsplatApplied(HitsplatApplied event)
|
||||
{
|
||||
if (gorillas.isEmpty())
|
||||
{
|
||||
@@ -645,8 +660,7 @@ public class DemonicGorillaPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
GameState gs = event.getGameState();
|
||||
if (gs == GameState.LOGGING_IN ||
|
||||
@@ -657,8 +671,7 @@ public class DemonicGorillaPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onPlayerSpawned(PlayerSpawned event)
|
||||
private void onPlayerSpawned(PlayerSpawned event)
|
||||
{
|
||||
if (gorillas.isEmpty())
|
||||
{
|
||||
@@ -669,8 +682,7 @@ public class DemonicGorillaPlugin extends Plugin
|
||||
memorizedPlayers.put(player, new MemorizedPlayer(player));
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onPlayerDespawned(PlayerDespawned event)
|
||||
private void onPlayerDespawned(PlayerDespawned event)
|
||||
{
|
||||
if (gorillas.isEmpty())
|
||||
{
|
||||
@@ -680,8 +692,7 @@ public class DemonicGorillaPlugin extends Plugin
|
||||
memorizedPlayers.remove(event.getPlayer());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcSpawned(NpcSpawned event)
|
||||
private void onNpcSpawned(NpcSpawned event)
|
||||
{
|
||||
NPC npc = event.getNpc();
|
||||
if (isNpcGorilla(npc.getId()))
|
||||
@@ -697,8 +708,7 @@ public class DemonicGorillaPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcDespawned(NpcDespawned event)
|
||||
private void onNpcDespawned(NpcDespawned event)
|
||||
{
|
||||
if (gorillas.remove(event.getNpc()) != null && gorillas.isEmpty())
|
||||
{
|
||||
@@ -706,8 +716,7 @@ public class DemonicGorillaPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
checkGorillaAttacks();
|
||||
checkPendingAttacks();
|
||||
|
||||
@@ -42,15 +42,16 @@ import net.runelite.api.NPC;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.AreaSoundEffectPlayed;
|
||||
import net.runelite.api.events.BoostedLevelChanged;
|
||||
import net.runelite.api.events.CommandExecuted;
|
||||
import net.runelite.api.events.ExperienceChanged;
|
||||
import net.runelite.api.events.MenuEntryAdded;
|
||||
import net.runelite.api.events.SoundEffectPlayed;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.api.kit.KitType;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.ClientToolbar;
|
||||
@@ -143,6 +144,8 @@ public class DevToolsPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
addSubscriptions();
|
||||
|
||||
players = new DevToolsButton("Players");
|
||||
npcs = new DevToolsButton("NPCs");
|
||||
|
||||
@@ -200,14 +203,13 @@ public class DevToolsPlugin extends Plugin
|
||||
.build();
|
||||
|
||||
clientToolbar.addNavigation(navButton);
|
||||
|
||||
eventBus.register(soundEffectOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(soundEffectOverlay);
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(locationOverlay);
|
||||
overlayManager.remove(sceneOverlay);
|
||||
@@ -218,8 +220,15 @@ public class DevToolsPlugin extends Plugin
|
||||
clientToolbar.removeNavigation(navButton);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onCommandExecuted(CommandExecuted commandExecuted)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(CommandExecuted.class, this, this::onCommandExecuted);
|
||||
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
|
||||
eventBus.subscribe(AreaSoundEffectPlayed.class, this, this::onAreaSoundEffectPlayed);
|
||||
eventBus.subscribe(SoundEffectPlayed.class, this, this::onSoundEffectPlayed);
|
||||
}
|
||||
|
||||
private void onCommandExecuted(CommandExecuted commandExecuted)
|
||||
{
|
||||
String[] args = commandExecuted.getArguments();
|
||||
|
||||
@@ -260,7 +269,7 @@ public class DevToolsPlugin extends Plugin
|
||||
client.addChatMessage(ChatMessageType.GAMEMESSAGE, "", "Set VarPlayer " + varp + " to " + value, null);
|
||||
VarbitChanged varbitChanged = new VarbitChanged();
|
||||
varbitChanged.setIndex(varp);
|
||||
eventBus.post(varbitChanged); // fake event
|
||||
eventBus.post(VarbitChanged.class, varbitChanged); // fake event
|
||||
break;
|
||||
}
|
||||
case "getvarb":
|
||||
@@ -276,7 +285,7 @@ public class DevToolsPlugin extends Plugin
|
||||
int value = Integer.parseInt(args[1]);
|
||||
client.setVarbitValue(client.getVarps(), varbit, value);
|
||||
client.addChatMessage(ChatMessageType.GAMEMESSAGE, "", "Set varbit " + varbit + " to " + value, null);
|
||||
eventBus.post(new VarbitChanged()); // fake event
|
||||
eventBus.post(VarbitChanged.class, new VarbitChanged()); // fake event
|
||||
break;
|
||||
}
|
||||
case "addxp":
|
||||
@@ -295,7 +304,7 @@ public class DevToolsPlugin extends Plugin
|
||||
|
||||
ExperienceChanged experienceChanged = new ExperienceChanged();
|
||||
experienceChanged.setSkill(skill);
|
||||
eventBus.post(experienceChanged);
|
||||
eventBus.post(ExperienceChanged.class, experienceChanged);
|
||||
break;
|
||||
}
|
||||
case "setstat":
|
||||
@@ -314,11 +323,11 @@ public class DevToolsPlugin extends Plugin
|
||||
|
||||
ExperienceChanged experienceChanged = new ExperienceChanged();
|
||||
experienceChanged.setSkill(skill);
|
||||
eventBus.post(experienceChanged);
|
||||
eventBus.post(ExperienceChanged.class, experienceChanged);
|
||||
|
||||
BoostedLevelChanged boostedLevelChanged = new BoostedLevelChanged();
|
||||
boostedLevelChanged.setSkill(skill);
|
||||
eventBus.post(boostedLevelChanged);
|
||||
eventBus.post(BoostedLevelChanged.class, boostedLevelChanged);
|
||||
break;
|
||||
}
|
||||
case "anim":
|
||||
@@ -363,8 +372,7 @@ public class DevToolsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||
private void onMenuEntryAdded(MenuEntryAdded event)
|
||||
{
|
||||
if (!examine.isActive())
|
||||
{
|
||||
@@ -401,4 +409,24 @@ public class DevToolsPlugin extends Plugin
|
||||
client.setMenuEntries(entries);
|
||||
}
|
||||
}
|
||||
|
||||
private void onSoundEffectPlayed(SoundEffectPlayed event)
|
||||
{
|
||||
if (!getSoundEffects().isActive() || soundEffectOverlay == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
soundEffectOverlay.onSoundEffectPlayed(event);
|
||||
}
|
||||
|
||||
private void onAreaSoundEffectPlayed(AreaSoundEffectPlayed event)
|
||||
{
|
||||
if (!getSoundEffects().isActive() || soundEffectOverlay == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
soundEffectOverlay.onAreaSoundEffectPlayed(event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ import net.runelite.api.Player;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.events.AreaSoundEffectPlayed;
|
||||
import net.runelite.api.events.SoundEffectPlayed;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
@@ -74,14 +73,8 @@ class SoundEffectOverlay extends Overlay
|
||||
return panelComponent.render(graphics);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onSoundEffectPlayed(SoundEffectPlayed event)
|
||||
void onSoundEffectPlayed(SoundEffectPlayed event)
|
||||
{
|
||||
if (!plugin.getSoundEffects().isActive())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
String text =
|
||||
"Id: " + event.getSoundId() +
|
||||
" - D: " + event.getDelay();
|
||||
@@ -94,14 +87,8 @@ class SoundEffectOverlay extends Overlay
|
||||
checkMaxLines();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onAreaSoundEffectPlayed(AreaSoundEffectPlayed event)
|
||||
void onAreaSoundEffectPlayed(AreaSoundEffectPlayed event)
|
||||
{
|
||||
if (!plugin.getSoundEffects().isActive())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Color textColor = COLOR_AREA_SOUND_EFFECT;
|
||||
|
||||
// Check if the player is within range to hear the sound
|
||||
|
||||
@@ -56,8 +56,6 @@ import net.runelite.api.events.VarClientIntChanged;
|
||||
import net.runelite.api.events.VarClientStrChanged;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.eventbus.EventBusImplementation;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.ui.ClientUI;
|
||||
import net.runelite.client.ui.ColorScheme;
|
||||
import net.runelite.client.ui.DynamicGridLayout;
|
||||
@@ -87,7 +85,7 @@ class VarInspector extends JFrame
|
||||
private final static int MAX_LOG_ENTRIES = 10_000;
|
||||
|
||||
private final Client client;
|
||||
private final EventBusImplementation eventBus;
|
||||
private final EventBus eventBus;
|
||||
|
||||
private final JPanel tracker = new JPanel();
|
||||
|
||||
@@ -100,7 +98,7 @@ class VarInspector extends JFrame
|
||||
private Map<Integer, Object> varcs = null;
|
||||
|
||||
@Inject
|
||||
VarInspector(Client client, EventBusImplementation eventBus, DevToolsPlugin plugin)
|
||||
VarInspector(Client client, EventBus eventBus, DevToolsPlugin plugin)
|
||||
{
|
||||
this.eventBus = eventBus;
|
||||
this.client = client;
|
||||
@@ -116,6 +114,7 @@ class VarInspector extends JFrame
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e)
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
close();
|
||||
plugin.getVarInspector().setActive(false);
|
||||
}
|
||||
@@ -171,6 +170,15 @@ class VarInspector extends JFrame
|
||||
add(trackerOpts, BorderLayout.SOUTH);
|
||||
|
||||
pack();
|
||||
|
||||
addSubscriptions();
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(VarbitChanged.class, this, this::onVarbitChanged);
|
||||
eventBus.subscribe(VarClientIntChanged.class, this, this::onVarClientIntChanged);
|
||||
eventBus.subscribe(VarClientStrChanged.class, this, this::onVarClientStrChanged);
|
||||
}
|
||||
|
||||
private void addVarLog(VarType type, String name, int old, int neew)
|
||||
@@ -211,8 +219,7 @@ class VarInspector extends JFrame
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onVarbitChanged(VarbitChanged ev)
|
||||
private void onVarbitChanged(VarbitChanged ev)
|
||||
{
|
||||
int[] varps = client.getVarps();
|
||||
|
||||
@@ -275,8 +282,7 @@ class VarInspector extends JFrame
|
||||
System.arraycopy(client.getVarps(), 0, oldVarps2, 0, oldVarps2.length);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onVarClientIntChanged(VarClientIntChanged e)
|
||||
private void onVarClientIntChanged(VarClientIntChanged e)
|
||||
{
|
||||
int idx = e.getIndex();
|
||||
int neew = (Integer) client.getVarcMap().getOrDefault(idx, 0);
|
||||
@@ -298,8 +304,7 @@ class VarInspector extends JFrame
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onVarClientStrChanged(VarClientStrChanged e)
|
||||
private void onVarClientStrChanged(VarClientStrChanged e)
|
||||
{
|
||||
int idx = e.getIndex();
|
||||
String neew = (String) client.getVarcMap().getOrDefault(idx, "");
|
||||
@@ -358,7 +363,7 @@ class VarInspector extends JFrame
|
||||
public void close()
|
||||
{
|
||||
tracker.removeAll();
|
||||
// eventBus.unregister(this);
|
||||
eventBus.unregister(this);
|
||||
setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,6 @@ import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.api.widgets.WidgetItem;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.ui.ClientUI;
|
||||
|
||||
@Slf4j
|
||||
@@ -86,8 +85,6 @@ class WidgetInspector extends JFrame
|
||||
this.config = config;
|
||||
this.overlay = overlay;
|
||||
|
||||
eventBus.register(this);
|
||||
|
||||
setTitle("RuneLite Widget Inspector");
|
||||
setIconImage(ClientUI.ICON);
|
||||
|
||||
@@ -97,6 +94,7 @@ class WidgetInspector extends JFrame
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e)
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
close();
|
||||
plugin.getWidgetInspector().setActive(false);
|
||||
}
|
||||
@@ -165,9 +163,10 @@ class WidgetInspector extends JFrame
|
||||
add(split, BorderLayout.CENTER);
|
||||
|
||||
pack();
|
||||
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
private void onConfigChanged(ConfigChanged ev)
|
||||
{
|
||||
boolean onTop = config.inspectorAlwaysOnTop();
|
||||
|
||||
@@ -56,7 +56,7 @@ import net.runelite.client.discord.DiscordService;
|
||||
import net.runelite.client.discord.events.DiscordJoinGame;
|
||||
import net.runelite.client.discord.events.DiscordJoinRequest;
|
||||
import net.runelite.client.discord.events.DiscordReady;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.PartyChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -110,6 +110,9 @@ public class DiscordPlugin extends Plugin
|
||||
@Inject
|
||||
private WSClient wsClient;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private final Map<Skill, Integer> skillExp = new HashMap<>();
|
||||
private NavigationButton discordButton;
|
||||
private boolean loginFlag;
|
||||
@@ -137,6 +140,7 @@ public class DiscordPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
final BufferedImage icon = ImageUtil.getResourceStreamFromClass(getClass(), "discord.png");
|
||||
|
||||
@@ -162,14 +166,31 @@ public class DiscordPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
clientToolbar.removeNavigation(discordButton);
|
||||
discordState.reset();
|
||||
partyService.changeParty(null);
|
||||
wsClient.unregisterMessage(DiscordUserInfo.class);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(ExperienceChanged.class, this, this::onExperienceChanged);
|
||||
eventBus.subscribe(VarbitChanged.class, this, this::onVarbitChanged);
|
||||
eventBus.subscribe(DiscordReady.class, this, this::onDiscordReady);
|
||||
eventBus.subscribe(DiscordJoinRequest.class, this, this::onDiscordJoinRequest);
|
||||
eventBus.subscribe(DiscordJoinGame.class, this, this::onDiscordJoinGame);
|
||||
eventBus.subscribe(DiscordUserInfo.class, this, this::onDiscordUserInfo);
|
||||
eventBus.subscribe(UserJoin.class, this, this::onUserJoin);
|
||||
eventBus.subscribe(UserSync.class, this, this::onUserSync);
|
||||
eventBus.subscribe(UserPart.class, this, this::onUserPart);
|
||||
eventBus.subscribe(PartyChanged.class, this, this::onPartyChanged);
|
||||
}
|
||||
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
switch (event.getGameState())
|
||||
{
|
||||
@@ -192,8 +213,7 @@ public class DiscordPlugin extends Plugin
|
||||
checkForAreaUpdate();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equalsIgnoreCase("discord"))
|
||||
{
|
||||
@@ -205,8 +225,7 @@ public class DiscordPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onExperienceChanged(ExperienceChanged event)
|
||||
private void onExperienceChanged(ExperienceChanged event)
|
||||
{
|
||||
final int exp = client.getSkillExperience(event.getSkill());
|
||||
final Integer previous = skillExp.put(event.getSkill(), exp);
|
||||
@@ -224,8 +243,7 @@ public class DiscordPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onVarbitChanged(VarbitChanged event)
|
||||
private void onVarbitChanged(VarbitChanged event)
|
||||
{
|
||||
if (!this.showRaidingActivity)
|
||||
{
|
||||
@@ -240,14 +258,12 @@ public class DiscordPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onDiscordReady(DiscordReady event)
|
||||
private void onDiscordReady(DiscordReady event)
|
||||
{
|
||||
partyService.setUsername(event.getUsername() + "#" + event.getDiscriminator());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onDiscordJoinRequest(DiscordJoinRequest request)
|
||||
private void onDiscordJoinRequest(DiscordJoinRequest request)
|
||||
{
|
||||
log.debug("Got discord join request {}", request);
|
||||
if (partyService.isOwner() && partyService.getMembers().isEmpty())
|
||||
@@ -258,8 +274,7 @@ public class DiscordPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onDiscordJoinGame(DiscordJoinGame joinGame)
|
||||
private void onDiscordJoinGame(DiscordJoinGame joinGame)
|
||||
{
|
||||
log.debug("Got discord join game {}", joinGame);
|
||||
UUID partyId = UUID.fromString(joinGame.getJoinSecret());
|
||||
@@ -267,8 +282,7 @@ public class DiscordPlugin extends Plugin
|
||||
updatePresence();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onDiscordUserInfo(final DiscordUserInfo event)
|
||||
private void onDiscordUserInfo(final DiscordUserInfo event)
|
||||
{
|
||||
final PartyMember memberById = partyService.getMemberById(event.getMemberId());
|
||||
|
||||
@@ -327,14 +341,12 @@ public class DiscordPlugin extends Plugin
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onUserJoin(final UserJoin event)
|
||||
private void onUserJoin(final UserJoin event)
|
||||
{
|
||||
updatePresence();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onUserSync(final UserSync event)
|
||||
private void onUserSync(final UserSync event)
|
||||
{
|
||||
final PartyMember localMember = partyService.getLocalMember();
|
||||
|
||||
@@ -349,14 +361,12 @@ public class DiscordPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onUserPart(final UserPart event)
|
||||
private void onUserPart(final UserPart event)
|
||||
{
|
||||
updatePresence();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onPartyChanged(final PartyChanged event)
|
||||
private void onPartyChanged(final PartyChanged event)
|
||||
{
|
||||
updatePresence();
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.OverheadTextChanged;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.util.ImageUtil;
|
||||
@@ -64,16 +64,32 @@ public class EmojiPlugin extends Plugin
|
||||
@Inject
|
||||
private ChatMessageManager chatMessageManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private int modIconsStart = -1;
|
||||
|
||||
@Override
|
||||
protected void startUp()
|
||||
{
|
||||
loadEmojiIcons();
|
||||
addSubscriptions();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
eventBus.subscribe(OverheadTextChanged.class, this, this::onOverheadTextChanged);
|
||||
}
|
||||
|
||||
private void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||
{
|
||||
if (gameStateChanged.getGameState() == GameState.LOGGED_IN)
|
||||
{
|
||||
@@ -113,8 +129,7 @@ public class EmojiPlugin extends Plugin
|
||||
client.setModIcons(newModIcons);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage chatMessage)
|
||||
private void onChatMessage(ChatMessage chatMessage)
|
||||
{
|
||||
if (client.getGameState() != GameState.LOGGED_IN || modIconsStart == -1)
|
||||
{
|
||||
@@ -148,8 +163,7 @@ public class EmojiPlugin extends Plugin
|
||||
client.refreshChat();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onOverheadTextChanged(final OverheadTextChanged event)
|
||||
private void onOverheadTextChanged(final OverheadTextChanged event)
|
||||
{
|
||||
if (!(event.getActor() instanceof Player))
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
|
||||
@@ -54,6 +54,9 @@ public class EntityHiderPlugin extends Plugin
|
||||
@Inject
|
||||
private EntityHiderConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Provides
|
||||
EntityHiderConfig provideConfig(ConfigManager configManager)
|
||||
{
|
||||
@@ -63,16 +66,20 @@ public class EntityHiderPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp()
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged e)
|
||||
{
|
||||
updateConfig();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
if (event.getGameState() == GameState.LOGGED_IN)
|
||||
@@ -106,6 +113,8 @@ public class EntityHiderPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
client.setIsHidingEntities(false);
|
||||
|
||||
client.setPlayersHidden(false);
|
||||
|
||||
@@ -52,7 +52,7 @@ import net.runelite.client.chat.ChatMessageBuilder;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.chat.QueuedMessage;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.menus.MenuManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -94,6 +94,10 @@ public class EquipmentInspectorPlugin extends Plugin
|
||||
|
||||
@Inject
|
||||
private ClientToolbar pluginToolbar;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private NavigationButton navButton;
|
||||
private EquipmentInspectorPanel equipmentInspectorPanel;
|
||||
private int TotalPrice = 0;
|
||||
@@ -116,6 +120,7 @@ public class EquipmentInspectorPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
equipmentInspectorPanel = injector.getInstance(EquipmentInspectorPanel.class);
|
||||
if (client != null)
|
||||
@@ -140,12 +145,18 @@ public class EquipmentInspectorPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
menuManager.removePlayerMenuItem(INSPECT_EQUIPMENT);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onPlayerMenuOptionClicked(PlayerMenuOptionClicked event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(PlayerMenuOptionClicked.class, this, this::onPlayerMenuOptionClicked);
|
||||
}
|
||||
|
||||
private void onPlayerMenuOptionClicked(PlayerMenuOptionClicked event)
|
||||
{
|
||||
if (event.getMenuOption().equals(INSPECT_EQUIPMENT))
|
||||
{
|
||||
@@ -297,8 +308,7 @@ public class EquipmentInspectorPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equalsIgnoreCase("equipmentinspector"))
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ import net.runelite.client.chat.ChatColorType;
|
||||
import net.runelite.client.chat.ChatMessageBuilder;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.chat.QueuedMessage;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -96,15 +96,34 @@ public class ExaminePlugin extends Plugin
|
||||
@Inject
|
||||
private ScheduledExecutorService executor;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
addSubscriptions();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(MenuOptionClicked.class, this, this::onMenuOptionClicked);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
}
|
||||
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
pending.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuOptionClicked(MenuOptionClicked event)
|
||||
private void onMenuOptionClicked(MenuOptionClicked event)
|
||||
{
|
||||
if (!event.getOption().equals("Examine"))
|
||||
{
|
||||
@@ -161,8 +180,7 @@ public class ExaminePlugin extends Plugin
|
||||
pending.push(pendingExamine);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage event)
|
||||
private void onChatMessage(ChatMessage event)
|
||||
{
|
||||
ExamineType type;
|
||||
switch (event.getType())
|
||||
|
||||
@@ -55,7 +55,7 @@ import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetID;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.NPCManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -89,6 +89,9 @@ public class XpDropPlugin extends Plugin
|
||||
@Inject
|
||||
private XpDropOverlay overlay;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private int damage = 0;
|
||||
|
||||
@@ -126,6 +129,7 @@ public class XpDropPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
damageMode = config.showdamagedrops();
|
||||
|
||||
@@ -138,11 +142,22 @@ public class XpDropPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(WidgetHiddenChanged.class, this, this::onWidgetHiddenChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(ExperienceChanged.class, this, this::onExperienceChanged);
|
||||
eventBus.subscribe(ScriptCallbackEvent.class, this, this::onScriptCallbackEvent);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!event.getGroup().equals("xpdrop"))
|
||||
{
|
||||
@@ -171,15 +186,13 @@ public class XpDropPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
damage = 0;
|
||||
tickShow = 0;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetHiddenChanged(WidgetHiddenChanged event)
|
||||
private void onWidgetHiddenChanged(WidgetHiddenChanged event)
|
||||
{
|
||||
Widget widget = event.getWidget();
|
||||
|
||||
@@ -303,8 +316,7 @@ public class XpDropPlugin extends Plugin
|
||||
return null;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick tick)
|
||||
private void onGameTick(GameTick tick)
|
||||
{
|
||||
lastOpponent = client.getLocalPlayer().getInteracting();
|
||||
|
||||
@@ -339,8 +351,7 @@ public class XpDropPlugin extends Plugin
|
||||
client.runScript(XPDROP_DISABLED, lastSkill.ordinal(), previousExpGained);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onExperienceChanged(ExperienceChanged event)
|
||||
private void onExperienceChanged(ExperienceChanged event)
|
||||
{
|
||||
final Skill skill = event.getSkill();
|
||||
final int xp = client.getSkillExperience(skill);
|
||||
@@ -355,8 +366,7 @@ public class XpDropPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onScriptCallbackEvent(ScriptCallbackEvent e)
|
||||
private void onScriptCallbackEvent(ScriptCallbackEvent e)
|
||||
{
|
||||
if (this.showdamagedrops == XpDropConfig.DamageMode.NONE)
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@ import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.api.widgets.WidgetType;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.chatbox.ChatboxPanelManager;
|
||||
import net.runelite.client.game.chatbox.ChatboxTextInput;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -92,6 +92,9 @@ public class FairyRingPlugin extends Plugin
|
||||
@Inject
|
||||
private ClientThread clientThread;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private ChatboxTextInput searchInput = null;
|
||||
private Widget searchBtn;
|
||||
private Collection<CodeWidgets> codes = null;
|
||||
@@ -115,10 +118,24 @@ public class FairyRingPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
this.autoOpen = config.autoOpen();
|
||||
addSubscriptions();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(VarbitChanged.class, this, this::onVarbitChanged);
|
||||
eventBus.subscribe(WidgetLoaded.class, this, this::onWidgetLoaded);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!event.getGroup().equals("fairyrings"))
|
||||
{
|
||||
@@ -134,14 +151,12 @@ public class FairyRingPlugin extends Plugin
|
||||
return configManager.getConfig(FairyRingConfig.class);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onVarbitChanged(VarbitChanged event)
|
||||
private void onVarbitChanged(VarbitChanged event)
|
||||
{
|
||||
setWidgetTextToDestination();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetLoaded(WidgetLoaded widgetLoaded)
|
||||
private void onWidgetLoaded(WidgetLoaded widgetLoaded)
|
||||
{
|
||||
if (widgetLoaded.getGroupId() == WidgetID.FAIRY_RING_PANEL_GROUP_ID)
|
||||
{
|
||||
@@ -227,8 +242,7 @@ public class FairyRingPlugin extends Plugin
|
||||
.build();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick t)
|
||||
private void onGameTick(GameTick t)
|
||||
{
|
||||
// This has to happen because the only widget that gets hidden is the tli one
|
||||
Widget fairyRingTeleportButton = client.getWidget(WidgetInfo.FAIRY_RING_TELEPORT_BUTTON);
|
||||
|
||||
@@ -37,7 +37,7 @@ import javax.inject.Singleton;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.task.Schedule;
|
||||
@@ -66,6 +66,9 @@ public class FeedPlugin extends Plugin
|
||||
@Inject
|
||||
private ScheduledExecutorService executorService;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private FeedPanel feedPanel;
|
||||
private NavigationButton navButton;
|
||||
|
||||
@@ -86,6 +89,8 @@ public class FeedPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
|
||||
feedPanel = new FeedPanel(config, feedSupplier);
|
||||
|
||||
final BufferedImage icon = ImageUtil.getResourceStreamFromClass(getClass(), "icon.png");
|
||||
@@ -104,6 +109,7 @@ public class FeedPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
clientToolbar.removeNavigation(navButton);
|
||||
}
|
||||
|
||||
@@ -112,8 +118,7 @@ public class FeedPlugin extends Plugin
|
||||
feedPanel.rebuildFeed();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("feed"))
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.NPCManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -130,6 +130,8 @@ public class FightCavePlugin extends Plugin
|
||||
private FightCaveOverlay fightCaveOverlay;
|
||||
@Inject
|
||||
private FightCaveConfig config;
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private Set<FightCaveContainer> fightCaveContainer = new HashSet<>();
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@@ -170,6 +172,7 @@ public class FightCavePlugin extends Plugin
|
||||
public void startUp()
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
if (client.getGameState() == GameState.LOGGED_IN && regionCheck())
|
||||
{
|
||||
@@ -182,13 +185,24 @@ public class FightCavePlugin extends Plugin
|
||||
@Override
|
||||
public void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(waveOverlay);
|
||||
overlayManager.remove(fightCaveOverlay);
|
||||
currentWave = -1;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(NpcSpawned.class, this, this::onNpcSpawned);
|
||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!event.getGroup().equals("fightcave"))
|
||||
{
|
||||
@@ -198,8 +212,7 @@ public class FightCavePlugin extends Plugin
|
||||
updateConfig();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage event)
|
||||
private void onChatMessage(ChatMessage event)
|
||||
{
|
||||
if (!validRegion)
|
||||
{
|
||||
@@ -216,8 +229,7 @@ public class FightCavePlugin extends Plugin
|
||||
currentWave = Integer.parseInt(waveMatcher.group(1));
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
if (event.getGameState() != GameState.LOGGED_IN)
|
||||
{
|
||||
@@ -240,8 +252,7 @@ public class FightCavePlugin extends Plugin
|
||||
fightCaveContainer.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcSpawned(NpcSpawned event)
|
||||
private void onNpcSpawned(NpcSpawned event)
|
||||
{
|
||||
if (!validRegion)
|
||||
{
|
||||
@@ -265,8 +276,7 @@ public class FightCavePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcDespawned(NpcDespawned event)
|
||||
private void onNpcDespawned(NpcDespawned event)
|
||||
{
|
||||
if (!validRegion)
|
||||
{
|
||||
@@ -290,8 +300,7 @@ public class FightCavePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick Event)
|
||||
private void onGameTick(GameTick Event)
|
||||
{
|
||||
if (!validRegion)
|
||||
{
|
||||
|
||||
@@ -64,7 +64,7 @@ import net.runelite.api.widgets.WidgetID;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDependency;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -131,6 +131,9 @@ public class FishingPlugin extends Plugin
|
||||
@Inject
|
||||
private FishingSpotMinimapOverlay fishingSpotMinimapOverlay;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private boolean trawlerNotificationSent;
|
||||
|
||||
@Provides
|
||||
@@ -159,6 +162,7 @@ public class FishingPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(spotOverlay);
|
||||
@@ -168,6 +172,8 @@ public class FishingPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
spotOverlay.setHidden(true);
|
||||
fishingSpotMinimapOverlay.setHidden(true);
|
||||
overlayManager.remove(overlay);
|
||||
@@ -180,8 +186,21 @@ public class FishingPlugin extends Plugin
|
||||
trawlerStartTime = null;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(ItemContainerChanged.class, this, this::onItemContainerChanged);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
eventBus.subscribe(InteractingChanged.class, this, this::onInteractingChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(NpcSpawned.class, this, this::onNpcSpawned);
|
||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||
eventBus.subscribe(VarbitChanged.class, this, this::onVarbitChanged);
|
||||
eventBus.subscribe(WidgetLoaded.class, this, this::onWidgetLoaded);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!event.getGroup().equals("fishing"))
|
||||
{
|
||||
@@ -191,8 +210,7 @@ public class FishingPlugin extends Plugin
|
||||
updateConfig();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||
private void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||
{
|
||||
GameState gameState = gameStateChanged.getGameState();
|
||||
if (gameState == GameState.CONNECTION_LOST || gameState == GameState.LOGIN_SCREEN || gameState == GameState.HOPPING)
|
||||
@@ -202,8 +220,7 @@ public class FishingPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onItemContainerChanged(ItemContainerChanged event)
|
||||
private void onItemContainerChanged(ItemContainerChanged event)
|
||||
{
|
||||
if (event.getItemContainer() != client.getItemContainer(InventoryID.INVENTORY)
|
||||
&& event.getItemContainer() != client.getItemContainer(InventoryID.EQUIPMENT))
|
||||
@@ -224,8 +241,7 @@ public class FishingPlugin extends Plugin
|
||||
fishingSpotMinimapOverlay.setHidden(!showOverlays);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage event)
|
||||
private void onChatMessage(ChatMessage event)
|
||||
{
|
||||
if (event.getType() != ChatMessageType.SPAM)
|
||||
{
|
||||
@@ -241,8 +257,7 @@ public class FishingPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onInteractingChanged(InteractingChanged event)
|
||||
private void onInteractingChanged(InteractingChanged event)
|
||||
{
|
||||
if (event.getSource() != client.getLocalPlayer())
|
||||
{
|
||||
@@ -277,8 +292,7 @@ public class FishingPlugin extends Plugin
|
||||
return ItemUtil.containsAnyItemId(itemContainer.getItems(), FISHING_TOOLS);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
// Reset fishing session
|
||||
if (session.getLastFishCaught() != null)
|
||||
@@ -318,8 +332,7 @@ public class FishingPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcSpawned(NpcSpawned event)
|
||||
private void onNpcSpawned(NpcSpawned event)
|
||||
{
|
||||
final NPC npc = event.getNpc();
|
||||
|
||||
@@ -332,8 +345,7 @@ public class FishingPlugin extends Plugin
|
||||
inverseSortSpotDistanceFromPlayer();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcDespawned(NpcDespawned npcDespawned)
|
||||
private void onNpcDespawned(NpcDespawned npcDespawned)
|
||||
{
|
||||
final NPC npc = npcDespawned.getNpc();
|
||||
|
||||
@@ -346,8 +358,7 @@ public class FishingPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onVarbitChanged(VarbitChanged event)
|
||||
private void onVarbitChanged(VarbitChanged event)
|
||||
{
|
||||
if (!this.trawlerNotification || client.getGameState() != GameState.LOGGED_IN)
|
||||
{
|
||||
@@ -371,8 +382,7 @@ public class FishingPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetLoaded(WidgetLoaded event)
|
||||
private void onWidgetLoaded(WidgetLoaded event)
|
||||
{
|
||||
if (event.getGroupId() == WidgetID.FISHING_TRAWLER_GROUP_ID)
|
||||
{
|
||||
|
||||
@@ -51,7 +51,7 @@ import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.events.BeforeRender;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.flexo.Flexo;
|
||||
import net.runelite.client.flexo.FlexoMouse;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -104,6 +104,9 @@ public class FlexoPlugin extends Plugin
|
||||
@Inject
|
||||
private FlexoConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Provides
|
||||
FlexoConfig getConfig(ConfigManager configManager)
|
||||
{
|
||||
@@ -138,7 +141,6 @@ public class FlexoPlugin extends Plugin
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private List<Point> clickPoints = new ArrayList<>();
|
||||
|
||||
@Subscribe
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!event.getGroup().equals("flexo") || (!event.getGroup().equals("stretchedmode")) )
|
||||
@@ -150,9 +152,7 @@ public class FlexoPlugin extends Plugin
|
||||
updateMouseMotionFactory();
|
||||
}
|
||||
|
||||
|
||||
@Subscribe
|
||||
public void onBeforeRender(BeforeRender event)
|
||||
private void onBeforeRender(BeforeRender event)
|
||||
{
|
||||
if (Flexo.client == null)
|
||||
{
|
||||
@@ -293,6 +293,7 @@ public class FlexoPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
Flexo.isStretched = client.isStretchedEnabled();
|
||||
overlayManager.add(overlay);
|
||||
@@ -302,9 +303,17 @@ public class FlexoPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(BeforeRender.class, this, this::onBeforeRender);
|
||||
}
|
||||
|
||||
private void updateConfig()
|
||||
{
|
||||
this.overlayEnabled = config.overlayEnabled();
|
||||
|
||||
@@ -38,7 +38,7 @@ import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.FocusChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.DrawManager;
|
||||
@@ -92,6 +92,9 @@ public class FpsPlugin extends Plugin
|
||||
@Inject
|
||||
private FpsConfig fpsConfig;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private final ScheduledExecutorService pingExecutorService = new ExecutorServiceExceptionLogger(Executors.newSingleThreadScheduledExecutor());
|
||||
|
||||
private boolean loaded = false;
|
||||
@@ -113,8 +116,7 @@ public class FpsPlugin extends Plugin
|
||||
return configManager.getConfig(FpsConfig.class);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals(CONFIG_GROUP_KEY))
|
||||
{
|
||||
@@ -126,15 +128,13 @@ public class FpsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onFocusChanged(FocusChanged event)
|
||||
private void onFocusChanged(FocusChanged event)
|
||||
{
|
||||
drawListener.onFocusChanged(event);
|
||||
overlay.onFocusChanged(event);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
shutdown = event.getGameState() != GameState.LOGGED_IN;
|
||||
}
|
||||
@@ -142,6 +142,8 @@ public class FpsPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
addSubscriptions();
|
||||
|
||||
limitMode = fpsConfig.limitMode();
|
||||
drawFps = fpsConfig.drawFps();
|
||||
drawPing = fpsConfig.drawPing();
|
||||
@@ -160,11 +162,20 @@ public class FpsPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
drawManager.unregisterEveryFrameListener(drawListener);
|
||||
shutdown = true;
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(FocusChanged.class, this, this::onFocusChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
}
|
||||
|
||||
private void getPingToCurrentWorld()
|
||||
{
|
||||
if (!shutdown && drawPing)
|
||||
|
||||
@@ -39,7 +39,7 @@ import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.SpotAnimationChanged;
|
||||
import net.runelite.api.events.PlayerDespawned;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
@@ -75,6 +75,9 @@ public class FreezeTimersPlugin extends Plugin
|
||||
@Inject
|
||||
private FreezeTimersConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private boolean showPlayers;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@@ -97,11 +100,14 @@ public class FreezeTimersPlugin extends Plugin
|
||||
public void startUp()
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
public void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
|
||||
@@ -111,8 +117,15 @@ public class FreezeTimersPlugin extends Plugin
|
||||
return configManager.getConfig(FreezeTimersConfig.class);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onSpotAnimationChanged(SpotAnimationChanged graphicChanged)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(SpotAnimationChanged.class, this, this::onSpotAnimationChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(PlayerDespawned.class, this, this::onPlayerDespawned);
|
||||
}
|
||||
|
||||
private void onSpotAnimationChanged(SpotAnimationChanged graphicChanged)
|
||||
{
|
||||
int oldGraphic = prayerTracker.getSpotanimLastTick(graphicChanged.getActor());
|
||||
int newGraphic = graphicChanged.getActor().getSpotAnimation();
|
||||
@@ -138,8 +151,7 @@ public class FreezeTimersPlugin extends Plugin
|
||||
System.currentTimeMillis() + length);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick tickEvent)
|
||||
private void onGameTick(GameTick tickEvent)
|
||||
{
|
||||
timers.gameTick();
|
||||
prayerTracker.gameTick();
|
||||
@@ -149,13 +161,12 @@ public class FreezeTimersPlugin extends Plugin
|
||||
{
|
||||
SpotAnimationChanged callback = new SpotAnimationChanged();
|
||||
callback.setActor(actor);
|
||||
client.getCallbacks().post(callback);
|
||||
client.getCallbacks().post(SpotAnimationChanged.class, callback);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onPlayerDespawned(PlayerDespawned playerDespawned)
|
||||
private void onPlayerDespawned(PlayerDespawned playerDespawned)
|
||||
{
|
||||
final Player player = playerDespawned.getPlayer();
|
||||
// All despawns ok: death, teleports, log out, runs away from screen
|
||||
@@ -167,9 +178,7 @@ public class FreezeTimersPlugin extends Plugin
|
||||
freezes.remove(actor.getName());
|
||||
}
|
||||
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("freezetimers"))
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
|
||||
@@ -52,16 +52,26 @@ public class FriendListPlugin extends Plugin
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
final int world = client.getWorld();
|
||||
setFriendsListTitle("Friends List - World " + world);
|
||||
setIgnoreListTitle("Ignore List - World " + world);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick tick)
|
||||
private void onGameTick(GameTick tick)
|
||||
{
|
||||
final int world = client.getWorld();
|
||||
final boolean isMember = client.getVar(VarPlayer.MEMBERSHIP_DAYS) > 0;
|
||||
|
||||
@@ -46,7 +46,7 @@ import net.runelite.api.events.NameableNameChanged;
|
||||
import net.runelite.api.events.FriendRemoved;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.chatbox.ChatboxPanelManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -85,21 +85,35 @@ public class FriendNotesPlugin extends Plugin
|
||||
@Inject
|
||||
private ChatboxPanelManager chatboxPanelManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter
|
||||
private HoveredFriend hoveredFriend = null;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
addSubscriptions();
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
|
||||
eventBus.subscribe(MenuOptionClicked.class, this, this::onMenuOptionClicked);
|
||||
eventBus.subscribe(NameableNameChanged.class, this, this::onNameableNameChanged);
|
||||
eventBus.subscribe(FriendRemoved.class, this, this::onFriendRemoved);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a friend note, or unset by passing a null/empty note.
|
||||
*/
|
||||
@@ -160,8 +174,7 @@ public class FriendNotesPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||
private void onMenuEntryAdded(MenuEntryAdded event)
|
||||
{
|
||||
final int groupId = WidgetInfo.TO_GROUP(event.getActionParam1());
|
||||
|
||||
@@ -189,8 +202,7 @@ public class FriendNotesPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuOptionClicked(MenuOptionClicked event)
|
||||
private void onMenuOptionClicked(MenuOptionClicked event)
|
||||
{
|
||||
if (WidgetInfo.TO_GROUP(event.getActionParam1()) == WidgetInfo.FRIENDS_LIST.getGroupId())
|
||||
{
|
||||
@@ -227,8 +239,7 @@ public class FriendNotesPlugin extends Plugin
|
||||
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNameableNameChanged(NameableNameChanged event)
|
||||
private void onNameableNameChanged(NameableNameChanged event)
|
||||
{
|
||||
final Nameable nameable = event.getNameable();
|
||||
|
||||
@@ -249,8 +260,7 @@ public class FriendNotesPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onFriendRemoved(FriendRemoved event)
|
||||
private void onFriendRemoved(FriendRemoved event)
|
||||
{
|
||||
// Delete a friend's note if they are removed
|
||||
final String displayName = Text.toJagexName(event.getName());
|
||||
|
||||
@@ -34,7 +34,7 @@ import net.runelite.api.events.FriendRemoved;
|
||||
import net.runelite.api.events.WidgetMenuOptionClicked;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.chatbox.ChatboxPanelManager;
|
||||
import net.runelite.client.game.chatbox.ChatboxTextInput;
|
||||
import net.runelite.client.menus.MenuManager;
|
||||
@@ -84,9 +84,14 @@ public class FriendTaggingPlugin extends Plugin
|
||||
@Inject
|
||||
private ChatboxPanelManager chatboxPanelManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
addSubscriptions();
|
||||
|
||||
menuManager.addManagedCustomMenu(friendsTabMenuOption);
|
||||
menuManager.addManagedCustomMenu(ignoreTabMenuOption);
|
||||
menuManager.addManagedCustomMenu(friendTabResizableOption);
|
||||
@@ -97,14 +102,24 @@ public class FriendTaggingPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
menuManager.removeManagedCustomMenu(friendsTabMenuOption);
|
||||
menuManager.removeManagedCustomMenu(ignoreTabMenuOption);
|
||||
menuManager.removeManagedCustomMenu(friendTabResizableOption);
|
||||
menuManager.removeManagedCustomMenu(ignoreTabResizableOption);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
|
||||
eventBus.subscribe(FriendRemoved.class, this, this::onFriendRemoved);
|
||||
eventBus.subscribe(NameableNameChanged.class, this, this::onNameableNameChanged);
|
||||
eventBus.subscribe(WidgetMenuOptionClicked.class, this, this::onWidgetMenuOptionClicked);
|
||||
eventBus.subscribe(MenuOptionClicked.class, this, this::onMenuOptionClicked);
|
||||
}
|
||||
|
||||
private void onMenuEntryAdded(MenuEntryAdded event)
|
||||
{
|
||||
final int groupId = WidgetInfo.TO_GROUP(event.getActionParam1());
|
||||
|
||||
@@ -127,15 +142,13 @@ public class FriendTaggingPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onFriendRemoved(FriendRemoved event)
|
||||
private void onFriendRemoved(FriendRemoved event)
|
||||
{
|
||||
final String displayName = event.getName().trim().toLowerCase();
|
||||
deleteTag(displayName);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNameableNameChanged(NameableNameChanged event)
|
||||
private void onNameableNameChanged(NameableNameChanged event)
|
||||
{
|
||||
final Nameable nameable = event.getNameable();
|
||||
|
||||
@@ -150,8 +163,7 @@ public class FriendTaggingPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetMenuOptionClicked(WidgetMenuOptionClicked event)
|
||||
private void onWidgetMenuOptionClicked(WidgetMenuOptionClicked event)
|
||||
{
|
||||
if (event.getWidget().getId() == WidgetInfo.FIXED_VIEWPORT_FRIENDS_TAB.getId() &&
|
||||
Text.standardize(event.getMenuTarget()).equals(Text.standardize("clipboard")))
|
||||
@@ -160,8 +172,7 @@ public class FriendTaggingPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuOptionClicked(MenuOptionClicked event)
|
||||
private void onMenuOptionClicked(MenuOptionClicked event)
|
||||
{
|
||||
if (WidgetInfo.TO_GROUP(event.getActionParam1()) == WidgetInfo.FRIENDS_LIST.getGroupId())
|
||||
{
|
||||
|
||||
@@ -366,7 +366,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
super.shutDown();
|
||||
eventbus.unregister(this);
|
||||
|
||||
clientThread.invoke(() ->
|
||||
{
|
||||
|
||||
@@ -67,7 +67,7 @@ import net.runelite.client.Notifier;
|
||||
import net.runelite.client.account.AccountSession;
|
||||
import net.runelite.client.account.SessionManager;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.SessionClose;
|
||||
import net.runelite.client.events.SessionOpen;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
@@ -150,6 +150,9 @@ public class GrandExchangePlugin extends Plugin
|
||||
@Inject
|
||||
private ConfigManager configManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private Widget grandExchangeText;
|
||||
private Widget grandExchangeItem;
|
||||
private Map<Integer, Integer> itemGELimits;
|
||||
@@ -191,6 +194,7 @@ public class GrandExchangePlugin extends Plugin
|
||||
protected void startUp()
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
itemGELimits = loadGELimits();
|
||||
panel = injector.getInstance(GrandExchangePanel.class);
|
||||
@@ -223,6 +227,8 @@ public class GrandExchangePlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
clientToolbar.removeNavigation(button);
|
||||
mouseManager.unregisterMouseListener(inputListener);
|
||||
keyManager.unregisterKeyListener(inputListener);
|
||||
@@ -232,8 +238,23 @@ public class GrandExchangePlugin extends Plugin
|
||||
grandExchangeClient = null;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onSessionOpen(SessionOpen sessionOpen)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
eventBus.subscribe(SessionOpen.class, this, this::onSessionOpen);
|
||||
eventBus.subscribe(SessionClose.class, this, this::onSessionClose);
|
||||
eventBus.subscribe(GrandExchangeOfferChanged.class, this, this::onGrandExchangeOfferChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
|
||||
eventBus.subscribe(FocusChanged.class, this, this::onFocusChanged);
|
||||
eventBus.subscribe(WidgetLoaded.class, this, this::onWidgetLoaded);
|
||||
eventBus.subscribe(ScriptCallbackEvent.class, this, this::onScriptCallbackEvent);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
}
|
||||
|
||||
private void onSessionOpen(SessionOpen sessionOpen)
|
||||
{
|
||||
AccountSession accountSession = sessionManager.getAccountSession();
|
||||
if (accountSession.getUuid() != null)
|
||||
@@ -254,14 +275,12 @@ public class GrandExchangePlugin extends Plugin
|
||||
this.enableGELimits = config.enableGELimits();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onSessionClose(SessionClose sessionClose)
|
||||
private void onSessionClose(SessionClose sessionClose)
|
||||
{
|
||||
grandExchangeClient = null;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("grandexchange"))
|
||||
{
|
||||
@@ -282,8 +301,7 @@ public class GrandExchangePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGrandExchangeOfferChanged(GrandExchangeOfferChanged offerEvent)
|
||||
private void onGrandExchangeOfferChanged(GrandExchangeOfferChanged offerEvent)
|
||||
{
|
||||
final int slot = offerEvent.getSlot();
|
||||
final GrandExchangeOffer offer = offerEvent.getOffer();
|
||||
@@ -360,8 +378,7 @@ public class GrandExchangePlugin extends Plugin
|
||||
return savedOffer.getState() != grandExchangeOffer.getState();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage event)
|
||||
private void onChatMessage(ChatMessage event)
|
||||
{
|
||||
if (!this.enableNotifications || event.getType() != ChatMessageType.GAMEMESSAGE)
|
||||
{
|
||||
@@ -376,8 +393,7 @@ public class GrandExchangePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||
private void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||
{
|
||||
if (gameStateChanged.getGameState() == GameState.LOGIN_SCREEN)
|
||||
{
|
||||
@@ -385,8 +401,7 @@ public class GrandExchangePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||
private void onMenuEntryAdded(MenuEntryAdded event)
|
||||
{
|
||||
// At the moment, if the user disables quick lookup, the input listener gets disabled. Thus, isHotKeyPressed()
|
||||
// should always return false when quick lookup is disabled.
|
||||
@@ -419,8 +434,7 @@ public class GrandExchangePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onFocusChanged(FocusChanged focusChanged)
|
||||
private void onFocusChanged(FocusChanged focusChanged)
|
||||
{
|
||||
if (!focusChanged.isFocused())
|
||||
{
|
||||
@@ -428,8 +442,7 @@ public class GrandExchangePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetLoaded(WidgetLoaded event)
|
||||
private void onWidgetLoaded(WidgetLoaded event)
|
||||
{
|
||||
switch (event.getGroupId())
|
||||
{
|
||||
@@ -447,8 +460,7 @@ public class GrandExchangePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onScriptCallbackEvent(ScriptCallbackEvent event)
|
||||
private void onScriptCallbackEvent(ScriptCallbackEvent event)
|
||||
{
|
||||
if (!event.getEventName().equals("setGETitle") || !config.showTotal())
|
||||
{
|
||||
@@ -490,8 +502,7 @@ public class GrandExchangePlugin extends Plugin
|
||||
stringStack[stringStackSize - 1] += titleBuilder.toString();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
if (grandExchangeText == null || grandExchangeItem == null || grandExchangeItem.isHidden())
|
||||
{
|
||||
|
||||
@@ -26,11 +26,11 @@ package net.runelite.client.plugins.grotesqueguardians;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import java.util.ArrayList;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.NPC;
|
||||
@@ -57,6 +57,8 @@ public class GrotesqueGuardiansPlugin extends Plugin
|
||||
private OverlayManager overlayManager;
|
||||
@Inject
|
||||
private GrotesqueGuardiansPrayerOverlay prayerOverlay;
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
@Nullable
|
||||
private DuskAttack prayAgainst;
|
||||
@Nullable
|
||||
@@ -76,6 +78,8 @@ public class GrotesqueGuardiansPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(prayerOverlay);
|
||||
dusk = null;
|
||||
@@ -85,14 +89,15 @@ public class GrotesqueGuardiansPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(prayerOverlay);
|
||||
dusk = null;
|
||||
prayAgainst = null;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(final GameTick event)
|
||||
private void onGameTick(final GameTick event)
|
||||
{
|
||||
final ArrayList<Integer> regions = new ArrayList<>();
|
||||
for (final int intValue : client.getMapRegions())
|
||||
|
||||
@@ -74,7 +74,7 @@ import net.runelite.api.events.MenuEntryAdded;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.NpcLootReceived;
|
||||
import net.runelite.client.events.PlayerLootReceived;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
@@ -180,6 +180,9 @@ public class GroundItemsPlugin extends Plugin
|
||||
@Inject
|
||||
private Notifier notifier;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PUBLIC)
|
||||
public static final Map<GroundItem.GroundItemKey, GroundItem> collectedGroundItems = new LinkedHashMap<>();
|
||||
private final Map<Integer, Color> priceChecks = new LinkedHashMap<>();
|
||||
@@ -247,6 +250,8 @@ public class GroundItemsPlugin extends Plugin
|
||||
protected void startUp()
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(overlay);
|
||||
reset();
|
||||
mouseManager.registerMouseListener(inputListener);
|
||||
@@ -256,6 +261,8 @@ public class GroundItemsPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
mouseManager.unregisterMouseListener(inputListener);
|
||||
keyManager.unregisterKeyListener(inputListener);
|
||||
@@ -268,8 +275,22 @@ public class GroundItemsPlugin extends Plugin
|
||||
collectedGroundItems.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(ItemSpawned.class, this, this::onItemSpawned);
|
||||
eventBus.subscribe(ItemDespawned.class, this, this::onItemDespawned);
|
||||
eventBus.subscribe(ItemQuantityChanged.class, this, this::onItemQuantityChanged);
|
||||
eventBus.subscribe(NpcLootReceived.class, this, this::onNpcLootReceived);
|
||||
eventBus.subscribe(PlayerLootReceived.class, this, this::onPlayerLootReceived);
|
||||
eventBus.subscribe(ClientTick.class, this, this::onClientTick);
|
||||
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
|
||||
eventBus.subscribe(FocusChanged.class, this, this::onFocusChanged);
|
||||
}
|
||||
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
for (GroundItem item : collectedGroundItems.values())
|
||||
{
|
||||
@@ -281,8 +302,7 @@ public class GroundItemsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("grounditems"))
|
||||
{
|
||||
@@ -291,8 +311,7 @@ public class GroundItemsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(final GameStateChanged event)
|
||||
private void onGameStateChanged(final GameStateChanged event)
|
||||
{
|
||||
if (event.getGameState() == GameState.LOADING)
|
||||
{
|
||||
@@ -300,8 +319,7 @@ public class GroundItemsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onItemSpawned(ItemSpawned itemSpawned)
|
||||
private void onItemSpawned(ItemSpawned itemSpawned)
|
||||
{
|
||||
Item item = itemSpawned.getItem();
|
||||
Tile tile = itemSpawned.getTile();
|
||||
@@ -326,8 +344,7 @@ public class GroundItemsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onItemDespawned(ItemDespawned itemDespawned)
|
||||
private void onItemDespawned(ItemDespawned itemDespawned)
|
||||
{
|
||||
Item item = itemDespawned.getItem();
|
||||
Tile tile = itemDespawned.getTile();
|
||||
@@ -349,8 +366,7 @@ public class GroundItemsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onItemQuantityChanged(ItemQuantityChanged itemQuantityChanged)
|
||||
private void onItemQuantityChanged(ItemQuantityChanged itemQuantityChanged)
|
||||
{
|
||||
Item item = itemQuantityChanged.getItem();
|
||||
Tile tile = itemQuantityChanged.getTile();
|
||||
@@ -366,8 +382,7 @@ public class GroundItemsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcLootReceived(NpcLootReceived npcLootReceived)
|
||||
private void onNpcLootReceived(NpcLootReceived npcLootReceived)
|
||||
{
|
||||
npcLootReceived.getItems().forEach(item ->
|
||||
{
|
||||
@@ -384,8 +399,7 @@ public class GroundItemsPlugin extends Plugin
|
||||
lootNotifier(items);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onPlayerLootReceived(PlayerLootReceived playerLootReceived)
|
||||
private void onPlayerLootReceived(PlayerLootReceived playerLootReceived)
|
||||
{
|
||||
Collection<ItemStack> items = playerLootReceived.getItems();
|
||||
lootReceived(items);
|
||||
@@ -432,8 +446,7 @@ public class GroundItemsPlugin extends Plugin
|
||||
notifier.notify(notification);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onClientTick(ClientTick event)
|
||||
private void onClientTick(ClientTick event)
|
||||
{
|
||||
final MenuEntry[] menuEntries = client.getMenuEntries();
|
||||
final List<MenuEntryWithCount> newEntries = new ArrayList<>(menuEntries.length);
|
||||
@@ -670,8 +683,7 @@ public class GroundItemsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||
private void onMenuEntryAdded(MenuEntryAdded event)
|
||||
{
|
||||
if (this.itemHighlightMode != OVERLAY
|
||||
&& event.getOption().equals("Take")
|
||||
@@ -905,8 +917,7 @@ public class GroundItemsPlugin extends Plugin
|
||||
return this.defaultColor;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onFocusChanged(FocusChanged focusChanged)
|
||||
private void onFocusChanged(FocusChanged focusChanged)
|
||||
{
|
||||
if (!focusChanged.isFocused())
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.MenuEntryAdded;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.input.KeyManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -112,6 +112,9 @@ public class GroundMarkerPlugin extends Plugin
|
||||
@Inject
|
||||
private GroundMarkerMinimapOverlay minimapOverlay;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Inject
|
||||
private KeyManager keyManager;
|
||||
|
||||
@@ -272,8 +275,7 @@ public class GroundMarkerPlugin extends Plugin
|
||||
return point;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||
private void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||
{
|
||||
if (gameStateChanged.getGameState() != GameState.LOGGED_IN)
|
||||
{
|
||||
@@ -284,8 +286,7 @@ public class GroundMarkerPlugin extends Plugin
|
||||
loadPoints();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onFocusChanged(FocusChanged focusChanged)
|
||||
private void onFocusChanged(FocusChanged focusChanged)
|
||||
{
|
||||
if (!focusChanged.isFocused())
|
||||
{
|
||||
@@ -293,8 +294,7 @@ public class GroundMarkerPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||
private void onMenuEntryAdded(MenuEntryAdded event)
|
||||
{
|
||||
if (hotKeyPressed && event.getOption().equals(WALK_HERE))
|
||||
{
|
||||
@@ -328,8 +328,7 @@ public class GroundMarkerPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuOptionClicked(MenuOptionClicked event)
|
||||
private void onMenuOptionClicked(MenuOptionClicked event)
|
||||
{
|
||||
if (!event.getOption().contains(MARK) && !event.getOption().contains(UNMARK))
|
||||
{
|
||||
@@ -356,6 +355,7 @@ public class GroundMarkerPlugin extends Plugin
|
||||
protected void startUp()
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(minimapOverlay);
|
||||
@@ -366,12 +366,22 @@ public class GroundMarkerPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(minimapOverlay);
|
||||
keyManager.unregisterKeyListener(inputListener);
|
||||
points.clear();
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(FocusChanged.class, this, this::onFocusChanged);
|
||||
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
|
||||
eventBus.subscribe(MenuOptionClicked.class, this, this::onMenuOptionClicked);
|
||||
}
|
||||
|
||||
private void markTile(LocalPoint localPoint, int group)
|
||||
{
|
||||
if (localPoint == null)
|
||||
@@ -424,8 +434,7 @@ public class GroundMarkerPlugin extends Plugin
|
||||
return color;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("groundMarker"))
|
||||
{
|
||||
|
||||
@@ -57,7 +57,7 @@ import net.runelite.api.events.GroundObjectDespawned;
|
||||
import net.runelite.api.events.GroundObjectSpawned;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
@@ -112,6 +112,9 @@ public class HerbiboarPlugin extends Plugin
|
||||
@Inject
|
||||
private HerbiboarConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private boolean inHerbiboarArea;
|
||||
|
||||
@@ -172,6 +175,7 @@ public class HerbiboarPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(minimapOverlay);
|
||||
@@ -181,10 +185,25 @@ public class HerbiboarPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(minimapOverlay);
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(VarbitChanged.class, this, this::onVarbitChanged);
|
||||
eventBus.subscribe(GameObjectSpawned.class, this, this::onGameObjectSpawned);
|
||||
eventBus.subscribe(GameObjectChanged.class, this, this::onGameObjectChanged);
|
||||
eventBus.subscribe(GameObjectDespawned.class, this, this::onGameObjectDespawned);
|
||||
eventBus.subscribe(GroundObjectSpawned.class, this, this::onGroundObjectSpawned);
|
||||
eventBus.subscribe(GroundObjectChanged.class, this, this::onGroundObjectChanged);
|
||||
eventBus.subscribe(GroundObjectDespawned.class, this, this::onGroundObjectDespawned);
|
||||
}
|
||||
|
||||
private void updateTrailData()
|
||||
{
|
||||
currentTrail = null;
|
||||
@@ -241,8 +260,7 @@ public class HerbiboarPlugin extends Plugin
|
||||
tunnels.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
switch (event.getGameState())
|
||||
{
|
||||
@@ -259,8 +277,7 @@ public class HerbiboarPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onVarbitChanged(VarbitChanged event)
|
||||
private void onVarbitChanged(VarbitChanged event)
|
||||
{
|
||||
if (isInHerbiboarArea())
|
||||
{
|
||||
@@ -268,38 +285,32 @@ public class HerbiboarPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameObjectSpawned(GameObjectSpawned event)
|
||||
private void onGameObjectSpawned(GameObjectSpawned event)
|
||||
{
|
||||
onGameObject(event.getTile(), null, event.getGameObject());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameObjectChanged(GameObjectChanged event)
|
||||
private void onGameObjectChanged(GameObjectChanged event)
|
||||
{
|
||||
onGameObject(event.getTile(), event.getPrevious(), event.getGameObject());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameObjectDespawned(GameObjectDespawned event)
|
||||
private void onGameObjectDespawned(GameObjectDespawned event)
|
||||
{
|
||||
onGameObject(event.getTile(), event.getGameObject(), null);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGroundObjectSpawned(GroundObjectSpawned event)
|
||||
private void onGroundObjectSpawned(GroundObjectSpawned event)
|
||||
{
|
||||
onGroundObject( null, event.getGroundObject());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGroundObjectChanged(GroundObjectChanged event)
|
||||
private void onGroundObjectChanged(GroundObjectChanged event)
|
||||
{
|
||||
onGroundObject(event.getPrevious(), event.getGroundObject());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGroundObjectDespawned(GroundObjectDespawned event)
|
||||
private void onGroundObjectDespawned(GroundObjectDespawned event)
|
||||
{
|
||||
onGroundObject(event.getGroundObject(), null);
|
||||
}
|
||||
@@ -382,8 +393,7 @@ public class HerbiboarPlugin extends Plugin
|
||||
return END_LOCATIONS;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("herbiboar"))
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetID;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
@@ -109,6 +109,9 @@ public class HidePrayersPlugin extends Plugin
|
||||
@Inject
|
||||
private HidePrayersConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private boolean showindividualprayers;
|
||||
private boolean ShowTHICK_SKIN;
|
||||
private boolean ShowBURST_OF_STRENGTH;
|
||||
@@ -169,17 +172,27 @@ public class HidePrayersPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
hidePrayers();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
restorePrayers();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(WidgetLoaded.class, this, this::onWidgetLoaded);
|
||||
}
|
||||
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
if (event.getGameState() == GameState.LOGGED_IN)
|
||||
{
|
||||
@@ -188,8 +201,7 @@ public class HidePrayersPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("hideprayers"))
|
||||
{
|
||||
@@ -198,8 +210,7 @@ public class HidePrayersPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetLoaded(WidgetLoaded event)
|
||||
private void onWidgetLoaded(WidgetLoaded event)
|
||||
{
|
||||
if (event.getGroupId() == WidgetID.PRAYER_GROUP_ID || event.getGroupId() == WidgetID.QUICK_PRAYERS_GROUP_ID)
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ import static net.runelite.api.widgets.WidgetID.GUIDE_PRICES_INVENTORY_GROUP_ID;
|
||||
import static net.runelite.api.widgets.WidgetID.INVENTORY_GROUP_ID;
|
||||
import static net.runelite.api.widgets.WidgetID.SHOP_INVENTORY_GROUP_ID;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
@@ -76,6 +76,9 @@ public class HighAlchemyPlugin extends Plugin
|
||||
@Inject
|
||||
private HighAlchemyOverlay overlay;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Provides
|
||||
HighAlchemyConfig getConfig(ConfigManager configManager)
|
||||
{
|
||||
@@ -95,6 +98,8 @@ public class HighAlchemyPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
|
||||
buildGroupList();
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
@@ -105,8 +110,7 @@ public class HighAlchemyPlugin extends Plugin
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals(CONFIG_GROUP))
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ import net.runelite.api.events.MenuEntryAdded;
|
||||
import net.runelite.api.events.PlayerMenuOptionClicked;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.menus.MenuManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -87,6 +87,9 @@ public class HiscorePlugin extends Plugin
|
||||
@Inject
|
||||
private HiscoreConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private NavigationButton navButton;
|
||||
private HiscorePanel hiscorePanel;
|
||||
|
||||
@@ -102,6 +105,8 @@ public class HiscorePlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
addSubscriptions();
|
||||
|
||||
hiscorePanel = injector.getInstance(HiscorePanel.class);
|
||||
|
||||
final BufferedImage icon = ImageUtil.getResourceStreamFromClass(getClass(), "normal.png");
|
||||
@@ -128,6 +133,8 @@ public class HiscorePlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
hiscorePanel.removeInputKeyListener(autocompleter);
|
||||
clientToolbar.removeNavigation(navButton);
|
||||
|
||||
@@ -137,8 +144,15 @@ public class HiscorePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
|
||||
eventBus.subscribe(PlayerMenuOptionClicked.class, this, this::onPlayerMenuOptionClicked);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("hiscore"))
|
||||
{
|
||||
@@ -166,8 +180,7 @@ public class HiscorePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||
private void onMenuEntryAdded(MenuEntryAdded event)
|
||||
{
|
||||
if (!config.menuOption())
|
||||
{
|
||||
@@ -201,8 +214,7 @@ public class HiscorePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onPlayerMenuOptionClicked(PlayerMenuOptionClicked event)
|
||||
private void onPlayerMenuOptionClicked(PlayerMenuOptionClicked event)
|
||||
{
|
||||
if (event.getMenuOption().equals(LOOKUP))
|
||||
{
|
||||
@@ -210,8 +222,7 @@ public class HiscorePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage event)
|
||||
private void onChatMessage(ChatMessage event)
|
||||
{
|
||||
if (!config.bountylookup() || !event.getType().equals(ChatMessageType.GAMEMESSAGE))
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ import net.runelite.api.events.GameObjectSpawned;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
@@ -77,6 +77,9 @@ public class HunterPlugin extends Plugin
|
||||
@Inject
|
||||
private HunterConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private final Map<WorldPoint, HunterTrap> traps = new HashMap<>();
|
||||
|
||||
@@ -105,6 +108,7 @@ public class HunterPlugin extends Plugin
|
||||
protected void startUp()
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(overlay);
|
||||
overlay.updateConfig();
|
||||
@@ -113,13 +117,21 @@ public class HunterPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
lastActionTime = Instant.ofEpochMilli(0);
|
||||
traps.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameObjectSpawned(GameObjectSpawned event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(GameObjectSpawned.class, this, this::onGameObjectSpawned);
|
||||
}
|
||||
|
||||
private void onGameObjectSpawned(GameObjectSpawned event)
|
||||
{
|
||||
final GameObject gameObject = event.getGameObject();
|
||||
final WorldPoint trapLocation = gameObject.getWorldLocation();
|
||||
@@ -309,8 +321,7 @@ public class HunterPlugin extends Plugin
|
||||
* checks if the trap is still there. If the trap is gone, it removes
|
||||
* the trap from the local players trap collection.
|
||||
*/
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
// Check if all traps are still there, and remove the ones that are not.
|
||||
Iterator<Map.Entry<WorldPoint, HunterTrap>> it = traps.entrySet().iterator();
|
||||
@@ -387,8 +398,7 @@ public class HunterPlugin extends Plugin
|
||||
lastTickLocalPlayerLocation = client.getLocalPlayer().getWorldLocation();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("hunterplugin"))
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
@@ -73,6 +73,9 @@ public class BabyHydraPlugin extends Plugin
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Provides
|
||||
BabyHydraConfig provideConfig(ConfigManager configManager)
|
||||
{
|
||||
@@ -97,6 +100,7 @@ public class BabyHydraPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
if (this.TextIndicator)
|
||||
{
|
||||
@@ -112,6 +116,8 @@ public class BabyHydraPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(hydraOverlay);
|
||||
overlayManager.remove(hydraPrayOverlay);
|
||||
overlayManager.remove(hydraIndicatorOverlay);
|
||||
@@ -119,8 +125,15 @@ public class BabyHydraPlugin extends Plugin
|
||||
hydraattacks.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(NpcSpawned.class, this, this::onNpcSpawned);
|
||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||
eventBus.subscribe(AnimationChanged.class, this, this::onAnimationChanged);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!event.getGroup().equals("hydra"))
|
||||
{
|
||||
@@ -155,8 +168,7 @@ public class BabyHydraPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcSpawned(NpcSpawned event)
|
||||
private void onNpcSpawned(NpcSpawned event)
|
||||
{
|
||||
NPC hydra = event.getNpc();
|
||||
if (hydra.getCombatLevel() != 0 && hydra.getName() != null && hydra.getName().equalsIgnoreCase("Hydra") && !hydras.containsKey(hydra.getIndex()))
|
||||
@@ -165,8 +177,7 @@ public class BabyHydraPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcDespawned(NpcDespawned event)
|
||||
private void onNpcDespawned(NpcDespawned event)
|
||||
{
|
||||
NPC hydra = event.getNpc();
|
||||
if (hydra.getCombatLevel() != 0 && hydra.getName() != null && hydra.getName().equalsIgnoreCase("Hydra"))
|
||||
@@ -176,8 +187,7 @@ public class BabyHydraPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onAnimationChanged(AnimationChanged event)
|
||||
private void onAnimationChanged(AnimationChanged event)
|
||||
{
|
||||
Actor monster = event.getActor();
|
||||
Actor local = client.getLocalPlayer();
|
||||
|
||||
@@ -67,7 +67,7 @@ import net.runelite.api.events.PlayerSpawned;
|
||||
import net.runelite.api.events.SpotAnimationChanged;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.Sound;
|
||||
import net.runelite.client.game.SoundManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -109,6 +109,9 @@ public class IdleNotifierPlugin extends Plugin
|
||||
@Inject
|
||||
private IdleNotifierConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private Instant lastAnimating;
|
||||
private int lastAnimation = AnimationID.IDLE;
|
||||
private Instant lastInteracting;
|
||||
@@ -164,8 +167,7 @@ public class IdleNotifierPlugin extends Plugin
|
||||
return configManager.getConfig(IdleNotifierConfig.class);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onAnimationChanged(AnimationChanged event)
|
||||
private void onAnimationChanged(AnimationChanged event)
|
||||
{
|
||||
if (client.getGameState() != GameState.LOGGED_IN)
|
||||
{
|
||||
@@ -309,7 +311,6 @@ public class IdleNotifierPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
private void onPlayerSpawned(PlayerSpawned event)
|
||||
{
|
||||
final Player p = event.getPlayer();
|
||||
@@ -324,8 +325,7 @@ public class IdleNotifierPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onItemContainerChanged(ItemContainerChanged event)
|
||||
private void onItemContainerChanged(ItemContainerChanged event)
|
||||
{
|
||||
ItemContainer itemContainer = event.getItemContainer();
|
||||
|
||||
@@ -402,8 +402,7 @@ public class IdleNotifierPlugin extends Plugin
|
||||
itemQuantitiesPrevious = itemQuantities;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onInteractingChanged(InteractingChanged event)
|
||||
private void onInteractingChanged(InteractingChanged event)
|
||||
{
|
||||
final Actor source = event.getSource();
|
||||
if (source != client.getLocalPlayer())
|
||||
@@ -453,8 +452,7 @@ public class IdleNotifierPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||
private void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||
{
|
||||
lastInteracting = null;
|
||||
|
||||
@@ -486,8 +484,7 @@ public class IdleNotifierPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onHitsplatApplied(HitsplatApplied event)
|
||||
private void onHitsplatApplied(HitsplatApplied event)
|
||||
{
|
||||
if (event.getActor() != client.getLocalPlayer())
|
||||
{
|
||||
@@ -503,8 +500,7 @@ public class IdleNotifierPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onSpotAnimationChanged(SpotAnimationChanged event)
|
||||
private void onSpotAnimationChanged(SpotAnimationChanged event)
|
||||
{
|
||||
Actor actor = event.getActor();
|
||||
|
||||
@@ -519,8 +515,7 @@ public class IdleNotifierPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
skullNotifier();
|
||||
|
||||
@@ -903,8 +898,26 @@ public class IdleNotifierPlugin extends Plugin
|
||||
updateConfig();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(AnimationChanged.class, this, this::onAnimationChanged);
|
||||
eventBus.subscribe(PlayerSpawned.class, this, this::onPlayerSpawned);
|
||||
eventBus.subscribe(ItemContainerChanged.class, this, this::onItemContainerChanged);
|
||||
eventBus.subscribe(InteractingChanged.class, this, this::onInteractingChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(HitsplatApplied.class, this, this::onHitsplatApplied);
|
||||
eventBus.subscribe(SpotAnimationChanged.class, this, this::onSpotAnimationChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!event.getGroup().equals("idlenotifier"))
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
@@ -77,7 +77,6 @@ public class ImplingsPlugin extends Plugin
|
||||
@Inject
|
||||
private ImplingCounterOverlay implingCounterOverlay;
|
||||
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@@ -87,6 +86,9 @@ public class ImplingsPlugin extends Plugin
|
||||
@Inject
|
||||
private ImplingsConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private boolean showBaby;
|
||||
private Color getBabyColor;
|
||||
private boolean showYoung;
|
||||
@@ -128,6 +130,7 @@ public class ImplingsPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
dynamicSpawns.put(DYNAMIC_SPAWN_NATURE_DRAGON, "T3 Nature-Lucky Dynamic");
|
||||
dynamicSpawns.put(DYNAMIC_SPAWN_ECLECTIC, "T2 Eclectic Dynamic");
|
||||
@@ -141,13 +144,23 @@ public class ImplingsPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(minimapOverlay);
|
||||
overlayManager.remove(implingCounterOverlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(NpcSpawned.class, this, this::onNpcSpawned);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||
}
|
||||
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
implingCounterMap.clear();
|
||||
for (NPC npc : implings)
|
||||
@@ -171,8 +184,7 @@ public class ImplingsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcSpawned(NpcSpawned npcSpawned)
|
||||
private void onNpcSpawned(NpcSpawned npcSpawned)
|
||||
{
|
||||
NPC npc = npcSpawned.getNpc();
|
||||
Impling impling = Impling.findImpling(npc.getId());
|
||||
@@ -183,8 +195,7 @@ public class ImplingsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
if (event.getGameState() == GameState.LOGIN_SCREEN || event.getGameState() == GameState.HOPPING)
|
||||
{
|
||||
@@ -193,8 +204,7 @@ public class ImplingsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcDespawned(NpcDespawned npcDespawned)
|
||||
private void onNpcDespawned(NpcDespawned npcDespawned)
|
||||
{
|
||||
if (implings.isEmpty())
|
||||
{
|
||||
@@ -291,8 +301,7 @@ public class ImplingsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!event.getGroup().equals("implings"))
|
||||
{
|
||||
|
||||
@@ -51,7 +51,7 @@ import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
@@ -94,6 +94,9 @@ public class InfernoPlugin extends Plugin
|
||||
@Inject
|
||||
private InfernoConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private int currentWave = -1;
|
||||
|
||||
@@ -143,6 +146,8 @@ public class InfernoPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
waveOverlay.setDisplayMode(this.waveDisplay);
|
||||
|
||||
if (isInInferno())
|
||||
@@ -177,6 +182,8 @@ public class InfernoPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(infernoInfobox);
|
||||
overlayManager.remove(infernoOverlay);
|
||||
overlayManager.remove(nibblerOverlay);
|
||||
@@ -188,7 +195,17 @@ public class InfernoPlugin extends Plugin
|
||||
currentWaveNumber = -1;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(NpcSpawned.class, this, this::onNpcSpawned);
|
||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(AnimationChanged.class, this, this::onAnimationChanged);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!"inferno".equals(event.getGroup()))
|
||||
@@ -216,8 +233,7 @@ public class InfernoPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcSpawned(NpcSpawned event)
|
||||
private void onNpcSpawned(NpcSpawned event)
|
||||
{
|
||||
if (client.getMapRegions()[0] != 9043)
|
||||
{
|
||||
@@ -251,8 +267,7 @@ public class InfernoPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcDespawned(NpcDespawned event)
|
||||
private void onNpcDespawned(NpcDespawned event)
|
||||
{
|
||||
if (client.getMapRegions()[0] != 9043)
|
||||
{
|
||||
@@ -283,8 +298,7 @@ public class InfernoPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
if (event.getGameState() != GameState.LOGGED_IN)
|
||||
{
|
||||
@@ -316,8 +330,7 @@ public class InfernoPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage event)
|
||||
private void onChatMessage(ChatMessage event)
|
||||
{
|
||||
if (!isInInferno() || event.getType() != ChatMessageType.GAMEMESSAGE)
|
||||
{
|
||||
@@ -333,8 +346,7 @@ public class InfernoPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
if (client.getMapRegions()[0] != 9043)
|
||||
{
|
||||
@@ -403,8 +415,7 @@ public class InfernoPlugin extends Plugin
|
||||
calculatePriorityNPC();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onAnimationChanged(final AnimationChanged event)
|
||||
private void onAnimationChanged(final AnimationChanged event)
|
||||
{
|
||||
if (event.getActor() != jad)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.WidgetMenuOptionClicked;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import static net.runelite.api.widgets.WidgetInfo.WORLD_MAP_OPTION;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.input.KeyManager;
|
||||
import net.runelite.client.input.MouseManager;
|
||||
import net.runelite.client.menus.MenuManager;
|
||||
@@ -67,6 +67,9 @@ public class InstanceMapPlugin extends Plugin
|
||||
@Inject
|
||||
private MouseManager mouseManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Override
|
||||
public void configure(Binder binder)
|
||||
{
|
||||
@@ -86,6 +89,8 @@ public class InstanceMapPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(overlay);
|
||||
addCustomOptions();
|
||||
keyManager.registerKeyListener(inputListener);
|
||||
@@ -96,6 +101,8 @@ public class InstanceMapPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlay.setShowMap(false);
|
||||
overlayManager.remove(overlay);
|
||||
removeCustomOptions();
|
||||
@@ -104,8 +111,13 @@ public class InstanceMapPlugin extends Plugin
|
||||
mouseManager.unregisterMouseWheelListener(inputListener);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(WidgetMenuOptionClicked.class, this, this::onWidgetMenuOptionClicked);
|
||||
}
|
||||
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
overlay.onGameStateChange(event);
|
||||
}
|
||||
@@ -115,8 +127,7 @@ public class InstanceMapPlugin extends Plugin
|
||||
return event.getMenuOption().equals(widgetMenuOption.getMenuOption()) && event.getMenuTarget().equals(widgetMenuOption.getMenuTarget());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetMenuOptionClicked(WidgetMenuOptionClicked event)
|
||||
private void onWidgetMenuOptionClicked(WidgetMenuOptionClicked event)
|
||||
{
|
||||
if (event.getWidget() != WORLD_MAP_OPTION)
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@ import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.SpriteManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -73,6 +73,9 @@ public class InterfaceStylesPlugin extends Plugin
|
||||
@Inject
|
||||
private SpriteManager spriteManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private Sprite[] defaultCrossSprites;
|
||||
|
||||
private Skin skin;
|
||||
@@ -90,12 +93,15 @@ public class InterfaceStylesPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
clientThread.invoke(this::updateAllOverrides);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
clientThread.invoke(() ->
|
||||
{
|
||||
restoreWidgetDimensions();
|
||||
@@ -105,8 +111,16 @@ public class InterfaceStylesPlugin extends Plugin
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged config)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(WidgetPositioned.class, this, this::onWidgetPositioned);
|
||||
eventBus.subscribe(PostHealthBar.class, this, this::onPostHealthBar);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(BeforeMenuRender.class, this, this::onBeforeMenuRender);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged config)
|
||||
{
|
||||
if (config.getGroup().equals("interfaceStyles"))
|
||||
{
|
||||
@@ -115,14 +129,12 @@ public class InterfaceStylesPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetPositioned(WidgetPositioned widgetPositioned)
|
||||
private void onWidgetPositioned(WidgetPositioned widgetPositioned)
|
||||
{
|
||||
adjustWidgetDimensions();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onPostHealthBar(PostHealthBar postHealthBar)
|
||||
private void onPostHealthBar(PostHealthBar postHealthBar)
|
||||
{
|
||||
if (!this.hdHealthBars)
|
||||
{
|
||||
@@ -140,8 +152,7 @@ public class InterfaceStylesPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||
private void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||
{
|
||||
if (gameStateChanged.getGameState() != GameState.LOGIN_SCREEN)
|
||||
{
|
||||
@@ -167,8 +178,7 @@ public class InterfaceStylesPlugin extends Plugin
|
||||
overrideCrossSprites();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onBeforeMenuRender(BeforeMenuRender event)
|
||||
private void onBeforeMenuRender(BeforeMenuRender event)
|
||||
{
|
||||
if (this.hdMenu)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
@@ -56,6 +56,9 @@ public class InventoryGridPlugin extends Plugin
|
||||
@Inject
|
||||
private InventoryGridConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private boolean showItem;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@@ -73,12 +76,16 @@ public class InventoryGridPlugin extends Plugin
|
||||
public void startUp()
|
||||
{
|
||||
updateConfig();
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
|
||||
@@ -88,8 +95,7 @@ public class InventoryGridPlugin extends Plugin
|
||||
return configManager.getConfig(InventoryGridConfig.class);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged config)
|
||||
private void onConfigChanged(ConfigChanged config)
|
||||
{
|
||||
if (config.getGroup().equals("inventorygrid"))
|
||||
{
|
||||
|
||||
@@ -54,7 +54,7 @@ import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.ItemContainerChanged;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.game.ItemVariationMapping;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -104,6 +104,9 @@ public class InventorySetupPlugin extends Plugin
|
||||
@Inject
|
||||
private ClientThread clientThread;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Inject
|
||||
private ConfigManager configManager;
|
||||
|
||||
@@ -131,6 +134,7 @@ public class InventorySetupPlugin extends Plugin
|
||||
public void startUp()
|
||||
{
|
||||
updateConfigOptions();
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(overlay);
|
||||
|
||||
@@ -257,8 +261,7 @@ public class InventorySetupPlugin extends Plugin
|
||||
return configManager.getConfig(InventorySetupConfig.class);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals(CONFIG_GROUP))
|
||||
{
|
||||
@@ -313,8 +316,7 @@ public class InventorySetupPlugin extends Plugin
|
||||
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onItemContainerChanged(ItemContainerChanged event)
|
||||
private void onItemContainerChanged(ItemContainerChanged event)
|
||||
{
|
||||
|
||||
if (!highlightDifference || client.getGameState() != GameState.LOGGED_IN)
|
||||
@@ -347,8 +349,7 @@ public class InventorySetupPlugin extends Plugin
|
||||
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
switch (event.getGameState())
|
||||
{
|
||||
@@ -422,10 +423,18 @@ public class InventorySetupPlugin extends Plugin
|
||||
@Override
|
||||
public void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
overlayManager.remove(overlay);
|
||||
clientToolbar.removeNavigation(navButton);
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(ItemContainerChanged.class, this, this::onItemContainerChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
}
|
||||
|
||||
final int[] getCurrentInventorySetupIds()
|
||||
{
|
||||
InventorySetup setup = inventorySetups.get(panel.getSelectedInventorySetup());
|
||||
|
||||
@@ -40,7 +40,7 @@ import net.runelite.api.events.MenuOptionClicked;
|
||||
import net.runelite.api.events.WidgetMenuOptionClicked;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.menus.MenuManager;
|
||||
import net.runelite.client.menus.WidgetMenuOption;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -104,6 +104,9 @@ public class InventoryTagsPlugin extends Plugin
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private boolean editorMode;
|
||||
|
||||
private Color group1Color;
|
||||
@@ -142,6 +145,8 @@ public class InventoryTagsPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
refreshInventoryMenuOptions();
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
@@ -149,13 +154,22 @@ public class InventoryTagsPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
removeInventoryMenuOptions();
|
||||
overlayManager.remove(overlay);
|
||||
editorMode = false;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetMenuOptionClicked(final WidgetMenuOptionClicked event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(WidgetMenuOptionClicked.class, this, this::onWidgetMenuOptionClicked);
|
||||
eventBus.subscribe(MenuOptionClicked.class, this, this::onMenuOptionClicked);
|
||||
eventBus.subscribe(MenuOpened.class, this, this::onMenuOpened);
|
||||
}
|
||||
|
||||
private void onWidgetMenuOptionClicked(final WidgetMenuOptionClicked event)
|
||||
{
|
||||
if (event.getWidget() == WidgetInfo.FIXED_VIEWPORT_INVENTORY_TAB
|
||||
|| event.getWidget() == WidgetInfo.RESIZABLE_VIEWPORT_INVENTORY_TAB
|
||||
@@ -166,8 +180,7 @@ public class InventoryTagsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuOptionClicked(final MenuOptionClicked event)
|
||||
private void onMenuOptionClicked(final MenuOptionClicked event)
|
||||
{
|
||||
if (event.getMenuAction() != MenuAction.RUNELITE)
|
||||
{
|
||||
@@ -186,8 +199,7 @@ public class InventoryTagsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuOpened(final MenuOpened event)
|
||||
private void onMenuOpened(final MenuOpened event)
|
||||
{
|
||||
final MenuEntry firstEntry = event.getFirstEntry();
|
||||
|
||||
@@ -277,8 +289,7 @@ public class InventoryTagsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("inventorytags"))
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
@@ -56,6 +56,9 @@ public class InventoryViewerPlugin extends Plugin
|
||||
@Inject
|
||||
private InventoryViewerConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private InventoryViewerMode viewerMode;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@@ -73,11 +76,12 @@ public class InventoryViewerPlugin extends Plugin
|
||||
public void startUp()
|
||||
{
|
||||
updateConfig();
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals(CONFIG_GROUP_KEY))
|
||||
{
|
||||
@@ -88,6 +92,8 @@ public class InventoryViewerPlugin extends Plugin
|
||||
@Override
|
||||
public void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -161,6 +161,9 @@ public class ItemChargePlugin extends Plugin
|
||||
@Inject
|
||||
private ItemChargeConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
// Limits destroy callback to once per tick
|
||||
private int lastCheckTick;
|
||||
|
||||
@@ -233,6 +236,7 @@ public class ItemChargePlugin extends Plugin
|
||||
protected void startUp()
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(recoilOverlay);
|
||||
@@ -242,14 +246,26 @@ public class ItemChargePlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(recoilOverlay);
|
||||
infoBoxManager.removeIf(ItemChargeInfobox.class::isInstance);
|
||||
lastCheckTick = -1;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
eventBus.subscribe(ItemContainerChanged.class, this, this::onItemContainerChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(SpotAnimationChanged.class, this, this::onSpotAnimationChanged);
|
||||
eventBus.subscribe(ScriptCallbackEvent.class, this, this::onScriptCallbackEvent);
|
||||
eventBus.subscribe(VarbitChanged.class, this, this::onVarbitChanged);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!event.getGroup().equals("itemCharge"))
|
||||
{
|
||||
@@ -296,8 +312,7 @@ public class ItemChargePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage event)
|
||||
private void onChatMessage(ChatMessage event)
|
||||
{
|
||||
String message = event.getMessage();
|
||||
Matcher dodgyCheckMatcher = DODGY_CHECK_PATTERN.matcher(message);
|
||||
@@ -420,8 +435,7 @@ public class ItemChargePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onItemContainerChanged(ItemContainerChanged event)
|
||||
private void onItemContainerChanged(ItemContainerChanged event)
|
||||
{
|
||||
if (event.getItemContainer() != client.getItemContainer(InventoryID.EQUIPMENT) || !this.showInfoboxes)
|
||||
{
|
||||
@@ -462,8 +476,7 @@ public class ItemChargePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
Widget braceletBreakWidget = client.getWidget(WidgetInfo.DIALOG_SPRITE_TEXT);
|
||||
|
||||
@@ -564,8 +577,7 @@ public class ItemChargePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onSpotAnimationChanged(SpotAnimationChanged event)
|
||||
private void onSpotAnimationChanged(SpotAnimationChanged event)
|
||||
{
|
||||
if (event.getActor() == client.getLocalPlayer() && client.getLocalPlayer().getSpotAnimation() == GraphicID.XERIC_TELEPORT)
|
||||
{
|
||||
@@ -574,7 +586,6 @@ public class ItemChargePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
private void onScriptCallbackEvent(ScriptCallbackEvent event)
|
||||
{
|
||||
if (!"destroyOnOpKey".equals(event.getEventName()))
|
||||
@@ -589,7 +600,6 @@ public class ItemChargePlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
private void onVarbitChanged(VarbitChanged event)
|
||||
{
|
||||
int explorerRingCharge = client.getVar(Varbits.EXPLORER_RING_ALCHS);
|
||||
|
||||
@@ -32,7 +32,7 @@ import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
@@ -54,6 +54,9 @@ public class ItemIdentificationPlugin extends Plugin
|
||||
@Inject
|
||||
private ItemIdentificationConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private ItemIdentificationMode identificationType;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@@ -79,17 +82,20 @@ public class ItemIdentificationPlugin extends Plugin
|
||||
protected void startUp()
|
||||
{
|
||||
updateConfig();
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!event.getGroup().equals("itemidentification"))
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
@@ -54,6 +54,9 @@ public class ItemPricesPlugin extends Plugin
|
||||
@Inject
|
||||
private ItemPricesConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private boolean showGEPrice;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@@ -75,17 +78,19 @@ public class ItemPricesPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!event.getGroup().equals("itemprices"))
|
||||
{
|
||||
|
||||
@@ -57,7 +57,7 @@ import net.runelite.api.vars.AccountType;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.api.widgets.WidgetType;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.game.ItemMapping;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -112,6 +112,9 @@ public class ItemsKeptOnDeathPlugin extends Plugin
|
||||
@Inject
|
||||
private ItemManager itemManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private WidgetButton deepWildyButton;
|
||||
private WidgetButton lowWildyButton;
|
||||
|
||||
@@ -122,8 +125,19 @@ public class ItemsKeptOnDeathPlugin extends Plugin
|
||||
@VisibleForTesting
|
||||
int wildyLevel;
|
||||
|
||||
@Subscribe
|
||||
public void onScriptCallbackEvent(ScriptCallbackEvent event)
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
eventBus.subscribe(ScriptCallbackEvent.class, this, this::onScriptCallbackEvent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
}
|
||||
|
||||
private void onScriptCallbackEvent(ScriptCallbackEvent event)
|
||||
{
|
||||
if (event.getEventName().equals("itemsKeptOnDeath"))
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ import net.runelite.api.widgets.WidgetTextAlignment;
|
||||
import net.runelite.api.widgets.WidgetType;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -98,6 +98,9 @@ public class ItemStatPlugin extends Plugin
|
||||
@Inject
|
||||
private ClientThread clientThread;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private Widget itemInformationTitle;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@@ -140,18 +143,28 @@ public class ItemStatPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
clientThread.invokeLater(this::resetGEInventory);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(VarbitChanged.class, this, this::onVarbitChanged);
|
||||
eventBus.subscribe(ScriptCallbackEvent.class, this, this::onScriptCallbackEvent);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getKey().equals("geStats"))
|
||||
{
|
||||
@@ -160,8 +173,7 @@ public class ItemStatPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
if (itemInformationTitle != null && this.geStats
|
||||
&& (client.getWidget(WidgetInfo.GRAND_EXCHANGE_WINDOW_CONTAINER) == null
|
||||
@@ -171,8 +183,8 @@ public class ItemStatPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onVarbitChanged(VarbitChanged event)
|
||||
|
||||
private void onVarbitChanged(VarbitChanged event)
|
||||
{
|
||||
if (client.getVar(VarPlayer.CURRENT_GE_ITEM) == -1 && this.geStats)
|
||||
{
|
||||
@@ -180,8 +192,7 @@ public class ItemStatPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onScriptCallbackEvent(ScriptCallbackEvent event)
|
||||
private void onScriptCallbackEvent(ScriptCallbackEvent event)
|
||||
{
|
||||
if (event.getEventName().equals("geBuilt") && this.geStats)
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@ import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.config.ModifierlessKeybind;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.input.KeyManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -80,6 +80,9 @@ public class KeyRemappingPlugin extends Plugin
|
||||
@Inject
|
||||
private KeyRemappingListener inputListener;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@Setter(AccessLevel.PACKAGE)
|
||||
private boolean typing;
|
||||
@@ -128,6 +131,7 @@ public class KeyRemappingPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
typing = false;
|
||||
keyManager.registerKeyListener(inputListener);
|
||||
@@ -144,6 +148,8 @@ public class KeyRemappingPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
clientThread.invoke(() ->
|
||||
{
|
||||
if (client.getGameState() == GameState.LOGGED_IN)
|
||||
@@ -155,6 +161,12 @@ public class KeyRemappingPlugin extends Plugin
|
||||
keyManager.unregisterKeyListener(inputListener);
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(ScriptCallbackEvent.class, this, this::onScriptCallbackEvent);
|
||||
}
|
||||
|
||||
@Provides
|
||||
KeyRemappingConfig getConfig(ConfigManager configManager)
|
||||
{
|
||||
@@ -195,8 +207,7 @@ public class KeyRemappingPlugin extends Plugin
|
||||
return w == null || w.isSelfHidden();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged configChanged)
|
||||
private void onConfigChanged(ConfigChanged configChanged)
|
||||
{
|
||||
if (!configChanged.getGroup().equals("keyremapping"))
|
||||
{
|
||||
@@ -216,8 +227,7 @@ public class KeyRemappingPlugin extends Plugin
|
||||
);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onScriptCallbackEvent(ScriptCallbackEvent scriptCallbackEvent)
|
||||
private void onScriptCallbackEvent(ScriptCallbackEvent scriptCallbackEvent)
|
||||
{
|
||||
switch (scriptCallbackEvent.getEventName())
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@ import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -64,19 +64,35 @@ public class KingdomPlugin extends Plugin
|
||||
@Inject
|
||||
private ItemManager itemManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private int favor = 0, coffer = 0;
|
||||
|
||||
private KingdomCounter counter;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
addSubscriptions();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
removeKingdomInfobox();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onVarbitChanged(VarbitChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(VarbitChanged.class, this, this::onVarbitChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
}
|
||||
|
||||
private void onVarbitChanged(VarbitChanged event)
|
||||
{
|
||||
if (isInKingdom())
|
||||
{
|
||||
@@ -86,7 +102,6 @@ public class KingdomPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
if (event.getGameState() == GameState.LOGGED_IN)
|
||||
|
||||
@@ -53,7 +53,7 @@ import net.runelite.api.events.MenuOptionClicked;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -98,6 +98,9 @@ public class KourendLibraryPlugin extends Plugin
|
||||
@Inject
|
||||
private ItemManager itemManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private KourendLibraryPanel panel;
|
||||
private NavigationButton navButton;
|
||||
private boolean buttonAttached = false;
|
||||
@@ -118,6 +121,8 @@ public class KourendLibraryPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
addSubscriptions();
|
||||
|
||||
hideButton = config.hideButton();
|
||||
hideDuplicateBook = config.hideDuplicateBook();
|
||||
|
||||
@@ -148,6 +153,8 @@ public class KourendLibraryPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlay.setHidden(true);
|
||||
overlayManager.remove(overlay);
|
||||
clientToolbar.removeNavigation(navButton);
|
||||
@@ -157,8 +164,17 @@ public class KourendLibraryPlugin extends Plugin
|
||||
playerBooks = null;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged ev)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(MenuOptionClicked.class, this, this::onMenuOptionClicked);
|
||||
eventBus.subscribe(AnimationChanged.class, this, this::onAnimationChanged);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(ItemContainerChanged.class, this, this::onItemContainerChanged);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged ev)
|
||||
{
|
||||
if (!KourendLibraryConfig.GROUP_KEY.equals(ev.getGroup()))
|
||||
{
|
||||
@@ -190,8 +206,7 @@ public class KourendLibraryPlugin extends Plugin
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuOptionClicked(MenuOptionClicked menuOpt)
|
||||
private void onMenuOptionClicked(MenuOptionClicked menuOpt)
|
||||
{
|
||||
if (MenuAction.GAME_OBJECT_FIRST_OPTION == menuOpt.getMenuAction() && menuOpt.getTarget().contains("Bookshelf"))
|
||||
{
|
||||
@@ -200,8 +215,7 @@ public class KourendLibraryPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onAnimationChanged(AnimationChanged anim)
|
||||
private void onAnimationChanged(AnimationChanged anim)
|
||||
{
|
||||
if (anim.getActor() == client.getLocalPlayer() && anim.getActor().getAnimation() == AnimationID.LOOKING_INTO)
|
||||
{
|
||||
@@ -209,8 +223,7 @@ public class KourendLibraryPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage event)
|
||||
private void onChatMessage(ChatMessage event)
|
||||
{
|
||||
if (lastBookcaseAnimatedOn != null && event.getType() == ChatMessageType.GAMEMESSAGE)
|
||||
{
|
||||
@@ -223,8 +236,7 @@ public class KourendLibraryPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick tick)
|
||||
private void onGameTick(GameTick tick)
|
||||
{
|
||||
boolean inRegion = client.getLocalPlayer().getWorldLocation().getRegionID() == REGION;
|
||||
if (this.hideButton && inRegion != buttonAttached)
|
||||
@@ -295,8 +307,7 @@ public class KourendLibraryPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onItemContainerChanged(ItemContainerChanged itemContainerChangedEvent)
|
||||
private void onItemContainerChanged(ItemContainerChanged itemContainerChangedEvent)
|
||||
{
|
||||
updatePlayerBooks();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.runelite.api.events.WidgetLoaded;
|
||||
import net.runelite.api.widgets.WidgetID;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
@@ -50,6 +50,9 @@ public class LearnToClickPlugin extends Plugin
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private boolean shouldBlockCompass;
|
||||
private boolean shouldRightClickMap;
|
||||
private boolean shouldRightClickXp;
|
||||
@@ -66,17 +69,27 @@ public class LearnToClickPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
forceRightClickFlag = false;
|
||||
hideOrbWidgets(false);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(WidgetLoaded.class, this, this::onWidgetLoaded);
|
||||
eventBus.subscribe(MenuShouldLeftClick.class, this, this::onMenuShouldLeftClick);
|
||||
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!event.getGroup().equals("learntoclick"))
|
||||
{
|
||||
@@ -96,8 +109,7 @@ public class LearnToClickPlugin extends Plugin
|
||||
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetLoaded(WidgetLoaded event)
|
||||
private void onWidgetLoaded(WidgetLoaded event)
|
||||
{
|
||||
if (!this.hideOrbs)
|
||||
{
|
||||
@@ -109,8 +121,7 @@ public class LearnToClickPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuShouldLeftClick(MenuShouldLeftClick event)
|
||||
private void onMenuShouldLeftClick(MenuShouldLeftClick event)
|
||||
{
|
||||
if (!forceRightClickFlag)
|
||||
{
|
||||
@@ -131,8 +142,7 @@ public class LearnToClickPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||
private void onMenuEntryAdded(MenuEntryAdded event)
|
||||
{
|
||||
if ((event.getOption().equals("Floating") && this.shouldRightClickMap) || (event.getOption().equals("Hide")
|
||||
&& this.shouldRightClickXp) || (event.getOption().equals("Show") && this.shouldRightClickXp) ||
|
||||
|
||||
@@ -40,7 +40,7 @@ import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
@@ -75,6 +75,9 @@ public class LizardmenShamanPlugin extends Plugin
|
||||
@Inject
|
||||
private Notifier notifier;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private boolean showTimer;
|
||||
private boolean notifyOnSpawn;
|
||||
|
||||
@@ -87,6 +90,8 @@ public class LizardmenShamanPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
addSubscriptions();
|
||||
|
||||
this.showTimer = config.showTimer();
|
||||
this.notifyOnSpawn = config.notifyOnSpawn();
|
||||
|
||||
@@ -96,12 +101,20 @@ public class LizardmenShamanPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
spawns.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
eventBus.subscribe(AnimationChanged.class, this, this::onAnimationChanged);
|
||||
}
|
||||
|
||||
private void onChatMessage(ChatMessage event)
|
||||
{
|
||||
if (this.notifyOnSpawn && /* event.getType() == ChatMessageType.GAMEMESSAGE && */event.getMessage().contains(MESSAGE))
|
||||
// ChatMessageType should probably be SPAM <- should be tested first though
|
||||
@@ -110,8 +123,7 @@ public class LizardmenShamanPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onAnimationChanged(AnimationChanged event)
|
||||
private void onAnimationChanged(AnimationChanged event)
|
||||
{
|
||||
Actor actor = event.getActor();
|
||||
if (actor == null || actor.getName() == null)
|
||||
@@ -125,8 +137,7 @@ public class LizardmenShamanPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!event.getGroup().equals("shaman"))
|
||||
{
|
||||
|
||||
@@ -38,9 +38,9 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.SessionOpen;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.input.KeyListener;
|
||||
import net.runelite.client.input.KeyManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -68,6 +68,9 @@ public class LoginScreenPlugin extends Plugin implements KeyListener
|
||||
@Inject
|
||||
private KeyManager keyManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private String usernameCache;
|
||||
|
||||
private boolean syncUsername;
|
||||
@@ -78,6 +81,8 @@ public class LoginScreenPlugin extends Plugin implements KeyListener
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
applyUsername();
|
||||
keyManager.registerKeyListener(this);
|
||||
}
|
||||
@@ -85,6 +90,8 @@ public class LoginScreenPlugin extends Plugin implements KeyListener
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
if (this.syncUsername)
|
||||
{
|
||||
client.getPreferences().setRememberedUsername(usernameCache);
|
||||
@@ -93,14 +100,20 @@ public class LoginScreenPlugin extends Plugin implements KeyListener
|
||||
keyManager.unregisterKeyListener(this);
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(SessionOpen.class, this, this::onSessionOpen);
|
||||
}
|
||||
|
||||
@Provides
|
||||
LoginScreenConfig getConfig(ConfigManager configManager)
|
||||
{
|
||||
return configManager.getConfig(LoginScreenConfig.class);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
if (!this.syncUsername)
|
||||
{
|
||||
@@ -131,8 +144,7 @@ public class LoginScreenPlugin extends Plugin implements KeyListener
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onSessionOpen(SessionOpen event)
|
||||
private void onSessionOpen(SessionOpen event)
|
||||
{
|
||||
// configuation for the account is available now, so update the username
|
||||
applyUsername();
|
||||
@@ -230,8 +242,7 @@ public class LoginScreenPlugin extends Plugin implements KeyListener
|
||||
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!event.getGroup().equals("loginscreen"))
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ import net.runelite.api.Player;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.AnimationChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
@@ -26,34 +26,45 @@ import net.runelite.client.ui.overlay.OverlayManager;
|
||||
public class LootAssistPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
OverlayManager overlayManager;
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
LootAssistOverlay lootAssistOverlay;
|
||||
private LootAssistOverlay lootAssistOverlay;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
static final ConcurrentHashMap<WorldPoint, LootPile> lootPiles = new ConcurrentHashMap<>();
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
addSubscriptions();
|
||||
|
||||
overlayManager.add(lootAssistOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
lootPiles.clear();
|
||||
overlayManager.remove(lootAssistOverlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(AnimationChanged.class, this, this::onAnimationChanged);
|
||||
}
|
||||
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
lootPiles.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onAnimationChanged(AnimationChanged event)
|
||||
private void onAnimationChanged(AnimationChanged event)
|
||||
{
|
||||
final Actor actor = event.getActor();
|
||||
if (actor.getAnimation() == AnimationID.DEATH && actor instanceof Player)
|
||||
|
||||
@@ -40,7 +40,7 @@ import net.runelite.api.events.WidgetHiddenChanged;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
@@ -80,6 +80,9 @@ public class LootingBagViewerPlugin extends Plugin
|
||||
@Inject
|
||||
private LootingBagViewerConfig config;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@Setter(AccessLevel.PACKAGE)
|
||||
private int valueToShow = -1;
|
||||
@@ -93,6 +96,8 @@ public class LootingBagViewerPlugin extends Plugin
|
||||
@Override
|
||||
public void startUp()
|
||||
{
|
||||
addSubscriptions();
|
||||
|
||||
if (config.renderViewer())
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
@@ -107,12 +112,19 @@ public class LootingBagViewerPlugin extends Plugin
|
||||
@Override
|
||||
public void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(widgetOverlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged configChanged)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(WidgetHiddenChanged.class, this, this::onWidgetHiddenChanged);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged configChanged)
|
||||
{
|
||||
if (configChanged.getKey().equals("renderViewer"))
|
||||
{
|
||||
@@ -142,8 +154,7 @@ public class LootingBagViewerPlugin extends Plugin
|
||||
/**
|
||||
* @param widgetHiddenChanged
|
||||
*/
|
||||
@Subscribe
|
||||
public void onWidgetHiddenChanged(WidgetHiddenChanged widgetHiddenChanged)
|
||||
private void onWidgetHiddenChanged(WidgetHiddenChanged widgetHiddenChanged)
|
||||
{
|
||||
Widget widget = widgetHiddenChanged.getWidget();
|
||||
if (widget.getParentId() == 5308416 && !widget.isHidden())
|
||||
|
||||
@@ -91,7 +91,7 @@ import net.runelite.client.chat.ChatMessageBuilder;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.chat.QueuedMessage;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.NpcLootReceived;
|
||||
import net.runelite.client.events.PlayerLootReceived;
|
||||
import net.runelite.client.events.SessionClose;
|
||||
@@ -167,6 +167,8 @@ public class LootTrackerPlugin extends Plugin
|
||||
private SessionManager sessionManager;
|
||||
@Inject
|
||||
private ScheduledExecutorService executor;
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
private LootTrackerPanel panel;
|
||||
private NavigationButton navButton;
|
||||
private String eventType;
|
||||
@@ -232,8 +234,7 @@ public class LootTrackerPlugin extends Plugin
|
||||
return configManager.getConfig(LootTrackerConfig.class);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onSessionOpen(SessionOpen sessionOpen)
|
||||
private void onSessionOpen(SessionOpen sessionOpen)
|
||||
{
|
||||
AccountSession accountSession = sessionManager.getAccountSession();
|
||||
if (accountSession.getUuid() != null)
|
||||
@@ -246,14 +247,12 @@ public class LootTrackerPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onSessionClose(SessionClose sessionClose)
|
||||
private void onSessionClose(SessionClose sessionClose)
|
||||
{
|
||||
lootTrackerClient = null;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onLocalPlayerDeath(LocalPlayerDeath event)
|
||||
private void onLocalPlayerDeath(LocalPlayerDeath event)
|
||||
{
|
||||
if (client.getVar(Varbits.IN_WILDERNESS) == 1 || WorldType.isPvpWorld(client.getWorldType()))
|
||||
{
|
||||
@@ -262,8 +261,7 @@ public class LootTrackerPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("loottracker"))
|
||||
{
|
||||
@@ -291,6 +289,8 @@ public class LootTrackerPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
addSubscriptions();
|
||||
|
||||
ignoredItems = Text.fromCSV(config.getIgnoredItems());
|
||||
ignoredNPCs = Text.fromCSV(config.getIgnoredNPCs());
|
||||
updateConfig();
|
||||
@@ -377,14 +377,30 @@ public class LootTrackerPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
clientToolbar.removeNavigation(navButton);
|
||||
lootTrackerClient = null;
|
||||
lootRecords = new ArrayList<>();
|
||||
chestLooted = false;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(final GameStateChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(SessionOpen.class, this, this::onSessionOpen);
|
||||
eventBus.subscribe(SessionClose.class, this, this::onSessionClose);
|
||||
eventBus.subscribe(LocalPlayerDeath.class, this, this::onLocalPlayerDeath);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(NpcLootReceived.class, this, this::onNpcLootReceived);
|
||||
eventBus.subscribe(PlayerSpawned.class, this, this::onPlayerSpawned);
|
||||
eventBus.subscribe(PlayerLootReceived.class, this, this::onPlayerLootReceived);
|
||||
eventBus.subscribe(WidgetLoaded.class, this, this::onWidgetLoaded);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
eventBus.subscribe(ItemContainerChanged.class, this, this::onItemContainerChanged);
|
||||
}
|
||||
|
||||
private void onGameStateChanged(final GameStateChanged event)
|
||||
{
|
||||
if (event.getGameState() == GameState.LOADING)
|
||||
{
|
||||
@@ -392,8 +408,7 @@ public class LootTrackerPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onNpcLootReceived(final NpcLootReceived npcLootReceived)
|
||||
private void onNpcLootReceived(final NpcLootReceived npcLootReceived)
|
||||
{
|
||||
final NPC npc = npcLootReceived.getNpc();
|
||||
final Collection<ItemStack> items = npcLootReceived.getItems();
|
||||
@@ -435,8 +450,7 @@ public class LootTrackerPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onPlayerSpawned(PlayerSpawned event)
|
||||
private void onPlayerSpawned(PlayerSpawned event)
|
||||
{
|
||||
if (event.getPlayer().equals(client.getLocalPlayer()))
|
||||
{
|
||||
@@ -444,8 +458,7 @@ public class LootTrackerPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onPlayerLootReceived(final PlayerLootReceived playerLootReceived)
|
||||
private void onPlayerLootReceived(final PlayerLootReceived playerLootReceived)
|
||||
{
|
||||
if (this.sendLootValueMessages)
|
||||
{
|
||||
@@ -479,8 +492,7 @@ public class LootTrackerPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetLoaded(WidgetLoaded event)
|
||||
private void onWidgetLoaded(WidgetLoaded event)
|
||||
{
|
||||
final ItemContainer container;
|
||||
switch (event.getGroupId())
|
||||
@@ -582,8 +594,7 @@ public class LootTrackerPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage event)
|
||||
private void onChatMessage(ChatMessage event)
|
||||
{
|
||||
if (event.getType() != ChatMessageType.GAMEMESSAGE && event.getType() != ChatMessageType.SPAM)
|
||||
{
|
||||
@@ -643,7 +654,6 @@ public class LootTrackerPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onItemContainerChanged(ItemContainerChanged event)
|
||||
{
|
||||
if (pvpDeath && RESPAWN_REGIONS.contains(client.getLocalPlayer().getWorldLocation().getRegionID()))
|
||||
|
||||
@@ -29,7 +29,7 @@ import javax.inject.Singleton;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
|
||||
@@ -45,9 +45,14 @@ public class LowMemoryPlugin extends Plugin
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
|
||||
if (client.getGameState() == GameState.LOGGED_IN)
|
||||
{
|
||||
client.changeMemoryMode(true);
|
||||
@@ -57,10 +62,11 @@ public class LowMemoryPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
client.changeMemoryMode(false);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
if (event.getGameState() == GameState.LOGIN_SCREEN)
|
||||
|
||||
@@ -35,7 +35,7 @@ import net.runelite.api.events.ItemContainerChanged;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
@@ -56,20 +56,39 @@ public class MaxHitPlugin extends Plugin
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Subscribe
|
||||
public void onItemContainerChanged(final ItemContainerChanged event)
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
addSubscriptions();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
}
|
||||
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(ItemContainerChanged.class, this, this::onItemContainerChanged);
|
||||
eventBus.subscribe(VarbitChanged.class, this, this::onVarbitChanged);
|
||||
}
|
||||
|
||||
private void onItemContainerChanged(final ItemContainerChanged event)
|
||||
{
|
||||
this.updateMaxHitWidget();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(final ConfigChanged event)
|
||||
private void onConfigChanged(final ConfigChanged event)
|
||||
{
|
||||
this.updateMaxHitWidget();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onVarbitChanged(VarbitChanged event)
|
||||
private void onVarbitChanged(VarbitChanged event)
|
||||
{
|
||||
this.updateMaxHitWidget();
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ import net.runelite.api.events.WidgetMenuOptionClicked;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.game.ItemVariationMapping;
|
||||
import net.runelite.client.input.KeyManager;
|
||||
@@ -185,6 +185,9 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
@Inject
|
||||
private ItemManager itemManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private boolean configuringShiftClick = false;
|
||||
|
||||
@@ -325,6 +328,8 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
public void startUp()
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
|
||||
addSwaps();
|
||||
loadConstructionItems(config.getEasyConstructionItems());
|
||||
client.setHideFriendCastOptions(config.getRemoveFreezePlayerToB());
|
||||
@@ -341,6 +346,8 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
@Override
|
||||
public void shutDown()
|
||||
{
|
||||
eventBus.unregister(this);
|
||||
|
||||
client.setHideFriendCastOptions(false);
|
||||
disableCustomization();
|
||||
loadConstructionItems("");
|
||||
@@ -348,8 +355,20 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
removeSwaps();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
private void addSubscriptions()
|
||||
{
|
||||
eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventBus.subscribe(WidgetMenuOptionClicked.class, this, this::onWidgetMenuOptionClicked);
|
||||
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
|
||||
eventBus.subscribe(VarbitChanged.class, this, this::onVarbitChanged);
|
||||
eventBus.subscribe(MenuOpened.class, this, this::onMenuOpened);
|
||||
eventBus.subscribe(MenuOptionClicked.class, this, this::onMenuOptionClicked);
|
||||
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
|
||||
eventBus.subscribe(PostItemDefinition.class, this, this::onPostItemDefinition);
|
||||
eventBus.subscribe(FocusChanged.class, this, this::onFocusChanged);
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (!"menuentryswapper".equals(event.getGroup()))
|
||||
{
|
||||
@@ -450,8 +469,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
clientThread.invoke(this::resetItemDefinitionCache);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetMenuOptionClicked(WidgetMenuOptionClicked event)
|
||||
private void onWidgetMenuOptionClicked(WidgetMenuOptionClicked event)
|
||||
{
|
||||
if (event.getWidget() == WidgetInfo.FIXED_VIEWPORT_INVENTORY_TAB
|
||||
|| event.getWidget() == WidgetInfo.RESIZABLE_VIEWPORT_INVENTORY_TAB
|
||||
@@ -462,8 +480,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
private void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
if (client.getGameState() != GameState.LOGGED_IN)
|
||||
{
|
||||
@@ -473,14 +490,12 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
loadConstructionItems(this.getEasyConstructionItems);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onVarbitChanged(VarbitChanged event)
|
||||
private void onVarbitChanged(VarbitChanged event)
|
||||
{
|
||||
buildingMode = client.getVar(BUILDING_MODE) == 1;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuOpened(MenuOpened event)
|
||||
private void onMenuOpened(MenuOpened event)
|
||||
{
|
||||
Player localPlayer = client.getLocalPlayer();
|
||||
|
||||
@@ -632,8 +647,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
client.setMenuEntries(ArrayUtils.addAll(entries, resetShiftClickEntry));
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuOptionClicked(MenuOptionClicked event)
|
||||
private void onMenuOptionClicked(MenuOptionClicked event)
|
||||
{
|
||||
if (event.getMenuAction() != MenuAction.RUNELITE || event.getActionParam1() != WidgetInfo.INVENTORY.getId())
|
||||
{
|
||||
@@ -689,7 +703,6 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||
{
|
||||
if (client.getGameState() != GameState.LOGGED_IN)
|
||||
@@ -1388,8 +1401,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onPostItemDefinition(PostItemDefinition event)
|
||||
private void onPostItemDefinition(PostItemDefinition event)
|
||||
{
|
||||
ItemDefinition itemComposition = event.getItemDefinition();
|
||||
Integer option = getSwapConfig(itemComposition.getId());
|
||||
@@ -1400,8 +1412,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onFocusChanged(FocusChanged event)
|
||||
private void onFocusChanged(FocusChanged event)
|
||||
{
|
||||
if (!event.isFocused())
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user