plugins: reduce config calls by saving and reusing values, misc performance tweaks. (#799)
* Save config values -- AgilityPlugin * Static state value map * Don't run area in the for loop * Checking for bounds is enough for widget null check * Cache font settings * SAve config values -- AntiDragPlugin * Save config values -- AoEPlugin * Save config values -- AttackStylesPlugin * Save config values -- BankPlugin * Check if player is in kingdom * Save hideAutoRetaliate -- AttackStylesPlugin * Save config values -- BanListPlugin * Save config values -- BarbaranAssaultPlugin * Save config values -- BarrowsPlugin * Checkstyle * Move up updateConfig.java * Save config values -- BlackjackPlugin * Save config values -- BlastFurnacePlugin * Save config values -- BlastMinePlugin * Save config values -- BoostsPlugin * Save config values -- CannonPlugin * Fix bank plugin test * Parallelize plugin loading * Fix sidebar going AWOL * Save config values -- ChatFilterPlugin * Save config values -- ChatHistoryPlugin * Save config values -- ChatNotificationsPlugin * Save config values -- ChatTranslationPlugin * Save config values -- ClanChatPlugin * Save config values -- ClueScrollPlugin * Cleanup CombatCounterPlugin * Save config values -- CombatCounter * Checkstyle * Save config values -- CombatLevelPlugin * Convert game thread events without mutable field to singletons These should be safe to convert, events with mutable field should be checked * Checkstyle * Fix test * Save config values -- CookingPlugin * Save config values -- CorpPlugin * SAve config values -- CoxPlugin * Save config values -- DailyTasksPlugin * Save config values -- DiscordPlugin * Coxhelper checkstyle * Save config values -- EquipmentInspectorPlugin * SAve cofig values -- XpDropPlugin * Save config values -- FairyRingPlugin * Save config values -- FightCavePlugin * Save config values -- FishingPlugin * Save config values and refactor -- FlexoPlugin * Save config values -- FlinchingPlugin * Save config values -- FreezeTimersPlugin * Save config values -- GpuPlugin * Save config values -- GrandExchangePlugin * Save config values -- GroundItemsPlugin * Save config values -- GroundMarkerPlugin * Save config values -- GroundMarkerPlugin * Save config values -- HerbiboarPlugin * Save config values -- HidePrayersPlugin * Save config values -- HighAlchemyPlugin * Save config values -- HunterPlugin * Save config values -- BabyHydraPlugin * Fix Flexo * Checkstyle * Save config values -- IdleNotifierPlugin * Save config values -- ImplingsPlugin * Save config values and cleanup -- InfernoPlugin * Use EqualsAndHashCode for GroundMarkerPoint * Save config values -- InterfaceStylesPlugin * Save config values -- InventoryGridPlugin * Save config values -- InventorySetupPlugin * Checkstyle * Save config values -- InventoryTagsPlugin * Save config values -- InventoryViewerPlugin * Save config values -- ItemChargePlugin * Save config values -- ItemIdentificationPlugin * Save config values -- ItemPricesPlugin * Save config values -- ItemStatPlugin * Save config values -- KeyRemappingPlugin * Save config values -- KourendLibraryPlugin * Save config values -- LearnToClickPlugin * Save config values -- LizardmenShamanPlugin * Save config values -- LoginScreenPlugin * Cleanup LootAssistOverlay * Remove unused LootAssistConfig * Save config values -- LootTrackerPlugin * Save config values -- MetronomePlugin * Add border color ground items * Save config values -- WorstPluginEverPlugin * Fix inferno plugin * Save config values -- MinimapPlugin * Save config values -- MiningPlugin * Save config values -- MotherlodePlugin * Save config values -- MouseHighlightPlugin * Save config values -- MTAPlugin * Save config values -- MultiIndicatorsPlugin * Save config values -- NightmareZonePlugin * Save config values -- NpcIndicatorsPlugin * Save config values -- NpcStatusPlugin * Save config values -- NpcAggroAreaPlugin * Save config values -- ObjectIndicatorsPlugin * Save config values -- OpponentInfoPlugin * Save config values -- PartyPlugin * Save config values -- PerformanceStatsPlugin * Save config values and cleanup -- PestcontrolPlugin * Save config values , cleanup and refactor -- PileIndicatorsPlugin * Save config values -- PlayerIndicatorsPlugin * Save config values -- PlayerInfoPlugin * Save config values -- PluginSorterPlugin * Save config values -- PohPlugin * Checkstyle * Save config values -- PoisonPlugin * Save config values -- PrayAgainstPlayerPlugin * Save config values -- PrayerPlugin * Save config values -- PrayerAlertPlugin * Checkstyle * Save config values -- PuzzleSolverPlugin * Save config values -- PvpToolsPlugin * Save config values -- PyramidPlunderPlugin * Save config values -- RaidsPlugin * Save config values -- ShortcutPlugin * Save config values -- RaidsThievingPlugin * Oopsie * Save config values -- RegenMeterPlugin * Save config values -- ReportButtonPlugin * Save config values -- RunecraftPlugin * Save config values -- RunedokuPlugin * Save config values -- RunepouchPlugin * Save config values -- SafeSpotPlugin * Save config values -- ScreenshotPlugin * Save config values -- ShiftWalkerPlugin * Save config values -- SlayerPlugin * Save config values -- SmeltingPlugin * Save config values -- SpawnTimerPlugin * Save config values -- SpellbookPlugin * Save config values -- StatusBarsPlugin * Save config values -- ThievingPlugin * Checkstyle * Cleanup Zulrah * Save config values -- XpTrackerPlugin * Save config values -- XpGlobesPlugin * Save config values -- WorldMapPlugin * Save config values -- TheatrePlugin * Save config values -- TickTimersPlugin * Save config values -- TileIndicatorsPlugin * Save config values -- TimersPlugin * Save config values -- TitheFarmPlugin * Save config values -- TMorphPlugin * Save config values -- WarIndicatorPlugin * Save config values -- WhaleWatchersPlugin * Save config values -- WildernessLocationsPlugin * Save config values -- WintertodtPlugin * Save config values -- WorldHopperPlugin * Save config values -- WoodcuttingPlugin * Cleanup * Checkstyle * Fix tests
This commit is contained in:
@@ -24,6 +24,11 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.api;
|
package net.runelite.api;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An enumeration of game states the client is in.
|
* An enumeration of game states the client is in.
|
||||||
*/
|
*/
|
||||||
@@ -66,6 +71,10 @@ public enum GameState
|
|||||||
*/
|
*/
|
||||||
HOPPING(45);
|
HOPPING(45);
|
||||||
|
|
||||||
|
private static final Map<Integer, GameState> stateValueMap =
|
||||||
|
Arrays.stream(GameState.values())
|
||||||
|
.collect(Collectors.toMap(gs -> gs.state, Function.identity()));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The raw state value.
|
* The raw state value.
|
||||||
*/
|
*/
|
||||||
@@ -85,13 +94,6 @@ public enum GameState
|
|||||||
*/
|
*/
|
||||||
public static GameState of(int state)
|
public static GameState of(int state)
|
||||||
{
|
{
|
||||||
for (GameState gs : GameState.values())
|
return stateValueMap.getOrDefault(state, UNKNOWN);
|
||||||
{
|
|
||||||
if (gs.state == state)
|
|
||||||
{
|
|
||||||
return gs;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return UNKNOWN;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.api;
|
package net.runelite.api;
|
||||||
|
|
||||||
|
import java.awt.geom.Path2D;
|
||||||
import static net.runelite.api.Constants.TILE_FLAG_BRIDGE;
|
import static net.runelite.api.Constants.TILE_FLAG_BRIDGE;
|
||||||
import java.awt.FontMetrics;
|
import java.awt.FontMetrics;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
@@ -549,7 +550,7 @@ public class Perspective
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
int radius = 5;
|
int radius = 5;
|
||||||
Area geometry = new Area();
|
Path2D.Double geometry = new Path2D.Double();
|
||||||
|
|
||||||
final int tileHeight = getTileHeight(client, point, client.getPlane());
|
final int tileHeight = getTileHeight(client, point, client.getPlane());
|
||||||
|
|
||||||
@@ -607,10 +608,10 @@ public class Perspective
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
geometry.add(new Area(clickableRect));
|
geometry.append(clickableRect, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return geometry;
|
return new Area(geometry);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Area getAABB(
|
private static Area getAABB(
|
||||||
|
|||||||
@@ -29,4 +29,10 @@ package net.runelite.api.events;
|
|||||||
*/
|
*/
|
||||||
public class BeforeRender
|
public class BeforeRender
|
||||||
{
|
{
|
||||||
|
public static final BeforeRender INSTANCE = new BeforeRender();
|
||||||
|
|
||||||
|
private BeforeRender()
|
||||||
|
{
|
||||||
|
// noop
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,4 +29,10 @@ package net.runelite.api.events;
|
|||||||
*/
|
*/
|
||||||
public class CannonballFired
|
public class CannonballFired
|
||||||
{
|
{
|
||||||
|
public static final CannonballFired INSTANCE = new CannonballFired();
|
||||||
|
|
||||||
|
private CannonballFired()
|
||||||
|
{
|
||||||
|
// noop
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,4 +29,10 @@ package net.runelite.api.events;
|
|||||||
*/
|
*/
|
||||||
public class CanvasSizeChanged
|
public class CanvasSizeChanged
|
||||||
{
|
{
|
||||||
|
public static final CanvasSizeChanged INSTANCE = new CanvasSizeChanged();
|
||||||
|
|
||||||
|
private CanvasSizeChanged()
|
||||||
|
{
|
||||||
|
// noop
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,4 +29,10 @@ package net.runelite.api.events;
|
|||||||
*/
|
*/
|
||||||
public class ClientTick
|
public class ClientTick
|
||||||
{
|
{
|
||||||
|
public static final ClientTick INSTANCE = new ClientTick();
|
||||||
|
|
||||||
|
private ClientTick()
|
||||||
|
{
|
||||||
|
// noop
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
// The NPC update event seem to run every server tick,
|
// The NPC update event seem to run every server tick,
|
||||||
// but having the game tick event after all packets
|
// but having the game tick event after all packets
|
||||||
// have been processed is typically more useful.
|
// have been processed is typically more useful.
|
||||||
@@ -43,7 +41,12 @@ import lombok.Data;
|
|||||||
* Note that occurrences that take place purely on the client, such as right
|
* Note that occurrences that take place purely on the client, such as right
|
||||||
* click menus, are independent of the game tick.
|
* click menus, are independent of the game tick.
|
||||||
*/
|
*/
|
||||||
@Data
|
|
||||||
public class GameTick
|
public class GameTick
|
||||||
{
|
{
|
||||||
|
public static final GameTick INSTANCE = new GameTick();
|
||||||
|
|
||||||
|
private GameTick()
|
||||||
|
{
|
||||||
|
// noop
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,4 +29,10 @@ package net.runelite.api.events;
|
|||||||
*/
|
*/
|
||||||
public class LocalPlayerDeath
|
public class LocalPlayerDeath
|
||||||
{
|
{
|
||||||
|
public static final LocalPlayerDeath INSTANCE = new LocalPlayerDeath();
|
||||||
|
|
||||||
|
private LocalPlayerDeath()
|
||||||
|
{
|
||||||
|
// noop
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,4 +32,10 @@ package net.runelite.api.events;
|
|||||||
*/
|
*/
|
||||||
public class UsernameChanged
|
public class UsernameChanged
|
||||||
{
|
{
|
||||||
|
public static final UsernameChanged INSTANCE = new UsernameChanged();
|
||||||
|
|
||||||
|
private UsernameChanged()
|
||||||
|
{
|
||||||
|
// noop
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,13 +24,16 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
import lombok.Value;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event where the position of a {@link net.runelite.api.widgets.Widget}
|
* An event where the position of a {@link net.runelite.api.widgets.Widget}
|
||||||
* relative to its parent has changed.
|
* relative to its parent has changed.
|
||||||
*/
|
*/
|
||||||
@Value
|
|
||||||
public class WidgetPositioned
|
public class WidgetPositioned
|
||||||
{
|
{
|
||||||
|
public static final WidgetPositioned INSTANCE = new WidgetPositioned();
|
||||||
|
|
||||||
|
private WidgetPositioned()
|
||||||
|
{
|
||||||
|
// noop
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,9 +87,6 @@ public class Hooks implements Callbacks
|
|||||||
private static final OverlayRenderer renderer = injector.getInstance(OverlayRenderer.class);
|
private static final OverlayRenderer renderer = injector.getInstance(OverlayRenderer.class);
|
||||||
private static final OverlayManager overlayManager = injector.getInstance(OverlayManager.class);
|
private static final OverlayManager overlayManager = injector.getInstance(OverlayManager.class);
|
||||||
|
|
||||||
private static final GameTick GAME_TICK = new GameTick();
|
|
||||||
private static final BeforeRender BEFORE_RENDER = new BeforeRender();
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private EventBus eventBus;
|
private EventBus eventBus;
|
||||||
|
|
||||||
@@ -151,13 +148,13 @@ public class Hooks implements Callbacks
|
|||||||
|
|
||||||
deferredEventBus.replay();
|
deferredEventBus.replay();
|
||||||
|
|
||||||
eventBus.post(GAME_TICK);
|
eventBus.post(GameTick.INSTANCE);
|
||||||
|
|
||||||
int tick = client.getTickCount();
|
int tick = client.getTickCount();
|
||||||
client.setTickCount(tick + 1);
|
client.setTickCount(tick + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
eventBus.post(BEFORE_RENDER);
|
eventBus.post(BeforeRender.INSTANCE);
|
||||||
|
|
||||||
clientThread.invoke();
|
clientThread.invoke();
|
||||||
|
|
||||||
|
|||||||
@@ -43,11 +43,16 @@ import java.lang.reflect.InvocationTargetException;
|
|||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Iterator;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.Future;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@@ -228,7 +233,6 @@ public class PluginManager
|
|||||||
.directed()
|
.directed()
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
List<Plugin> scannedPlugins = new ArrayList<>();
|
|
||||||
ClassPath classPath = ClassPath.from(classLoader);
|
ClassPath classPath = ClassPath.from(classLoader);
|
||||||
|
|
||||||
ImmutableSet<ClassInfo> classes = packageName == null ? classPath.getAllClasses()
|
ImmutableSet<ClassInfo> classes = packageName == null ? classPath.getAllClasses()
|
||||||
@@ -285,24 +289,47 @@ public class PluginManager
|
|||||||
throw new RuntimeException("Plugin dependency graph contains a cycle!");
|
throw new RuntimeException("Plugin dependency graph contains a cycle!");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Class<? extends Plugin>> sortedPlugins = topologicalSort(graph);
|
List<List<Class<? extends Plugin>>> sortedPlugins = topologicalGroupSort(graph);
|
||||||
sortedPlugins = Lists.reverse(sortedPlugins);
|
sortedPlugins = Lists.reverse(sortedPlugins);
|
||||||
|
|
||||||
for (Class<? extends Plugin> pluginClazz : sortedPlugins)
|
final long start = System.currentTimeMillis();
|
||||||
{
|
|
||||||
Plugin plugin;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
plugin = instantiate(scannedPlugins, (Class<Plugin>) pluginClazz);
|
|
||||||
}
|
|
||||||
catch (PluginInstantiationException ex)
|
|
||||||
{
|
|
||||||
log.warn("Error instantiating plugin!", ex);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
scannedPlugins.add(plugin);
|
// some plugins get stuck on IO, so add some extra threads
|
||||||
}
|
ExecutorService exec = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 2);
|
||||||
|
|
||||||
|
List<Plugin> scannedPlugins = new CopyOnWriteArrayList<>();
|
||||||
|
sortedPlugins.forEach(group ->
|
||||||
|
{
|
||||||
|
List<Future<?>> curGroup = new ArrayList<>();
|
||||||
|
group.forEach(pluginClazz ->
|
||||||
|
curGroup.add(exec.submit(() ->
|
||||||
|
{
|
||||||
|
Plugin plugin;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
plugin = instantiate(scannedPlugins, (Class<Plugin>) pluginClazz);
|
||||||
|
}
|
||||||
|
catch (PluginInstantiationException e)
|
||||||
|
{
|
||||||
|
log.warn("Error instantiating plugin!", e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
scannedPlugins.add(plugin);
|
||||||
|
})));
|
||||||
|
curGroup.forEach(future ->
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
future.get();
|
||||||
|
}
|
||||||
|
catch (InterruptedException | ExecutionException e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
log.info("Plugin instantiation took {}ms", System.currentTimeMillis() - start);
|
||||||
|
|
||||||
return scannedPlugins;
|
return scannedPlugins;
|
||||||
}
|
}
|
||||||
@@ -515,40 +542,54 @@ public class PluginManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Topologically sort a graph. Uses Kahn's algorithm.
|
* Topologically sort a graph into separate groups.
|
||||||
*
|
* Each group represents the dependency level of the plugins.
|
||||||
|
* Plugins in group (index) 0 has no dependents.
|
||||||
|
* Plugins in group 1 has dependents in group 0.
|
||||||
|
* Plugins in group 2 has dependents in group 1, etc.
|
||||||
|
* This allows for loading dependent groups serially, starting from the last group,
|
||||||
|
* while loading plugins within each group in parallel.
|
||||||
* @param graph
|
* @param graph
|
||||||
* @param <T>
|
* @param <T>
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private <T> List<T> topologicalSort(Graph<T> graph)
|
private <T> List<List<T>> topologicalGroupSort(Graph<T> graph)
|
||||||
{
|
{
|
||||||
MutableGraph<T> graphCopy = Graphs.copyOf(graph);
|
final Set<T> root = graph.nodes().stream()
|
||||||
List<T> l = new ArrayList<>();
|
.filter(node -> graph.inDegree(node) == 0)
|
||||||
Set<T> s = graphCopy.nodes().stream()
|
|
||||||
.filter(node -> graphCopy.inDegree(node) == 0)
|
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
while (!s.isEmpty())
|
final Map<T, Integer> dependencyCount = new HashMap<>();
|
||||||
{
|
|
||||||
Iterator<T> it = s.iterator();
|
|
||||||
T n = it.next();
|
|
||||||
it.remove();
|
|
||||||
|
|
||||||
l.add(n);
|
root.forEach(n -> dependencyCount.put(n, 0));
|
||||||
|
root.forEach(n -> graph.successors(n)
|
||||||
|
.forEach(m -> incrementChildren(graph, dependencyCount, m, dependencyCount.get(n) + 1)));
|
||||||
|
|
||||||
for (T m : graphCopy.successors(n))
|
// create list<list> dependency grouping
|
||||||
|
final List<List<T>> dependencyGroups = new ArrayList<>();
|
||||||
|
final int[] curGroup = {-1};
|
||||||
|
|
||||||
|
dependencyCount.entrySet().stream()
|
||||||
|
.sorted(Map.Entry.comparingByValue())
|
||||||
|
.forEach(entry ->
|
||||||
{
|
{
|
||||||
graphCopy.removeEdge(n, m);
|
if (entry.getValue() != curGroup[0])
|
||||||
if (graphCopy.inDegree(m) == 0)
|
|
||||||
{
|
{
|
||||||
s.add(m);
|
curGroup[0] = entry.getValue();
|
||||||
|
dependencyGroups.add(new ArrayList<>());
|
||||||
}
|
}
|
||||||
}
|
dependencyGroups.get(dependencyGroups.size() - 1).add(entry.getKey());
|
||||||
}
|
});
|
||||||
if (!graphCopy.edges().isEmpty())
|
|
||||||
|
return dependencyGroups;
|
||||||
|
}
|
||||||
|
|
||||||
|
private <T> void incrementChildren(Graph<T> graph, Map<T, Integer> dependencyCount, T n, int val)
|
||||||
|
{
|
||||||
|
if (!dependencyCount.containsKey(n) || dependencyCount.get(n) < val)
|
||||||
{
|
{
|
||||||
throw new RuntimeException("Graph has at least one cycle");
|
dependencyCount.put(n, val);
|
||||||
|
graph.successors(n).forEach(m ->
|
||||||
|
incrementChildren(graph, dependencyCount, m, val + 1));
|
||||||
}
|
}
|
||||||
return l;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ package net.runelite.client.plugins.account;
|
|||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.client.account.AccountSession;
|
import net.runelite.client.account.AccountSession;
|
||||||
@@ -47,6 +48,7 @@ import net.runelite.client.util.ImageUtil;
|
|||||||
loadWhenOutdated = true
|
loadWhenOutdated = true
|
||||||
)
|
)
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@Singleton
|
||||||
public class AccountPlugin extends Plugin
|
public class AccountPlugin extends Plugin
|
||||||
{
|
{
|
||||||
@Inject
|
@Inject
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.FontTypeFace;
|
import net.runelite.api.FontTypeFace;
|
||||||
@@ -66,6 +67,7 @@ import net.runelite.client.util.Text;
|
|||||||
description = "Display level requirements in Achievement Diary interface",
|
description = "Display level requirements in Achievement Diary interface",
|
||||||
tags = {"achievements", "tasks"}
|
tags = {"achievements", "tasks"}
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
public class DiaryRequirementsPlugin extends Plugin
|
public class DiaryRequirementsPlugin extends Plugin
|
||||||
{
|
{
|
||||||
private static final String AND_JOINER = ", ";
|
private static final String AND_JOINER = ", ";
|
||||||
|
|||||||
@@ -32,45 +32,43 @@ import java.awt.Polygon;
|
|||||||
import java.awt.geom.Area;
|
import java.awt.geom.Area;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.Point;
|
import net.runelite.api.Point;
|
||||||
import net.runelite.api.Tile;
|
import net.runelite.api.Tile;
|
||||||
import net.runelite.api.coords.LocalPoint;
|
|
||||||
import net.runelite.client.game.AgilityShortcut;
|
import net.runelite.client.game.AgilityShortcut;
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
import net.runelite.client.ui.overlay.OverlayUtil;
|
import net.runelite.client.ui.overlay.OverlayUtil;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
class AgilityOverlay extends Overlay
|
class AgilityOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private static final Color SHORTCUT_HIGH_LEVEL_COLOR = Color.ORANGE;
|
private static final Color SHORTCUT_HIGH_LEVEL_COLOR = Color.ORANGE;
|
||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final AgilityPlugin plugin;
|
private final AgilityPlugin plugin;
|
||||||
private final AgilityConfig config;
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private AgilityOverlay(Client client, AgilityPlugin plugin, AgilityConfig config)
|
private AgilityOverlay(final Client client, final AgilityPlugin plugin)
|
||||||
{
|
{
|
||||||
super(plugin);
|
super(plugin);
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
setLayer(OverlayLayer.ABOVE_SCENE);
|
setLayer(OverlayLayer.ABOVE_SCENE);
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.config = config;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Dimension render(Graphics2D graphics)
|
public Dimension render(Graphics2D graphics)
|
||||||
{
|
{
|
||||||
LocalPoint playerLocation = client.getLocalPlayer().getLocalLocation();
|
|
||||||
Point mousePosition = client.getMouseCanvasPosition();
|
Point mousePosition = client.getMouseCanvasPosition();
|
||||||
final List<Tile> marksOfGrace = plugin.getMarksOfGrace();
|
final List<Tile> marksOfGrace = plugin.getMarksOfGrace();
|
||||||
plugin.getObstacles().forEach((object, obstacle) ->
|
plugin.getObstacles().forEach((object, obstacle) ->
|
||||||
{
|
{
|
||||||
if (Obstacles.SHORTCUT_OBSTACLE_IDS.containsKey(object.getId()) && !config.highlightShortcuts() ||
|
if (Obstacles.SHORTCUT_OBSTACLE_IDS.containsKey(object.getId()) && !plugin.isHighlightShortcuts() ||
|
||||||
Obstacles.TRAP_OBSTACLE_IDS.contains(object.getId()) && !config.showTrapOverlay())
|
Obstacles.TRAP_OBSTACLE_IDS.contains(object.getId()) && !plugin.isShowTrapOverlay())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -84,7 +82,7 @@ class AgilityOverlay extends Overlay
|
|||||||
Polygon polygon = object.getCanvasTilePoly();
|
Polygon polygon = object.getCanvasTilePoly();
|
||||||
if (polygon != null)
|
if (polygon != null)
|
||||||
{
|
{
|
||||||
OverlayUtil.renderPolygon(graphics, polygon, config.getTrapColor());
|
OverlayUtil.renderPolygon(graphics, polygon, plugin.getTrapColor());
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -92,10 +90,10 @@ class AgilityOverlay extends Overlay
|
|||||||
if (objectClickbox != null)
|
if (objectClickbox != null)
|
||||||
{
|
{
|
||||||
AgilityShortcut agilityShortcut = obstacle.getShortcut();
|
AgilityShortcut agilityShortcut = obstacle.getShortcut();
|
||||||
Color configColor = agilityShortcut == null || agilityShortcut.getLevel() <= plugin.getAgilityLevel() ? config.getOverlayColor() : SHORTCUT_HIGH_LEVEL_COLOR;
|
Color configColor = agilityShortcut == null || agilityShortcut.getLevel() <= plugin.getAgilityLevel() ? plugin.getOverlayColor() : SHORTCUT_HIGH_LEVEL_COLOR;
|
||||||
if (config.highlightMarks() && !marksOfGrace.isEmpty())
|
if (plugin.isHighlightMarks() && !marksOfGrace.isEmpty())
|
||||||
{
|
{
|
||||||
configColor = config.getMarkColor();
|
configColor = plugin.getMarkColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (objectClickbox.contains(mousePosition.getX(), mousePosition.getY()))
|
if (objectClickbox.contains(mousePosition.getX(), mousePosition.getY()))
|
||||||
@@ -115,7 +113,7 @@ class AgilityOverlay extends Overlay
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (config.highlightMarks() && !marksOfGrace.isEmpty())
|
if (plugin.isHighlightMarks() && !marksOfGrace.isEmpty())
|
||||||
{
|
{
|
||||||
for (Tile markOfGraceTile : marksOfGrace)
|
for (Tile markOfGraceTile : marksOfGrace)
|
||||||
{
|
{
|
||||||
@@ -128,7 +126,7 @@ class AgilityOverlay extends Overlay
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
OverlayUtil.renderPolygon(graphics, poly, config.getMarkColor());
|
OverlayUtil.renderPolygon(graphics, poly, plugin.getMarkColor());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
@@ -83,14 +85,15 @@ import net.runelite.client.util.ColorUtil;
|
|||||||
tags = {"grace", "marks", "overlay", "shortcuts", "skilling", "traps"}
|
tags = {"grace", "marks", "overlay", "shortcuts", "skilling", "traps"}
|
||||||
)
|
)
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@Singleton
|
||||||
public class AgilityPlugin extends Plugin
|
public class AgilityPlugin extends Plugin
|
||||||
{
|
{
|
||||||
private static final int AGILITY_ARENA_REGION_ID = 11157;
|
private static final int AGILITY_ARENA_REGION_ID = 11157;
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final Map<TileObject, Obstacle> obstacles = new HashMap<>();
|
private final Map<TileObject, Obstacle> obstacles = new HashMap<>();
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final List<Tile> marksOfGrace = new ArrayList<>();
|
private final List<Tile> marksOfGrace = new ArrayList<>();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@@ -117,13 +120,13 @@ public class AgilityPlugin extends Plugin
|
|||||||
@Inject
|
@Inject
|
||||||
private ItemManager itemManager;
|
private ItemManager itemManager;
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private AgilitySession session;
|
private AgilitySession session;
|
||||||
|
|
||||||
private int lastAgilityXp;
|
private int lastAgilityXp;
|
||||||
private WorldPoint lastArenaTicketPosition;
|
private WorldPoint lastArenaTicketPosition;
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private int agilityLevel;
|
private int agilityLevel;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@@ -132,9 +135,36 @@ public class AgilityPlugin extends Plugin
|
|||||||
return configManager.getConfig(AgilityConfig.class);
|
return configManager.getConfig(AgilityConfig.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Config values
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showLapCount;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private int lapTimeout;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean lapsToLevel;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean lapsToGoal;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private Color overlayColor;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean highlightMarks;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private Color markColor;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean highlightShortcuts;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showTrapOverlay;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private Color trapColor;
|
||||||
|
private boolean notifyAgilityArena;
|
||||||
|
private boolean showAgilityArenaTimer;
|
||||||
|
private boolean showShortcutLevel;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
|
|
||||||
overlayManager.add(agilityOverlay);
|
overlayManager.add(agilityOverlay);
|
||||||
overlayManager.add(lapCounterOverlay);
|
overlayManager.add(lapCounterOverlay);
|
||||||
agilityLevel = client.getBoostedSkillLevel(Skill.AGILITY);
|
agilityLevel = client.getBoostedSkillLevel(Skill.AGILITY);
|
||||||
@@ -179,16 +209,40 @@ public class AgilityPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onConfigChanged(ConfigChanged event)
|
public void onConfigChanged(ConfigChanged event)
|
||||||
{
|
{
|
||||||
if (!config.showAgilityArenaTimer())
|
if (!event.getGroup().equals("agility"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
updateConfig();
|
||||||
|
|
||||||
|
if (!this.showAgilityArenaTimer)
|
||||||
{
|
{
|
||||||
removeAgilityArenaTimer();
|
removeAgilityArenaTimer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateConfig()
|
||||||
|
{
|
||||||
|
this.showLapCount = config.showLapCount();
|
||||||
|
this.lapTimeout = config.lapTimeout();
|
||||||
|
this.lapsToLevel = config.lapsToLevel();
|
||||||
|
this.lapsToGoal = config.lapsToGoal();
|
||||||
|
this.overlayColor = config.getOverlayColor();
|
||||||
|
this.highlightMarks = config.highlightMarks();
|
||||||
|
this.markColor = config.getMarkColor();
|
||||||
|
this.highlightShortcuts = config.highlightShortcuts();
|
||||||
|
this.showTrapOverlay = config.showTrapOverlay();
|
||||||
|
this.trapColor = config.getTrapColor();
|
||||||
|
this.notifyAgilityArena = config.notifyAgilityArena();
|
||||||
|
this.showAgilityArenaTimer = config.showAgilityArenaTimer();
|
||||||
|
this.showShortcutLevel = config.showShortcutLevel();
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onExperienceChanged(ExperienceChanged event)
|
public void onExperienceChanged(ExperienceChanged event)
|
||||||
{
|
{
|
||||||
if (event.getSkill() != AGILITY || !config.showLapCount())
|
if (event.getSkill() != AGILITY || !this.showLapCount)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -272,12 +326,12 @@ public class AgilityPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
log.debug("Ticked position moved from {} to {}", oldTickPosition, newTicketPosition);
|
log.debug("Ticked position moved from {} to {}", oldTickPosition, newTicketPosition);
|
||||||
|
|
||||||
if (config.notifyAgilityArena())
|
if (this.notifyAgilityArena)
|
||||||
{
|
{
|
||||||
notifier.notify("Ticket location changed");
|
notifier.notify("Ticket location changed");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.showAgilityArenaTimer())
|
if (this.showAgilityArenaTimer)
|
||||||
{
|
{
|
||||||
showNewAgilityArenaTimer();
|
showNewAgilityArenaTimer();
|
||||||
}
|
}
|
||||||
@@ -430,7 +484,7 @@ public class AgilityPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||||
{
|
{
|
||||||
if (!config.showShortcutLevel())
|
if (!this.showShortcutLevel)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class AgilitySession
|
|||||||
private int lapsTillLevel;
|
private int lapsTillLevel;
|
||||||
private int lapsTillGoal;
|
private int lapsTillGoal;
|
||||||
|
|
||||||
AgilitySession(Courses course)
|
AgilitySession(final Courses course)
|
||||||
{
|
{
|
||||||
this.course = course;
|
this.course = course;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ package net.runelite.client.plugins.agility;
|
|||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.api.coords.WorldPoint;
|
import net.runelite.api.coords.WorldPoint;
|
||||||
|
|
||||||
@@ -50,16 +51,16 @@ enum Courses
|
|||||||
|
|
||||||
private final static Map<Integer, Courses> coursesByRegion;
|
private final static Map<Integer, Courses> coursesByRegion;
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final double totalXp;
|
private final double totalXp;
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final int lastObstacleXp;
|
private final int lastObstacleXp;
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final int regionId;
|
private final int regionId;
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final WorldPoint[] courseEndWorldPoints;
|
private final WorldPoint[] courseEndWorldPoints;
|
||||||
|
|
||||||
static
|
static
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import java.awt.Graphics2D;
|
|||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
|
import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
|
||||||
@@ -39,21 +40,20 @@ import net.runelite.client.ui.overlay.components.PanelComponent;
|
|||||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
class LapCounterOverlay extends Overlay
|
class LapCounterOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private final AgilityPlugin plugin;
|
private final AgilityPlugin plugin;
|
||||||
private final AgilityConfig config;
|
|
||||||
|
|
||||||
private final PanelComponent panelComponent = new PanelComponent();
|
private final PanelComponent panelComponent = new PanelComponent();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private LapCounterOverlay(AgilityPlugin plugin, AgilityConfig config)
|
private LapCounterOverlay(final AgilityPlugin plugin)
|
||||||
{
|
{
|
||||||
super(plugin);
|
super(plugin);
|
||||||
setPosition(OverlayPosition.TOP_LEFT);
|
setPosition(OverlayPosition.TOP_LEFT);
|
||||||
setPriority(OverlayPriority.LOW);
|
setPriority(OverlayPriority.LOW);
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.config = config;
|
|
||||||
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Agility overlay"));
|
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Agility overlay"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ class LapCounterOverlay extends Overlay
|
|||||||
{
|
{
|
||||||
AgilitySession session = plugin.getSession();
|
AgilitySession session = plugin.getSession();
|
||||||
|
|
||||||
if (!config.showLapCount() ||
|
if (!plugin.isShowLapCount() ||
|
||||||
session == null ||
|
session == null ||
|
||||||
session.getLastLapCompleted() == null ||
|
session.getLastLapCompleted() == null ||
|
||||||
session.getCourse() == null)
|
session.getCourse() == null)
|
||||||
@@ -70,7 +70,7 @@ class LapCounterOverlay extends Overlay
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Duration lapTimeout = Duration.ofMinutes(config.lapTimeout());
|
Duration lapTimeout = Duration.ofMinutes(plugin.getLapTimeout());
|
||||||
Duration sinceLap = Duration.between(session.getLastLapCompleted(), Instant.now());
|
Duration sinceLap = Duration.between(session.getLastLapCompleted(), Instant.now());
|
||||||
|
|
||||||
if (sinceLap.compareTo(lapTimeout) >= 0)
|
if (sinceLap.compareTo(lapTimeout) >= 0)
|
||||||
@@ -85,12 +85,12 @@ class LapCounterOverlay extends Overlay
|
|||||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||||
tableComponent.addRow("Total Laps:", Integer.toString(session.getTotalLaps()));
|
tableComponent.addRow("Total Laps:", Integer.toString(session.getTotalLaps()));
|
||||||
|
|
||||||
if (config.lapsToLevel() && session.getLapsTillLevel() > 0)
|
if (plugin.isLapsToLevel() && session.getLapsTillLevel() > 0)
|
||||||
{
|
{
|
||||||
tableComponent.addRow("Laps until level:", Integer.toString(session.getLapsTillLevel()));
|
tableComponent.addRow("Laps until level:", Integer.toString(session.getLapsTillLevel()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.lapsToGoal() && session.getLapsTillGoal() > 0)
|
if (plugin.isLapsToGoal() && session.getLapsTillGoal() > 0)
|
||||||
{
|
{
|
||||||
tableComponent.addRow("Laps until goal:", Integer.toString(session.getLapsTillGoal()));
|
tableComponent.addRow("Laps until goal:", Integer.toString(session.getLapsTillGoal()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class HydraOverlay extends Overlay
|
|||||||
private final PanelComponent panelComponent = new PanelComponent();
|
private final PanelComponent panelComponent = new PanelComponent();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
HydraOverlay(HydraPlugin plugin, Client client, SpriteManager spriteManager)
|
HydraOverlay(final HydraPlugin plugin, final Client client, final SpriteManager spriteManager)
|
||||||
{
|
{
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.client = client;
|
this.client = client;
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import java.util.HashSet;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -59,6 +60,7 @@ import net.runelite.client.ui.overlay.OverlayManager;
|
|||||||
enabledByDefault = false
|
enabledByDefault = false
|
||||||
)
|
)
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@Singleton
|
||||||
public class HydraPlugin extends Plugin
|
public class HydraPlugin extends Plugin
|
||||||
{
|
{
|
||||||
@Getter(AccessLevel.PACKAGE)
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class HydraSceneOverlay extends Overlay
|
|||||||
private final Client client;
|
private final Client client;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public HydraSceneOverlay(Client client, HydraPlugin plugin)
|
public HydraSceneOverlay(final Client client, final HydraPlugin plugin)
|
||||||
{
|
{
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
setLayer(OverlayLayer.UNDER_WIDGETS);
|
setLayer(OverlayLayer.UNDER_WIDGETS);
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import java.math.BigDecimal;
|
|||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
import net.runelite.client.ui.overlay.infobox.Counter;
|
import net.runelite.client.ui.overlay.infobox.Counter;
|
||||||
@@ -36,7 +37,7 @@ import net.runelite.client.util.StackFormatter;
|
|||||||
|
|
||||||
class AmmoCounter extends Counter
|
class AmmoCounter extends Counter
|
||||||
{
|
{
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private int itemID;
|
private int itemID;
|
||||||
private String name;
|
private String name;
|
||||||
private int total;
|
private int total;
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ package net.runelite.client.plugins.ammo;
|
|||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.EquipmentInventorySlot;
|
import net.runelite.api.EquipmentInventorySlot;
|
||||||
import net.runelite.api.InventoryID;
|
import net.runelite.api.InventoryID;
|
||||||
@@ -45,6 +46,7 @@ import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
|||||||
description = "Shows the current ammo the player has equipped",
|
description = "Shows the current ammo the player has equipped",
|
||||||
tags = {"bolts", "darts", "chinchompa", "equipment"}
|
tags = {"bolts", "darts", "chinchompa", "equipment"}
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
public class AmmoPlugin extends Plugin
|
public class AmmoPlugin extends Plugin
|
||||||
{
|
{
|
||||||
@Inject
|
@Inject
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ package net.runelite.client.plugins.animsmoothing;
|
|||||||
|
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.events.ConfigChanged;
|
import net.runelite.api.events.ConfigChanged;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
@@ -39,6 +40,7 @@ import net.runelite.client.plugins.PluginDescriptor;
|
|||||||
tags = {"npcs", "objects", "players"},
|
tags = {"npcs", "objects", "players"},
|
||||||
enabledByDefault = false
|
enabledByDefault = false
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
public class AnimationSmoothingPlugin extends Plugin
|
public class AnimationSmoothingPlugin extends Plugin
|
||||||
{
|
{
|
||||||
static final String CONFIG_GROUP = "animationSmoothing";
|
static final String CONFIG_GROUP = "animationSmoothing";
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ import net.runelite.client.config.ModifierlessKeybind;
|
|||||||
@ConfigGroup("antiDrag")
|
@ConfigGroup("antiDrag")
|
||||||
public interface AntiDragConfig extends Config
|
public interface AntiDragConfig extends Config
|
||||||
{
|
{
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 0,
|
position = 0,
|
||||||
keyName = "alwaysOn",
|
keyName = "alwaysOn",
|
||||||
|
|||||||
@@ -42,13 +42,13 @@ public class AntiDragOverlay extends Overlay
|
|||||||
{
|
{
|
||||||
private static final int RADIUS = 20;
|
private static final int RADIUS = 20;
|
||||||
|
|
||||||
private Client client;
|
private final Client client;
|
||||||
private AntiDragConfig config;
|
private final AntiDragPlugin plugin;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private AntiDragOverlay(Client client, AntiDragConfig config)
|
private AntiDragOverlay(final Client client, final AntiDragPlugin plugin)
|
||||||
{
|
{
|
||||||
this.config = config;
|
this.plugin = plugin;
|
||||||
this.client = client;
|
this.client = client;
|
||||||
setPosition(OverlayPosition.TOOLTIP);
|
setPosition(OverlayPosition.TOOLTIP);
|
||||||
setPriority(OverlayPriority.HIGHEST);
|
setPriority(OverlayPriority.HIGHEST);
|
||||||
@@ -58,7 +58,7 @@ public class AntiDragOverlay extends Overlay
|
|||||||
@Override
|
@Override
|
||||||
public Dimension render(Graphics2D g)
|
public Dimension render(Graphics2D g)
|
||||||
{
|
{
|
||||||
final Color color = config.color();
|
final Color color = plugin.getColor();
|
||||||
g.setColor(color);
|
g.setColor(color);
|
||||||
|
|
||||||
final net.runelite.api.Point mouseCanvasPosition = client.getMouseCanvasPosition();
|
final net.runelite.api.Point mouseCanvasPosition = client.getMouseCanvasPosition();
|
||||||
|
|||||||
@@ -26,11 +26,16 @@
|
|||||||
package net.runelite.client.plugins.antidrag;
|
package net.runelite.client.plugins.antidrag;
|
||||||
|
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
|
import java.awt.Color;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.Getter;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.events.ConfigChanged;
|
import net.runelite.api.events.ConfigChanged;
|
||||||
import net.runelite.api.events.FocusChanged;
|
import net.runelite.api.events.FocusChanged;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
|
import net.runelite.client.config.Keybind;
|
||||||
import net.runelite.client.eventbus.Subscribe;
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
import net.runelite.client.input.KeyManager;
|
import net.runelite.client.input.KeyManager;
|
||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
@@ -48,11 +53,11 @@ import net.runelite.client.util.HotkeyListener;
|
|||||||
type = PluginType.UTILITY,
|
type = PluginType.UTILITY,
|
||||||
enabledByDefault = false
|
enabledByDefault = false
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
public class AntiDragPlugin extends Plugin
|
public class AntiDragPlugin extends Plugin
|
||||||
{
|
{
|
||||||
private static final int DEFAULT_DELAY = 5;
|
private static final int DEFAULT_DELAY = 5;
|
||||||
|
|
||||||
private boolean toggleDrag;
|
private boolean toggleDrag;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@@ -82,14 +87,27 @@ public class AntiDragPlugin extends Plugin
|
|||||||
return configManager.getConfig(AntiDragConfig.class);
|
return configManager.getConfig(AntiDragConfig.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean alwaysOn;
|
||||||
|
private boolean keybind;
|
||||||
|
private Keybind key;
|
||||||
|
private int dragDelay;
|
||||||
|
private boolean reqfocus;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean configOverlay;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private Color color;
|
||||||
|
private boolean changeCursor;
|
||||||
|
private CustomCursor selectedCursor;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
if (config.keybind())
|
updateConfig();
|
||||||
|
if (this.keybind)
|
||||||
{
|
{
|
||||||
keyManager.registerKeyListener(hotkeyListener);
|
keyManager.registerKeyListener(hotkeyListener);
|
||||||
}
|
}
|
||||||
client.setInventoryDragDelay(config.alwaysOn() ? config.dragDelay() : DEFAULT_DELAY);
|
client.setInventoryDragDelay(this.alwaysOn ? this.dragDelay : DEFAULT_DELAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -106,9 +124,11 @@ public class AntiDragPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (event.getGroup().equals("antiDrag"))
|
if (event.getGroup().equals("antiDrag"))
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
|
|
||||||
if (event.getKey().equals("keybind"))
|
if (event.getKey().equals("keybind"))
|
||||||
{
|
{
|
||||||
if (config.keybind())
|
if (this.keybind)
|
||||||
{
|
{
|
||||||
keyManager.registerKeyListener(hotkeyListener);
|
keyManager.registerKeyListener(hotkeyListener);
|
||||||
}
|
}
|
||||||
@@ -119,17 +139,30 @@ public class AntiDragPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
if (event.getKey().equals("alwaysOn"))
|
if (event.getKey().equals("alwaysOn"))
|
||||||
{
|
{
|
||||||
client.setInventoryDragDelay(config.alwaysOn() ? config.dragDelay() : DEFAULT_DELAY);
|
client.setInventoryDragDelay(this.alwaysOn ? this.dragDelay : DEFAULT_DELAY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateConfig()
|
||||||
|
{
|
||||||
|
this.alwaysOn = config.alwaysOn();
|
||||||
|
this.keybind = config.keybind();
|
||||||
|
this.key = config.key();
|
||||||
|
this.dragDelay = config.dragDelay();
|
||||||
|
this.reqfocus = config.reqfocus();
|
||||||
|
this.configOverlay = config.overlay();
|
||||||
|
this.color = config.color();
|
||||||
|
this.changeCursor = config.changeCursor();
|
||||||
|
this.selectedCursor = config.selectedCursor();
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onFocusChanged(FocusChanged focusChanged)
|
public void onFocusChanged(FocusChanged focusChanged)
|
||||||
{
|
{
|
||||||
if (!config.alwaysOn())
|
if (!this.alwaysOn)
|
||||||
{
|
{
|
||||||
if (!focusChanged.isFocused() && config.reqfocus())
|
if (!focusChanged.isFocused() && this.reqfocus)
|
||||||
{
|
{
|
||||||
client.setInventoryDragDelay(DEFAULT_DELAY);
|
client.setInventoryDragDelay(DEFAULT_DELAY);
|
||||||
overlayManager.remove(overlay);
|
overlayManager.remove(overlay);
|
||||||
@@ -137,33 +170,32 @@ public class AntiDragPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final HotkeyListener hotkeyListener = new HotkeyListener(() -> config.key())
|
private final HotkeyListener hotkeyListener = new HotkeyListener(() -> this.key)
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void hotkeyPressed()
|
public void hotkeyPressed()
|
||||||
{
|
{
|
||||||
if (!config.alwaysOn())
|
if (!alwaysOn)
|
||||||
{
|
{
|
||||||
toggleDrag = !toggleDrag;
|
toggleDrag = !toggleDrag;
|
||||||
if (toggleDrag)
|
if (toggleDrag)
|
||||||
{
|
{
|
||||||
if (config.overlay())
|
if (configOverlay)
|
||||||
{
|
{
|
||||||
overlayManager.add(overlay);
|
overlayManager.add(overlay);
|
||||||
}
|
}
|
||||||
if (config.changeCursor())
|
if (changeCursor)
|
||||||
{
|
{
|
||||||
CustomCursor selectedCursor = config.selectedCursor();
|
|
||||||
clientUI.setCursor(selectedCursor.getCursorImage(), selectedCursor.toString());
|
clientUI.setCursor(selectedCursor.getCursorImage(), selectedCursor.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
client.setInventoryDragDelay(config.dragDelay());
|
client.setInventoryDragDelay(dragDelay);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
overlayManager.remove(overlay);
|
overlayManager.remove(overlay);
|
||||||
client.setInventoryDragDelay(DEFAULT_DELAY);
|
client.setInventoryDragDelay(DEFAULT_DELAY);
|
||||||
if (config.changeCursor())
|
if (changeCursor)
|
||||||
{
|
{
|
||||||
net.runelite.client.plugins.customcursor.CustomCursor selectedCursor = configManager.getConfig(CustomCursorConfig.class).selectedCursor();
|
net.runelite.client.plugins.customcursor.CustomCursor selectedCursor = configManager.getConfig(CustomCursorConfig.class).selectedCursor();
|
||||||
clientUI.setCursor(selectedCursor.getCursorImage(), selectedCursor.toString());
|
clientUI.setCursor(selectedCursor.getCursorImage(), selectedCursor.toString());
|
||||||
@@ -172,4 +204,4 @@ public class AntiDragPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -25,6 +25,7 @@
|
|||||||
package net.runelite.client.plugins.antidrag;
|
package net.runelite.client.plugins.antidrag;
|
||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.client.plugins.customcursor.CustomCursorPlugin;
|
import net.runelite.client.plugins.customcursor.CustomCursorPlugin;
|
||||||
import net.runelite.client.util.ImageUtil;
|
import net.runelite.client.util.ImageUtil;
|
||||||
@@ -43,7 +44,8 @@ public enum CustomCursor
|
|||||||
ZAMORAK_GODSWORD("Zamorak Godsword", "cursor-zamorak-godsword.png");
|
ZAMORAK_GODSWORD("Zamorak Godsword", "cursor-zamorak-godsword.png");
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
@Getter
|
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final BufferedImage cursorImage;
|
private final BufferedImage cursorImage;
|
||||||
|
|
||||||
CustomCursor(String name, String icon)
|
CustomCursor(String name, String icon)
|
||||||
|
|||||||
@@ -28,11 +28,12 @@
|
|||||||
package net.runelite.client.plugins.aoewarnings;
|
package net.runelite.client.plugins.aoewarnings;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.api.coords.LocalPoint;
|
import net.runelite.api.coords.LocalPoint;
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
class AoeProjectile
|
class AoeProjectile
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import java.time.Instant;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.Perspective;
|
import net.runelite.api.Perspective;
|
||||||
import net.runelite.api.Point;
|
import net.runelite.api.Point;
|
||||||
@@ -48,6 +49,7 @@ import net.runelite.client.ui.overlay.OverlayPosition;
|
|||||||
import net.runelite.client.ui.overlay.OverlayUtil;
|
import net.runelite.client.ui.overlay.OverlayUtil;
|
||||||
import static net.runelite.client.util.ColorUtil.setAlphaComponent;
|
import static net.runelite.client.util.ColorUtil.setAlphaComponent;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class AoeWarningOverlay extends Overlay
|
public class AoeWarningOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private static final int FILL_START_ALPHA = 25;
|
private static final int FILL_START_ALPHA = 25;
|
||||||
@@ -55,16 +57,14 @@ public class AoeWarningOverlay extends Overlay
|
|||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final AoeWarningPlugin plugin;
|
private final AoeWarningPlugin plugin;
|
||||||
private final AoeWarningConfig config;
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public AoeWarningOverlay(Client client, AoeWarningPlugin plugin, AoeWarningConfig config)
|
public AoeWarningOverlay(final Client client, final AoeWarningPlugin plugin)
|
||||||
{
|
{
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
setLayer(OverlayLayer.UNDER_WIDGETS);
|
setLayer(OverlayLayer.UNDER_WIDGETS);
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.config = config;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -115,7 +115,7 @@ public class AoeWarningOverlay extends Overlay
|
|||||||
int tickProgress = aoeProjectile.getFinalTick() - client.getTickCount();
|
int tickProgress = aoeProjectile.getFinalTick() - client.getTickCount();
|
||||||
|
|
||||||
int fillAlpha, outlineAlpha;
|
int fillAlpha, outlineAlpha;
|
||||||
if (config.isFadeEnabled())
|
if (plugin.isConfigFadeEnabled())
|
||||||
{
|
{
|
||||||
fillAlpha = (int) ((1 - progress) * FILL_START_ALPHA);//alpha drop off over lifetime
|
fillAlpha = (int) ((1 - progress) * FILL_START_ALPHA);//alpha drop off over lifetime
|
||||||
outlineAlpha = (int) ((1 - progress) * OUTLINE_START_ALPHA);
|
outlineAlpha = (int) ((1 - progress) * OUTLINE_START_ALPHA);
|
||||||
@@ -152,12 +152,12 @@ public class AoeWarningOverlay extends Overlay
|
|||||||
outlineAlpha = 255;
|
outlineAlpha = 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.isOutlineEnabled())
|
if (plugin.isConfigOutlineEnabled())
|
||||||
{
|
{
|
||||||
graphics.setColor(new Color(setAlphaComponent(config.overlayColor().getRGB(), outlineAlpha), true));
|
graphics.setColor(new Color(setAlphaComponent(plugin.getOverlayColor().getRGB(), outlineAlpha), true));
|
||||||
graphics.drawPolygon(tilePoly);
|
graphics.drawPolygon(tilePoly);
|
||||||
}
|
}
|
||||||
if (config.tickTimers())
|
if (plugin.isTickTimers())
|
||||||
{
|
{
|
||||||
if (tickProgress >= 0)
|
if (tickProgress >= 0)
|
||||||
{
|
{
|
||||||
@@ -165,7 +165,7 @@ public class AoeWarningOverlay extends Overlay
|
|||||||
plugin.getFontStyle(), color, centerPoint(tilePoly.getBounds()), plugin.isShadows(), 0);
|
plugin.getFontStyle(), color, centerPoint(tilePoly.getBounds()), plugin.isShadows(), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
graphics.setColor(new Color(setAlphaComponent(config.overlayColor().getRGB(), fillAlpha), true));
|
graphics.setColor(new Color(setAlphaComponent(plugin.getOverlayColor().getRGB(), fillAlpha), true));
|
||||||
graphics.fillPolygon(tilePoly);
|
graphics.fillPolygon(tilePoly);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ package net.runelite.client.plugins.aoewarnings;
|
|||||||
|
|
||||||
|
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
|
import java.awt.Color;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -35,6 +36,7 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -70,12 +72,13 @@ import net.runelite.client.ui.overlay.OverlayManager;
|
|||||||
type = PluginType.PVM,
|
type = PluginType.PVM,
|
||||||
enabledByDefault = false
|
enabledByDefault = false
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class AoeWarningPlugin extends Plugin
|
public class AoeWarningPlugin extends Plugin
|
||||||
{
|
{
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final Map<WorldPoint, CrystalBomb> bombs = new HashMap<>();
|
private final Map<WorldPoint, CrystalBomb> bombs = new HashMap<>();
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final Map<Projectile, AoeProjectile> projectiles = new HashMap<>();
|
private final Map<Projectile, AoeProjectile> projectiles = new HashMap<>();
|
||||||
@Inject
|
@Inject
|
||||||
public AoeWarningConfig config;
|
public AoeWarningConfig config;
|
||||||
@@ -97,12 +100,6 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
private List<WorldPoint> CrystalSpike = new ArrayList<>();
|
private List<WorldPoint> CrystalSpike = new ArrayList<>();
|
||||||
@Getter(AccessLevel.PACKAGE)
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private List<WorldPoint> WintertodtSnowFall = new ArrayList<>();
|
private List<WorldPoint> WintertodtSnowFall = new ArrayList<>();
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private boolean shadows;
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private int textSize;
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private int fontStyle;
|
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
AoeWarningConfig getConfig(ConfigManager configManager)
|
AoeWarningConfig getConfig(ConfigManager configManager)
|
||||||
@@ -110,17 +107,73 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
return configManager.getConfig(AoeWarningConfig.class);
|
return configManager.getConfig(AoeWarningConfig.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<Projectile, AoeProjectile> getProjectiles()
|
// Config values
|
||||||
{
|
private boolean aoeNotifyAll;
|
||||||
return projectiles;
|
@Getter(AccessLevel.PACKAGE)
|
||||||
}
|
private Color overlayColor;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean configOutlineEnabled;
|
||||||
|
private int delay;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean configFadeEnabled;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean tickTimers;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private int fontStyle;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private int textSize;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean shadows;
|
||||||
|
private boolean configShamansEnabled;
|
||||||
|
private boolean configShamansNotifyEnabled;
|
||||||
|
private boolean configArchaeologistEnabled;
|
||||||
|
private boolean configArchaeologistNotifyEnabled;
|
||||||
|
private boolean configIceDemonEnabled;
|
||||||
|
private boolean configIceDemonNotifyEnabled;
|
||||||
|
private boolean configVasaEnabled;
|
||||||
|
private boolean configVasaNotifyEnabled;
|
||||||
|
private boolean configTektonEnabled;
|
||||||
|
private boolean configTektonNotifyEnabled;
|
||||||
|
private boolean configVorkathEnabled;
|
||||||
|
private boolean configVorkathNotifyEnabled;
|
||||||
|
private boolean configGalvekEnabled;
|
||||||
|
private boolean configGalvekNotifyEnabled;
|
||||||
|
private boolean configGargBossEnabled;
|
||||||
|
private boolean configGargBossNotifyEnabled;
|
||||||
|
private boolean configVetionEnabled;
|
||||||
|
private boolean configVetionNotifyEnabled;
|
||||||
|
private boolean configChaosFanaticEnabled;
|
||||||
|
private boolean configChaosFanaticNotifyEnabled;
|
||||||
|
private boolean configOlmEnabled;
|
||||||
|
private boolean configOlmNotifyEnabled;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean configbombDisplay;
|
||||||
|
private boolean configbombDisplayNotifyEnabled;
|
||||||
|
private boolean configLightningTrail;
|
||||||
|
private boolean configLightningTrailNotifyEnabled;
|
||||||
|
private boolean configCorpEnabled;
|
||||||
|
private boolean configCorpNotifyEnabled;
|
||||||
|
private boolean configWintertodtEnabled;
|
||||||
|
private boolean configWintertodtNotifyEnabled;
|
||||||
|
private boolean configXarpusEnabled;
|
||||||
|
private boolean configXarpusNotifyEnabled;
|
||||||
|
private boolean configaddyDrags;
|
||||||
|
private boolean configaddyDragsNotifyEnabled;
|
||||||
|
private boolean configDrakeEnabled;
|
||||||
|
private boolean configDrakeNotifyEnabled;
|
||||||
|
private boolean configCerbFireEnabled;
|
||||||
|
private boolean configCerbFireNotifyEnabled;
|
||||||
|
private boolean configDemonicGorillaEnabled;
|
||||||
|
private boolean configDemonicGorillaNotifyEnabled;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
|
|
||||||
overlayManager.add(coreOverlay);
|
overlayManager.add(coreOverlay);
|
||||||
overlayManager.add(bombOverlay);
|
overlayManager.add(bombOverlay);
|
||||||
reset(true);
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -128,7 +181,7 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
overlayManager.remove(coreOverlay);
|
overlayManager.remove(coreOverlay);
|
||||||
overlayManager.remove(bombOverlay);
|
overlayManager.remove(bombOverlay);
|
||||||
reset(false);
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
@@ -139,18 +192,7 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (event.getKey())
|
updateConfig();
|
||||||
{
|
|
||||||
case "fontStyle":
|
|
||||||
fontStyle = config.fontStyle().getFont();
|
|
||||||
break;
|
|
||||||
case "textSize":
|
|
||||||
textSize = config.textSize();
|
|
||||||
break;
|
|
||||||
case "shadows":
|
|
||||||
shadows = config.shadows();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
@@ -159,7 +201,7 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
Projectile projectile = event.getProjectile();
|
Projectile projectile = event.getProjectile();
|
||||||
|
|
||||||
int projectileId = projectile.getId();
|
int projectileId = projectile.getId();
|
||||||
int projectileLifetime = config.delay() + (projectile.getRemainingCycles() * 20);
|
int projectileLifetime = this.delay + (projectile.getRemainingCycles() * 20);
|
||||||
int ticksRemaining = projectile.getRemainingCycles() / 30;
|
int ticksRemaining = projectile.getRemainingCycles() / 30;
|
||||||
if (!isTickTimersEnabledForProjectileID(projectileId))
|
if (!isTickTimersEnabledForProjectileID(projectileId))
|
||||||
{
|
{
|
||||||
@@ -174,7 +216,7 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
AoeProjectile aoeProjectile = new AoeProjectile(Instant.now(), targetPoint, aoeProjectileInfo, projectileLifetime, tickCycle);
|
AoeProjectile aoeProjectile = new AoeProjectile(Instant.now(), targetPoint, aoeProjectileInfo, projectileLifetime, tickCycle);
|
||||||
projectiles.put(projectile, aoeProjectile);
|
projectiles.put(projectile, aoeProjectile);
|
||||||
|
|
||||||
if (config.aoeNotifyAll() || isConfigEnabledForProjectileId(projectileId, true))
|
if (this.aoeNotifyAll || isConfigEnabledForProjectileId(projectileId, true))
|
||||||
{
|
{
|
||||||
notifier.notify("AoE attack detected!");
|
notifier.notify("AoE attack detected!");
|
||||||
}
|
}
|
||||||
@@ -192,7 +234,7 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
case ObjectID.CRYSTAL_BOMB:
|
case ObjectID.CRYSTAL_BOMB:
|
||||||
bombs.put(wp, new CrystalBomb(gameObject, client.getTickCount()));
|
bombs.put(wp, new CrystalBomb(gameObject, client.getTickCount()));
|
||||||
|
|
||||||
if (config.aoeNotifyAll() || config.bombDisplayNotifyEnabled())
|
if (this.aoeNotifyAll || this.configbombDisplayNotifyEnabled)
|
||||||
{
|
{
|
||||||
notifier.notify("Bomb!");
|
notifier.notify("Bomb!");
|
||||||
}
|
}
|
||||||
@@ -205,11 +247,11 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
break;
|
break;
|
||||||
case NullObjectID.NULL_26690:
|
case NullObjectID.NULL_26690:
|
||||||
//Wintertodt Snowfall
|
//Wintertodt Snowfall
|
||||||
if (config.isWintertodtEnabled())
|
if (this.configWintertodtEnabled)
|
||||||
{
|
{
|
||||||
WintertodtSnowFall.add(wp);
|
WintertodtSnowFall.add(wp);
|
||||||
|
|
||||||
if (config.aoeNotifyAll() || config.isWintertodtNotifyEnabled())
|
if (this.aoeNotifyAll || this.configWintertodtNotifyEnabled)
|
||||||
{
|
{
|
||||||
notifier.notify("Snow Fall!");
|
notifier.notify("Snow Fall!");
|
||||||
}
|
}
|
||||||
@@ -236,7 +278,7 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
break;
|
break;
|
||||||
case NullObjectID.NULL_26690:
|
case NullObjectID.NULL_26690:
|
||||||
//Wintertodt Snowfall
|
//Wintertodt Snowfall
|
||||||
if (config.isWintertodtEnabled())
|
if (this.configWintertodtEnabled)
|
||||||
{
|
{
|
||||||
WintertodtSnowFall.remove(wp);
|
WintertodtSnowFall.remove(wp);
|
||||||
}
|
}
|
||||||
@@ -256,7 +298,7 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onGameTick(GameTick event)
|
public void onGameTick(GameTick event)
|
||||||
{
|
{
|
||||||
if (config.LightningTrail())
|
if (this.configLightningTrail)
|
||||||
{
|
{
|
||||||
LightningTrail.clear();
|
LightningTrail.clear();
|
||||||
for (GraphicsObject o : client.getGraphicsObjects())
|
for (GraphicsObject o : client.getGraphicsObjects())
|
||||||
@@ -265,7 +307,7 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
LightningTrail.add(WorldPoint.fromLocal(client, o.getLocation()));
|
LightningTrail.add(WorldPoint.fromLocal(client, o.getLocation()));
|
||||||
|
|
||||||
if (config.aoeNotifyAll() || config.LightningTrailNotifyEnabled())
|
if (this.aoeNotifyAll || this.configLightningTrailNotifyEnabled)
|
||||||
{
|
{
|
||||||
notifier.notify("Lightning!");
|
notifier.notify("Lightning!");
|
||||||
}
|
}
|
||||||
@@ -350,7 +392,7 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notify && config.aoeNotifyAll())
|
if (notify && this.aoeNotifyAll)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -358,57 +400,110 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
switch (projectileInfo)
|
switch (projectileInfo)
|
||||||
{
|
{
|
||||||
case LIZARDMAN_SHAMAN_AOE:
|
case LIZARDMAN_SHAMAN_AOE:
|
||||||
return notify ? config.isShamansNotifyEnabled() : config.isShamansEnabled();
|
return notify ? this.configShamansNotifyEnabled : this.configShamansEnabled;
|
||||||
case CRAZY_ARCHAEOLOGIST_AOE:
|
case CRAZY_ARCHAEOLOGIST_AOE:
|
||||||
return notify ? config.isArchaeologistNotifyEnabled() : config.isArchaeologistEnabled();
|
return notify ? this.configArchaeologistNotifyEnabled : this.configArchaeologistEnabled;
|
||||||
case ICE_DEMON_RANGED_AOE:
|
case ICE_DEMON_RANGED_AOE:
|
||||||
case ICE_DEMON_ICE_BARRAGE_AOE:
|
case ICE_DEMON_ICE_BARRAGE_AOE:
|
||||||
return notify ? config.isIceDemonNotifyEnabled() : config.isIceDemonEnabled();
|
return notify ? this.configIceDemonNotifyEnabled : this.configIceDemonEnabled;
|
||||||
case VASA_AWAKEN_AOE:
|
case VASA_AWAKEN_AOE:
|
||||||
case VASA_RANGED_AOE:
|
case VASA_RANGED_AOE:
|
||||||
return notify ? config.isVasaNotifyEnabled() : config.isVasaEnabled();
|
return notify ? this.configVasaNotifyEnabled : this.configVasaEnabled;
|
||||||
case TEKTON_METEOR_AOE:
|
case TEKTON_METEOR_AOE:
|
||||||
return notify ? config.isTektonNotifyEnabled() : config.isTektonEnabled();
|
return notify ? this.configTektonNotifyEnabled : this.configTektonEnabled;
|
||||||
case VORKATH_BOMB:
|
case VORKATH_BOMB:
|
||||||
case VORKATH_POISON_POOL:
|
case VORKATH_POISON_POOL:
|
||||||
case VORKATH_SPAWN:
|
case VORKATH_SPAWN:
|
||||||
case VORKATH_TICK_FIRE:
|
case VORKATH_TICK_FIRE:
|
||||||
return notify ? config.isVorkathNotifyEnabled() : config.isVorkathEnabled();
|
return notify ? this.configVorkathNotifyEnabled : this.configVorkathEnabled;
|
||||||
case VETION_LIGHTNING:
|
case VETION_LIGHTNING:
|
||||||
return notify ? config.isVetionNotifyEnabled() : config.isVetionEnabled();
|
return notify ? this.configVetionNotifyEnabled : this.configVetionEnabled;
|
||||||
case CHAOS_FANATIC:
|
case CHAOS_FANATIC:
|
||||||
return notify ? config.isChaosFanaticNotifyEnabled() : config.isChaosFanaticEnabled();
|
return notify ? this.configChaosFanaticNotifyEnabled : this.configChaosFanaticEnabled;
|
||||||
case GALVEK_BOMB:
|
case GALVEK_BOMB:
|
||||||
case GALVEK_MINE:
|
case GALVEK_MINE:
|
||||||
return notify ? config.isGalvekNotifyEnabled() : config.isGalvekEnabled();
|
return notify ? this.configGalvekNotifyEnabled : this.configGalvekEnabled;
|
||||||
case DAWN_FREEZE:
|
case DAWN_FREEZE:
|
||||||
case DUSK_CEILING:
|
case DUSK_CEILING:
|
||||||
return notify ? config.isGargBossNotifyEnabled() : config.isGargBossEnabled();
|
return notify ? this.configGargBossNotifyEnabled : this.configGargBossEnabled;
|
||||||
case OLM_FALLING_CRYSTAL:
|
case OLM_FALLING_CRYSTAL:
|
||||||
case OLM_BURNING:
|
case OLM_BURNING:
|
||||||
case OLM_FALLING_CRYSTAL_TRAIL:
|
case OLM_FALLING_CRYSTAL_TRAIL:
|
||||||
case OLM_ACID_TRAIL:
|
case OLM_ACID_TRAIL:
|
||||||
case OLM_FIRE_LINE:
|
case OLM_FIRE_LINE:
|
||||||
return notify ? config.isOlmNotifyEnabled() : config.isOlmEnabled();
|
return notify ? this.configOlmNotifyEnabled : this.configOlmEnabled;
|
||||||
case CORPOREAL_BEAST:
|
case CORPOREAL_BEAST:
|
||||||
case CORPOREAL_BEAST_DARK_CORE:
|
case CORPOREAL_BEAST_DARK_CORE:
|
||||||
return notify ? config.isCorpNotifyEnabled() : config.isCorpEnabled();
|
return notify ? this.configCorpNotifyEnabled : this.configCorpEnabled;
|
||||||
case XARPUS_POISON_AOE:
|
case XARPUS_POISON_AOE:
|
||||||
return notify ? config.isXarpusNotifyEnabled() : config.isXarpusEnabled();
|
return notify ? this.configXarpusNotifyEnabled : this.configXarpusEnabled;
|
||||||
case ADDY_DRAG_POISON:
|
case ADDY_DRAG_POISON:
|
||||||
return notify ? config.addyDragsNotifyEnabled() : config.addyDrags();
|
return notify ? this.configaddyDragsNotifyEnabled : this.configaddyDrags;
|
||||||
case DRAKE_BREATH:
|
case DRAKE_BREATH:
|
||||||
return notify ? config.isDrakeNotifyEnabled() : config.isDrakeEnabled();
|
return notify ? this.configDrakeNotifyEnabled : this.configDrakeEnabled;
|
||||||
case CERB_FIRE:
|
case CERB_FIRE:
|
||||||
return notify ? config.isCerbFireNotifyEnabled() : config.isCerbFireEnabled();
|
return notify ? this.configCerbFireNotifyEnabled : this.configCerbFireEnabled;
|
||||||
case DEMONIC_GORILLA_BOULDER:
|
case DEMONIC_GORILLA_BOULDER:
|
||||||
return notify ? config.isDemonicGorillaNotifyEnabled() : config.isDemonicGorillaEnabled();
|
return notify ? this.configDemonicGorillaNotifyEnabled : this.configDemonicGorillaEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void reset(boolean setConfig)
|
public void updateConfig()
|
||||||
|
{
|
||||||
|
this.aoeNotifyAll = config.aoeNotifyAll();
|
||||||
|
this.overlayColor = config.overlayColor();
|
||||||
|
this.configOutlineEnabled = config.isOutlineEnabled();
|
||||||
|
this.delay = config.delay();
|
||||||
|
this.configFadeEnabled = config.isFadeEnabled();
|
||||||
|
this.tickTimers = config.tickTimers();
|
||||||
|
this.fontStyle = config.fontStyle().getFont();
|
||||||
|
this.textSize = config.textSize();
|
||||||
|
this.shadows = config.shadows();
|
||||||
|
this.configShamansEnabled = config.isShamansEnabled();
|
||||||
|
this.configShamansNotifyEnabled = config.isShamansNotifyEnabled();
|
||||||
|
this.configArchaeologistEnabled = config.isArchaeologistEnabled();
|
||||||
|
this.configArchaeologistNotifyEnabled = config.isArchaeologistNotifyEnabled();
|
||||||
|
this.configIceDemonEnabled = config.isIceDemonEnabled();
|
||||||
|
this.configIceDemonNotifyEnabled = config.isIceDemonNotifyEnabled();
|
||||||
|
this.configVasaEnabled = config.isVasaEnabled();
|
||||||
|
this.configVasaNotifyEnabled = config.isVasaNotifyEnabled();
|
||||||
|
this.configTektonEnabled = config.isTektonEnabled();
|
||||||
|
this.configTektonNotifyEnabled = config.isTektonNotifyEnabled();
|
||||||
|
this.configVorkathEnabled = config.isVorkathEnabled();
|
||||||
|
this.configVorkathNotifyEnabled = config.isVorkathNotifyEnabled();
|
||||||
|
this.configGalvekEnabled = config.isGalvekEnabled();
|
||||||
|
this.configGalvekNotifyEnabled = config.isGalvekNotifyEnabled();
|
||||||
|
this.configGargBossEnabled = config.isGargBossEnabled();
|
||||||
|
this.configGargBossNotifyEnabled = config.isGargBossNotifyEnabled();
|
||||||
|
this.configVetionEnabled = config.isVetionEnabled();
|
||||||
|
this.configVetionNotifyEnabled = config.isVetionNotifyEnabled();
|
||||||
|
this.configChaosFanaticEnabled = config.isChaosFanaticEnabled();
|
||||||
|
this.configChaosFanaticNotifyEnabled = config.isChaosFanaticNotifyEnabled();
|
||||||
|
this.configOlmEnabled = config.isOlmEnabled();
|
||||||
|
this.configOlmNotifyEnabled = config.isOlmNotifyEnabled();
|
||||||
|
this.configbombDisplay = config.bombDisplay();
|
||||||
|
this.configbombDisplayNotifyEnabled = config.bombDisplayNotifyEnabled();
|
||||||
|
this.configLightningTrail = config.LightningTrail();
|
||||||
|
this.configLightningTrailNotifyEnabled = config.LightningTrailNotifyEnabled();
|
||||||
|
this.configCorpEnabled = config.isCorpEnabled();
|
||||||
|
this.configCorpNotifyEnabled = config.isCorpNotifyEnabled();
|
||||||
|
this.configWintertodtEnabled = config.isWintertodtEnabled();
|
||||||
|
this.configWintertodtNotifyEnabled = config.isWintertodtNotifyEnabled();
|
||||||
|
this.configXarpusEnabled = config.isXarpusEnabled();
|
||||||
|
this.configXarpusNotifyEnabled = config.isXarpusNotifyEnabled();
|
||||||
|
this.configaddyDrags = config.addyDrags();
|
||||||
|
this.configaddyDragsNotifyEnabled = config.addyDragsNotifyEnabled();
|
||||||
|
this.configDrakeEnabled = config.isDrakeEnabled();
|
||||||
|
this.configDrakeNotifyEnabled = config.isDrakeNotifyEnabled();
|
||||||
|
this.configCerbFireEnabled = config.isCerbFireEnabled();
|
||||||
|
this.configCerbFireNotifyEnabled = config.isCerbFireNotifyEnabled();
|
||||||
|
this.configDemonicGorillaEnabled = config.isDemonicGorillaEnabled();
|
||||||
|
this.configDemonicGorillaNotifyEnabled = config.isDemonicGorillaNotifyEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void reset()
|
||||||
{
|
{
|
||||||
LightningTrail.clear();
|
LightningTrail.clear();
|
||||||
AcidTrail.clear();
|
AcidTrail.clear();
|
||||||
@@ -416,11 +511,5 @@ public class AoeWarningPlugin extends Plugin
|
|||||||
WintertodtSnowFall.clear();
|
WintertodtSnowFall.clear();
|
||||||
bombs.clear();
|
bombs.clear();
|
||||||
projectiles.clear();
|
projectiles.clear();
|
||||||
if (setConfig)
|
|
||||||
{
|
|
||||||
fontStyle = config.fontStyle().getFont();
|
|
||||||
textSize = config.textSize();
|
|
||||||
shadows = config.shadows();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ import java.awt.Polygon;
|
|||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.text.NumberFormat;
|
import java.text.NumberFormat;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.Perspective;
|
import net.runelite.api.Perspective;
|
||||||
@@ -50,6 +50,7 @@ import net.runelite.client.ui.overlay.OverlayPriority;
|
|||||||
import net.runelite.client.ui.overlay.OverlayUtil;
|
import net.runelite.client.ui.overlay.OverlayUtil;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@Singleton
|
||||||
public class BombOverlay extends Overlay
|
public class BombOverlay extends Overlay
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -81,15 +82,13 @@ public class BombOverlay extends Overlay
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final AoeWarningConfig config;
|
|
||||||
private final AoeWarningPlugin plugin;
|
private final AoeWarningPlugin plugin;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public BombOverlay(Client client, AoeWarningPlugin plugin, AoeWarningConfig config)
|
public BombOverlay(final Client client, final AoeWarningPlugin plugin)
|
||||||
{
|
{
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.config = config;
|
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
setLayer(OverlayLayer.ABOVE_SCENE);
|
setLayer(OverlayLayer.ABOVE_SCENE);
|
||||||
setPriority(OverlayPriority.MED);
|
setPriority(OverlayPriority.MED);
|
||||||
@@ -98,7 +97,7 @@ public class BombOverlay extends Overlay
|
|||||||
@Override
|
@Override
|
||||||
public Dimension render(Graphics2D graphics)
|
public Dimension render(Graphics2D graphics)
|
||||||
{
|
{
|
||||||
if (config.bombDisplay())
|
if (plugin.isConfigbombDisplay())
|
||||||
{
|
{
|
||||||
drawBombs(graphics);
|
drawBombs(graphics);
|
||||||
}
|
}
|
||||||
@@ -108,10 +107,8 @@ public class BombOverlay extends Overlay
|
|||||||
private void drawBombs(Graphics2D graphics)
|
private void drawBombs(Graphics2D graphics)
|
||||||
//I can condense drawDangerZone into this. Ambivalent though.
|
//I can condense drawDangerZone into this. Ambivalent though.
|
||||||
{
|
{
|
||||||
Iterator<Map.Entry<WorldPoint, CrystalBomb>> it = plugin.getBombs().entrySet().iterator();
|
for (Map.Entry<WorldPoint, CrystalBomb> entry : plugin.getBombs().entrySet())
|
||||||
while (it.hasNext())
|
|
||||||
{
|
{
|
||||||
Map.Entry<WorldPoint, CrystalBomb> entry = it.next();
|
|
||||||
CrystalBomb bomb = entry.getValue();
|
CrystalBomb bomb = entry.getValue();
|
||||||
drawDangerZone(graphics, bomb);
|
drawDangerZone(graphics, bomb);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
package net.runelite.client.plugins.aoewarnings;
|
package net.runelite.client.plugins.aoewarnings;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.GameObject;
|
import net.runelite.api.GameObject;
|
||||||
@@ -33,20 +34,20 @@ import net.runelite.api.coords.WorldPoint;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
class CrystalBomb
|
class CrystalBomb
|
||||||
{
|
{
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private Instant plantedOn;
|
private Instant plantedOn;
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private Instant lastClockUpdate;
|
private Instant lastClockUpdate;
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private int objectId;
|
private int objectId;
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private int tickStarted;
|
private int tickStarted;
|
||||||
//
|
//
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private WorldPoint worldLocation;
|
private WorldPoint worldLocation;
|
||||||
|
|
||||||
CrystalBomb(GameObject gameObject, int startTick)
|
CrystalBomb(GameObject gameObject, int startTick)
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import java.awt.Color;
|
|||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
|
import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
|
||||||
@@ -36,19 +37,18 @@ import net.runelite.client.ui.overlay.OverlayPosition;
|
|||||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
class AttackStylesOverlay extends Overlay
|
class AttackStylesOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private final AttackStylesPlugin plugin;
|
private final AttackStylesPlugin plugin;
|
||||||
private final AttackStylesConfig config;
|
|
||||||
private final PanelComponent panelComponent = new PanelComponent();
|
private final PanelComponent panelComponent = new PanelComponent();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private AttackStylesOverlay(AttackStylesPlugin plugin, AttackStylesConfig config)
|
private AttackStylesOverlay(final AttackStylesPlugin plugin)
|
||||||
{
|
{
|
||||||
super(plugin);
|
super(plugin);
|
||||||
setPosition(OverlayPosition.ABOVE_CHATBOX_RIGHT);
|
setPosition(OverlayPosition.ABOVE_CHATBOX_RIGHT);
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.config = config;
|
|
||||||
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Attack style overlay"));
|
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Attack style overlay"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ class AttackStylesOverlay extends Overlay
|
|||||||
panelComponent.getChildren().clear();
|
panelComponent.getChildren().clear();
|
||||||
boolean warnedSkillSelected = plugin.isWarnedSkillSelected();
|
boolean warnedSkillSelected = plugin.isWarnedSkillSelected();
|
||||||
|
|
||||||
if (warnedSkillSelected || config.alwaysShowStyle())
|
if (warnedSkillSelected || plugin.isAlwaysShowStyle())
|
||||||
{
|
{
|
||||||
final String attackStyleString = plugin.getAttackStyle().getName();
|
final String attackStyleString = plugin.getAttackStyle().getName();
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ import com.google.inject.Provides;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.Getter;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
import net.runelite.api.Skill;
|
import net.runelite.api.Skill;
|
||||||
@@ -60,6 +63,7 @@ import net.runelite.client.ui.overlay.OverlayManager;
|
|||||||
description = "Show your current attack style as an overlay",
|
description = "Show your current attack style as an overlay",
|
||||||
tags = {"combat", "defence", "magic", "overlay", "ranged", "strength", "warn", "pure"}
|
tags = {"combat", "defence", "magic", "overlay", "ranged", "strength", "warn", "pure"}
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
public class AttackStylesPlugin extends Plugin
|
public class AttackStylesPlugin extends Plugin
|
||||||
{
|
{
|
||||||
private int attackStyleVarbit = -1;
|
private int attackStyleVarbit = -1;
|
||||||
@@ -91,9 +95,22 @@ public class AttackStylesPlugin extends Plugin
|
|||||||
return configManager.getConfig(AttackStylesConfig.class);
|
return configManager.getConfig(AttackStylesConfig.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// config values
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean alwaysShowStyle;
|
||||||
|
private boolean warnForDefence;
|
||||||
|
private boolean warnForAttack;
|
||||||
|
private boolean warnForStrength;
|
||||||
|
private boolean warnForRanged;
|
||||||
|
private boolean warnForMagic;
|
||||||
|
private boolean hideAutoRetaliate;
|
||||||
|
private boolean removeWarnedStyles;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
|
|
||||||
overlayManager.add(overlay);
|
overlayManager.add(overlay);
|
||||||
|
|
||||||
if (client.getGameState() == GameState.LOGGED_IN)
|
if (client.getGameState() == GameState.LOGGED_IN)
|
||||||
@@ -104,11 +121,11 @@ public class AttackStylesPlugin extends Plugin
|
|||||||
|
|
||||||
private void start()
|
private void start()
|
||||||
{
|
{
|
||||||
updateWarnedSkills(config.warnForAttack(), Skill.ATTACK);
|
updateWarnedSkills(warnForAttack, Skill.ATTACK);
|
||||||
updateWarnedSkills(config.warnForStrength(), Skill.STRENGTH);
|
updateWarnedSkills(warnForStrength, Skill.STRENGTH);
|
||||||
updateWarnedSkills(config.warnForDefence(), Skill.DEFENCE);
|
updateWarnedSkills(warnForDefence, Skill.DEFENCE);
|
||||||
updateWarnedSkills(config.warnForRanged(), Skill.RANGED);
|
updateWarnedSkills(warnForRanged, Skill.RANGED);
|
||||||
updateWarnedSkills(config.warnForMagic(), Skill.MAGIC);
|
updateWarnedSkills(warnForMagic, Skill.MAGIC);
|
||||||
attackStyleVarbit = client.getVar(VarPlayer.ATTACK_STYLE);
|
attackStyleVarbit = client.getVar(VarPlayer.ATTACK_STYLE);
|
||||||
equippedWeaponTypeVarbit = client.getVar(Varbits.EQUIPPED_WEAPON_TYPE);
|
equippedWeaponTypeVarbit = client.getVar(Varbits.EQUIPPED_WEAPON_TYPE);
|
||||||
castingModeVarbit = client.getVar(Varbits.DEFENSIVE_CASTING_MODE);
|
castingModeVarbit = client.getVar(Varbits.DEFENSIVE_CASTING_MODE);
|
||||||
@@ -134,7 +151,7 @@ public class AttackStylesPlugin extends Plugin
|
|||||||
return attackStyle;
|
return attackStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isWarnedSkillSelected()
|
boolean isWarnedSkillSelected()
|
||||||
{
|
{
|
||||||
return warnedSkillSelected;
|
return warnedSkillSelected;
|
||||||
}
|
}
|
||||||
@@ -175,7 +192,7 @@ public class AttackStylesPlugin extends Plugin
|
|||||||
hideWidget(client.getWidget(widgetKey), widgetsToHide.get(equippedWeaponType, widgetKey));
|
hideWidget(client.getWidget(widgetKey), widgetsToHide.get(equippedWeaponType, widgetKey));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hideWidget(client.getWidget(WidgetInfo.COMBAT_AUTO_RETALIATE), config.hideAutoRetaliate());
|
hideWidget(client.getWidget(WidgetInfo.COMBAT_AUTO_RETALIATE), this.hideAutoRetaliate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
@@ -183,11 +200,11 @@ public class AttackStylesPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (event.getGameState() == GameState.LOGGED_IN)
|
if (event.getGameState() == GameState.LOGGED_IN)
|
||||||
{
|
{
|
||||||
updateWarnedSkills(config.warnForAttack(), Skill.ATTACK);
|
updateWarnedSkills(this.warnForAttack, Skill.ATTACK);
|
||||||
updateWarnedSkills(config.warnForStrength(), Skill.STRENGTH);
|
updateWarnedSkills(this.warnForStrength, Skill.STRENGTH);
|
||||||
updateWarnedSkills(config.warnForDefence(), Skill.DEFENCE);
|
updateWarnedSkills(this.warnForDefence, Skill.DEFENCE);
|
||||||
updateWarnedSkills(config.warnForRanged(), Skill.RANGED);
|
updateWarnedSkills(this.warnForRanged, Skill.RANGED);
|
||||||
updateWarnedSkills(config.warnForMagic(), Skill.MAGIC);
|
updateWarnedSkills(this.warnForMagic, Skill.MAGIC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,6 +241,8 @@ public class AttackStylesPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (event.getGroup().equals("attackIndicator"))
|
if (event.getGroup().equals("attackIndicator"))
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
|
|
||||||
boolean enabled = event.getNewValue().equals("true");
|
boolean enabled = event.getNewValue().equals("true");
|
||||||
switch (event.getKey())
|
switch (event.getKey())
|
||||||
{
|
{
|
||||||
@@ -250,6 +269,18 @@ public class AttackStylesPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateConfig()
|
||||||
|
{
|
||||||
|
this.alwaysShowStyle = config.alwaysShowStyle();
|
||||||
|
this.warnForDefence = config.warnForDefence();
|
||||||
|
this.warnForAttack = config.warnForAttack();
|
||||||
|
this.warnForStrength = config.warnForStrength();
|
||||||
|
this.warnForRanged = config.warnForRanged();
|
||||||
|
this.warnForMagic = config.warnForMagic();
|
||||||
|
this.hideAutoRetaliate = config.hideAutoRetaliate();
|
||||||
|
this.removeWarnedStyles = config.removeWarnedStyles();
|
||||||
|
}
|
||||||
|
|
||||||
private void updateAttackStyle(int equippedWeaponType, int attackStyleIndex, int castingMode)
|
private void updateAttackStyle(int equippedWeaponType, int attackStyleIndex, int castingMode)
|
||||||
{
|
{
|
||||||
AttackStyle[] attackStyles = WeaponType.getWeaponType(equippedWeaponType).getAttackStyles();
|
AttackStyle[] attackStyles = WeaponType.getWeaponType(equippedWeaponType).getAttackStyles();
|
||||||
@@ -298,7 +329,7 @@ public class AttackStylesPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hideWarnedStyles(config.removeWarnedStyles());
|
hideWarnedStyles(this.removeWarnedStyles);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void hideWarnedStyles(boolean enabled)
|
private void hideWarnedStyles(boolean enabled)
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class BankCalculation
|
|||||||
Varbits.BANK_TAB_NINE_COUNT
|
Varbits.BANK_TAB_NINE_COUNT
|
||||||
);
|
);
|
||||||
|
|
||||||
private final BankConfig config;
|
private final BankPlugin plugin;
|
||||||
private final ItemManager itemManager;
|
private final ItemManager itemManager;
|
||||||
private final Client client;
|
private final Client client;
|
||||||
|
|
||||||
@@ -72,10 +72,10 @@ class BankCalculation
|
|||||||
private long haPrice;
|
private long haPrice;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
BankCalculation(ItemManager itemManager, BankConfig config, Client client)
|
BankCalculation(ItemManager itemManager, BankPlugin plugin, Client client)
|
||||||
{
|
{
|
||||||
this.itemManager = itemManager;
|
this.itemManager = itemManager;
|
||||||
this.config = config;
|
this.plugin = plugin;
|
||||||
this.client = client;
|
this.client = client;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,12 +142,12 @@ class BankCalculation
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.showGE())
|
if (plugin.isShowGE())
|
||||||
{
|
{
|
||||||
itemIds.add(item.getId());
|
itemIds.add(item.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.showHA())
|
if (plugin.isShowHA())
|
||||||
{
|
{
|
||||||
long alchValue = itemManager.getAlchValue(item.getId());
|
long alchValue = itemManager.getAlchValue(item.getId());
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ class BankCalculation
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Now do the calculations
|
// Now do the calculations
|
||||||
if (config.showGE() && !itemIds.isEmpty())
|
if (plugin.isShowGE() && !itemIds.isEmpty())
|
||||||
{
|
{
|
||||||
for (Item item : items)
|
for (Item item : items)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,8 +28,12 @@ package net.runelite.client.plugins.bank;
|
|||||||
|
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.Getter;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.MenuEntry;
|
import net.runelite.api.MenuEntry;
|
||||||
|
import net.runelite.api.events.ConfigChanged;
|
||||||
import net.runelite.api.events.MenuEntryAdded;
|
import net.runelite.api.events.MenuEntryAdded;
|
||||||
import net.runelite.api.events.MenuShouldLeftClick;
|
import net.runelite.api.events.MenuShouldLeftClick;
|
||||||
import net.runelite.api.events.ScriptCallbackEvent;
|
import net.runelite.api.events.ScriptCallbackEvent;
|
||||||
@@ -46,6 +50,7 @@ import net.runelite.client.util.StackFormatter;
|
|||||||
description = "Modifications to the banking interface",
|
description = "Modifications to the banking interface",
|
||||||
tags = {"grand", "exchange", "high", "alchemy", "prices", "deposit"}
|
tags = {"grand", "exchange", "high", "alchemy", "prices", "deposit"}
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
public class BankPlugin extends Plugin
|
public class BankPlugin extends Plugin
|
||||||
{
|
{
|
||||||
private static final String DEPOSIT_WORN = "Deposit worn items";
|
private static final String DEPOSIT_WORN = "Deposit worn items";
|
||||||
@@ -75,6 +80,21 @@ public class BankPlugin extends Plugin
|
|||||||
return configManager.getConfig(BankConfig.class);
|
return configManager.getConfig(BankConfig.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showGE;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showHA;
|
||||||
|
private boolean showExact;
|
||||||
|
private boolean rightClickBankInventory;
|
||||||
|
private boolean rightClickBankEquip;
|
||||||
|
private boolean rightClickBankLoot;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void startUp() throws Exception
|
||||||
|
{
|
||||||
|
updateConfig();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void shutDown()
|
protected void shutDown()
|
||||||
{
|
{
|
||||||
@@ -94,9 +114,9 @@ public class BankPlugin extends Plugin
|
|||||||
MenuEntry[] menuEntries = client.getMenuEntries();
|
MenuEntry[] menuEntries = client.getMenuEntries();
|
||||||
for (MenuEntry entry : menuEntries)
|
for (MenuEntry entry : menuEntries)
|
||||||
{
|
{
|
||||||
if ((entry.getOption().equals(DEPOSIT_WORN) && config.rightClickBankEquip())
|
if ((entry.getOption().equals(DEPOSIT_WORN) && this.rightClickBankEquip)
|
||||||
|| (entry.getOption().equals(DEPOSIT_INVENTORY) && config.rightClickBankInventory())
|
|| (entry.getOption().equals(DEPOSIT_INVENTORY) && this.rightClickBankInventory)
|
||||||
|| (entry.getOption().equals(DEPOSIT_LOOT) && config.rightClickBankLoot()))
|
|| (entry.getOption().equals(DEPOSIT_LOOT) && this.rightClickBankLoot))
|
||||||
{
|
{
|
||||||
event.setForceRightClick(true);
|
event.setForceRightClick(true);
|
||||||
return;
|
return;
|
||||||
@@ -107,9 +127,9 @@ public class BankPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||||
{
|
{
|
||||||
if ((event.getOption().equals(DEPOSIT_WORN) && config.rightClickBankEquip())
|
if ((event.getOption().equals(DEPOSIT_WORN) && this.rightClickBankEquip)
|
||||||
|| (event.getOption().equals(DEPOSIT_INVENTORY) && config.rightClickBankInventory())
|
|| (event.getOption().equals(DEPOSIT_INVENTORY) && this.rightClickBankInventory)
|
||||||
|| (event.getOption().equals(DEPOSIT_LOOT) && config.rightClickBankLoot()))
|
|| (event.getOption().equals(DEPOSIT_LOOT) && this.rightClickBankLoot))
|
||||||
{
|
{
|
||||||
forceRightClickFlag = true;
|
forceRightClickFlag = true;
|
||||||
}
|
}
|
||||||
@@ -128,16 +148,16 @@ public class BankPlugin extends Plugin
|
|||||||
long gePrice = bankCalculation.getGePrice();
|
long gePrice = bankCalculation.getGePrice();
|
||||||
long haPrice = bankCalculation.getHaPrice();
|
long haPrice = bankCalculation.getHaPrice();
|
||||||
|
|
||||||
if (config.showGE() && gePrice != 0)
|
if (this.showGE && gePrice != 0)
|
||||||
{
|
{
|
||||||
strCurrentTab += " (";
|
strCurrentTab += " (";
|
||||||
|
|
||||||
if (config.showHA())
|
if (this.showHA)
|
||||||
{
|
{
|
||||||
strCurrentTab += "EX: ";
|
strCurrentTab += "EX: ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.showExact())
|
if (this.showExact)
|
||||||
{
|
{
|
||||||
strCurrentTab += StackFormatter.formatNumber(gePrice) + ")";
|
strCurrentTab += StackFormatter.formatNumber(gePrice) + ")";
|
||||||
}
|
}
|
||||||
@@ -147,16 +167,16 @@ public class BankPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.showHA() && haPrice != 0)
|
if (this.showHA && haPrice != 0)
|
||||||
{
|
{
|
||||||
strCurrentTab += " (";
|
strCurrentTab += " (";
|
||||||
|
|
||||||
if (config.showGE())
|
if (this.showGE)
|
||||||
{
|
{
|
||||||
strCurrentTab += "HA: ";
|
strCurrentTab += "HA: ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.showExact())
|
if (this.showExact)
|
||||||
{
|
{
|
||||||
strCurrentTab += StackFormatter.formatNumber(haPrice) + ")";
|
strCurrentTab += StackFormatter.formatNumber(haPrice) + ")";
|
||||||
}
|
}
|
||||||
@@ -171,4 +191,25 @@ public class BankPlugin extends Plugin
|
|||||||
|
|
||||||
stringStack[stringStackSize - 1] += strCurrentTab;
|
stringStack[stringStackSize - 1] += strCurrentTab;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onConfigChanged(ConfigChanged event)
|
||||||
|
{
|
||||||
|
if (!event.getGroup().equals("bank"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
updateConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateConfig()
|
||||||
|
{
|
||||||
|
this.showGE = config.showGE();
|
||||||
|
this.showHA = config.showHA();
|
||||||
|
this.showExact = config.showExact();
|
||||||
|
this.rightClickBankInventory = config.rightClickBankInventory();
|
||||||
|
this.rightClickBankEquip = config.rightClickBankEquip();
|
||||||
|
this.rightClickBankLoot = config.rightClickBankLoot();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import java.util.Collection;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.InventoryID;
|
import net.runelite.api.InventoryID;
|
||||||
import net.runelite.api.Item;
|
import net.runelite.api.Item;
|
||||||
@@ -82,6 +83,7 @@ import net.runelite.client.util.Text;
|
|||||||
tags = {"searching", "tagging"}
|
tags = {"searching", "tagging"}
|
||||||
)
|
)
|
||||||
@PluginDependency(ClueScrollPlugin.class)
|
@PluginDependency(ClueScrollPlugin.class)
|
||||||
|
@Singleton
|
||||||
public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyListener
|
public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyListener
|
||||||
{
|
{
|
||||||
public static final String CONFIG_GROUP = "banktags";
|
public static final String CONFIG_GROUP = "banktags";
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import net.runelite.client.config.ConfigItem;
|
|||||||
|
|
||||||
public interface BanListConfig extends Config
|
public interface BanListConfig extends Config
|
||||||
{
|
{
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "bannedPlayers",
|
keyName = "bannedPlayers",
|
||||||
name = "Manual Scammer List",
|
name = "Manual Scammer List",
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import java.io.IOException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.ChatMessageType;
|
import net.runelite.api.ChatMessageType;
|
||||||
import net.runelite.api.ClanMember;
|
import net.runelite.api.ClanMember;
|
||||||
@@ -67,7 +68,7 @@ import okhttp3.Response;
|
|||||||
type = PluginType.UTILITY,
|
type = PluginType.UTILITY,
|
||||||
enabledByDefault = false
|
enabledByDefault = false
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class BanListPlugin extends Plugin
|
public class BanListPlugin extends Plugin
|
||||||
{
|
{
|
||||||
@@ -94,9 +95,16 @@ public class BanListPlugin extends Plugin
|
|||||||
return configManager.getConfig(BanListConfig.class);
|
return configManager.getConfig(BanListConfig.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// save config values
|
||||||
|
private boolean enableWDR;
|
||||||
|
private boolean enableRuneWatch;
|
||||||
|
private boolean highlightInClan;
|
||||||
|
private boolean highlightInTrade;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
manualBans.addAll(Text.fromCSV(config.getBannedPlayers()));
|
manualBans.addAll(Text.fromCSV(config.getBannedPlayers()));
|
||||||
fetchFromWebsites();
|
fetchFromWebsites();
|
||||||
}
|
}
|
||||||
@@ -128,6 +136,14 @@ public class BanListPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateConfig()
|
||||||
|
{
|
||||||
|
this.enableWDR = config.enableWDR();
|
||||||
|
this.enableRuneWatch = config.enableRuneWatch();
|
||||||
|
this.highlightInClan = config.highlightInClan();
|
||||||
|
this.highlightInTrade = config.highlightInTrade();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event to keep making sure player names are highlighted red in clan chat, since the red name goes away frequently
|
* Event to keep making sure player names are highlighted red in clan chat, since the red name goes away frequently
|
||||||
*/
|
*/
|
||||||
@@ -138,7 +154,7 @@ public class BanListPlugin extends Plugin
|
|||||||
|| client.getWidget(WidgetInfo.LOGIN_CLICK_TO_PLAY_SCREEN) != null
|
|| client.getWidget(WidgetInfo.LOGIN_CLICK_TO_PLAY_SCREEN) != null
|
||||||
|| client.getViewportWidget() == null
|
|| client.getViewportWidget() == null
|
||||||
|| client.getWidget(WidgetInfo.CLAN_CHAT) == null
|
|| client.getWidget(WidgetInfo.CLAN_CHAT) == null
|
||||||
|| !config.highlightInClan())
|
|| !this.highlightInClan)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -163,7 +179,7 @@ public class BanListPlugin extends Plugin
|
|||||||
if (scamList != null)
|
if (scamList != null)
|
||||||
{
|
{
|
||||||
sendWarning(Text.standardize(member.getUsername()), scamList);
|
sendWarning(Text.standardize(member.getUsername()), scamList);
|
||||||
if (config.highlightInClan())
|
if (this.highlightInClan)
|
||||||
{
|
{
|
||||||
highlightRedInCC();
|
highlightRedInCC();
|
||||||
}
|
}
|
||||||
@@ -172,7 +188,7 @@ public class BanListPlugin extends Plugin
|
|||||||
if (toxicList != null)
|
if (toxicList != null)
|
||||||
{
|
{
|
||||||
sendWarning(Text.standardize(member.getUsername()), toxicList);
|
sendWarning(Text.standardize(member.getUsername()), toxicList);
|
||||||
if (config.highlightInClan())
|
if (this.highlightInClan)
|
||||||
{
|
{
|
||||||
highlightRedInCC();
|
highlightRedInCC();
|
||||||
}
|
}
|
||||||
@@ -185,7 +201,7 @@ public class BanListPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onWidgetLoaded(WidgetLoaded widgetLoaded)
|
public void onWidgetLoaded(WidgetLoaded widgetLoaded)
|
||||||
{
|
{
|
||||||
if (config.highlightInTrade())
|
if (this.highlightInTrade)
|
||||||
{
|
{
|
||||||
if (widgetLoaded.getGroupId() == 335)
|
if (widgetLoaded.getGroupId() == 335)
|
||||||
{ //if trading window was loaded
|
{ //if trading window was loaded
|
||||||
@@ -211,7 +227,7 @@ public class BanListPlugin extends Plugin
|
|||||||
*/
|
*/
|
||||||
private ListType checkScamList(String nameToBeChecked)
|
private ListType checkScamList(String nameToBeChecked)
|
||||||
{
|
{
|
||||||
if (wdrScamArrayList.size() > 0 && config.enableWDR())
|
if (wdrScamArrayList.size() > 0 && this.enableWDR)
|
||||||
{
|
{
|
||||||
if (wdrScamArrayList.stream().anyMatch(nameToBeChecked::equalsIgnoreCase))
|
if (wdrScamArrayList.stream().anyMatch(nameToBeChecked::equalsIgnoreCase))
|
||||||
{
|
{
|
||||||
@@ -219,7 +235,7 @@ public class BanListPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (runeWatchArrayList.size() > 0 && config.enableRuneWatch())
|
if (runeWatchArrayList.size() > 0 && this.enableRuneWatch)
|
||||||
{
|
{
|
||||||
if (runeWatchArrayList.stream().anyMatch(nameToBeChecked::equalsIgnoreCase))
|
if (runeWatchArrayList.stream().anyMatch(nameToBeChecked::equalsIgnoreCase))
|
||||||
{
|
{
|
||||||
@@ -241,7 +257,7 @@ public class BanListPlugin extends Plugin
|
|||||||
private ListType checkToxicList(String nameToBeChecked)
|
private ListType checkToxicList(String nameToBeChecked)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (wdrToxicArrayList.size() > 0 && config.enableWDR())
|
if (wdrToxicArrayList.size() > 0 && this.enableWDR)
|
||||||
{
|
{
|
||||||
if (wdrToxicArrayList.stream().anyMatch(nameToBeChecked::equalsIgnoreCase))
|
if (wdrToxicArrayList.stream().anyMatch(nameToBeChecked::equalsIgnoreCase))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
package net.runelite.client.plugins.barbarianassault;
|
package net.runelite.client.plugins.barbarianassault;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.Perspective;
|
import net.runelite.api.Perspective;
|
||||||
import net.runelite.api.Point;
|
import net.runelite.api.Point;
|
||||||
@@ -46,7 +47,7 @@ import java.awt.Stroke;
|
|||||||
import java.awt.BasicStroke;
|
import java.awt.BasicStroke;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
class AboveSceneOverlay extends Overlay
|
class AboveSceneOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private static final int HEALTH_BAR_HEIGHT = 20;
|
private static final int HEALTH_BAR_HEIGHT = 20;
|
||||||
@@ -62,18 +63,16 @@ class AboveSceneOverlay extends Overlay
|
|||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final BarbarianAssaultPlugin game;
|
private final BarbarianAssaultPlugin game;
|
||||||
private final BarbarianAssaultConfig config;
|
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private AboveSceneOverlay(Client client, BarbarianAssaultPlugin game, BarbarianAssaultConfig config)
|
private AboveSceneOverlay(final Client client, final BarbarianAssaultPlugin game)
|
||||||
{
|
{
|
||||||
super(game);
|
super(game);
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
setLayer(OverlayLayer.ABOVE_SCENE);
|
setLayer(OverlayLayer.ABOVE_SCENE);
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.game = game;
|
this.game = game;
|
||||||
this.config = config;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -88,11 +87,11 @@ class AboveSceneOverlay extends Overlay
|
|||||||
{
|
{
|
||||||
|
|
||||||
case HEALER:
|
case HEALER:
|
||||||
if (config.showTeammateHealthbars())
|
if (game.isShowTeammateHealthbars())
|
||||||
{
|
{
|
||||||
renderHealthBars(graphics);
|
renderHealthBars(graphics);
|
||||||
}
|
}
|
||||||
if (config.healerCodes())
|
if (game.isHealerCodes())
|
||||||
{
|
{
|
||||||
renderHealerCodes(graphics);
|
renderHealerCodes(graphics);
|
||||||
}
|
}
|
||||||
@@ -100,7 +99,7 @@ class AboveSceneOverlay extends Overlay
|
|||||||
|
|
||||||
|
|
||||||
case COLLECTOR:
|
case COLLECTOR:
|
||||||
if (config.highlightCollectorEggs())
|
if (game.isHighlightCollectorEggs())
|
||||||
{
|
{
|
||||||
renderEggs(graphics);
|
renderEggs(graphics);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import java.awt.Rectangle;
|
|||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.Point;
|
import net.runelite.api.Point;
|
||||||
import net.runelite.api.widgets.Widget;
|
import net.runelite.api.widgets.Widget;
|
||||||
@@ -43,7 +44,7 @@ import net.runelite.client.ui.overlay.OverlayPosition;
|
|||||||
import net.runelite.client.ui.overlay.OverlayUtil;
|
import net.runelite.client.ui.overlay.OverlayUtil;
|
||||||
import net.runelite.client.util.ImageUtil;
|
import net.runelite.client.util.ImageUtil;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
class AboveWidgetsOverlay extends Overlay
|
class AboveWidgetsOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private static final int OFFSET_X_TEXT_QUANTITY = 0;
|
private static final int OFFSET_X_TEXT_QUANTITY = 0;
|
||||||
@@ -51,18 +52,15 @@ class AboveWidgetsOverlay extends Overlay
|
|||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final BarbarianAssaultPlugin game;
|
private final BarbarianAssaultPlugin game;
|
||||||
private final BarbarianAssaultConfig config;
|
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private AboveWidgetsOverlay(Client client, BarbarianAssaultPlugin game, BarbarianAssaultConfig config)
|
private AboveWidgetsOverlay(final Client client, final BarbarianAssaultPlugin game)
|
||||||
{
|
{
|
||||||
super(game);
|
super(game);
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.game = game;
|
this.game = game;
|
||||||
this.config = config;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -75,7 +73,7 @@ class AboveWidgetsOverlay extends Overlay
|
|||||||
|
|
||||||
Role role = game.getRole();
|
Role role = game.getRole();
|
||||||
|
|
||||||
if (config.showTimer())
|
if (game.isShowTimer())
|
||||||
{
|
{
|
||||||
renderTimer(graphics, role);
|
renderTimer(graphics, role);
|
||||||
}
|
}
|
||||||
@@ -83,23 +81,23 @@ class AboveWidgetsOverlay extends Overlay
|
|||||||
switch (role)
|
switch (role)
|
||||||
{
|
{
|
||||||
case ATTACKER:
|
case ATTACKER:
|
||||||
if (config.highlightArrows())
|
if (game.isHighlightArrows())
|
||||||
{
|
{
|
||||||
renderInventoryHighlights(graphics, game.getRole().getListenItem(game.getLastListenText()), config.highlightArrowColor());
|
renderInventoryHighlights(graphics, game.getRole().getListenItem(game.getLastListenText()), game.getHighlightArrowColor());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEFENDER:
|
case DEFENDER:
|
||||||
if (config.highlightBait())
|
if (game.isHighlightBait())
|
||||||
{
|
{
|
||||||
renderInventoryHighlights(graphics, game.getRole().getListenItem(game.getLastListenText()), config.highlightBaitColor());
|
renderInventoryHighlights(graphics, game.getRole().getListenItem(game.getLastListenText()), game.getHighlightBaitColor());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HEALER:
|
case HEALER:
|
||||||
if (config.highlightPoison())
|
if (game.isHighlightPoison())
|
||||||
{
|
{
|
||||||
renderInventoryHighlights(graphics, game.getRole().getListenItem(game.getLastListenText()), config.highlightPoisonColor());
|
renderInventoryHighlights(graphics, game.getRole().getListenItem(game.getLastListenText()), game.getHighlightPoisonColor());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -115,11 +113,11 @@ class AboveWidgetsOverlay extends Overlay
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (role == Role.COLLECTOR && config.showEggCountOverlay() && game.getWave() != null)
|
if (role == Role.COLLECTOR && game.isShowEggCountOverlay() && game.getWave() != null)
|
||||||
{
|
{
|
||||||
roleText.setText("(" + game.getWave().getCollectedEggCount() + ") " + formatClock());
|
roleText.setText("(" + game.getWave().getCollectedEggCount() + ") " + formatClock());
|
||||||
}
|
}
|
||||||
else if (role == Role.HEALER && config.showHpCountOverlay() && game.getWave() != null)
|
else if (role == Role.HEALER && game.isShowHpCountOverlay() && game.getWave() != null)
|
||||||
{
|
{
|
||||||
roleText.setText("(" + game.getWave().getHpHealed() + ") " + formatClock());
|
roleText.setText("(" + game.getWave().getHpHealed() + ") " + formatClock());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
package net.runelite.client.plugins.barbarianassault;
|
package net.runelite.client.plugins.barbarianassault;
|
||||||
|
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import net.runelite.client.menus.ComparableEntry;
|
import net.runelite.client.menus.ComparableEntry;
|
||||||
@@ -40,19 +41,19 @@ class BarbarianAssaultMenu
|
|||||||
{
|
{
|
||||||
private final MenuManager menuManager;
|
private final MenuManager menuManager;
|
||||||
private final BarbarianAssaultPlugin game;
|
private final BarbarianAssaultPlugin game;
|
||||||
private final BarbarianAssaultConfig config;
|
|
||||||
private final ArrayList<ComparableEntry> tracker = new ArrayList<>();
|
private final ArrayList<ComparableEntry> tracker = new ArrayList<>();
|
||||||
@Getter @Setter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
@Setter(AccessLevel.PACKAGE)
|
||||||
private boolean hornUpdated = false;
|
private boolean hornUpdated = false;
|
||||||
@Getter @Setter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
@Setter(AccessLevel.PACKAGE)
|
||||||
private boolean rebuildForced = false;
|
private boolean rebuildForced = false;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
BarbarianAssaultMenu(MenuManager menuManager, BarbarianAssaultPlugin game, BarbarianAssaultConfig config)
|
BarbarianAssaultMenu(final MenuManager menuManager, final BarbarianAssaultPlugin game)
|
||||||
{
|
{
|
||||||
this.menuManager = menuManager;
|
this.menuManager = menuManager;
|
||||||
this.game = game;
|
this.game = game;
|
||||||
this.config = config;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isHornOptionHidden(String option)
|
private boolean isHornOptionHidden(String option)
|
||||||
@@ -100,24 +101,24 @@ class BarbarianAssaultMenu
|
|||||||
case TELL_BLUE_ATTACKER_HORN:
|
case TELL_BLUE_ATTACKER_HORN:
|
||||||
case TELL_GREEN_ATTACKER_HORN:
|
case TELL_GREEN_ATTACKER_HORN:
|
||||||
case TELL_RED_ATTACKER_HORN:
|
case TELL_RED_ATTACKER_HORN:
|
||||||
return ((role == Role.ATTACKER && isHornOptionHidden(entry.getOption())) || role == null) && config.removeIncorrectCalls();
|
return ((role == Role.ATTACKER && isHornOptionHidden(entry.getOption())) || role == null) && game.isRemoveIncorrectCalls();
|
||||||
|
|
||||||
case ATTACK_PENANCE_FIGHTER:
|
case ATTACK_PENANCE_FIGHTER:
|
||||||
case ATTACK_PENANCE_RANGER:
|
case ATTACK_PENANCE_RANGER:
|
||||||
case GET_SPIKES_PETRIFIED_MUSHROOM:
|
case GET_SPIKES_PETRIFIED_MUSHROOM:
|
||||||
case TAKE_ATTACKER_ITEM_MACHINE:
|
case TAKE_ATTACKER_ITEM_MACHINE:
|
||||||
return (role != Role.ATTACKER && role != null) && config.removeUnusedMenus();
|
return (role != Role.ATTACKER && role != null) && game.isRemoveUnusedMenus();
|
||||||
|
|
||||||
|
|
||||||
// Defender role Options
|
// Defender role Options
|
||||||
case TELL_MEAT_DEFENDER_HORN:
|
case TELL_MEAT_DEFENDER_HORN:
|
||||||
case TELL_TOFU_DEFENDER_HORN:
|
case TELL_TOFU_DEFENDER_HORN:
|
||||||
case TELL_WORMS_DEFENDER_HORN:
|
case TELL_WORMS_DEFENDER_HORN:
|
||||||
return ((role == Role.DEFENDER && isHornOptionHidden(entry.getOption())) || role == null) && config.removeIncorrectCalls();
|
return ((role == Role.DEFENDER && isHornOptionHidden(entry.getOption())) || role == null) && game.isRemoveIncorrectCalls();
|
||||||
|
|
||||||
case BLOCK_PENANCE_CAVE:
|
case BLOCK_PENANCE_CAVE:
|
||||||
return ((role != Role.DEFENDER && role != null) && config.removeUnusedMenus())
|
return ((role != Role.DEFENDER && role != null) && game.isRemoveUnusedMenus())
|
||||||
|| (role == Role.DEFENDER && config.removePenanceCave());
|
|| (role == Role.DEFENDER && game.isRemovePenanceCave());
|
||||||
|
|
||||||
case DUNK_LAVA_CRATER:
|
case DUNK_LAVA_CRATER:
|
||||||
case FIX:
|
case FIX:
|
||||||
@@ -125,7 +126,7 @@ class BarbarianAssaultMenu
|
|||||||
case TAKE_DEFENDER_ITEM_MACHINE:
|
case TAKE_DEFENDER_ITEM_MACHINE:
|
||||||
case TAKE_HAMMER:
|
case TAKE_HAMMER:
|
||||||
case TAKE_LOGS:
|
case TAKE_LOGS:
|
||||||
return (role != Role.DEFENDER && role != null) && config.removeUnusedMenus();
|
return (role != Role.DEFENDER && role != null) && game.isRemoveUnusedMenus();
|
||||||
|
|
||||||
|
|
||||||
// Collector role options
|
// Collector role options
|
||||||
@@ -133,7 +134,7 @@ class BarbarianAssaultMenu
|
|||||||
case TELL_AGGRESSIVE_COLLECTOR_HORN:
|
case TELL_AGGRESSIVE_COLLECTOR_HORN:
|
||||||
case TELL_CONTROLLED_COLLECTOR_HORN:
|
case TELL_CONTROLLED_COLLECTOR_HORN:
|
||||||
case TELL_DEFENSIVE_COLLECTOR_HORN:
|
case TELL_DEFENSIVE_COLLECTOR_HORN:
|
||||||
return ((role == Role.COLLECTOR && isHornOptionHidden(entry.getOption())) || role == null) && config.removeIncorrectCalls();
|
return ((role == Role.COLLECTOR && isHornOptionHidden(entry.getOption())) || role == null) && game.isRemoveIncorrectCalls();
|
||||||
|
|
||||||
case CONVERT_COLLECTOR_CONVERTER:
|
case CONVERT_COLLECTOR_CONVERTER:
|
||||||
case LOAD_EGG_HOPPER:
|
case LOAD_EGG_HOPPER:
|
||||||
@@ -141,40 +142,40 @@ class BarbarianAssaultMenu
|
|||||||
case TAKE_GREEN_EGG:
|
case TAKE_GREEN_EGG:
|
||||||
case TAKE_RED_EGG:
|
case TAKE_RED_EGG:
|
||||||
case TAKE_YELLOW_EGG:
|
case TAKE_YELLOW_EGG:
|
||||||
return (role != Role.COLLECTOR && role != null) && config.removeUnusedMenus();
|
return (role != Role.COLLECTOR && role != null) && game.isRemoveUnusedMenus();
|
||||||
|
|
||||||
|
|
||||||
// Healer role options
|
// Healer role options
|
||||||
case TELL_CRACKERS_HEALER_HORN:
|
case TELL_CRACKERS_HEALER_HORN:
|
||||||
case TELL_TOFU_HEALER_HORN:
|
case TELL_TOFU_HEALER_HORN:
|
||||||
case TELL_WORMS_HEALER_HORN:
|
case TELL_WORMS_HEALER_HORN:
|
||||||
return ((role == Role.HEALER && isHornOptionHidden(entry.getOption())) || role == null) && config.removeIncorrectCalls();
|
return ((role == Role.HEALER && isHornOptionHidden(entry.getOption())) || role == null) && game.isRemoveIncorrectCalls();
|
||||||
|
|
||||||
case DUNK_POISON_CRATER:
|
case DUNK_POISON_CRATER:
|
||||||
case STOCK_UP_HEALER_ITEM_MACHINE:
|
case STOCK_UP_HEALER_ITEM_MACHINE:
|
||||||
case TAKE_HEALER_ITEM_MACHINE:
|
case TAKE_HEALER_ITEM_MACHINE:
|
||||||
case TAKE_FROM_HEALER_SPRING:
|
case TAKE_FROM_HEALER_SPRING:
|
||||||
case DRINK_FROM_HEALER_SPRING:
|
case DRINK_FROM_HEALER_SPRING:
|
||||||
return (role != Role.HEALER && role != null) && config.removeUnusedMenus();
|
return (role != Role.HEALER && role != null) && game.isRemoveUnusedMenus();
|
||||||
|
|
||||||
case USE_VIAL_GROUND:
|
case USE_VIAL_GROUND:
|
||||||
case USE_VIAL_ITEM:
|
case USE_VIAL_ITEM:
|
||||||
case USE_VIAL_NPC:
|
case USE_VIAL_NPC:
|
||||||
case USE_VIAL_WIDGET:
|
case USE_VIAL_WIDGET:
|
||||||
return role == Role.HEALER && config.removeUnusedMenus();
|
return role == Role.HEALER && game.isRemoveUnusedMenus();
|
||||||
|
|
||||||
|
|
||||||
// Any role options
|
// Any role options
|
||||||
case DROP_HORN:
|
case DROP_HORN:
|
||||||
case EXAMINE_HORN:
|
case EXAMINE_HORN:
|
||||||
case USE_HORN:
|
case USE_HORN:
|
||||||
return config.removeIncorrectCalls();
|
return game.isRemoveIncorrectCalls();
|
||||||
|
|
||||||
case MEDIC_HORN:
|
case MEDIC_HORN:
|
||||||
return config.removeIncorrectCalls() && !hornUpdated;
|
return game.isRemoveIncorrectCalls() && !hornUpdated;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return role != null && config.removeUnusedMenus();
|
return role != null && game.isRemoveUnusedMenus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -189,15 +190,15 @@ class BarbarianAssaultMenu
|
|||||||
|
|
||||||
void enableSwaps()
|
void enableSwaps()
|
||||||
{
|
{
|
||||||
if (config.swapLadder())
|
if (game.isSwapLadder())
|
||||||
{
|
{
|
||||||
menuManager.addSwap("climb-down", "ladder", "quick-start", "ladder");
|
menuManager.addSwap("climb-down", "ladder", "quick-start", "ladder");
|
||||||
}
|
}
|
||||||
if (config.swapCollectorBag())
|
if (game.isSwapCollectorBag())
|
||||||
{
|
{
|
||||||
menuManager.addSwap("look-in", "collection bag", "empty", "collection bag");
|
menuManager.addSwap("look-in", "collection bag", "empty", "collection bag");
|
||||||
}
|
}
|
||||||
if (config.swapDestroyEggs())
|
if (game.isSwapDestroyEggs())
|
||||||
{
|
{
|
||||||
menuManager.addSwap("use", "blue egg", "destroy", "blue egg");
|
menuManager.addSwap("use", "blue egg", "destroy", "blue egg");
|
||||||
menuManager.addSwap("use", "green egg", "destroy", "green egg");
|
menuManager.addSwap("use", "green egg", "destroy", "green egg");
|
||||||
@@ -207,17 +208,17 @@ class BarbarianAssaultMenu
|
|||||||
|
|
||||||
void disableSwaps(boolean force)
|
void disableSwaps(boolean force)
|
||||||
{
|
{
|
||||||
if (!config.swapLadder() || force)
|
if (!game.isSwapLadder() || force)
|
||||||
{
|
{
|
||||||
menuManager.removeSwap("climb-down", "ladder", "quick-start", "ladder");
|
menuManager.removeSwap("climb-down", "ladder", "quick-start", "ladder");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config.swapCollectorBag() || force)
|
if (!game.isSwapCollectorBag() || force)
|
||||||
{
|
{
|
||||||
menuManager.removeSwap("look-in", "collection bag", "empty", "collection bag");
|
menuManager.removeSwap("look-in", "collection bag", "empty", "collection bag");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config.swapDestroyEggs() || force)
|
if (!game.isSwapDestroyEggs() || force)
|
||||||
{
|
{
|
||||||
menuManager.removeSwap("use", "blue egg", "destroy", "blue egg");
|
menuManager.removeSwap("use", "blue egg", "destroy", "blue egg");
|
||||||
menuManager.removeSwap("use", "green egg", "destroy", "green egg");
|
menuManager.removeSwap("use", "green egg", "destroy", "green egg");
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ package net.runelite.client.plugins.barbarianassault;
|
|||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.event.KeyEvent;
|
import java.awt.event.KeyEvent;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
@@ -42,6 +43,8 @@ import java.util.Map;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@@ -108,6 +111,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
tags = {"minigame", "overlay", "timer"},
|
tags = {"minigame", "overlay", "timer"},
|
||||||
type = PluginType.PVM // don't remove this, added this because our barbarian assault plugin is big time modified
|
type = PluginType.PVM // don't remove this, added this because our barbarian assault plugin is big time modified
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
||||||
{
|
{
|
||||||
private static final String ENDGAME_REWARD_NEEDLE_TEXT = "<br>5";
|
private static final String ENDGAME_REWARD_NEEDLE_TEXT = "<br>5";
|
||||||
@@ -241,16 +245,71 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
|
|
||||||
private String poisonUsed = null;
|
private String poisonUsed = null;
|
||||||
|
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
BarbarianAssaultConfig provideConfig(ConfigManager configManager)
|
BarbarianAssaultConfig provideConfig(ConfigManager configManager)
|
||||||
{
|
{
|
||||||
return configManager.getConfig(BarbarianAssaultConfig.class);
|
return configManager.getConfig(BarbarianAssaultConfig.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// save config values
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean swapLadder;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showTimer;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean removeIncorrectCalls;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean removeUnusedMenus;
|
||||||
|
private boolean prayerMetronome;
|
||||||
|
private int prayerMetronomeVolume;
|
||||||
|
private boolean showDeathTimes;
|
||||||
|
private DeathTimesMode showDeathTimesMode;
|
||||||
|
private boolean waveTimes;
|
||||||
|
private boolean showTotalRewards;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean highlightArrows;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private Color highlightArrowColor;
|
||||||
|
private boolean removeIncorrectAttackStyles;
|
||||||
|
private boolean tagging;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean highlightBait;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private Color highlightBaitColor;
|
||||||
|
private boolean showDefTimer;
|
||||||
|
private boolean deprioritizeBait;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean removePenanceCave;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean highlightPoison;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private Color highlightPoisonColor;
|
||||||
|
private boolean highlightNotification;
|
||||||
|
private Color highlightNotificationColor;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showHpCountOverlay;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showTeammateHealthbars;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean healerCodes;
|
||||||
|
private boolean healerMenuOption;
|
||||||
|
private boolean shiftOverstock;
|
||||||
|
private boolean controlHealer;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean swapCollectorBag;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean swapDestroyEggs;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean highlightCollectorEggs;
|
||||||
|
private boolean deprioritizeIncorrectEggs;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showEggCountOverlay;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
|
|
||||||
font = FontManager.getRunescapeFont().deriveFont(Font.BOLD, 24);
|
font = FontManager.getRunescapeFont().deriveFont(Font.BOLD, 24);
|
||||||
torsoImage = itemManager.getImage(ItemID.FIGHTER_TORSO);
|
torsoImage = itemManager.getImage(ItemID.FIGHTER_TORSO);
|
||||||
clockImage = ImageUtil.getResourceStreamFromClass(getClass(), "clock.png");
|
clockImage = ImageUtil.getResourceStreamFromClass(getClass(), "clock.png");
|
||||||
@@ -329,10 +388,12 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateConfig();
|
||||||
|
|
||||||
switch (configChanged.getKey())
|
switch (configChanged.getKey())
|
||||||
{
|
{
|
||||||
case "showTimer":
|
case "showTimer":
|
||||||
if (!config.showTimer())
|
if (!this.showTimer)
|
||||||
{
|
{
|
||||||
showRoleSprite();
|
showRoleSprite();
|
||||||
}
|
}
|
||||||
@@ -352,7 +413,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "showDefTimer":
|
case "showDefTimer":
|
||||||
if (config.showDefTimer() && getRole() == Role.DEFENDER)
|
if (this.showDefTimer && getRole() == Role.DEFENDER)
|
||||||
{
|
{
|
||||||
addTickTimer();
|
addTickTimer();
|
||||||
}
|
}
|
||||||
@@ -364,9 +425,9 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
|
|
||||||
case "showDeathTimes":
|
case "showDeathTimes":
|
||||||
case "showDeathTimesMode":
|
case "showDeathTimesMode":
|
||||||
if (config.showDeathTimes()
|
if (this.showDeathTimes
|
||||||
&& (config.showDeathTimesMode() == DeathTimesMode.INFO_BOX
|
&& (this.showDeathTimesMode == DeathTimesMode.INFO_BOX
|
||||||
|| config.showDeathTimesMode() == DeathTimesMode.BOTH))
|
|| this.showDeathTimesMode == DeathTimesMode.BOTH))
|
||||||
{
|
{
|
||||||
addAllDeathTimes();
|
addAllDeathTimes();
|
||||||
}
|
}
|
||||||
@@ -383,7 +444,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "removeIncorrectAttackStyles":
|
case "removeIncorrectAttackStyles":
|
||||||
if (!config.removeIncorrectAttackStyles())
|
if (!this.removeIncorrectAttackStyles)
|
||||||
{
|
{
|
||||||
clientThread.invoke(this::showAllStyles);
|
clientThread.invoke(this::showAllStyles);
|
||||||
}
|
}
|
||||||
@@ -391,6 +452,44 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateConfig()
|
||||||
|
{
|
||||||
|
this.swapLadder = config.swapLadder();
|
||||||
|
this.showTimer = config.showTimer();
|
||||||
|
this.removeIncorrectCalls = config.removeIncorrectCalls();
|
||||||
|
this.removeUnusedMenus = config.removeUnusedMenus();
|
||||||
|
this.prayerMetronome = config.prayerMetronome();
|
||||||
|
this.prayerMetronomeVolume = config.prayerMetronomeVolume();
|
||||||
|
this.showDeathTimes = config.showDeathTimes();
|
||||||
|
this.showDeathTimesMode = config.showDeathTimesMode();
|
||||||
|
this.waveTimes = config.waveTimes();
|
||||||
|
this.showTotalRewards = config.showTotalRewards();
|
||||||
|
this.highlightArrows = config.highlightArrows();
|
||||||
|
this.highlightArrowColor = config.highlightArrowColor();
|
||||||
|
this.removeIncorrectAttackStyles = config.removeIncorrectAttackStyles();
|
||||||
|
this.tagging = config.tagging();
|
||||||
|
this.highlightBait = config.highlightBait();
|
||||||
|
this.highlightBaitColor = config.highlightBaitColor();
|
||||||
|
this.showDefTimer = config.showDefTimer();
|
||||||
|
this.deprioritizeBait = config.deprioritizeBait();
|
||||||
|
this.removePenanceCave = config.removePenanceCave();
|
||||||
|
this.highlightPoison = config.highlightPoison();
|
||||||
|
this.highlightPoisonColor = config.highlightPoisonColor();
|
||||||
|
this.highlightNotification = config.highlightNotification();
|
||||||
|
this.highlightNotificationColor = config.highlightNotificationColor();
|
||||||
|
this.showHpCountOverlay = config.showHpCountOverlay();
|
||||||
|
this.showTeammateHealthbars = config.showTeammateHealthbars();
|
||||||
|
this.healerCodes = config.healerCodes();
|
||||||
|
this.healerMenuOption = config.healerMenuOption();
|
||||||
|
this.shiftOverstock = config.shiftOverstock();
|
||||||
|
this.controlHealer = config.controlHealer();
|
||||||
|
this.swapCollectorBag = config.swapCollectorBag();
|
||||||
|
this.swapDestroyEggs = config.swapDestroyEggs();
|
||||||
|
this.highlightCollectorEggs = config.highlightCollectorEggs();
|
||||||
|
this.deprioritizeIncorrectEggs = config.deprioritizeIncorrectEggs();
|
||||||
|
this.showEggCountOverlay = config.showEggCountOverlay();
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onWidgetLoaded(WidgetLoaded event)
|
public void onWidgetLoaded(WidgetLoaded event)
|
||||||
{
|
{
|
||||||
@@ -408,7 +507,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
Widget pointsWidget = client.getWidget(WidgetInfo.BA_REWARD_TEXT);
|
Widget pointsWidget = client.getWidget(WidgetInfo.BA_REWARD_TEXT);
|
||||||
if (!rewardWidget.getText().contains(ENDGAME_REWARD_NEEDLE_TEXT))
|
if (!rewardWidget.getText().contains(ENDGAME_REWARD_NEEDLE_TEXT))
|
||||||
{
|
{
|
||||||
if (config.showTotalRewards() && pointsWidget != null)
|
if (this.showTotalRewards && pointsWidget != null)
|
||||||
{
|
{
|
||||||
// The wave will be null if the plugin is disabled mid game, but
|
// The wave will be null if the plugin is disabled mid game, but
|
||||||
// the wave points will still be accurate if it is re-enabled
|
// the wave points will still be accurate if it is re-enabled
|
||||||
@@ -433,7 +532,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
{
|
{
|
||||||
announceGameTime();
|
announceGameTime();
|
||||||
|
|
||||||
if (config.showTotalRewards() && scorecard != null && scorecard.getNumberOfWaves() == 9)
|
if (this.showTotalRewards && scorecard != null && scorecard.getNumberOfWaves() == 9)
|
||||||
{
|
{
|
||||||
announce(scorecard.getGameSummary());
|
announce(scorecard.getGameSummary());
|
||||||
}
|
}
|
||||||
@@ -496,11 +595,11 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
wave.setHpHealed(wave.getHpHealed() + health);
|
wave.setHpHealed(wave.getHpHealed() + health);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (message.contains("the wrong type of poisoned food to use") && config.highlightNotification())
|
else if (message.contains("the wrong type of poisoned food to use") && this.highlightNotification)
|
||||||
{
|
{
|
||||||
final MessageNode messageNode = chatMessage.getMessageNode();
|
final MessageNode messageNode = chatMessage.getMessageNode();
|
||||||
final String nodeValue = Text.removeTags(messageNode.getValue());
|
final String nodeValue = Text.removeTags(messageNode.getValue());
|
||||||
messageNode.setValue(ColorUtil.wrapWithColorTag(nodeValue, config.highlightNotificationColor()));
|
messageNode.setValue(ColorUtil.wrapWithColorTag(nodeValue, this.highlightNotificationColor));
|
||||||
chatMessageManager.update(messageNode);
|
chatMessageManager.update(messageNode);
|
||||||
}
|
}
|
||||||
else if (message.startsWith("All of the Penance"))
|
else if (message.startsWith("All of the Penance"))
|
||||||
@@ -528,9 +627,9 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.showDeathTimes() && wave != null
|
if (this.showDeathTimes && wave != null
|
||||||
&& (config.showDeathTimesMode() == DeathTimesMode.CHAT_BOX
|
&& (this.showDeathTimesMode == DeathTimesMode.CHAT_BOX
|
||||||
|| config.showDeathTimesMode() == DeathTimesMode.BOTH))
|
|| this.showDeathTimesMode == DeathTimesMode.BOTH))
|
||||||
{
|
{
|
||||||
final MessageNode node = chatMessage.getMessageNode();
|
final MessageNode node = chatMessage.getMessageNode();
|
||||||
final String nodeValue = Text.removeTags(node.getValue());
|
final String nodeValue = Text.removeTags(node.getValue());
|
||||||
@@ -635,9 +734,9 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
tickCounter.setCount(tickNum);
|
tickCounter.setCount(tickNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.prayerMetronome() && isAnyPrayerActive())
|
if (this.prayerMetronome && isAnyPrayerActive())
|
||||||
{
|
{
|
||||||
for (int i = 0; i < config.prayerMetronomeVolume(); i++)
|
for (int i = 0; i < this.prayerMetronomeVolume; i++)
|
||||||
{
|
{
|
||||||
client.playSoundEffect(SoundEffectID.GE_INCREMENT_PLOP);
|
client.playSoundEffect(SoundEffectID.GE_INCREMENT_PLOP);
|
||||||
}
|
}
|
||||||
@@ -821,7 +920,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
// This doesn't have to be done in BeforeRender. And although it is
|
// This doesn't have to be done in BeforeRender. And although it is
|
||||||
// inefficient, it's only being done while in the instance. Will
|
// inefficient, it's only being done while in the instance. Will
|
||||||
// likely be changed in the future
|
// likely be changed in the future
|
||||||
if (getRole() == Role.ATTACKER && config.removeIncorrectAttackStyles())
|
if (getRole() == Role.ATTACKER && this.removeIncorrectAttackStyles)
|
||||||
{
|
{
|
||||||
Widget weapon = client.getWidget(WidgetInfo.COMBAT_WEAPON);
|
Widget weapon = client.getWidget(WidgetInfo.COMBAT_WEAPON);
|
||||||
|
|
||||||
@@ -891,7 +990,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
switch (getRole())
|
switch (getRole())
|
||||||
{
|
{
|
||||||
case ATTACKER:
|
case ATTACKER:
|
||||||
if (config.tagging() && option.equals("attack") && (target.startsWith("penance fighter") || target.startsWith("penance ranger")))
|
if (this.tagging && option.equals("attack") && (target.startsWith("penance fighter") || target.startsWith("penance ranger")))
|
||||||
{
|
{
|
||||||
String tag = StringUtils.substringBefore(entry.getTarget(), ")");
|
String tag = StringUtils.substringBefore(entry.getTarget(), ")");
|
||||||
|
|
||||||
@@ -932,7 +1031,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
priority.add(entry);
|
priority.add(entry);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (config.deprioritizeIncorrectEggs()
|
else if (this.deprioritizeIncorrectEggs
|
||||||
&& option.equals("take")
|
&& option.equals("take")
|
||||||
&& (target.equals("blue egg") || target.equals("green egg") || target.equals("red egg")))
|
&& (target.equals("blue egg") || target.equals("green egg") || target.equals("red egg")))
|
||||||
{
|
{
|
||||||
@@ -954,7 +1053,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
priority.add(entry);
|
priority.add(entry);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (config.deprioritizeBait()
|
else if (this.deprioritizeBait
|
||||||
&& option.equals("take")
|
&& option.equals("take")
|
||||||
&& (target.equals("tofu") || target.equals("crackers") || target.equals("worms")))
|
&& (target.equals("tofu") || target.equals("crackers") || target.equals("worms")))
|
||||||
{
|
{
|
||||||
@@ -963,7 +1062,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case HEALER:
|
case HEALER:
|
||||||
if (config.healerMenuOption() && target.contains("penance healer") && healers.containsKey(identifier))
|
if (this.healerMenuOption && target.contains("penance healer") && healers.containsKey(identifier))
|
||||||
{
|
{
|
||||||
String tag = StringUtils.substringBefore(entry.getTarget(), " (");
|
String tag = StringUtils.substringBefore(entry.getTarget(), " (");
|
||||||
int time = healers.get(identifier).timeToPoison();
|
int time = healers.get(identifier).timeToPoison();
|
||||||
@@ -978,17 +1077,17 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
if ((target.startsWith("poisoned meat ->") || target.startsWith("poisoned tofu ->") || target.startsWith("poisoned worms ->")))
|
if ((target.startsWith("poisoned meat ->") || target.startsWith("poisoned tofu ->") || target.startsWith("poisoned worms ->")))
|
||||||
{
|
{
|
||||||
// Poison should only be used on healers
|
// Poison should only be used on healers
|
||||||
if (config.removeUnusedMenus() && !target.contains("penance healer"))
|
if (this.removeUnusedMenus && !target.contains("penance healer"))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (config.controlHealer() && controlDown && identifier == lastHealerPoisoned && target.contains("penance healer"))
|
else if (this.controlHealer && controlDown && identifier == lastHealerPoisoned && target.contains("penance healer"))
|
||||||
{
|
{
|
||||||
selected.add(entry);
|
selected.add(entry);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (config.shiftOverstock() && target.equals("healer item machine") && shiftDown)
|
else if (this.shiftOverstock && target.equals("healer item machine") && shiftDown)
|
||||||
{
|
{
|
||||||
if (option.contains(listen))
|
if (option.contains(listen))
|
||||||
{
|
{
|
||||||
@@ -996,7 +1095,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (config.removeUnusedMenus())
|
else if (this.removeUnusedMenus)
|
||||||
{
|
{
|
||||||
// Vials that are empty should only be used on spring
|
// Vials that are empty should only be used on spring
|
||||||
if (target.startsWith("healing vial ->") && !target.endsWith("healer spring"))
|
if (target.startsWith("healing vial ->") && !target.endsWith("healer spring"))
|
||||||
@@ -1312,12 +1411,12 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
|
|
||||||
private void validateWidgets()
|
private void validateWidgets()
|
||||||
{
|
{
|
||||||
if (!config.showTimer())
|
if (!this.showTimer)
|
||||||
{
|
{
|
||||||
showRoleSprite();
|
showRoleSprite();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.showDefTimer() && getRole() == Role.DEFENDER)
|
if (this.showDefTimer && getRole() == Role.DEFENDER)
|
||||||
{
|
{
|
||||||
addTickTimer();
|
addTickTimer();
|
||||||
}
|
}
|
||||||
@@ -1326,9 +1425,9 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
removeTickTimer();
|
removeTickTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.showDeathTimes()
|
if (this.showDeathTimes
|
||||||
&& (config.showDeathTimesMode() == DeathTimesMode.INFO_BOX
|
&& (this.showDeathTimesMode == DeathTimesMode.INFO_BOX
|
||||||
|| config.showDeathTimesMode() == DeathTimesMode.BOTH))
|
|| this.showDeathTimesMode == DeathTimesMode.BOTH))
|
||||||
{
|
{
|
||||||
addAllDeathTimes();
|
addAllDeathTimes();
|
||||||
}
|
}
|
||||||
@@ -1388,7 +1487,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
|
|
||||||
deathTimes.add(box);
|
deathTimes.add(box);
|
||||||
|
|
||||||
if (config.showDeathTimes() && (config.showDeathTimesMode() == DeathTimesMode.INFO_BOX || config.showDeathTimesMode() == DeathTimesMode.BOTH))
|
if (this.showDeathTimes && (this.showDeathTimesMode == DeathTimesMode.INFO_BOX || this.showDeathTimesMode == DeathTimesMode.BOTH))
|
||||||
{
|
{
|
||||||
infoBoxManager.addInfoBox(box);
|
infoBoxManager.addInfoBox(box);
|
||||||
}
|
}
|
||||||
@@ -1454,7 +1553,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
|
|
||||||
private void announceWaveTime()
|
private void announceWaveTime()
|
||||||
{
|
{
|
||||||
if (config.waveTimes() && wave != null)
|
if (this.waveTimes && wave != null)
|
||||||
{
|
{
|
||||||
announceTime("Wave " + getStage() + " duration: ", wave.getWaveTimer().getElapsedTimeFormatted());
|
announceTime("Wave " + getStage() + " duration: ", wave.getWaveTimer().getElapsedTimeFormatted());
|
||||||
}
|
}
|
||||||
@@ -1462,7 +1561,7 @@ public class BarbarianAssaultPlugin extends Plugin implements KeyListener
|
|||||||
|
|
||||||
private void announceGameTime()
|
private void announceGameTime()
|
||||||
{
|
{
|
||||||
if (config.waveTimes() && gameTimer != null)
|
if (this.waveTimes && gameTimer != null)
|
||||||
{
|
{
|
||||||
announceTime("Game finished, duration: ", gameTimer.getElapsedTimeFormatted());
|
announceTime("Game finished, duration: ", gameTimer.getElapsedTimeFormatted());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import net.runelite.client.chat.ChatMessageBuilder;
|
|||||||
import net.runelite.client.eventbus.Subscribe;
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
|
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
public class Scorecard
|
public class Scorecard
|
||||||
{
|
{
|
||||||
private BarbarianAssaultPlugin game;
|
private BarbarianAssaultPlugin game;
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.barbarianassault;
|
package net.runelite.client.plugins.barbarianassault;
|
||||||
|
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
@@ -33,7 +34,7 @@ import java.time.format.DateTimeFormatter;
|
|||||||
|
|
||||||
class Timer
|
class Timer
|
||||||
{
|
{
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final Instant startTime;
|
private final Instant startTime;
|
||||||
|
|
||||||
Timer()
|
Timer()
|
||||||
|
|||||||
@@ -26,12 +26,14 @@
|
|||||||
package net.runelite.client.plugins.barbarianassault;
|
package net.runelite.client.plugins.barbarianassault;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
import net.runelite.client.ui.overlay.infobox.InfoBox;
|
import net.runelite.client.ui.overlay.infobox.InfoBox;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
public class TimerBox extends InfoBox
|
public class TimerBox extends InfoBox
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ import net.runelite.client.chat.ChatMessageBuilder;
|
|||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class Wave
|
public class Wave
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import java.awt.Color;
|
|||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||||
import net.runelite.api.Varbits;
|
import net.runelite.api.Varbits;
|
||||||
@@ -43,13 +44,14 @@ import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
|||||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||||
import net.runelite.client.util.ColorUtil;
|
import net.runelite.client.util.ColorUtil;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class BarrowsBrotherSlainOverlay extends Overlay
|
public class BarrowsBrotherSlainOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final PanelComponent panelComponent = new PanelComponent();
|
private final PanelComponent panelComponent = new PanelComponent();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private BarrowsBrotherSlainOverlay(BarrowsPlugin plugin, Client client)
|
private BarrowsBrotherSlainOverlay(final BarrowsPlugin plugin, final Client client)
|
||||||
{
|
{
|
||||||
super(plugin);
|
super(plugin);
|
||||||
setPosition(OverlayPosition.TOP_LEFT);
|
setPosition(OverlayPosition.TOP_LEFT);
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.barrows;
|
package net.runelite.client.plugins.barrows;
|
||||||
|
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import net.runelite.api.Varbits;
|
import net.runelite.api.Varbits;
|
||||||
@@ -39,10 +40,10 @@ public enum BarrowsBrothers
|
|||||||
TORAG("Torag", new WorldPoint(3553, 3283, 0), Varbits.BARROWS_KILLED_TORAG),
|
TORAG("Torag", new WorldPoint(3553, 3283, 0), Varbits.BARROWS_KILLED_TORAG),
|
||||||
VERAC("Verac", new WorldPoint(3557, 3298, 0), Varbits.BARROWS_KILLED_VERAC);
|
VERAC("Verac", new WorldPoint(3557, 3298, 0), Varbits.BARROWS_KILLED_VERAC);
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final String name;
|
private final String name;
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final WorldPoint location;
|
private final WorldPoint location;
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final Varbits killedVarbit;
|
private final Varbits killedVarbit;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import java.awt.Graphics2D;
|
|||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.GameObject;
|
import net.runelite.api.GameObject;
|
||||||
import net.runelite.api.NPC;
|
import net.runelite.api.NPC;
|
||||||
@@ -44,22 +45,21 @@ import net.runelite.client.ui.overlay.Overlay;
|
|||||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
class BarrowsOverlay extends Overlay
|
class BarrowsOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private static final int MAX_DISTANCE = 2350;
|
private static final int MAX_DISTANCE = 2350;
|
||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final BarrowsPlugin plugin;
|
private final BarrowsPlugin plugin;
|
||||||
private final BarrowsConfig config;
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private BarrowsOverlay(Client client, BarrowsPlugin plugin, BarrowsConfig config)
|
private BarrowsOverlay(final Client client, final BarrowsPlugin plugin)
|
||||||
{
|
{
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.config = config;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -71,7 +71,7 @@ class BarrowsOverlay extends Overlay
|
|||||||
Widget puzzleAnswer = plugin.getPuzzleAnswer();
|
Widget puzzleAnswer = plugin.getPuzzleAnswer();
|
||||||
|
|
||||||
// tunnels are only on z=0
|
// tunnels are only on z=0
|
||||||
if (!plugin.getWalls().isEmpty() && client.getPlane() == 0 && config.showMinimap())
|
if (!plugin.getWalls().isEmpty() && client.getPlane() == 0 && plugin.isShowMinimap())
|
||||||
{
|
{
|
||||||
// NPC dots
|
// NPC dots
|
||||||
graphics.setColor(npcColor);
|
graphics.setColor(npcColor);
|
||||||
@@ -117,12 +117,12 @@ class BarrowsOverlay extends Overlay
|
|||||||
graphics.setColor(playerColor);
|
graphics.setColor(playerColor);
|
||||||
graphics.fillRect(local.getMinimapLocation().getX(), local.getMinimapLocation().getY(), 3, 3);
|
graphics.fillRect(local.getMinimapLocation().getX(), local.getMinimapLocation().getY(), 3, 3);
|
||||||
}
|
}
|
||||||
else if (config.showBrotherLoc())
|
else if (plugin.isShowBrotherLoc())
|
||||||
{
|
{
|
||||||
renderBarrowsBrothers(graphics);
|
renderBarrowsBrothers(graphics);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (puzzleAnswer != null && config.showPuzzleAnswer() && !puzzleAnswer.isHidden())
|
if (puzzleAnswer != null && plugin.isShowPuzzleAnswer() && !puzzleAnswer.isHidden())
|
||||||
{
|
{
|
||||||
Rectangle answerRect = puzzleAnswer.getBounds();
|
Rectangle answerRect = puzzleAnswer.getBounds();
|
||||||
graphics.setColor(Color.GREEN);
|
graphics.setColor(Color.GREEN);
|
||||||
@@ -230,11 +230,11 @@ class BarrowsOverlay extends Overlay
|
|||||||
|
|
||||||
if (client.getVar(brother.getKilledVarbit()) > 0)
|
if (client.getVar(brother.getKilledVarbit()) > 0)
|
||||||
{
|
{
|
||||||
graphics.setColor(config.deadBrotherLocColor());
|
graphics.setColor(plugin.getDeadBrotherLocColor());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
graphics.setColor(config.brotherLocColor());
|
graphics.setColor(plugin.getBrotherLocColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
graphics.drawString(brotherLetter, minimapText.getX(), minimapText.getY());
|
graphics.drawString(brotherLetter, minimapText.getX(), minimapText.getY());
|
||||||
|
|||||||
@@ -27,10 +27,12 @@ package net.runelite.client.plugins.barrows;
|
|||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
|
import java.awt.Color;
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.api.ChatMessageType;
|
import net.runelite.api.ChatMessageType;
|
||||||
@@ -77,6 +79,7 @@ import net.runelite.client.util.StackFormatter;
|
|||||||
description = "Show helpful information for the Barrows minigame",
|
description = "Show helpful information for the Barrows minigame",
|
||||||
tags = {"combat", "minigame", "minimap", "bosses", "pve", "pvm"}
|
tags = {"combat", "minigame", "minimap", "bosses", "pve", "pvm"}
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
public class BarrowsPlugin extends Plugin
|
public class BarrowsPlugin extends Plugin
|
||||||
{
|
{
|
||||||
@Getter(AccessLevel.PACKAGE)
|
@Getter(AccessLevel.PACKAGE)
|
||||||
@@ -144,9 +147,23 @@ public class BarrowsPlugin extends Plugin
|
|||||||
return configManager.getConfig(BarrowsConfig.class);
|
return configManager.getConfig(BarrowsConfig.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showMinimap;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showBrotherLoc;
|
||||||
|
private boolean showChestValue;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private Color brotherLocColor;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private Color deadBrotherLocColor;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showPuzzleAnswer;
|
||||||
|
private boolean showPrayerDrainTimer;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
overlayManager.add(barrowsOverlay);
|
overlayManager.add(barrowsOverlay);
|
||||||
overlayManager.add(brotherOverlay);
|
overlayManager.add(brotherOverlay);
|
||||||
}
|
}
|
||||||
@@ -179,12 +196,28 @@ public class BarrowsPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onConfigChanged(ConfigChanged event)
|
public void onConfigChanged(ConfigChanged event)
|
||||||
{
|
{
|
||||||
if (event.getGroup().equals("barrows") && !config.showPrayerDrainTimer())
|
if (event.getGroup().equals("barrows"))
|
||||||
{
|
{
|
||||||
stopPrayerDrainTimer();
|
updateConfig();
|
||||||
|
|
||||||
|
if (!this.showPrayerDrainTimer)
|
||||||
|
{
|
||||||
|
stopPrayerDrainTimer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateConfig()
|
||||||
|
{
|
||||||
|
this.showMinimap = config.showMinimap();
|
||||||
|
this.showBrotherLoc = config.showBrotherLoc();
|
||||||
|
this.showChestValue = config.showChestValue();
|
||||||
|
this.brotherLocColor = config.brotherLocColor();
|
||||||
|
this.deadBrotherLocColor = config.deadBrotherLocColor();
|
||||||
|
this.showPuzzleAnswer = config.showPuzzleAnswer();
|
||||||
|
this.showPrayerDrainTimer = config.showPrayerDrainTimer();
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onWallObjectSpawned(WallObjectSpawned event)
|
public void onWallObjectSpawned(WallObjectSpawned event)
|
||||||
{
|
{
|
||||||
@@ -276,10 +309,14 @@ public class BarrowsPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onWidgetLoaded(WidgetLoaded event)
|
public void onWidgetLoaded(WidgetLoaded event)
|
||||||
{
|
{
|
||||||
if (event.getGroupId() == WidgetID.BARROWS_REWARD_GROUP_ID && config.showChestValue())
|
if (event.getGroupId() == WidgetID.BARROWS_REWARD_GROUP_ID && this.showChestValue)
|
||||||
{
|
{
|
||||||
ItemContainer barrowsRewardContainer = client.getItemContainer(InventoryID.BARROWS_REWARD);
|
ItemContainer barrowsRewardContainer = client.getItemContainer(InventoryID.BARROWS_REWARD);
|
||||||
Item[] items = barrowsRewardContainer.getItems();
|
Item[] items = new Item[0];
|
||||||
|
if (barrowsRewardContainer != null)
|
||||||
|
{
|
||||||
|
items = barrowsRewardContainer.getItems();
|
||||||
|
}
|
||||||
long chestPrice = 0;
|
long chestPrice = 0;
|
||||||
|
|
||||||
for (Item item : items)
|
for (Item item : items)
|
||||||
@@ -320,7 +357,7 @@ public class BarrowsPlugin extends Plugin
|
|||||||
|
|
||||||
private void startPrayerDrainTimer()
|
private void startPrayerDrainTimer()
|
||||||
{
|
{
|
||||||
if (config.showPrayerDrainTimer())
|
if (this.showPrayerDrainTimer)
|
||||||
{
|
{
|
||||||
final LoopTimer loopTimer = new LoopTimer(
|
final LoopTimer loopTimer = new LoopTimer(
|
||||||
PRAYER_DRAIN_INTERVAL_MS,
|
PRAYER_DRAIN_INTERVAL_MS,
|
||||||
|
|||||||
@@ -35,10 +35,10 @@ import net.runelite.api.Client;
|
|||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
import net.runelite.api.Varbits;
|
import net.runelite.api.Varbits;
|
||||||
import net.runelite.api.events.ChatMessage;
|
import net.runelite.api.events.ChatMessage;
|
||||||
|
import net.runelite.api.events.ConfigChanged;
|
||||||
import net.runelite.api.events.MenuEntryAdded;
|
import net.runelite.api.events.MenuEntryAdded;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.eventbus.Subscribe;
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
import net.runelite.client.menus.MenuManager;
|
|
||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
import net.runelite.client.plugins.PluginDescriptor;
|
import net.runelite.client.plugins.PluginDescriptor;
|
||||||
import net.runelite.client.plugins.PluginType;
|
import net.runelite.client.plugins.PluginType;
|
||||||
@@ -56,7 +56,6 @@ import org.apache.commons.lang3.RandomUtils;
|
|||||||
type = PluginType.SKILLING,
|
type = PluginType.SKILLING,
|
||||||
enabledByDefault = false
|
enabledByDefault = false
|
||||||
)
|
)
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class BlackjackPlugin extends Plugin
|
public class BlackjackPlugin extends Plugin
|
||||||
@@ -68,10 +67,9 @@ public class BlackjackPlugin extends Plugin
|
|||||||
@Inject
|
@Inject
|
||||||
private Client client;
|
private Client client;
|
||||||
@Inject
|
@Inject
|
||||||
private MenuManager menuManager;
|
|
||||||
@Inject
|
|
||||||
private BlackjackConfig config;
|
private BlackjackConfig config;
|
||||||
|
|
||||||
|
private boolean pickpocketOnAggro;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
BlackjackConfig getConfig(ConfigManager configManager)
|
BlackjackConfig getConfig(ConfigManager configManager)
|
||||||
@@ -79,6 +77,20 @@ public class BlackjackPlugin extends Plugin
|
|||||||
return configManager.getConfig(BlackjackConfig.class);
|
return configManager.getConfig(BlackjackConfig.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void startUp() throws Exception
|
||||||
|
{
|
||||||
|
this.pickpocketOnAggro = config.pickpocketOnAggro();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onConfigChanged(ConfigChanged event)
|
||||||
|
{
|
||||||
|
if (event.getGroup().equals("blackjack"))
|
||||||
|
{
|
||||||
|
this.pickpocketOnAggro = config.pickpocketOnAggro();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||||
@@ -107,7 +119,7 @@ public class BlackjackPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (event.getType() == ChatMessageType.SPAM)
|
if (event.getType() == ChatMessageType.SPAM)
|
||||||
{
|
{
|
||||||
if (event.getMessage().equals(SUCCESS_BLACKJACK) ^ (event.getMessage().equals(FAILED_BLACKJACK) && config.pickpocketOnAggro()))
|
if (event.getMessage().equals(SUCCESS_BLACKJACK) ^ (event.getMessage().equals(FAILED_BLACKJACK) && this.pickpocketOnAggro))
|
||||||
{
|
{
|
||||||
nextKnockOutTick = client.getTickCount() + RandomUtils.nextInt(3, 4);
|
nextKnockOutTick = client.getTickCount() + RandomUtils.nextInt(3, 4);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import java.awt.Dimension;
|
|||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.geom.Area;
|
import java.awt.geom.Area;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.EquipmentInventorySlot;
|
import net.runelite.api.EquipmentInventorySlot;
|
||||||
import net.runelite.api.GameObject;
|
import net.runelite.api.GameObject;
|
||||||
@@ -42,21 +43,20 @@ import net.runelite.api.coords.LocalPoint;
|
|||||||
import net.runelite.client.ui.overlay.Overlay;
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
class BlastFurnaceClickBoxOverlay extends Overlay
|
class BlastFurnaceClickBoxOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private static final int MAX_DISTANCE = 2350;
|
private static final int MAX_DISTANCE = 2350;
|
||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final BlastFurnacePlugin plugin;
|
private final BlastFurnacePlugin plugin;
|
||||||
private final BlastFurnaceConfig config;
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private BlastFurnaceClickBoxOverlay(Client client, BlastFurnacePlugin plugin, BlastFurnaceConfig config)
|
private BlastFurnaceClickBoxOverlay(final Client client, final BlastFurnacePlugin plugin)
|
||||||
{
|
{
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.config = config;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -64,13 +64,13 @@ class BlastFurnaceClickBoxOverlay extends Overlay
|
|||||||
{
|
{
|
||||||
int dispenserState = client.getVar(Varbits.BAR_DISPENSER);
|
int dispenserState = client.getVar(Varbits.BAR_DISPENSER);
|
||||||
|
|
||||||
if (config.showConveyorBelt() && plugin.getConveyorBelt() != null)
|
if (plugin.isShowConveyorBelt() && plugin.getConveyorBelt() != null)
|
||||||
{
|
{
|
||||||
Color color = dispenserState == 1 ? Color.RED : Color.GREEN;
|
Color color = dispenserState == 1 ? Color.RED : Color.GREEN;
|
||||||
renderObject(plugin.getConveyorBelt(), graphics, color);
|
renderObject(plugin.getConveyorBelt(), graphics, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.showBarDispenser() && plugin.getBarDispenser() != null)
|
if (plugin.isShowBarDispenser() && plugin.getBarDispenser() != null)
|
||||||
{
|
{
|
||||||
boolean hasIceGloves = hasIceGloves();
|
boolean hasIceGloves = hasIceGloves();
|
||||||
Color color = dispenserState == 2 && hasIceGloves ? Color.GREEN : (dispenserState == 3 ? Color.GREEN : Color.RED);
|
Color color = dispenserState == 2 && hasIceGloves ? Color.GREEN : (dispenserState == 3 ? Color.GREEN : Color.RED);
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ package net.runelite.client.plugins.blastfurnace;
|
|||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||||
import static net.runelite.api.Varbits.BLAST_FURNACE_COFFER;
|
import static net.runelite.api.Varbits.BLAST_FURNACE_COFFER;
|
||||||
@@ -41,6 +42,7 @@ import net.runelite.client.ui.overlay.components.table.TableComponent;
|
|||||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||||
import net.runelite.client.util.StackFormatter;
|
import net.runelite.client.util.StackFormatter;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
class BlastFurnaceCofferOverlay extends Overlay
|
class BlastFurnaceCofferOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private final Client client;
|
private final Client client;
|
||||||
@@ -48,7 +50,7 @@ class BlastFurnaceCofferOverlay extends Overlay
|
|||||||
private final PanelComponent panelComponent = new PanelComponent();
|
private final PanelComponent panelComponent = new PanelComponent();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private BlastFurnaceCofferOverlay(Client client, BlastFurnacePlugin plugin)
|
private BlastFurnaceCofferOverlay(final Client client, final BlastFurnacePlugin plugin)
|
||||||
{
|
{
|
||||||
super(plugin);
|
super(plugin);
|
||||||
setPosition(OverlayPosition.TOP_LEFT);
|
setPosition(OverlayPosition.TOP_LEFT);
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import java.awt.Dimension;
|
|||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||||
import net.runelite.client.game.ItemManager;
|
import net.runelite.client.game.ItemManager;
|
||||||
@@ -39,6 +40,7 @@ import net.runelite.client.ui.overlay.components.ComponentOrientation;
|
|||||||
import net.runelite.client.ui.overlay.components.ImageComponent;
|
import net.runelite.client.ui.overlay.components.ImageComponent;
|
||||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
class BlastFurnaceOverlay extends Overlay
|
class BlastFurnaceOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private final Client client;
|
private final Client client;
|
||||||
@@ -49,7 +51,7 @@ class BlastFurnaceOverlay extends Overlay
|
|||||||
private ItemManager itemManager;
|
private ItemManager itemManager;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
BlastFurnaceOverlay(Client client, BlastFurnacePlugin plugin)
|
BlastFurnaceOverlay(final Client client, final BlastFurnacePlugin plugin)
|
||||||
{
|
{
|
||||||
super(plugin);
|
super(plugin);
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import com.google.inject.Provides;
|
|||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
@@ -37,6 +38,7 @@ import net.runelite.api.GameState;
|
|||||||
import static net.runelite.api.NullObjectID.NULL_9092;
|
import static net.runelite.api.NullObjectID.NULL_9092;
|
||||||
import static net.runelite.api.ObjectID.CONVEYOR_BELT;
|
import static net.runelite.api.ObjectID.CONVEYOR_BELT;
|
||||||
import net.runelite.api.Skill;
|
import net.runelite.api.Skill;
|
||||||
|
import net.runelite.api.events.ConfigChanged;
|
||||||
import net.runelite.api.events.GameObjectDespawned;
|
import net.runelite.api.events.GameObjectDespawned;
|
||||||
import net.runelite.api.events.GameObjectSpawned;
|
import net.runelite.api.events.GameObjectSpawned;
|
||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
@@ -57,6 +59,7 @@ import net.runelite.client.util.Text;
|
|||||||
description = "Show helpful information for the Blast Furnace minigame",
|
description = "Show helpful information for the Blast Furnace minigame",
|
||||||
tags = {"minigame", "overlay", "skilling", "smithing"}
|
tags = {"minigame", "overlay", "skilling", "smithing"}
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
public class BlastFurnacePlugin extends Plugin
|
public class BlastFurnacePlugin extends Plugin
|
||||||
{
|
{
|
||||||
private static final int BAR_DISPENSER = NULL_9092;
|
private static final int BAR_DISPENSER = NULL_9092;
|
||||||
@@ -91,9 +94,19 @@ public class BlastFurnacePlugin extends Plugin
|
|||||||
@Inject
|
@Inject
|
||||||
private InfoBoxManager infoBoxManager;
|
private InfoBoxManager infoBoxManager;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private BlastFurnaceConfig config;
|
||||||
|
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showConveyorBelt;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showBarDispenser;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
|
|
||||||
overlayManager.add(overlay);
|
overlayManager.add(overlay);
|
||||||
overlayManager.add(cofferOverlay);
|
overlayManager.add(cofferOverlay);
|
||||||
overlayManager.add(clickBoxOverlay);
|
overlayManager.add(clickBoxOverlay);
|
||||||
@@ -117,6 +130,15 @@ public class BlastFurnacePlugin extends Plugin
|
|||||||
return configManager.getConfig(BlastFurnaceConfig.class);
|
return configManager.getConfig(BlastFurnaceConfig.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onConfigChanged(ConfigChanged event)
|
||||||
|
{
|
||||||
|
if (event.getGroup().equals("blastfurnace"))
|
||||||
|
{
|
||||||
|
updateConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onGameObjectSpawned(GameObjectSpawned event)
|
public void onGameObjectSpawned(GameObjectSpawned event)
|
||||||
{
|
{
|
||||||
@@ -187,4 +209,10 @@ public class BlastFurnacePlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateConfig()
|
||||||
|
{
|
||||||
|
this.showBarDispenser = config.showBarDispenser();
|
||||||
|
this.showConveyorBelt = config.showConveyorBelt();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import java.awt.Dimension;
|
|||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.ItemID;
|
import net.runelite.api.ItemID;
|
||||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||||
@@ -43,20 +44,21 @@ import net.runelite.client.ui.overlay.components.ComponentOrientation;
|
|||||||
import net.runelite.client.ui.overlay.components.ImageComponent;
|
import net.runelite.client.ui.overlay.components.ImageComponent;
|
||||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
class BlastMineOreCountOverlay extends Overlay
|
class BlastMineOreCountOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final BlastMinePluginConfig config;
|
private final BlastMinePlugin plugin;
|
||||||
private final ItemManager itemManager;
|
private final ItemManager itemManager;
|
||||||
private final PanelComponent panelComponent = new PanelComponent();
|
private final PanelComponent panelComponent = new PanelComponent();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private BlastMineOreCountOverlay(BlastMinePlugin plugin, Client client, BlastMinePluginConfig config, ItemManager itemManager)
|
private BlastMineOreCountOverlay(final BlastMinePlugin plugin, final Client client, final ItemManager itemManager)
|
||||||
{
|
{
|
||||||
super(plugin);
|
super(plugin);
|
||||||
setPosition(OverlayPosition.TOP_LEFT);
|
setPosition(OverlayPosition.TOP_LEFT);
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.config = config;
|
this.plugin = plugin;
|
||||||
this.itemManager = itemManager;
|
this.itemManager = itemManager;
|
||||||
panelComponent.setOrientation(ComponentOrientation.HORIZONTAL);
|
panelComponent.setOrientation(ComponentOrientation.HORIZONTAL);
|
||||||
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Blast mine overlay"));
|
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Blast mine overlay"));
|
||||||
@@ -74,7 +76,7 @@ class BlastMineOreCountOverlay extends Overlay
|
|||||||
|
|
||||||
panelComponent.getChildren().clear();
|
panelComponent.getChildren().clear();
|
||||||
|
|
||||||
if (config.showOreOverlay())
|
if (plugin.isShowOreOverlay())
|
||||||
{
|
{
|
||||||
blastMineWidget.setHidden(true);
|
blastMineWidget.setHidden(true);
|
||||||
panelComponent.getChildren().add(new ImageComponent(getImage(ItemID.COAL, client.getVar(Varbits.BLAST_MINE_COAL))));
|
panelComponent.getChildren().add(new ImageComponent(getImage(ItemID.COAL, client.getVar(Varbits.BLAST_MINE_COAL))));
|
||||||
|
|||||||
@@ -25,9 +25,12 @@
|
|||||||
package net.runelite.client.plugins.blastmine;
|
package net.runelite.client.plugins.blastmine;
|
||||||
|
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
|
import java.awt.Color;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.GameObject;
|
import net.runelite.api.GameObject;
|
||||||
@@ -49,9 +52,10 @@ import net.runelite.client.ui.overlay.OverlayManager;
|
|||||||
description = "Show helpful information for the Blast Mine minigame",
|
description = "Show helpful information for the Blast Mine minigame",
|
||||||
tags = {"explode", "explosive", "mining", "minigame", "skilling"}
|
tags = {"explode", "explosive", "mining", "minigame", "skilling"}
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
public class BlastMinePlugin extends Plugin
|
public class BlastMinePlugin extends Plugin
|
||||||
{
|
{
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final Map<WorldPoint, BlastMineRock> rocks = new HashMap<>();
|
private final Map<WorldPoint, BlastMineRock> rocks = new HashMap<>();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@@ -66,15 +70,33 @@ public class BlastMinePlugin extends Plugin
|
|||||||
@Inject
|
@Inject
|
||||||
private BlastMineOreCountOverlay blastMineOreCountOverlay;
|
private BlastMineOreCountOverlay blastMineOreCountOverlay;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private BlastMinePluginConfig config;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
BlastMinePluginConfig getConfig(ConfigManager configManager)
|
BlastMinePluginConfig getConfig(ConfigManager configManager)
|
||||||
{
|
{
|
||||||
return configManager.getConfig(BlastMinePluginConfig.class);
|
return configManager.getConfig(BlastMinePluginConfig.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showOreOverlay;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showRockIconOverlay;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showTimerOverlay;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showWarningOverlay;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private Color timerColor;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private Color warningColor;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
|
|
||||||
overlayManager.add(blastMineRockOverlay);
|
overlayManager.add(blastMineRockOverlay);
|
||||||
overlayManager.add(blastMineOreCountOverlay);
|
overlayManager.add(blastMineOreCountOverlay);
|
||||||
}
|
}
|
||||||
@@ -132,4 +154,14 @@ public class BlastMinePlugin extends Plugin
|
|||||||
(rock.getRemainingTimeRelative() == 1 && rock.getType() != BlastMineRockType.NORMAL) ||
|
(rock.getRemainingTimeRelative() == 1 && rock.getType() != BlastMineRockType.NORMAL) ||
|
||||||
(rock.getRemainingFuseTimeRelative() == 1 && rock.getType() == BlastMineRockType.LIT));
|
(rock.getRemainingFuseTimeRelative() == 1 && rock.getType() == BlastMineRockType.LIT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateConfig()
|
||||||
|
{
|
||||||
|
this.showOreOverlay = config.showOreOverlay();
|
||||||
|
this.showRockIconOverlay = config.showRockIconOverlay();
|
||||||
|
this.showTimerOverlay = config.showTimerOverlay();
|
||||||
|
this.showWarningOverlay = config.showWarningOverlay();
|
||||||
|
this.timerColor = config.getTimerColor();
|
||||||
|
this.warningColor = config.getWarningColor();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ package net.runelite.client.plugins.blastmine;
|
|||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.api.GameObject;
|
import net.runelite.api.GameObject;
|
||||||
|
|
||||||
@@ -34,10 +35,10 @@ class BlastMineRock
|
|||||||
private static final Duration PLANT_TIME = Duration.ofSeconds(30);
|
private static final Duration PLANT_TIME = Duration.ofSeconds(30);
|
||||||
private static final Duration FUSE_TIME = Duration.ofMillis(4200);
|
private static final Duration FUSE_TIME = Duration.ofMillis(4200);
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final GameObject gameObject;
|
private final GameObject gameObject;
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final BlastMineRockType type;
|
private final BlastMineRockType type;
|
||||||
|
|
||||||
private final Instant creationTime = Instant.now();
|
private final Instant creationTime = Instant.now();
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import java.awt.Polygon;
|
|||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.GameObject;
|
import net.runelite.api.GameObject;
|
||||||
import net.runelite.api.ItemID;
|
import net.runelite.api.ItemID;
|
||||||
@@ -49,6 +50,7 @@ import net.runelite.client.ui.overlay.OverlayLayer;
|
|||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
import net.runelite.client.ui.overlay.components.ProgressPieComponent;
|
import net.runelite.client.ui.overlay.components.ProgressPieComponent;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class BlastMineRockOverlay extends Overlay
|
public class BlastMineRockOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private static final int MAX_DISTANCE = 16;
|
private static final int MAX_DISTANCE = 16;
|
||||||
@@ -62,20 +64,18 @@ public class BlastMineRockOverlay extends Overlay
|
|||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final BlastMinePlugin plugin;
|
private final BlastMinePlugin plugin;
|
||||||
private final BlastMinePluginConfig config;
|
|
||||||
|
|
||||||
private final BufferedImage chiselIcon;
|
private final BufferedImage chiselIcon;
|
||||||
private final BufferedImage dynamiteIcon;
|
private final BufferedImage dynamiteIcon;
|
||||||
private final BufferedImage tinderboxIcon;
|
private final BufferedImage tinderboxIcon;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private BlastMineRockOverlay(Client client, BlastMinePlugin plugin, BlastMinePluginConfig config, ItemManager itemManager)
|
private BlastMineRockOverlay(final Client client, final BlastMinePlugin plugin, final ItemManager itemManager)
|
||||||
{
|
{
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
setLayer(OverlayLayer.ABOVE_SCENE);
|
setLayer(OverlayLayer.ABOVE_SCENE);
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.config = config;
|
|
||||||
chiselIcon = itemManager.getImage(ItemID.CHISEL);
|
chiselIcon = itemManager.getImage(ItemID.CHISEL);
|
||||||
dynamiteIcon = itemManager.getImage(ItemID.DYNAMITE);
|
dynamiteIcon = itemManager.getImage(ItemID.DYNAMITE);
|
||||||
tinderboxIcon = itemManager.getImage(ItemID.TINDERBOX);
|
tinderboxIcon = itemManager.getImage(ItemID.TINDERBOX);
|
||||||
@@ -114,8 +114,8 @@ public class BlastMineRockOverlay extends Overlay
|
|||||||
drawIconOnRock(graphics, rock, tinderboxIcon);
|
drawIconOnRock(graphics, rock, tinderboxIcon);
|
||||||
break;
|
break;
|
||||||
case LIT:
|
case LIT:
|
||||||
drawTimerOnRock(graphics, rock, config.getTimerColor());
|
drawTimerOnRock(graphics, rock, plugin.getTimerColor());
|
||||||
drawAreaWarning(graphics, rock, config.getWarningColor(), tiles);
|
drawAreaWarning(graphics, rock, plugin.getWarningColor(), tiles);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -125,7 +125,7 @@ public class BlastMineRockOverlay extends Overlay
|
|||||||
|
|
||||||
private void drawIconOnRock(Graphics2D graphics, BlastMineRock rock, BufferedImage icon)
|
private void drawIconOnRock(Graphics2D graphics, BlastMineRock rock, BufferedImage icon)
|
||||||
{
|
{
|
||||||
if (!config.showRockIconOverlay())
|
if (!plugin.isShowRockIconOverlay())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -140,7 +140,7 @@ public class BlastMineRockOverlay extends Overlay
|
|||||||
|
|
||||||
private void drawTimerOnRock(Graphics2D graphics, BlastMineRock rock, Color color)
|
private void drawTimerOnRock(Graphics2D graphics, BlastMineRock rock, Color color)
|
||||||
{
|
{
|
||||||
if (!config.showTimerOverlay())
|
if (!plugin.isShowTimerOverlay())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -161,7 +161,7 @@ public class BlastMineRockOverlay extends Overlay
|
|||||||
|
|
||||||
private void drawAreaWarning(Graphics2D graphics, BlastMineRock rock, Color color, Tile[][][] tiles)
|
private void drawAreaWarning(Graphics2D graphics, BlastMineRock rock, Color color, Tile[][][] tiles)
|
||||||
{
|
{
|
||||||
if (!config.showWarningOverlay())
|
if (!plugin.isShowWarningOverlay())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ package net.runelite.client.plugins.blastmine;
|
|||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.api.ObjectID;
|
import net.runelite.api.ObjectID;
|
||||||
|
|
||||||
@@ -54,7 +55,7 @@ public enum BlastMineRockType
|
|||||||
rockTypes = builder.build();
|
rockTypes = builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final int[] objectIds;
|
private final int[] objectIds;
|
||||||
|
|
||||||
BlastMineRockType(int... objectIds)
|
BlastMineRockType(int... objectIds)
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ package net.runelite.client.plugins.boosts;
|
|||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.Skill;
|
import net.runelite.api.Skill;
|
||||||
@@ -35,17 +36,15 @@ import net.runelite.client.ui.overlay.infobox.InfoBoxPriority;
|
|||||||
public class BoostIndicator extends InfoBox
|
public class BoostIndicator extends InfoBox
|
||||||
{
|
{
|
||||||
private final BoostsPlugin plugin;
|
private final BoostsPlugin plugin;
|
||||||
private final BoostsConfig config;
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private final Skill skill;
|
private final Skill skill;
|
||||||
|
|
||||||
BoostIndicator(Skill skill, BufferedImage image, BoostsPlugin plugin, Client client, BoostsConfig config)
|
BoostIndicator(final Skill skill, final BufferedImage image, final BoostsPlugin plugin, final Client client)
|
||||||
{
|
{
|
||||||
super(image, plugin);
|
super(image, plugin);
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.config = config;
|
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.skill = skill;
|
this.skill = skill;
|
||||||
setTooltip(skill.getName() + " boost");
|
setTooltip(skill.getName() + " boost");
|
||||||
@@ -55,7 +54,7 @@ public class BoostIndicator extends InfoBox
|
|||||||
@Override
|
@Override
|
||||||
public String getText()
|
public String getText()
|
||||||
{
|
{
|
||||||
if (!config.useRelativeBoost())
|
if (!plugin.isUseRelativeBoost())
|
||||||
{
|
{
|
||||||
return String.valueOf(client.getBoostedSkillLevel(skill));
|
return String.valueOf(client.getBoostedSkillLevel(skill));
|
||||||
}
|
}
|
||||||
@@ -81,13 +80,13 @@ public class BoostIndicator extends InfoBox
|
|||||||
return new Color(238, 51, 51);
|
return new Color(238, 51, 51);
|
||||||
}
|
}
|
||||||
|
|
||||||
return boosted - base <= config.boostThreshold() ? Color.YELLOW : Color.GREEN;
|
return boosted - base <= plugin.getBoostThreshold() ? Color.YELLOW : Color.GREEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean render()
|
public boolean render()
|
||||||
{
|
{
|
||||||
if (config.displayInfoboxes() && plugin.canShowBoosts() && plugin.getShownSkills().contains(getSkill()))
|
if (plugin.isDisplayInfoboxes() && plugin.canShowBoosts() && plugin.getShownSkills().contains(getSkill()))
|
||||||
{
|
{
|
||||||
return client.getBoostedSkillLevel(skill) != client.getRealSkillLevel(skill);
|
return client.getBoostedSkillLevel(skill) != client.getRealSkillLevel(skill);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import java.awt.Color;
|
|||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||||
import net.runelite.api.Skill;
|
import net.runelite.api.Skill;
|
||||||
@@ -41,20 +42,19 @@ import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
|||||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||||
import net.runelite.client.util.ColorUtil;
|
import net.runelite.client.util.ColorUtil;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
class BoostsOverlay extends Overlay
|
class BoostsOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final BoostsConfig config;
|
|
||||||
private final PanelComponent panelComponent = new PanelComponent();
|
private final PanelComponent panelComponent = new PanelComponent();
|
||||||
private final BoostsPlugin plugin;
|
private final BoostsPlugin plugin;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private BoostsOverlay(Client client, BoostsConfig config, BoostsPlugin plugin)
|
private BoostsOverlay(final Client client, final BoostsPlugin plugin)
|
||||||
{
|
{
|
||||||
super(plugin);
|
super(plugin);
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.config = config;
|
|
||||||
setPosition(OverlayPosition.TOP_LEFT);
|
setPosition(OverlayPosition.TOP_LEFT);
|
||||||
setPriority(OverlayPriority.MED);
|
setPriority(OverlayPriority.MED);
|
||||||
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Boosts overlay"));
|
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Boosts overlay"));
|
||||||
@@ -63,7 +63,7 @@ class BoostsOverlay extends Overlay
|
|||||||
@Override
|
@Override
|
||||||
public Dimension render(Graphics2D graphics)
|
public Dimension render(Graphics2D graphics)
|
||||||
{
|
{
|
||||||
if (config.displayInfoboxes() || config.displayIcons())
|
if (plugin.isDisplayInfoboxes() || plugin.isDisplayIcons())
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -103,7 +103,7 @@ class BoostsOverlay extends Overlay
|
|||||||
final Color strColor = getTextColor(boost);
|
final Color strColor = getTextColor(boost);
|
||||||
String str;
|
String str;
|
||||||
|
|
||||||
if (config.useRelativeBoost())
|
if (plugin.isUseRelativeBoost())
|
||||||
{
|
{
|
||||||
str = String.valueOf(boost);
|
str = String.valueOf(boost);
|
||||||
if (boost > 0)
|
if (boost > 0)
|
||||||
@@ -133,7 +133,7 @@ class BoostsOverlay extends Overlay
|
|||||||
return new Color(238, 51, 51);
|
return new Color(238, 51, 51);
|
||||||
}
|
}
|
||||||
|
|
||||||
return boost <= config.boostThreshold() ? Color.YELLOW : Color.GREEN;
|
return boost <= plugin.getBoostThreshold() ? Color.YELLOW : Color.GREEN;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.Constants;
|
import net.runelite.api.Constants;
|
||||||
@@ -107,6 +108,21 @@ public class BoostsPlugin extends Plugin
|
|||||||
private long lastTickMillis;
|
private long lastTickMillis;
|
||||||
private List<String> boostedSkillsChanged = new ArrayList<>();
|
private List<String> boostedSkillsChanged = new ArrayList<>();
|
||||||
|
|
||||||
|
private boolean enableSkill;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean useRelativeBoost;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean displayInfoboxes;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean displayIcons;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean boldIconFont;
|
||||||
|
private BoostsConfig.DisplayChangeMode displayNextBuffChange;
|
||||||
|
private BoostsConfig.DisplayChangeMode displayNextDebuffChange;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private int boostThreshold;
|
||||||
|
private boolean groupNotifications;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
BoostsConfig provideConfig(ConfigManager configManager)
|
BoostsConfig provideConfig(ConfigManager configManager)
|
||||||
{
|
{
|
||||||
@@ -116,6 +132,8 @@ public class BoostsPlugin extends Plugin
|
|||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
|
|
||||||
overlayManager.add(boostsOverlay);
|
overlayManager.add(boostsOverlay);
|
||||||
overlayManager.add(combatIconsOverlay);
|
overlayManager.add(combatIconsOverlay);
|
||||||
updateShownSkills();
|
updateShownSkills();
|
||||||
@@ -130,7 +148,7 @@ public class BoostsPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (skill != Skill.OVERALL)
|
if (skill != Skill.OVERALL)
|
||||||
{
|
{
|
||||||
infoBoxManager.addInfoBox(new BoostIndicator(skill, skillIconManager.getSkillImage(skill), this, client, config));
|
infoBoxManager.addInfoBox(new BoostIndicator(skill, skillIconManager.getSkillImage(skill), this, client));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -169,14 +187,15 @@ public class BoostsPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateConfig();
|
||||||
updateShownSkills();
|
updateShownSkills();
|
||||||
|
|
||||||
if (config.displayNextBuffChange() == BoostsConfig.DisplayChangeMode.NEVER)
|
if (this.displayNextBuffChange == BoostsConfig.DisplayChangeMode.NEVER)
|
||||||
{
|
{
|
||||||
lastChangeDown = -1;
|
lastChangeDown = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.displayNextDebuffChange() == BoostsConfig.DisplayChangeMode.NEVER)
|
if (this.displayNextDebuffChange == BoostsConfig.DisplayChangeMode.NEVER)
|
||||||
{
|
{
|
||||||
lastChangeUp = -1;
|
lastChangeUp = -1;
|
||||||
}
|
}
|
||||||
@@ -211,7 +230,7 @@ public class BoostsPlugin extends Plugin
|
|||||||
lastSkillLevels[skillIdx] = cur;
|
lastSkillLevels[skillIdx] = cur;
|
||||||
updateBoostedStats();
|
updateBoostedStats();
|
||||||
|
|
||||||
int boostThreshold = config.boostThreshold();
|
int boostThreshold = this.boostThreshold;
|
||||||
|
|
||||||
if (boostThreshold != 0)
|
if (boostThreshold != 0)
|
||||||
{
|
{
|
||||||
@@ -220,7 +239,7 @@ public class BoostsPlugin extends Plugin
|
|||||||
int boost = cur - real;
|
int boost = cur - real;
|
||||||
if (boost <= boostThreshold && boostThreshold < lastBoost)
|
if (boost <= boostThreshold && boostThreshold < lastBoost)
|
||||||
{
|
{
|
||||||
if (config.groupNotifications())
|
if (this.groupNotifications)
|
||||||
{
|
{
|
||||||
boostedSkillsChanged.add(skill.getName());
|
boostedSkillsChanged.add(skill.getName());
|
||||||
}
|
}
|
||||||
@@ -237,7 +256,7 @@ public class BoostsPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
lastTickMillis = System.currentTimeMillis();
|
lastTickMillis = System.currentTimeMillis();
|
||||||
|
|
||||||
if (config.groupNotifications() && !boostedSkillsChanged.isEmpty())
|
if (this.groupNotifications && !boostedSkillsChanged.isEmpty())
|
||||||
{
|
{
|
||||||
if (boostedSkillsChanged.size() == 1)
|
if (boostedSkillsChanged.size() == 1)
|
||||||
{
|
{
|
||||||
@@ -268,7 +287,7 @@ public class BoostsPlugin extends Plugin
|
|||||||
|
|
||||||
if (getChangeUpTicks() <= 0)
|
if (getChangeUpTicks() <= 0)
|
||||||
{
|
{
|
||||||
switch (config.displayNextDebuffChange())
|
switch (this.displayNextDebuffChange)
|
||||||
{
|
{
|
||||||
case ALWAYS:
|
case ALWAYS:
|
||||||
if (lastChangeUp != -1)
|
if (lastChangeUp != -1)
|
||||||
@@ -286,7 +305,7 @@ public class BoostsPlugin extends Plugin
|
|||||||
|
|
||||||
if (getChangeDownTicks() <= 0)
|
if (getChangeDownTicks() <= 0)
|
||||||
{
|
{
|
||||||
switch (config.displayNextBuffChange())
|
switch (this.displayNextBuffChange)
|
||||||
{
|
{
|
||||||
case ALWAYS:
|
case ALWAYS:
|
||||||
if (lastChangeDown != -1)
|
if (lastChangeDown != -1)
|
||||||
@@ -305,7 +324,7 @@ public class BoostsPlugin extends Plugin
|
|||||||
|
|
||||||
private void updateShownSkills()
|
private void updateShownSkills()
|
||||||
{
|
{
|
||||||
if (config.enableSkill())
|
if (this.enableSkill)
|
||||||
{
|
{
|
||||||
shownSkills.addAll(BOOSTABLE_NON_COMBAT_SKILLS);
|
shownSkills.addAll(BOOSTABLE_NON_COMBAT_SKILLS);
|
||||||
}
|
}
|
||||||
@@ -368,8 +387,8 @@ public class BoostsPlugin extends Plugin
|
|||||||
int getChangeDownTicks()
|
int getChangeDownTicks()
|
||||||
{
|
{
|
||||||
if (lastChangeDown == -1 ||
|
if (lastChangeDown == -1 ||
|
||||||
config.displayNextBuffChange() == BoostsConfig.DisplayChangeMode.NEVER ||
|
this.displayNextBuffChange == BoostsConfig.DisplayChangeMode.NEVER ||
|
||||||
(config.displayNextBuffChange() == BoostsConfig.DisplayChangeMode.BOOSTED && !isChangedUp))
|
(this.displayNextBuffChange == BoostsConfig.DisplayChangeMode.BOOSTED && !isChangedUp))
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -396,8 +415,8 @@ public class BoostsPlugin extends Plugin
|
|||||||
int getChangeUpTicks()
|
int getChangeUpTicks()
|
||||||
{
|
{
|
||||||
if (lastChangeUp == -1 ||
|
if (lastChangeUp == -1 ||
|
||||||
config.displayNextDebuffChange() == BoostsConfig.DisplayChangeMode.NEVER ||
|
this.displayNextDebuffChange == BoostsConfig.DisplayChangeMode.NEVER ||
|
||||||
(config.displayNextDebuffChange() == BoostsConfig.DisplayChangeMode.BOOSTED && !isChangedDown))
|
(this.displayNextDebuffChange == BoostsConfig.DisplayChangeMode.BOOSTED && !isChangedDown))
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -418,4 +437,17 @@ public class BoostsPlugin extends Plugin
|
|||||||
final long diff = System.currentTimeMillis() - lastTickMillis;
|
final long diff = System.currentTimeMillis() - lastTickMillis;
|
||||||
return time != -1 ? (int) ((time * Constants.GAME_TICK_LENGTH - diff) / 1000d) : time;
|
return time != -1 ? (int) ((time * Constants.GAME_TICK_LENGTH - diff) / 1000d) : time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateConfig()
|
||||||
|
{
|
||||||
|
this.enableSkill = config.enableSkill();
|
||||||
|
this.useRelativeBoost = config.useRelativeBoost();
|
||||||
|
this.displayInfoboxes = config.displayInfoboxes();
|
||||||
|
this.displayIcons = config.displayIcons();
|
||||||
|
this.boldIconFont = config.boldIconFont();
|
||||||
|
this.displayNextBuffChange = config.displayNextDebuffChange();
|
||||||
|
this.displayNextDebuffChange = config.displayNextDebuffChange();
|
||||||
|
this.boostThreshold = config.boostThreshold();
|
||||||
|
this.groupNotifications = config.groupNotifications();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import java.awt.Graphics2D;
|
|||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||||
import net.runelite.api.Skill;
|
import net.runelite.api.Skill;
|
||||||
@@ -23,21 +24,20 @@ import net.runelite.client.ui.FontManager;
|
|||||||
import net.runelite.client.util.ColorUtil;
|
import net.runelite.client.util.ColorUtil;
|
||||||
import net.runelite.client.util.ImageUtil;
|
import net.runelite.client.util.ImageUtil;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
class CombatIconsOverlay extends Overlay
|
class CombatIconsOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final BoostsConfig config;
|
|
||||||
private final PanelComponent panelComponent = new PanelComponent();
|
private final PanelComponent panelComponent = new PanelComponent();
|
||||||
private final SkillIconManager iconManager;
|
private final SkillIconManager iconManager;
|
||||||
private final BoostsPlugin plugin;
|
private final BoostsPlugin plugin;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private CombatIconsOverlay(Client client, BoostsConfig config, BoostsPlugin plugin, SkillIconManager iconManager)
|
private CombatIconsOverlay(final Client client, final BoostsPlugin plugin, final SkillIconManager iconManager)
|
||||||
{
|
{
|
||||||
super(plugin);
|
super(plugin);
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.config = config;
|
|
||||||
this.iconManager = iconManager;
|
this.iconManager = iconManager;
|
||||||
setPosition(OverlayPosition.TOP_LEFT);
|
setPosition(OverlayPosition.TOP_LEFT);
|
||||||
setPriority(OverlayPriority.MED);
|
setPriority(OverlayPriority.MED);
|
||||||
@@ -47,12 +47,12 @@ class CombatIconsOverlay extends Overlay
|
|||||||
@Override
|
@Override
|
||||||
public Dimension render(Graphics2D graphics)
|
public Dimension render(Graphics2D graphics)
|
||||||
{
|
{
|
||||||
if (config.displayInfoboxes() || !config.displayIcons())
|
if (plugin.isDisplayInfoboxes() || !plugin.isDisplayIcons())
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.boldIconFont())
|
if (plugin.isBoldIconFont())
|
||||||
{
|
{
|
||||||
graphics.setFont(FontManager.getRunescapeBoldFont());
|
graphics.setFont(FontManager.getRunescapeBoldFont());
|
||||||
}
|
}
|
||||||
@@ -79,7 +79,7 @@ class CombatIconsOverlay extends Overlay
|
|||||||
final Color strColor = getTextColor(boost);
|
final Color strColor = getTextColor(boost);
|
||||||
String str;
|
String str;
|
||||||
|
|
||||||
if (config.useRelativeBoost())
|
if (plugin.isUseRelativeBoost())
|
||||||
{
|
{
|
||||||
str = String.valueOf(boost);
|
str = String.valueOf(boost);
|
||||||
if (boost > 0)
|
if (boost > 0)
|
||||||
@@ -137,7 +137,7 @@ class CombatIconsOverlay extends Overlay
|
|||||||
return new Color(238, 51, 51);
|
return new Color(238, 51, 51);
|
||||||
}
|
}
|
||||||
|
|
||||||
return boost <= config.boostThreshold() ? Color.YELLOW : Color.GREEN;
|
return boost <= plugin.getBoostThreshold() ? Color.YELLOW : Color.GREEN;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
package net.runelite.client.plugins.bosstimer;
|
package net.runelite.client.plugins.bosstimer;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.NPC;
|
import net.runelite.api.NPC;
|
||||||
import net.runelite.api.events.NpcDespawned;
|
import net.runelite.api.events.NpcDespawned;
|
||||||
@@ -40,6 +41,7 @@ import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
|||||||
description = "Show boss spawn timer overlays",
|
description = "Show boss spawn timer overlays",
|
||||||
tags = {"combat", "pve", "overlay", "spawn"}
|
tags = {"combat", "pve", "overlay", "spawn"}
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class BossTimersPlugin extends Plugin
|
public class BossTimersPlugin extends Plugin
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class RespawnTimer extends Timer
|
|||||||
{
|
{
|
||||||
private final Boss boss;
|
private final Boss boss;
|
||||||
|
|
||||||
public RespawnTimer(Boss boss, BufferedImage bossImage, Plugin plugin)
|
RespawnTimer(Boss boss, BufferedImage bossImage, Plugin plugin)
|
||||||
{
|
{
|
||||||
super(boss.getSpawnTime().toMillis(), ChronoUnit.MILLIS, bossImage, plugin);
|
super(boss.getSpawnTime().toMillis(), ChronoUnit.MILLIS, bossImage, plugin);
|
||||||
this.boss = boss;
|
this.boss = boss;
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import java.awt.Dimension;
|
|||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Polygon;
|
import java.awt.Polygon;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.Perspective;
|
import net.runelite.api.Perspective;
|
||||||
import static net.runelite.api.Perspective.LOCAL_TILE_SIZE;
|
import static net.runelite.api.Perspective.LOCAL_TILE_SIZE;
|
||||||
@@ -40,22 +41,21 @@ import net.runelite.client.ui.overlay.OverlayPriority;
|
|||||||
import net.runelite.client.ui.overlay.OverlayUtil;
|
import net.runelite.client.ui.overlay.OverlayUtil;
|
||||||
import net.runelite.client.ui.overlay.components.TextComponent;
|
import net.runelite.client.ui.overlay.components.TextComponent;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
class CannonOverlay extends Overlay
|
class CannonOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private static final int MAX_DISTANCE = 2500;
|
private static final int MAX_DISTANCE = 2500;
|
||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final CannonConfig config;
|
|
||||||
private final CannonPlugin plugin;
|
private final CannonPlugin plugin;
|
||||||
private final TextComponent textComponent = new TextComponent();
|
private final TextComponent textComponent = new TextComponent();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
CannonOverlay(Client client, CannonConfig config, CannonPlugin plugin)
|
CannonOverlay(final Client client, final CannonPlugin plugin)
|
||||||
{
|
{
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
setPriority(OverlayPriority.MED);
|
setPriority(OverlayPriority.MED);
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.config = config;
|
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,9 +91,9 @@ class CannonOverlay extends Overlay
|
|||||||
textComponent.render(graphics);
|
textComponent.render(graphics);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.showDoubleHitSpot())
|
if (plugin.isShowDoubleHitSpot())
|
||||||
{
|
{
|
||||||
Color color = config.highlightDoubleHitColor();
|
Color color = plugin.getHighlightDoubleHitColor();
|
||||||
drawDoubleHitSpots(graphics, cannonPoint, color);
|
drawDoubleHitSpots(graphics, cannonPoint, color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import java.util.List;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.api.AnimationID;
|
import net.runelite.api.AnimationID;
|
||||||
import net.runelite.api.ChatMessageType;
|
import net.runelite.api.ChatMessageType;
|
||||||
@@ -80,19 +81,19 @@ public class CannonPlugin extends Plugin
|
|||||||
private CannonCounter counter;
|
private CannonCounter counter;
|
||||||
private boolean skipProjectileCheckThisTick;
|
private boolean skipProjectileCheckThisTick;
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private int cballsLeft;
|
private int cballsLeft;
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private boolean cannonPlaced;
|
private boolean cannonPlaced;
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private WorldPoint cannonPosition;
|
private WorldPoint cannonPosition;
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private GameObject cannon;
|
private GameObject cannon;
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private List<WorldPoint> spotPoints = new ArrayList<>();
|
private List<WorldPoint> spotPoints = new ArrayList<>();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@@ -124,6 +125,17 @@ public class CannonPlugin extends Plugin
|
|||||||
|
|
||||||
private boolean lock;
|
private boolean lock;
|
||||||
|
|
||||||
|
private boolean showEmptyCannonNotification;
|
||||||
|
private boolean showInfobox;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showDoubleHitSpot;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private Color highlightDoubleHitColor;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showCannonSpots;
|
||||||
|
private int ammoAmount;
|
||||||
|
private boolean notifyAmmoLeft;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
CannonConfig provideConfig(ConfigManager configManager)
|
CannonConfig provideConfig(ConfigManager configManager)
|
||||||
{
|
{
|
||||||
@@ -133,6 +145,8 @@ public class CannonPlugin extends Plugin
|
|||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
|
|
||||||
overlayManager.add(cannonOverlay);
|
overlayManager.add(cannonOverlay);
|
||||||
overlayManager.add(cannonSpotOverlay);
|
overlayManager.add(cannonSpotOverlay);
|
||||||
lock = false;
|
lock = false;
|
||||||
@@ -169,7 +183,9 @@ public class CannonPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (event.getGroup().equals("cannon"))
|
if (event.getGroup().equals("cannon"))
|
||||||
{
|
{
|
||||||
if (!config.showInfobox())
|
updateConfig();
|
||||||
|
|
||||||
|
if (!this.showInfobox)
|
||||||
{
|
{
|
||||||
removeCounter();
|
removeCounter();
|
||||||
}
|
}
|
||||||
@@ -190,7 +206,7 @@ public class CannonPlugin extends Plugin
|
|||||||
)
|
)
|
||||||
public void checkSpots()
|
public void checkSpots()
|
||||||
{
|
{
|
||||||
if (!config.showCannonSpots())
|
if (!this.showCannonSpots)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -318,7 +334,7 @@ public class CannonPlugin extends Plugin
|
|||||||
// extra check is a good idea.
|
// extra check is a good idea.
|
||||||
cballsLeft = 0;
|
cballsLeft = 0;
|
||||||
|
|
||||||
if (config.showEmptyCannonNotification())
|
if (this.showEmptyCannonNotification)
|
||||||
{
|
{
|
||||||
notifier.notify("Your cannon is out of ammo!");
|
notifier.notify("Your cannon is out of ammo!");
|
||||||
}
|
}
|
||||||
@@ -350,11 +366,11 @@ public class CannonPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
return Color.orange;
|
return Color.orange;
|
||||||
}
|
}
|
||||||
else if (cballsLeft <= config.ammoAmount())
|
else if (cballsLeft <= this.ammoAmount)
|
||||||
{
|
{
|
||||||
if (config.notifyAmmoLeft() && !lock)
|
if (this.notifyAmmoLeft && !lock)
|
||||||
{
|
{
|
||||||
notifier.notify("Your cannon has " + config.ammoAmount() + " balls left!");
|
notifier.notify("Your cannon has " + this.ammoAmount + " balls left!");
|
||||||
lock = true;
|
lock = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -364,7 +380,7 @@ public class CannonPlugin extends Plugin
|
|||||||
|
|
||||||
private void addCounter()
|
private void addCounter()
|
||||||
{
|
{
|
||||||
if (!config.showInfobox() || counter != null)
|
if (!this.showInfobox || counter != null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -385,4 +401,15 @@ public class CannonPlugin extends Plugin
|
|||||||
infoBoxManager.removeInfoBox(counter);
|
infoBoxManager.removeInfoBox(counter);
|
||||||
counter = null;
|
counter = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateConfig()
|
||||||
|
{
|
||||||
|
this.showEmptyCannonNotification = config.showEmptyCannonNotification();
|
||||||
|
this.showInfobox = config.showInfobox();
|
||||||
|
this.showDoubleHitSpot = config.showDoubleHitSpot();
|
||||||
|
this.highlightDoubleHitColor = config.highlightDoubleHitColor();
|
||||||
|
this.showCannonSpots = config.showCannonSpots();
|
||||||
|
this.ammoAmount = config.ammoAmount();
|
||||||
|
this.notifyAmmoLeft = config.notifyAmmoLeft();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import java.awt.Graphics2D;
|
|||||||
import java.awt.Polygon;
|
import java.awt.Polygon;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
@@ -43,13 +44,13 @@ import net.runelite.client.ui.overlay.Overlay;
|
|||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
import net.runelite.client.ui.overlay.OverlayUtil;
|
import net.runelite.client.ui.overlay.OverlayUtil;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class CannonSpotOverlay extends Overlay
|
public class CannonSpotOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private static final int MAX_DISTANCE = 2350;
|
private static final int MAX_DISTANCE = 2350;
|
||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final CannonPlugin plugin;
|
private final CannonPlugin plugin;
|
||||||
private final CannonConfig config;
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ItemManager itemManager;
|
private ItemManager itemManager;
|
||||||
@@ -58,18 +59,17 @@ public class CannonSpotOverlay extends Overlay
|
|||||||
private boolean hidden;
|
private boolean hidden;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
CannonSpotOverlay(Client client, CannonPlugin plugin, CannonConfig config)
|
CannonSpotOverlay(final Client client, final CannonPlugin plugin)
|
||||||
{
|
{
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.config = config;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Dimension render(Graphics2D graphics)
|
public Dimension render(Graphics2D graphics)
|
||||||
{
|
{
|
||||||
if (hidden || !config.showCannonSpots() || plugin.isCannonPlaced())
|
if (hidden || !plugin.isShowCannonSpots() || plugin.isCannonPlaced())
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,13 +27,14 @@ package net.runelite.client.plugins.cerberus;
|
|||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import net.runelite.api.NPC;
|
import net.runelite.api.NPC;
|
||||||
import net.runelite.api.NpcID;
|
import net.runelite.api.NpcID;
|
||||||
import net.runelite.api.Skill;
|
import net.runelite.api.Skill;
|
||||||
|
|
||||||
@Getter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public enum CerberusGhost
|
public enum CerberusGhost
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
package net.runelite.client.plugins.chatboxperformance;
|
package net.runelite.client.plugins.chatboxperformance;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.events.WidgetPositioned;
|
import net.runelite.api.events.WidgetPositioned;
|
||||||
import net.runelite.api.widgets.Widget;
|
import net.runelite.api.widgets.Widget;
|
||||||
@@ -40,6 +41,7 @@ import net.runelite.client.plugins.PluginDescriptor;
|
|||||||
name = "Chatbox performance",
|
name = "Chatbox performance",
|
||||||
hidden = true
|
hidden = true
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
public class ChatboxPerformancePlugin extends Plugin
|
public class ChatboxPerformancePlugin extends Plugin
|
||||||
{
|
{
|
||||||
@Inject
|
@Inject
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.chatcommands;
|
package net.runelite.client.plugins.chatcommands;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.vars.AccountType;
|
import net.runelite.api.vars.AccountType;
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -81,6 +82,7 @@ import org.apache.commons.text.WordUtils;
|
|||||||
description = "Enable chat commands",
|
description = "Enable chat commands",
|
||||||
tags = {"grand", "exchange", "level", "prices"}
|
tags = {"grand", "exchange", "level", "prices"}
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ChatCommandsPlugin extends Plugin
|
public class ChatCommandsPlugin extends Plugin
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ import java.util.regex.Matcher;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.regex.PatternSyntaxException;
|
import java.util.regex.PatternSyntaxException;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.Setter;
|
||||||
import net.runelite.api.ChatMessageType;
|
import net.runelite.api.ChatMessageType;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.MessageNode;
|
import net.runelite.api.MessageNode;
|
||||||
@@ -53,6 +56,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
description = "Censor user configurable words or patterns from chat",
|
description = "Censor user configurable words or patterns from chat",
|
||||||
enabledByDefault = false
|
enabledByDefault = false
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
public class ChatFilterPlugin extends Plugin
|
public class ChatFilterPlugin extends Plugin
|
||||||
{
|
{
|
||||||
private static final Splitter NEWLINE_SPLITTER = Splitter
|
private static final Splitter NEWLINE_SPLITTER = Splitter
|
||||||
@@ -71,6 +75,17 @@ public class ChatFilterPlugin extends Plugin
|
|||||||
@Inject
|
@Inject
|
||||||
private ChatFilterConfig config;
|
private ChatFilterConfig config;
|
||||||
|
|
||||||
|
@Setter(AccessLevel.PACKAGE)
|
||||||
|
private ChatFilterType filterType;
|
||||||
|
@Setter(AccessLevel.PACKAGE)
|
||||||
|
private String filteredWords;
|
||||||
|
@Setter(AccessLevel.PACKAGE)
|
||||||
|
private String filteredRegex;
|
||||||
|
@Setter(AccessLevel.PACKAGE)
|
||||||
|
private boolean filterFriends;
|
||||||
|
@Setter(AccessLevel.PACKAGE)
|
||||||
|
private boolean filterClan;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
ChatFilterConfig provideConfig(ConfigManager configManager)
|
ChatFilterConfig provideConfig(ConfigManager configManager)
|
||||||
{
|
{
|
||||||
@@ -80,6 +95,7 @@ public class ChatFilterPlugin extends Plugin
|
|||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
updateFilteredPatterns();
|
updateFilteredPatterns();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,8 +138,8 @@ public class ChatFilterPlugin extends Plugin
|
|||||||
MessageNode messageNode = (MessageNode) client.getMessages().get(messageId);
|
MessageNode messageNode = (MessageNode) client.getMessages().get(messageId);
|
||||||
|
|
||||||
if (client.getLocalPlayer().getName().equals(messageNode.getName()) ||
|
if (client.getLocalPlayer().getName().equals(messageNode.getName()) ||
|
||||||
!config.filterFriends() && messageNode.isFromFriend() ||
|
!this.filterFriends && messageNode.isFromFriend() ||
|
||||||
!config.filterClan() && messageNode.isFromClanMate())
|
!this.filterClan && messageNode.isFromClanMate())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -168,8 +184,8 @@ public class ChatFilterPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
boolean isMessageFromSelf = playerName.equals(client.getLocalPlayer().getName());
|
boolean isMessageFromSelf = playerName.equals(client.getLocalPlayer().getName());
|
||||||
return !isMessageFromSelf &&
|
return !isMessageFromSelf &&
|
||||||
(config.filterFriends() || !client.isFriended(playerName, false)) &&
|
(this.filterFriends || !client.isFriended(playerName, false)) &&
|
||||||
(config.filterClan() || !client.isClanMember(playerName));
|
(this.filterClan || !client.isClanMember(playerName));
|
||||||
}
|
}
|
||||||
|
|
||||||
String censorMessage(final String message)
|
String censorMessage(final String message)
|
||||||
@@ -185,7 +201,7 @@ public class ChatFilterPlugin extends Plugin
|
|||||||
|
|
||||||
while (m.find())
|
while (m.find())
|
||||||
{
|
{
|
||||||
switch (config.filterType())
|
switch (this.filterType)
|
||||||
{
|
{
|
||||||
case CENSOR_WORDS:
|
case CENSOR_WORDS:
|
||||||
m.appendReplacement(sb, StringUtils.repeat("*", m.group(0).length()));
|
m.appendReplacement(sb, StringUtils.repeat("*", m.group(0).length()));
|
||||||
@@ -209,11 +225,11 @@ public class ChatFilterPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
filteredPatterns.clear();
|
filteredPatterns.clear();
|
||||||
|
|
||||||
Text.fromCSV(config.filteredWords()).stream()
|
Text.fromCSV(this.filteredWords).stream()
|
||||||
.map(s -> Pattern.compile(Pattern.quote(s), Pattern.CASE_INSENSITIVE))
|
.map(s -> Pattern.compile(Pattern.quote(s), Pattern.CASE_INSENSITIVE))
|
||||||
.forEach(filteredPatterns::add);
|
.forEach(filteredPatterns::add);
|
||||||
|
|
||||||
NEWLINE_SPLITTER.splitToList(config.filteredRegex()).stream()
|
NEWLINE_SPLITTER.splitToList(this.filteredRegex).stream()
|
||||||
.map(s ->
|
.map(s ->
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -237,6 +253,16 @@ public class ChatFilterPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateConfig();
|
||||||
updateFilteredPatterns();
|
updateFilteredPatterns();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateConfig()
|
||||||
|
{
|
||||||
|
this.filterType = config.filterType();
|
||||||
|
this.filteredWords = config.filteredWords();
|
||||||
|
this.filteredRegex = config.filteredRegex();
|
||||||
|
this.filterFriends = config.filterFriends();
|
||||||
|
this.filterClan = config.filterClan();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,12 +32,14 @@ import java.util.Deque;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Queue;
|
import java.util.Queue;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.ChatMessageType;
|
import net.runelite.api.ChatMessageType;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.ScriptID;
|
import net.runelite.api.ScriptID;
|
||||||
import net.runelite.api.VarClientInt;
|
import net.runelite.api.VarClientInt;
|
||||||
import net.runelite.api.VarClientStr;
|
import net.runelite.api.VarClientStr;
|
||||||
import net.runelite.api.events.ChatMessage;
|
import net.runelite.api.events.ChatMessage;
|
||||||
|
import net.runelite.api.events.ConfigChanged;
|
||||||
import net.runelite.api.events.MenuOptionClicked;
|
import net.runelite.api.events.MenuOptionClicked;
|
||||||
import net.runelite.api.vars.InputType;
|
import net.runelite.api.vars.InputType;
|
||||||
import net.runelite.client.callback.ClientThread;
|
import net.runelite.client.callback.ClientThread;
|
||||||
@@ -56,6 +58,7 @@ import net.runelite.client.util.Text;
|
|||||||
description = "Retain your chat history when logging in/out or world hopping",
|
description = "Retain your chat history when logging in/out or world hopping",
|
||||||
tags = {"chat", "history", "retain", "cycle", "pm"}
|
tags = {"chat", "history", "retain", "cycle", "pm"}
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
public class ChatHistoryPlugin extends Plugin implements KeyListener
|
public class ChatHistoryPlugin extends Plugin implements KeyListener
|
||||||
{
|
{
|
||||||
private static final String WELCOME_MESSAGE = "Welcome to Old School RuneScape.";
|
private static final String WELCOME_MESSAGE = "Welcome to Old School RuneScape.";
|
||||||
@@ -82,6 +85,9 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener
|
|||||||
@Inject
|
@Inject
|
||||||
private ChatMessageManager chatMessageManager;
|
private ChatMessageManager chatMessageManager;
|
||||||
|
|
||||||
|
private boolean retainChatHistory;
|
||||||
|
private boolean pmTargetCycling;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
ChatHistoryConfig getConfig(ConfigManager configManager)
|
ChatHistoryConfig getConfig(ConfigManager configManager)
|
||||||
{
|
{
|
||||||
@@ -91,6 +97,8 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener
|
|||||||
@Override
|
@Override
|
||||||
protected void startUp()
|
protected void startUp()
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
|
|
||||||
messageQueue = EvictingQueue.create(100);
|
messageQueue = EvictingQueue.create(100);
|
||||||
friends = new ArrayDeque<>(FRIENDS_MAX_SIZE + 1);
|
friends = new ArrayDeque<>(FRIENDS_MAX_SIZE + 1);
|
||||||
keyManager.registerKeyListener(this);
|
keyManager.registerKeyListener(this);
|
||||||
@@ -113,7 +121,7 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener
|
|||||||
// of information that chat history was reset
|
// of information that chat history was reset
|
||||||
if (chatMessage.getMessage().equals(WELCOME_MESSAGE))
|
if (chatMessage.getMessage().equals(WELCOME_MESSAGE))
|
||||||
{
|
{
|
||||||
if (!config.retainChatHistory())
|
if (!this.retainChatHistory)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -204,7 +212,7 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener
|
|||||||
@Override
|
@Override
|
||||||
public void keyPressed(KeyEvent e)
|
public void keyPressed(KeyEvent e)
|
||||||
{
|
{
|
||||||
if (e.getKeyCode() != CYCLE_HOTKEY || !config.pmTargetCycling())
|
if (e.getKeyCode() != CYCLE_HOTKEY || !this.pmTargetCycling)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -260,4 +268,21 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener
|
|||||||
|
|
||||||
return friends.getLast();
|
return friends.getLast();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onConfigChanged(ConfigChanged event)
|
||||||
|
{
|
||||||
|
if (!"chathistory".equals(event.getGroup()))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
updateConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateConfig()
|
||||||
|
{
|
||||||
|
this.retainChatHistory = config.retainChatHistory();
|
||||||
|
this.pmTargetCycling = config.pmTargetCycling();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import java.util.regex.Pattern;
|
|||||||
import static java.util.regex.Pattern.quote;
|
import static java.util.regex.Pattern.quote;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.MessageNode;
|
import net.runelite.api.MessageNode;
|
||||||
import net.runelite.api.events.ChatMessage;
|
import net.runelite.api.events.ChatMessage;
|
||||||
@@ -57,6 +58,7 @@ import net.runelite.client.util.Text;
|
|||||||
tags = {"duel", "messages", "notifications", "trade", "username"},
|
tags = {"duel", "messages", "notifications", "trade", "username"},
|
||||||
enabledByDefault = false
|
enabledByDefault = false
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
public class ChatNotificationsPlugin extends Plugin
|
public class ChatNotificationsPlugin extends Plugin
|
||||||
{
|
{
|
||||||
@Inject
|
@Inject
|
||||||
@@ -82,6 +84,14 @@ public class ChatNotificationsPlugin extends Plugin
|
|||||||
// Private message cache used to avoid duplicate notifications from ChatHistory.
|
// Private message cache used to avoid duplicate notifications from ChatHistory.
|
||||||
private Set<Integer> privateMessageHashes = new HashSet<>();
|
private Set<Integer> privateMessageHashes = new HashSet<>();
|
||||||
|
|
||||||
|
private boolean highlightOwnName;
|
||||||
|
private String highlightWordsString;
|
||||||
|
private boolean notifyOnOwnName;
|
||||||
|
private boolean notifyOnHighlight;
|
||||||
|
private boolean notifyOnTrade;
|
||||||
|
private boolean notifyOnDuel;
|
||||||
|
private boolean notifyOnPm;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
ChatNotificationsConfig provideConfig(ConfigManager configManager)
|
ChatNotificationsConfig provideConfig(ConfigManager configManager)
|
||||||
{
|
{
|
||||||
@@ -91,6 +101,7 @@ public class ChatNotificationsPlugin extends Plugin
|
|||||||
@Override
|
@Override
|
||||||
public void startUp()
|
public void startUp()
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
updateHighlights();
|
updateHighlights();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,6 +128,7 @@ public class ChatNotificationsPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (event.getGroup().equals("chatnotification"))
|
if (event.getGroup().equals("chatnotification"))
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
updateHighlights();
|
updateHighlights();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -125,9 +137,9 @@ public class ChatNotificationsPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
highlightMatcher = null;
|
highlightMatcher = null;
|
||||||
|
|
||||||
if (!config.highlightWordsString().trim().equals(""))
|
if (!this.highlightWordsString.trim().equals(""))
|
||||||
{
|
{
|
||||||
List<String> items = Text.fromCSV(config.highlightWordsString());
|
List<String> items = Text.fromCSV(this.highlightWordsString);
|
||||||
String joined = items.stream()
|
String joined = items.stream()
|
||||||
.map(Text::escapeJagex) // we compare these strings to the raw Jagex ones
|
.map(Text::escapeJagex) // we compare these strings to the raw Jagex ones
|
||||||
.map(Pattern::quote)
|
.map(Pattern::quote)
|
||||||
@@ -147,13 +159,13 @@ public class ChatNotificationsPlugin extends Plugin
|
|||||||
switch (chatMessage.getType())
|
switch (chatMessage.getType())
|
||||||
{
|
{
|
||||||
case TRADEREQ:
|
case TRADEREQ:
|
||||||
if (chatMessage.getMessage().contains("wishes to trade with you.") && config.notifyOnTrade())
|
if (chatMessage.getMessage().contains("wishes to trade with you.") && this.notifyOnTrade)
|
||||||
{
|
{
|
||||||
notifier.notify(chatMessage.getMessage());
|
notifier.notify(chatMessage.getMessage());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CHALREQ_TRADE:
|
case CHALREQ_TRADE:
|
||||||
if (chatMessage.getMessage().contains("wishes to duel with you.") && config.notifyOnDuel())
|
if (chatMessage.getMessage().contains("wishes to duel with you.") && this.notifyOnDuel)
|
||||||
{
|
{
|
||||||
notifier.notify(chatMessage.getMessage());
|
notifier.notify(chatMessage.getMessage());
|
||||||
}
|
}
|
||||||
@@ -167,7 +179,7 @@ public class ChatNotificationsPlugin extends Plugin
|
|||||||
break;
|
break;
|
||||||
case PRIVATECHAT:
|
case PRIVATECHAT:
|
||||||
case MODPRIVATECHAT:
|
case MODPRIVATECHAT:
|
||||||
if (config.notifyOnPm())
|
if (this.notifyOnPm)
|
||||||
{
|
{
|
||||||
int messageHash = this.buildMessageHash(chatMessage);
|
int messageHash = this.buildMessageHash(chatMessage);
|
||||||
if (this.privateMessageHashes.contains(messageHash))
|
if (this.privateMessageHashes.contains(messageHash))
|
||||||
@@ -187,7 +199,7 @@ public class ChatNotificationsPlugin extends Plugin
|
|||||||
usernameReplacer = "<col" + ChatColorType.HIGHLIGHT.name() + "><u>" + username + "</u><col" + ChatColorType.NORMAL.name() + ">";
|
usernameReplacer = "<col" + ChatColorType.HIGHLIGHT.name() + "><u>" + username + "</u><col" + ChatColorType.NORMAL.name() + ">";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.highlightOwnName() && usernameMatcher != null)
|
if (this.highlightOwnName && usernameMatcher != null)
|
||||||
{
|
{
|
||||||
Matcher matcher = usernameMatcher.matcher(messageNode.getValue());
|
Matcher matcher = usernameMatcher.matcher(messageNode.getValue());
|
||||||
if (matcher.find())
|
if (matcher.find())
|
||||||
@@ -195,7 +207,7 @@ public class ChatNotificationsPlugin extends Plugin
|
|||||||
messageNode.setValue(matcher.replaceAll(usernameReplacer));
|
messageNode.setValue(matcher.replaceAll(usernameReplacer));
|
||||||
update = true;
|
update = true;
|
||||||
|
|
||||||
if (config.notifyOnOwnName())
|
if (this.notifyOnOwnName)
|
||||||
{
|
{
|
||||||
sendNotification(chatMessage);
|
sendNotification(chatMessage);
|
||||||
}
|
}
|
||||||
@@ -222,7 +234,7 @@ public class ChatNotificationsPlugin extends Plugin
|
|||||||
matcher.appendTail(stringBuffer);
|
matcher.appendTail(stringBuffer);
|
||||||
messageNode.setValue(stringBuffer.toString());
|
messageNode.setValue(stringBuffer.toString());
|
||||||
|
|
||||||
if (config.notifyOnHighlight())
|
if (this.notifyOnHighlight)
|
||||||
{
|
{
|
||||||
sendNotification(chatMessage);
|
sendNotification(chatMessage);
|
||||||
}
|
}
|
||||||
@@ -261,4 +273,15 @@ public class ChatNotificationsPlugin extends Plugin
|
|||||||
String notification = stringBuilder.toString();
|
String notification = stringBuilder.toString();
|
||||||
notifier.notify(notification);
|
notifier.notify(notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateConfig()
|
||||||
|
{
|
||||||
|
this.highlightOwnName = config.highlightOwnName();
|
||||||
|
this.highlightWordsString = config.highlightWordsString();
|
||||||
|
this.notifyOnOwnName = config.notifyOnOwnName();
|
||||||
|
this.notifyOnHighlight = config.notifyOnHighlight();
|
||||||
|
this.notifyOnTrade = config.notifyOnTrade();
|
||||||
|
this.notifyOnDuel = config.notifyOnDuel();
|
||||||
|
this.notifyOnPm = config.notifyOnPm();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package net.runelite.client.plugins.chattranslation;
|
|||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ObjectArrays;
|
import com.google.common.collect.ObjectArrays;
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.*;
|
import net.runelite.api.*;
|
||||||
import net.runelite.api.events.ChatMessage;
|
import net.runelite.api.events.ChatMessage;
|
||||||
import net.runelite.api.events.ConfigChanged;
|
import net.runelite.api.events.ConfigChanged;
|
||||||
@@ -34,6 +35,7 @@ import java.util.ArrayList;
|
|||||||
tags = {"translate", "language", "english", "spanish", "dutch", "french"},
|
tags = {"translate", "language", "english", "spanish", "dutch", "french"},
|
||||||
type = PluginType.UTILITY
|
type = PluginType.UTILITY
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
public class ChatTranslationPlugin extends Plugin implements KeyListener
|
public class ChatTranslationPlugin extends Plugin implements KeyListener
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -64,6 +66,13 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
|
|||||||
@Inject
|
@Inject
|
||||||
private ChatTranslationConfig config;
|
private ChatTranslationConfig config;
|
||||||
|
|
||||||
|
private boolean translateOptionVisable;
|
||||||
|
private boolean publicChat;
|
||||||
|
private String getPlayerNames;
|
||||||
|
private Languages publicTargetLanguage;
|
||||||
|
private boolean playerChat;
|
||||||
|
private Languages playerTargetLanguage;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
ChatTranslationConfig provideConfig(ConfigManager configManager)
|
ChatTranslationConfig provideConfig(ConfigManager configManager)
|
||||||
{
|
{
|
||||||
@@ -73,9 +82,11 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
|
|||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
|
|
||||||
if (client != null)
|
if (client != null)
|
||||||
{
|
{
|
||||||
if (config.translateOptionVisable())
|
if (this.translateOptionVisable)
|
||||||
{
|
{
|
||||||
menuManager.get().addPlayerMenuItem(TRANSLATE);
|
menuManager.get().addPlayerMenuItem(TRANSLATE);
|
||||||
}
|
}
|
||||||
@@ -90,7 +101,7 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
|
|||||||
{
|
{
|
||||||
if (client != null)
|
if (client != null)
|
||||||
{
|
{
|
||||||
if (config.translateOptionVisable())
|
if (this.translateOptionVisable)
|
||||||
{
|
{
|
||||||
menuManager.get().removePlayerMenuItem(TRANSLATE);
|
menuManager.get().removePlayerMenuItem(TRANSLATE);
|
||||||
}
|
}
|
||||||
@@ -105,9 +116,10 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
|
|||||||
{
|
{
|
||||||
if (event.getGroup().equals("chattranslation"))
|
if (event.getGroup().equals("chattranslation"))
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
if (event.getKey().equals("playerNames"))
|
if (event.getKey().equals("playerNames"))
|
||||||
{
|
{
|
||||||
for (String names : Text.fromCSV(config.getPlayerNames()))
|
for (String names : Text.fromCSV(this.getPlayerNames))
|
||||||
{
|
{
|
||||||
if (!playerNames.contains(Text.toJagexName(names)))
|
if (!playerNames.contains(Text.toJagexName(names)))
|
||||||
{
|
{
|
||||||
@@ -121,7 +133,7 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||||
{
|
{
|
||||||
if (!config.translateOptionVisable())
|
if (!this.translateOptionVisable)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -181,7 +193,7 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
|
|||||||
case PUBLICCHAT:
|
case PUBLICCHAT:
|
||||||
case MODCHAT:
|
case MODCHAT:
|
||||||
case FRIENDSCHAT:
|
case FRIENDSCHAT:
|
||||||
if (!config.publicChat())
|
if (!this.publicChat)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -201,7 +213,7 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
//Automatically check language of message and translate to selected language.
|
//Automatically check language of message and translate to selected language.
|
||||||
String translation = translator.translate("auto", config.publicTargetLanguage().toString(), message);
|
String translation = translator.translate("auto", this.publicTargetLanguage.toString(), message);
|
||||||
if (translation != null)
|
if (translation != null)
|
||||||
{
|
{
|
||||||
final MessageNode messageNode = chatMessage.getMessageNode();
|
final MessageNode messageNode = chatMessage.getMessageNode();
|
||||||
@@ -227,7 +239,7 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config.playerChat())
|
if (!this.playerChat)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -259,7 +271,7 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
//Automatically check language of message and translate to selected language.
|
//Automatically check language of message and translate to selected language.
|
||||||
String translation = translator.translate("auto", config.playerTargetLanguage().toString(), message);
|
String translation = translator.translate("auto", this.playerTargetLanguage.toString(), message);
|
||||||
if (translation != null)
|
if (translation != null)
|
||||||
{
|
{
|
||||||
client.setVar(VarClientStr.CHATBOX_TYPED_TEXT, translation);
|
client.setVar(VarClientStr.CHATBOX_TYPED_TEXT, translation);
|
||||||
@@ -291,4 +303,13 @@ public class ChatTranslationPlugin extends Plugin implements KeyListener
|
|||||||
// Nothing.
|
// Nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateConfig()
|
||||||
|
{
|
||||||
|
this.publicChat = config.publicChat();
|
||||||
|
this.getPlayerNames = config.getPlayerNames();
|
||||||
|
this.translateOptionVisable = config.translateOptionVisable();
|
||||||
|
this.publicTargetLanguage = config.publicTargetLanguage();
|
||||||
|
this.playerChat = config.playerChat();
|
||||||
|
this.playerTargetLanguage = config.playerTargetLanguage();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,13 +26,15 @@ package net.runelite.client.plugins.clanchat;
|
|||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.client.ui.overlay.infobox.Counter;
|
import net.runelite.client.ui.overlay.infobox.Counter;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
class ClanChatIndicator extends Counter
|
class ClanChatIndicator extends Counter
|
||||||
{
|
{
|
||||||
private final ClanChatPlugin plugin;
|
private final ClanChatPlugin plugin;
|
||||||
|
|
||||||
ClanChatIndicator(BufferedImage image, ClanChatPlugin plugin)
|
ClanChatIndicator(final BufferedImage image, final ClanChatPlugin plugin)
|
||||||
{
|
{
|
||||||
super(image, plugin, plugin.getClanAmount());
|
super(image, plugin, plugin.getClanAmount());
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.ChatLineBuffer;
|
import net.runelite.api.ChatLineBuffer;
|
||||||
import net.runelite.api.ChatMessageType;
|
import net.runelite.api.ChatMessageType;
|
||||||
import net.runelite.api.ClanMember;
|
import net.runelite.api.ClanMember;
|
||||||
@@ -68,7 +69,6 @@ import net.runelite.api.widgets.WidgetInfo;
|
|||||||
import net.runelite.api.widgets.WidgetType;
|
import net.runelite.api.widgets.WidgetType;
|
||||||
import net.runelite.client.callback.ClientThread;
|
import net.runelite.client.callback.ClientThread;
|
||||||
import net.runelite.client.chat.ChatMessageBuilder;
|
import net.runelite.client.chat.ChatMessageBuilder;
|
||||||
import net.runelite.client.chat.ChatMessageManager;
|
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.eventbus.Subscribe;
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
import net.runelite.client.game.ClanManager;
|
import net.runelite.client.game.ClanManager;
|
||||||
@@ -87,6 +87,7 @@ import net.runelite.client.util.Text;
|
|||||||
description = "Add rank icons to users talking in clan chat",
|
description = "Add rank icons to users talking in clan chat",
|
||||||
tags = {"icons", "rank", "recent"}
|
tags = {"icons", "rank", "recent"}
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
public class ClanChatPlugin extends Plugin
|
public class ClanChatPlugin extends Plugin
|
||||||
{
|
{
|
||||||
private static final int MAX_CHATS = 20;
|
private static final int MAX_CHATS = 20;
|
||||||
@@ -112,9 +113,6 @@ public class ClanChatPlugin extends Plugin
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ClientThread clientThread;
|
private ClientThread clientThread;
|
||||||
|
|
||||||
@Inject
|
|
||||||
private ChatMessageManager chatMessageManager;
|
|
||||||
|
|
||||||
private List<String> chats = new ArrayList<>();
|
private List<String> chats = new ArrayList<>();
|
||||||
|
|
||||||
@@ -132,6 +130,17 @@ public class ClanChatPlugin extends Plugin
|
|||||||
private Map<String, ClanMemberActivity> activityBuffer = new HashMap<>();
|
private Map<String, ClanMemberActivity> activityBuffer = new HashMap<>();
|
||||||
private int clanJoinedTick;
|
private int clanJoinedTick;
|
||||||
|
|
||||||
|
private boolean clanChatIcons;
|
||||||
|
private boolean recentChats;
|
||||||
|
private boolean showClanCounter;
|
||||||
|
private String chatsData;
|
||||||
|
private boolean showJoinLeave;
|
||||||
|
private ClanMemberRank joinLeaveRank;
|
||||||
|
private boolean privateMessageIcons;
|
||||||
|
private boolean publicChatIcons;
|
||||||
|
private boolean clanTabChat;
|
||||||
|
private String clanname;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
ClanChatConfig getConfig(ConfigManager configManager)
|
ClanChatConfig getConfig(ConfigManager configManager)
|
||||||
{
|
{
|
||||||
@@ -141,6 +150,7 @@ public class ClanChatPlugin extends Plugin
|
|||||||
@Override
|
@Override
|
||||||
public void startUp()
|
public void startUp()
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
chats = new ArrayList<>(Text.fromCSV(config.chatsData()));
|
chats = new ArrayList<>(Text.fromCSV(config.chatsData()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,12 +167,14 @@ public class ClanChatPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
if (configChanged.getGroup().equals("clanchat"))
|
if (configChanged.getGroup().equals("clanchat"))
|
||||||
{
|
{
|
||||||
if (!config.recentChats())
|
updateConfig();
|
||||||
|
|
||||||
|
if (!this.recentChats)
|
||||||
{
|
{
|
||||||
resetClanChats();
|
resetClanChats();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.showClanCounter())
|
if (this.showClanCounter)
|
||||||
{
|
{
|
||||||
clientThread.invoke(this::addClanCounter);
|
clientThread.invoke(this::addClanCounter);
|
||||||
}
|
}
|
||||||
@@ -200,8 +212,8 @@ public class ClanChatPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config.showJoinLeave() ||
|
if (!this.showJoinLeave ||
|
||||||
member.getRank().getValue() < config.joinLeaveRank().getValue())
|
member.getRank().getValue() < this.joinLeaveRank.getValue())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -245,8 +257,8 @@ public class ClanChatPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config.showJoinLeave() ||
|
if (!this.showJoinLeave ||
|
||||||
member.getRank().getValue() < config.joinLeaveRank().getValue())
|
member.getRank().getValue() < this.joinLeaveRank.getValue())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -271,7 +283,7 @@ public class ClanChatPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
client.setVar(VarClientStr.RECENT_CLAN_CHAT, config.clanname());
|
client.setVar(VarClientStr.RECENT_CLAN_CHAT, this.clanname);
|
||||||
|
|
||||||
Widget clanChatTitleWidget = client.getWidget(WidgetInfo.CLAN_CHAT_TITLE);
|
Widget clanChatTitleWidget = client.getWidget(WidgetInfo.CLAN_CHAT_TITLE);
|
||||||
if (clanChatTitleWidget != null)
|
if (clanChatTitleWidget != null)
|
||||||
@@ -282,7 +294,7 @@ public class ClanChatPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
clanChatTitleWidget.setText(CLAN_CHAT_TITLE + " (" + client.getClanChatCount() + "/100)");
|
clanChatTitleWidget.setText(CLAN_CHAT_TITLE + " (" + client.getClanChatCount() + "/100)");
|
||||||
}
|
}
|
||||||
else if (config.recentChats() && clanChatList.getChildren() == null && !Strings.isNullOrEmpty(owner.getText()))
|
else if (this.recentChats && clanChatList.getChildren() == null && !Strings.isNullOrEmpty(owner.getText()))
|
||||||
{
|
{
|
||||||
clanChatTitleWidget.setText(RECENT_TITLE);
|
clanChatTitleWidget.setText(RECENT_TITLE);
|
||||||
|
|
||||||
@@ -290,7 +302,7 @@ public class ClanChatPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config.showJoinLeave())
|
if (!this.showJoinLeave)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -373,7 +385,7 @@ public class ClanChatPlugin extends Plugin
|
|||||||
channelColor = CHAT_CLAN_NAME_TRANSPARENT_BACKGROUND;
|
channelColor = CHAT_CLAN_NAME_TRANSPARENT_BACKGROUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.clanChatIcons() && rank != null && rank != ClanMemberRank.UNRANKED)
|
if (this.clanChatIcons && rank != null && rank != ClanMemberRank.UNRANKED)
|
||||||
{
|
{
|
||||||
rankIcon = clanManager.getIconNumber(rank);
|
rankIcon = clanManager.getIconNumber(rank);
|
||||||
}
|
}
|
||||||
@@ -405,7 +417,7 @@ public class ClanChatPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onVarClientStrChanged(VarClientStrChanged strChanged)
|
public void onVarClientStrChanged(VarClientStrChanged strChanged)
|
||||||
{
|
{
|
||||||
if (strChanged.getIndex() == VarClientStr.RECENT_CLAN_CHAT.getIndex() && config.recentChats())
|
if (strChanged.getIndex() == VarClientStr.RECENT_CLAN_CHAT.getIndex() && this.recentChats)
|
||||||
{
|
{
|
||||||
updateRecentChat(client.getVar(VarClientStr.RECENT_CLAN_CHAT));
|
updateRecentChat(client.getVar(VarClientStr.RECENT_CLAN_CHAT));
|
||||||
}
|
}
|
||||||
@@ -428,20 +440,20 @@ public class ClanChatPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
case PRIVATECHAT:
|
case PRIVATECHAT:
|
||||||
case MODPRIVATECHAT:
|
case MODPRIVATECHAT:
|
||||||
if (!config.privateMessageIcons())
|
if (!this.privateMessageIcons)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PUBLICCHAT:
|
case PUBLICCHAT:
|
||||||
case MODCHAT:
|
case MODCHAT:
|
||||||
if (!config.publicChatIcons())
|
if (!this.publicChatIcons)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FRIENDSCHAT:
|
case FRIENDSCHAT:
|
||||||
if (!config.clanChatIcons())
|
if (!this.clanChatIcons)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -515,7 +527,7 @@ public class ClanChatPlugin extends Plugin
|
|||||||
|
|
||||||
final int[] intStack = client.getIntStack();
|
final int[] intStack = client.getIntStack();
|
||||||
final int size = client.getIntStackSize();
|
final int size = client.getIntStackSize();
|
||||||
intStack[size - 1] = config.clanTabChat() ? 1 : 0;
|
intStack[size - 1] = this.clanTabChat ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getClanAmount()
|
int getClanAmount()
|
||||||
@@ -617,7 +629,10 @@ public class ClanChatPlugin extends Plugin
|
|||||||
chats.remove(0);
|
chats.remove(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
config.chatsData(Text.toCSV(chats));
|
String csvText = Text.toCSV(chats);
|
||||||
|
|
||||||
|
config.chatsData(csvText);
|
||||||
|
this.chatsData = csvText;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeClanCounter()
|
private void removeClanCounter()
|
||||||
@@ -628,7 +643,7 @@ public class ClanChatPlugin extends Plugin
|
|||||||
|
|
||||||
private void addClanCounter()
|
private void addClanCounter()
|
||||||
{
|
{
|
||||||
if (!config.showClanCounter() || clanMemberCounter != null || clanMembers.isEmpty())
|
if (!this.showClanCounter || clanMemberCounter != null || clanMembers.isEmpty())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -637,4 +652,18 @@ public class ClanChatPlugin extends Plugin
|
|||||||
clanMemberCounter = new ClanChatIndicator(image, this);
|
clanMemberCounter = new ClanChatIndicator(image, this);
|
||||||
infoBoxManager.addInfoBox(clanMemberCounter);
|
infoBoxManager.addInfoBox(clanMemberCounter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateConfig()
|
||||||
|
{
|
||||||
|
this.clanChatIcons = config.clanChatIcons();
|
||||||
|
this.recentChats = config.recentChats();
|
||||||
|
this.showClanCounter = config.showClanCounter();
|
||||||
|
this.chatsData = config.chatsData();
|
||||||
|
this.showJoinLeave = config.showJoinLeave();
|
||||||
|
this.joinLeaveRank = config.joinLeaveRank();
|
||||||
|
this.privateMessageIcons = config.privateMessageIcons();
|
||||||
|
this.publicChatIcons = config.publicChatIcons();
|
||||||
|
this.clanTabChat = config.clanTabChat();
|
||||||
|
this.clanname = config.clanname();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class ClanManModeMinimapOverlay extends Overlay
|
|||||||
private final ClanManModeConfig config;
|
private final ClanManModeConfig config;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ClanManModeMinimapOverlay(ClanManModeConfig config, ClanManModeService ClanManModeService)
|
private ClanManModeMinimapOverlay(final ClanManModeConfig config, final ClanManModeService ClanManModeService)
|
||||||
{
|
{
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.ClanManModeService = ClanManModeService;
|
this.ClanManModeService = ClanManModeService;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class ClanManModeOverlay extends Overlay
|
|||||||
private final ClanManModeConfig config;
|
private final ClanManModeConfig config;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ClanManModeOverlay(ClanManModeConfig config, ClanManModeService ClanManModeService)
|
private ClanManModeOverlay(final ClanManModeConfig config, final ClanManModeService ClanManModeService)
|
||||||
{
|
{
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.ClanManModeService = ClanManModeService;
|
this.ClanManModeService = ClanManModeService;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import java.util.Collections;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
import net.runelite.api.Player;
|
import net.runelite.api.Player;
|
||||||
@@ -27,7 +28,7 @@ import net.runelite.client.ui.overlay.OverlayManager;
|
|||||||
type = PluginType.PVP,
|
type = PluginType.PVP,
|
||||||
enabledByDefault = false
|
enabledByDefault = false
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
public class ClanManModePlugin extends Plugin
|
public class ClanManModePlugin extends Plugin
|
||||||
{
|
{
|
||||||
@Inject
|
@Inject
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class ClanManModeService
|
|||||||
private final ClanManModePlugin plugin;
|
private final ClanManModePlugin plugin;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ClanManModeService(Client client, ClanManModeConfig config, ClanManModePlugin plugin)
|
private ClanManModeService(final Client client, final ClanManModeConfig config, final ClanManModePlugin plugin)
|
||||||
{
|
{
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.client = client;
|
this.client = client;
|
||||||
|
|||||||
@@ -4,19 +4,21 @@ import java.awt.Dimension;
|
|||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Polygon;
|
import java.awt.Polygon;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
import net.runelite.client.ui.overlay.OverlayPriority;
|
import net.runelite.client.ui.overlay.OverlayPriority;
|
||||||
import net.runelite.client.ui.overlay.OverlayUtil;
|
import net.runelite.client.ui.overlay.OverlayUtil;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class ClanManModeTileOverlay extends Overlay
|
public class ClanManModeTileOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private final ClanManModeService ClanManModeService;
|
private final ClanManModeService ClanManModeService;
|
||||||
private final ClanManModeConfig config;
|
private final ClanManModeConfig config;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ClanManModeTileOverlay(ClanManModeConfig config, ClanManModeService ClanManModeService)
|
private ClanManModeTileOverlay(final ClanManModeConfig config, final ClanManModeService ClanManModeService)
|
||||||
{
|
{
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.ClanManModeService = ClanManModeService;
|
this.ClanManModeService = ClanManModeService;
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ package net.runelite.client.plugins.cluescrolls;
|
|||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.widgets.Widget;
|
import net.runelite.api.widgets.Widget;
|
||||||
import net.runelite.api.widgets.WidgetInfo;
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
@@ -36,6 +37,7 @@ import net.runelite.client.ui.overlay.Overlay;
|
|||||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
class ClueScrollEmoteOverlay extends Overlay
|
class ClueScrollEmoteOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private final ClueScrollPlugin plugin;
|
private final ClueScrollPlugin plugin;
|
||||||
@@ -44,7 +46,7 @@ class ClueScrollEmoteOverlay extends Overlay
|
|||||||
private boolean hasScrolled;
|
private boolean hasScrolled;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ClueScrollEmoteOverlay(ClueScrollPlugin plugin, Client client)
|
private ClueScrollEmoteOverlay(final ClueScrollPlugin plugin, final Client client)
|
||||||
{
|
{
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import java.awt.Dimension;
|
|||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.widgets.Widget;
|
import net.runelite.api.widgets.Widget;
|
||||||
import net.runelite.api.widgets.WidgetInfo;
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
@@ -37,6 +38,7 @@ import net.runelite.client.ui.overlay.Overlay;
|
|||||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
class ClueScrollMusicOverlay extends Overlay
|
class ClueScrollMusicOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private static final Rectangle PADDING = new Rectangle(2, 1, 0, 1);
|
private static final Rectangle PADDING = new Rectangle(2, 1, 0, 1);
|
||||||
@@ -47,7 +49,7 @@ class ClueScrollMusicOverlay extends Overlay
|
|||||||
private boolean hasScrolled;
|
private boolean hasScrolled;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ClueScrollMusicOverlay(ClueScrollPlugin plugin, Client client)
|
private ClueScrollMusicOverlay(final ClueScrollPlugin plugin, final Client client)
|
||||||
{
|
{
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import java.awt.Color;
|
|||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import static net.runelite.api.ItemID.SPADE;
|
import static net.runelite.api.ItemID.SPADE;
|
||||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||||
import net.runelite.client.plugins.cluescrolls.clues.ClueScroll;
|
import net.runelite.client.plugins.cluescrolls.clues.ClueScroll;
|
||||||
@@ -43,6 +44,7 @@ import net.runelite.client.ui.overlay.components.ComponentConstants;
|
|||||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class ClueScrollOverlay extends Overlay
|
public class ClueScrollOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private static final ItemRequirement HAS_SPADE = new SingleItemRequirement(SPADE);
|
private static final ItemRequirement HAS_SPADE = new SingleItemRequirement(SPADE);
|
||||||
@@ -53,7 +55,7 @@ public class ClueScrollOverlay extends Overlay
|
|||||||
private final PanelComponent panelComponent = new PanelComponent();
|
private final PanelComponent panelComponent = new PanelComponent();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ClueScrollOverlay(ClueScrollPlugin plugin)
|
private ClueScrollOverlay(final ClueScrollPlugin plugin)
|
||||||
{
|
{
|
||||||
super(plugin);
|
super(plugin);
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import java.util.List;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.ChatMessageType;
|
import net.runelite.api.ChatMessageType;
|
||||||
@@ -108,6 +109,7 @@ import net.runelite.client.util.Text;
|
|||||||
tags = {"arrow", "hints", "world", "map", "coordinates", "emotes"}
|
tags = {"arrow", "hints", "world", "map", "coordinates", "emotes"}
|
||||||
)
|
)
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@Singleton
|
||||||
public class ClueScrollPlugin extends Plugin
|
public class ClueScrollPlugin extends Plugin
|
||||||
{
|
{
|
||||||
private static final Color HIGHLIGHT_BORDER_COLOR = Color.ORANGE;
|
private static final Color HIGHLIGHT_BORDER_COLOR = Color.ORANGE;
|
||||||
@@ -164,6 +166,8 @@ public class ClueScrollPlugin extends Plugin
|
|||||||
|
|
||||||
private final TextComponent textComponent = new TextComponent();
|
private final TextComponent textComponent = new TextComponent();
|
||||||
|
|
||||||
|
private boolean displayHintArrows;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
ClueScrollConfig getConfig(ConfigManager configManager)
|
ClueScrollConfig getConfig(ConfigManager configManager)
|
||||||
{
|
{
|
||||||
@@ -179,6 +183,7 @@ public class ClueScrollPlugin extends Plugin
|
|||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
|
this.displayHintArrows = config.displayHintArrows();
|
||||||
overlayManager.add(clueScrollOverlay);
|
overlayManager.add(clueScrollOverlay);
|
||||||
overlayManager.add(clueScrollEmoteOverlay);
|
overlayManager.add(clueScrollEmoteOverlay);
|
||||||
overlayManager.add(clueScrollWorldOverlay);
|
overlayManager.add(clueScrollWorldOverlay);
|
||||||
@@ -274,7 +279,7 @@ public class ClueScrollPlugin extends Plugin
|
|||||||
worldMapPointsSet = false;
|
worldMapPointsSet = false;
|
||||||
npcsToMark.clear();
|
npcsToMark.clear();
|
||||||
|
|
||||||
if (config.displayHintArrows())
|
if (this.displayHintArrows)
|
||||||
{
|
{
|
||||||
client.clearHintArrow();
|
client.clearHintArrow();
|
||||||
}
|
}
|
||||||
@@ -313,9 +318,13 @@ public class ClueScrollPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onConfigChanged(ConfigChanged event)
|
public void onConfigChanged(ConfigChanged event)
|
||||||
{
|
{
|
||||||
if (event.getGroup().equals("cluescroll") && !config.displayHintArrows())
|
if (event.getGroup().equals("cluescroll"))
|
||||||
{
|
{
|
||||||
client.clearHintArrow();
|
this.displayHintArrows = config.displayHintArrows();
|
||||||
|
if (!this.displayHintArrows)
|
||||||
|
{
|
||||||
|
client.clearHintArrow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,7 +375,7 @@ public class ClueScrollPlugin extends Plugin
|
|||||||
if (location != null)
|
if (location != null)
|
||||||
{
|
{
|
||||||
// Only set the location hint arrow if we do not already have more accurate location
|
// Only set the location hint arrow if we do not already have more accurate location
|
||||||
if (config.displayHintArrows()
|
if (this.displayHintArrows
|
||||||
&& (client.getHintArrowNpc() == null
|
&& (client.getHintArrowNpc() == null
|
||||||
|| !npcsToMark.contains(client.getHintArrowNpc())))
|
|| !npcsToMark.contains(client.getHintArrowNpc())))
|
||||||
{
|
{
|
||||||
@@ -455,7 +464,7 @@ public class ClueScrollPlugin extends Plugin
|
|||||||
worldMapPointsSet = false;
|
worldMapPointsSet = false;
|
||||||
npcsToMark.clear();
|
npcsToMark.clear();
|
||||||
|
|
||||||
if (config.displayHintArrows())
|
if (this.displayHintArrows)
|
||||||
{
|
{
|
||||||
client.clearHintArrow();
|
client.clearHintArrow();
|
||||||
}
|
}
|
||||||
@@ -698,7 +707,7 @@ public class ClueScrollPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!npcsToMark.isEmpty() && config.displayHintArrows())
|
if (!npcsToMark.isEmpty() && this.displayHintArrows)
|
||||||
{
|
{
|
||||||
// Always set hint arrow to first seen NPC
|
// Always set hint arrow to first seen NPC
|
||||||
client.setHintArrow(npcsToMark.get(0));
|
client.setHintArrow(npcsToMark.get(0));
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class ClueScrollServiceImpl implements ClueScrollService
|
|||||||
private final ClueScrollPlugin plugin;
|
private final ClueScrollPlugin plugin;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ClueScrollServiceImpl(ClueScrollPlugin plugin)
|
private ClueScrollServiceImpl(final ClueScrollPlugin plugin)
|
||||||
{
|
{
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class ClueScrollWorldMapPoint extends WorldMapPoint
|
|||||||
private final BufferedImage clueScrollWorldImage;
|
private final BufferedImage clueScrollWorldImage;
|
||||||
private final Point clueScrollWorldImagePoint;
|
private final Point clueScrollWorldImagePoint;
|
||||||
|
|
||||||
ClueScrollWorldMapPoint(final WorldPoint worldPoint, ClueScrollPlugin plugin)
|
ClueScrollWorldMapPoint(final WorldPoint worldPoint, final ClueScrollPlugin plugin)
|
||||||
{
|
{
|
||||||
super(worldPoint, null);
|
super(worldPoint, null);
|
||||||
|
|
||||||
|
|||||||
@@ -28,11 +28,13 @@ import java.awt.Color;
|
|||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.client.plugins.cluescrolls.clues.ClueScroll;
|
import net.runelite.client.plugins.cluescrolls.clues.ClueScroll;
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class ClueScrollWorldOverlay extends Overlay
|
public class ClueScrollWorldOverlay extends Overlay
|
||||||
{
|
{
|
||||||
public static final int IMAGE_Z_OFFSET = 30;
|
public static final int IMAGE_Z_OFFSET = 30;
|
||||||
@@ -44,7 +46,7 @@ public class ClueScrollWorldOverlay extends Overlay
|
|||||||
private final ClueScrollPlugin plugin;
|
private final ClueScrollPlugin plugin;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ClueScrollWorldOverlay(ClueScrollPlugin plugin)
|
private ClueScrollWorldOverlay(final ClueScrollPlugin plugin)
|
||||||
{
|
{
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
setLayer(OverlayLayer.ABOVE_SCENE);
|
setLayer(OverlayLayer.ABOVE_SCENE);
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
package net.runelite.client.plugins.combatcounter;
|
package net.runelite.client.plugins.combatcounter;
|
||||||
|
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
|
import java.awt.Color;
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import net.runelite.api.Actor;
|
import net.runelite.api.Actor;
|
||||||
@@ -35,6 +38,7 @@ import net.runelite.api.NPCDefinition;
|
|||||||
import net.runelite.api.Player;
|
import net.runelite.api.Player;
|
||||||
import net.runelite.api.coords.WorldPoint;
|
import net.runelite.api.coords.WorldPoint;
|
||||||
import net.runelite.api.events.AnimationChanged;
|
import net.runelite.api.events.AnimationChanged;
|
||||||
|
import net.runelite.api.events.ConfigChanged;
|
||||||
import net.runelite.api.events.GameTick;
|
import net.runelite.api.events.GameTick;
|
||||||
import net.runelite.api.events.HitsplatApplied;
|
import net.runelite.api.events.HitsplatApplied;
|
||||||
import net.runelite.api.kit.KitType;
|
import net.runelite.api.kit.KitType;
|
||||||
@@ -59,7 +63,7 @@ import java.util.Map;
|
|||||||
type = PluginType.UTILITY,
|
type = PluginType.UTILITY,
|
||||||
enabledByDefault = false
|
enabledByDefault = false
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
public class CombatCounter extends Plugin
|
public class CombatCounter extends Plugin
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -79,16 +83,30 @@ public class CombatCounter extends Plugin
|
|||||||
private CombatCounterConfig config;
|
private CombatCounterConfig config;
|
||||||
|
|
||||||
private boolean instanced = false;
|
private boolean instanced = false;
|
||||||
private boolean prevInstance = false;
|
@Setter(AccessLevel.PACKAGE)
|
||||||
@Setter
|
@Getter(AccessLevel.PACKAGE)
|
||||||
@Getter
|
private Map<String, Long> counter = new HashMap<>();
|
||||||
private Map<String, Long> counter = new HashMap<String, Long>();
|
|
||||||
private long BLOWPIPE_ID = 5061;
|
|
||||||
|
|
||||||
private Map<String, Long> blowpipe = new HashMap<>();
|
private Map<String, Long> blowpipe = new HashMap<>();
|
||||||
|
|
||||||
public Map<NPC, NPCDamageCounter> npcDamageMap = new HashMap<NPC, NPCDamageCounter>();
|
private Map<NPC, NPCDamageCounter> npcDamageMap = new HashMap<>();
|
||||||
public Map<String, Double> playerDamage = new HashMap<String, Double>();
|
Map<String, Double> playerDamage = new HashMap<>();
|
||||||
|
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showTickCounter;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showDamageCounter;
|
||||||
|
private boolean resetOnNewInstance;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private Color selfColor;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private Color totalColor;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private Color otherColor;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private Color bgColor;
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private Color titleColor;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
CombatCounterConfig provideConfig(ConfigManager configManager)
|
CombatCounterConfig provideConfig(ConfigManager configManager)
|
||||||
@@ -96,8 +114,6 @@ public class CombatCounter extends Plugin
|
|||||||
return configManager.getConfig(CombatCounterConfig.class);
|
return configManager.getConfig(CombatCounterConfig.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private Map<Integer, Integer> variables = new HashMap<Integer, Integer>()
|
private Map<Integer, Integer> variables = new HashMap<Integer, Integer>()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
@@ -157,7 +173,7 @@ public class CombatCounter extends Plugin
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public List<Integer> MELEE_ANIMATIONS = new ArrayList<Integer>()
|
private List<Integer> MELEE_ANIMATIONS = new ArrayList<Integer>()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
this.add(422); // Unarmed Punch, Block
|
this.add(422); // Unarmed Punch, Block
|
||||||
@@ -201,7 +217,7 @@ public class CombatCounter extends Plugin
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public List<Integer> RANGE_ANIMATIONS = new ArrayList<Integer>()
|
private List<Integer> RANGE_ANIMATIONS = new ArrayList<Integer>()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
this.add(7552); // Armadyl Crossbow Accurate, Rapid, Longrange, Special
|
this.add(7552); // Armadyl Crossbow Accurate, Rapid, Longrange, Special
|
||||||
@@ -214,7 +230,7 @@ public class CombatCounter extends Plugin
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public List<Integer> MAGE_ANIMATIONS = new ArrayList<Integer>()
|
private List<Integer> MAGE_ANIMATIONS = new ArrayList<Integer>()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
this.add(1167); // Trident Accurate, Accurate, Longrange
|
this.add(1167); // Trident Accurate, Accurate, Longrange
|
||||||
@@ -226,6 +242,8 @@ public class CombatCounter extends Plugin
|
|||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
|
|
||||||
overlayManager.add(tickOverlay);
|
overlayManager.add(tickOverlay);
|
||||||
overlayManager.add(damageOverlay);
|
overlayManager.add(damageOverlay);
|
||||||
|
|
||||||
@@ -252,7 +270,7 @@ public class CombatCounter extends Plugin
|
|||||||
{
|
{
|
||||||
Actor actor = event.getActor();
|
Actor actor = event.getActor();
|
||||||
|
|
||||||
if (actor != null && actor instanceof Player)
|
if (actor instanceof Player)
|
||||||
{
|
{
|
||||||
Player p = (Player) actor;
|
Player p = (Player) actor;
|
||||||
String name = actor.getName();
|
String name = actor.getName();
|
||||||
@@ -276,6 +294,7 @@ public class CombatCounter extends Plugin
|
|||||||
counter.put(name, ticks);
|
counter.put(name, ticks);
|
||||||
counter = sortByValue(counter);
|
counter = sortByValue(counter);
|
||||||
|
|
||||||
|
long BLOWPIPE_ID = 5061;
|
||||||
if (animation == BLOWPIPE_ID)
|
if (animation == BLOWPIPE_ID)
|
||||||
{
|
{
|
||||||
this.blowpipe.put(name, -4L);
|
this.blowpipe.put(name, -4L);
|
||||||
@@ -285,11 +304,11 @@ public class CombatCounter extends Plugin
|
|||||||
* This part handles the Damage Counter.
|
* This part handles the Damage Counter.
|
||||||
*/
|
*/
|
||||||
Actor interacting = actor.getInteracting();
|
Actor interacting = actor.getInteracting();
|
||||||
if (interacting != null && interacting instanceof NPC)
|
if (interacting instanceof NPC)
|
||||||
{
|
{
|
||||||
NPC npc = (NPC) interacting;
|
NPC npc = (NPC) interacting;
|
||||||
|
|
||||||
List<NPC> actives = new ArrayList<NPC>();
|
List<NPC> actives = new ArrayList<>();
|
||||||
actives.add(npc);
|
actives.add(npc);
|
||||||
|
|
||||||
if (animation == 1979 || animation == 7618)
|
if (animation == 1979 || animation == 7618)
|
||||||
@@ -340,7 +359,7 @@ public class CombatCounter extends Plugin
|
|||||||
|
|
||||||
if (delay != -1)
|
if (delay != -1)
|
||||||
{
|
{
|
||||||
List<Integer> ticksToAdd = new ArrayList<Integer>();
|
List<Integer> ticksToAdd = new ArrayList<>();
|
||||||
ticksToAdd.add(delay);
|
ticksToAdd.add(delay);
|
||||||
|
|
||||||
if (canFarcast && delay > 2)
|
if (canFarcast && delay > 2)
|
||||||
@@ -348,7 +367,7 @@ public class CombatCounter extends Plugin
|
|||||||
ticksToAdd.add(delay - 1);
|
ticksToAdd.add(delay - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* Dragon Claw Specials are 2 ticks long.
|
* Dragon Claw Specials are 2 ticks long.
|
||||||
*/
|
*/
|
||||||
if (animation == 7514)
|
if (animation == 7514)
|
||||||
@@ -364,7 +383,7 @@ public class CombatCounter extends Plugin
|
|||||||
|
|
||||||
for (Integer tick : ticksToAdd)
|
for (Integer tick : ticksToAdd)
|
||||||
{
|
{
|
||||||
List<String> attackers = new ArrayList<String>();
|
List<String> attackers = new ArrayList<>();
|
||||||
if (dc.attackers.containsKey(tick))
|
if (dc.attackers.containsKey(tick))
|
||||||
attackers = dc.attackers.get(tick);
|
attackers = dc.attackers.get(tick);
|
||||||
|
|
||||||
@@ -389,9 +408,9 @@ public class CombatCounter extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onGameTick(GameTick event)
|
public void onGameTick(GameTick event)
|
||||||
{
|
{
|
||||||
if (config.resetOnNewInstance())
|
if (this.resetOnNewInstance)
|
||||||
{
|
{
|
||||||
prevInstance = instanced;
|
boolean prevInstance = instanced;
|
||||||
instanced = client.isInInstancedRegion();
|
instanced = client.isInInstancedRegion();
|
||||||
if (!prevInstance && instanced)
|
if (!prevInstance && instanced)
|
||||||
{
|
{
|
||||||
@@ -402,19 +421,19 @@ public class CombatCounter extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Player> visible = new HashMap<String, Player>();
|
Map<String, Player> visible = new HashMap<>();
|
||||||
for (Player p : this.client.getPlayers())
|
for (Player p : this.client.getPlayers())
|
||||||
{
|
{
|
||||||
if (p.getName() != null)
|
if (p.getName() != null)
|
||||||
visible.put(p.getName(), p);
|
visible.put(p.getName(), p);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (NPC npc : new ArrayList<NPC>(this.npcDamageMap.keySet()))
|
for (NPC npc : new ArrayList<>(this.npcDamageMap.keySet()))
|
||||||
{
|
{
|
||||||
NPCDamageCounter counter = this.npcDamageMap.get(npc);
|
NPCDamageCounter counter = this.npcDamageMap.get(npc);
|
||||||
|
|
||||||
Map<Integer, List<String>> attackers = counter.attackers;
|
Map<Integer, List<String>> attackers = counter.attackers;
|
||||||
for (Integer i : new ArrayList<Integer>(attackers.keySet()))
|
for (Integer i : new ArrayList<>(attackers.keySet()))
|
||||||
{
|
{
|
||||||
List<String> p = attackers.get(i);
|
List<String> p = attackers.get(i);
|
||||||
attackers.put(i - 1, p);
|
attackers.put(i - 1, p);
|
||||||
@@ -455,7 +474,7 @@ public class CombatCounter extends Plugin
|
|||||||
// this.playerDamage.put(name, count);
|
// this.playerDamage.put(name, count);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
for (Integer i : new ArrayList<Integer>(attackers.keySet()))
|
for (Integer i : new ArrayList<>(attackers.keySet()))
|
||||||
if (i <= -1)
|
if (i <= -1)
|
||||||
attackers.remove(i);
|
attackers.remove(i);
|
||||||
|
|
||||||
@@ -465,7 +484,7 @@ public class CombatCounter extends Plugin
|
|||||||
|
|
||||||
this.playerDamage = sortByValue(this.playerDamage);
|
this.playerDamage = sortByValue(this.playerDamage);
|
||||||
|
|
||||||
for (String user : new ArrayList<String>(blowpipe.keySet()))
|
for (String user : new ArrayList<>(blowpipe.keySet()))
|
||||||
{
|
{
|
||||||
if (visible.containsKey(user))
|
if (visible.containsKey(user))
|
||||||
{
|
{
|
||||||
@@ -481,7 +500,7 @@ public class CombatCounter extends Plugin
|
|||||||
|
|
||||||
Player p = visible.get(user);
|
Player p = visible.get(user);
|
||||||
Actor interacting = p.getInteracting();
|
Actor interacting = p.getInteracting();
|
||||||
if (interacting != null && interacting instanceof NPC)
|
if (interacting instanceof NPC)
|
||||||
{
|
{
|
||||||
NPC npc = (NPC) interacting;
|
NPC npc = (NPC) interacting;
|
||||||
|
|
||||||
@@ -493,14 +512,14 @@ public class CombatCounter extends Plugin
|
|||||||
|
|
||||||
int delay = this.calculateBPDelay(distance);
|
int delay = this.calculateBPDelay(distance);
|
||||||
|
|
||||||
List<Integer> counts = new ArrayList<Integer>();
|
List<Integer> counts = new ArrayList<>();
|
||||||
counts.add(delay);
|
counts.add(delay);
|
||||||
if (delay > 2)
|
if (delay > 2)
|
||||||
counts.add(delay - 1);
|
counts.add(delay - 1);
|
||||||
|
|
||||||
for (int tick : counts)
|
for (int tick : counts)
|
||||||
{
|
{
|
||||||
List<String> attackers = new ArrayList<String>();
|
List<String> attackers = new ArrayList<>();
|
||||||
if (dc.attackers.containsKey(tick))
|
if (dc.attackers.containsKey(tick))
|
||||||
attackers = dc.attackers.get(tick);
|
attackers = dc.attackers.get(tick);
|
||||||
|
|
||||||
@@ -553,7 +572,7 @@ public class CombatCounter extends Plugin
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int calculateDistance(Player p, NPC npc)
|
private int calculateDistance(Player p, NPC npc)
|
||||||
{
|
{
|
||||||
int size = 1;
|
int size = 1;
|
||||||
NPCDefinition comp = npc.getTransformedDefinition();
|
NPCDefinition comp = npc.getTransformedDefinition();
|
||||||
@@ -582,23 +601,44 @@ public class CombatCounter extends Plugin
|
|||||||
return distance;
|
return distance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int calculateBPDelay(double distance)
|
private int calculateBPDelay(double distance)
|
||||||
{
|
{
|
||||||
return 2 + (int) Math.floor(distance / 6d);
|
return 2 + (int) Math.floor(distance / 6d);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int calculateChinDelay(double distance)
|
private int calculateChinDelay(double distance)
|
||||||
{
|
{
|
||||||
return 2 + (int) Math.floor(distance / 6d);
|
return 2 + (int) Math.floor(distance / 6d);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int calculateMageDelay(double distance)
|
private int calculateMageDelay(double distance)
|
||||||
{
|
{
|
||||||
return 2 + (int) Math.floor((1d + distance) / 3d);
|
return 2 + (int) Math.floor((1d + distance) / 3d);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int calculateRangedDelay(double distance)
|
private int calculateRangedDelay(double distance)
|
||||||
{
|
{
|
||||||
return 2 + (int) Math.floor((3d + distance) / 6d);
|
return 2 + (int) Math.floor((3d + distance) / 6d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onConfigChanged(ConfigChanged event)
|
||||||
|
{
|
||||||
|
if (event.getGroup().equals("combatcounter"))
|
||||||
|
{
|
||||||
|
updateConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateConfig()
|
||||||
|
{
|
||||||
|
this.showTickCounter = config.showTickCounter();
|
||||||
|
this.showDamageCounter = config.showDamageCounter();
|
||||||
|
this.resetOnNewInstance = config.resetOnNewInstance();
|
||||||
|
this.selfColor = config.selfColor();
|
||||||
|
this.totalColor = config.totalColor();
|
||||||
|
this.otherColor = config.otherColor();
|
||||||
|
this.bgColor = config.bgColor();
|
||||||
|
this.titleColor = config.titleColor();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -26,9 +26,9 @@ package net.runelite.client.plugins.combatcounter;
|
|||||||
|
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||||
import net.runelite.api.Player;
|
import net.runelite.api.Player;
|
||||||
@@ -42,17 +42,16 @@ import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
|||||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||||
import net.runelite.client.util.ColorUtil;
|
import net.runelite.client.util.ColorUtil;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
class CombatOverlay extends Overlay
|
class CombatOverlay extends Overlay
|
||||||
{
|
{
|
||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final CombatCounter plugin;
|
private final CombatCounter plugin;
|
||||||
private final PanelComponent panelComponent = new PanelComponent();
|
private final PanelComponent panelComponent = new PanelComponent();
|
||||||
private final CombatCounterConfig config;
|
|
||||||
private HashMap<String, Long> ticks = new HashMap<>();
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public CombatOverlay(Client client, CombatCounter plugin, CombatCounterConfig config)
|
public CombatOverlay(final Client client, final CombatCounter plugin)
|
||||||
{
|
{
|
||||||
super(plugin);
|
super(plugin);
|
||||||
|
|
||||||
@@ -60,7 +59,6 @@ class CombatOverlay extends Overlay
|
|||||||
setPosition(OverlayPosition.DETACHED);
|
setPosition(OverlayPosition.DETACHED);
|
||||||
setPosition(OverlayPosition.BOTTOM_RIGHT);
|
setPosition(OverlayPosition.BOTTOM_RIGHT);
|
||||||
|
|
||||||
this.config = config;
|
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
|
||||||
@@ -70,7 +68,7 @@ class CombatOverlay extends Overlay
|
|||||||
@Override
|
@Override
|
||||||
public Dimension render(Graphics2D graphics)
|
public Dimension render(Graphics2D graphics)
|
||||||
{
|
{
|
||||||
if (config.showTickCounter())
|
if (plugin.isShowTickCounter())
|
||||||
{
|
{
|
||||||
panelComponent.getChildren().clear();
|
panelComponent.getChildren().clear();
|
||||||
|
|
||||||
@@ -79,8 +77,8 @@ class CombatOverlay extends Overlay
|
|||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
panelComponent.setBackgroundColor(config.bgColor());
|
panelComponent.setBackgroundColor(plugin.getBgColor());
|
||||||
panelComponent.getChildren().add(TitleComponent.builder().text("Tick Counter").color(config.titleColor()).build());
|
panelComponent.getChildren().add(TitleComponent.builder().text("Tick Counter").color(plugin.getTitleColor()).build());
|
||||||
int total = 0;
|
int total = 0;
|
||||||
|
|
||||||
TableComponent tableComponent = new TableComponent();
|
TableComponent tableComponent = new TableComponent();
|
||||||
@@ -102,22 +100,22 @@ class CombatOverlay extends Overlay
|
|||||||
{
|
{
|
||||||
if (client.getLocalPlayer().getName().contains(name))
|
if (client.getLocalPlayer().getName().contains(name))
|
||||||
{
|
{
|
||||||
tableComponent.addRow(ColorUtil.prependColorTag(name, config.selfColor()), ColorUtil.prependColorTag(Long.toString(map.get(name)), config.selfColor()));
|
tableComponent.addRow(ColorUtil.prependColorTag(name, plugin.getSelfColor()), ColorUtil.prependColorTag(Long.toString(map.get(name)), plugin.getSelfColor()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tableComponent.addRow(ColorUtil.prependColorTag(name, config.otherColor()), ColorUtil.prependColorTag(Long.toString(map.get(name)), config.otherColor()));
|
tableComponent.addRow(ColorUtil.prependColorTag(name, plugin.getOtherColor()), ColorUtil.prependColorTag(Long.toString(map.get(name)), plugin.getOtherColor()));
|
||||||
}
|
}
|
||||||
total += map.get(name);
|
total += map.get(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!map.containsKey(local.getName()))
|
if (!map.containsKey(local.getName()))
|
||||||
{
|
{
|
||||||
tableComponent.addRow(ColorUtil.prependColorTag(local.getName(), config.selfColor()), ColorUtil.prependColorTag("0", config.selfColor()));
|
tableComponent.addRow(ColorUtil.prependColorTag(local.getName(), plugin.getSelfColor()), ColorUtil.prependColorTag("0", plugin.getSelfColor()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tableComponent.addRow(ColorUtil.prependColorTag("Total:", config.totalColor()), ColorUtil.prependColorTag(String.valueOf(total), config.totalColor()));
|
tableComponent.addRow(ColorUtil.prependColorTag("Total:", plugin.getTotalColor()), ColorUtil.prependColorTag(String.valueOf(total), plugin.getTotalColor()));
|
||||||
|
|
||||||
if (!tableComponent.isEmpty())
|
if (!tableComponent.isEmpty())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import java.awt.Dimension;
|
|||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||||
import net.runelite.api.Player;
|
import net.runelite.api.Player;
|
||||||
@@ -41,6 +42,7 @@ import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
|||||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||||
import net.runelite.client.util.ColorUtil;
|
import net.runelite.client.util.ColorUtil;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
class DamageOverlay extends Overlay
|
class DamageOverlay extends Overlay
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -48,12 +50,10 @@ class DamageOverlay extends Overlay
|
|||||||
|
|
||||||
private final CombatCounter plugin;
|
private final CombatCounter plugin;
|
||||||
|
|
||||||
private final CombatCounterConfig config;
|
|
||||||
|
|
||||||
private final PanelComponent panelComponent = new PanelComponent();
|
private final PanelComponent panelComponent = new PanelComponent();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public DamageOverlay(Client client, CombatCounter plugin, CombatCounterConfig config)
|
public DamageOverlay(final Client client, final CombatCounter plugin)
|
||||||
{
|
{
|
||||||
super(plugin);
|
super(plugin);
|
||||||
|
|
||||||
@@ -61,7 +61,6 @@ class DamageOverlay extends Overlay
|
|||||||
setPosition(OverlayPosition.DETACHED);
|
setPosition(OverlayPosition.DETACHED);
|
||||||
setPosition(OverlayPosition.BOTTOM_RIGHT);
|
setPosition(OverlayPosition.BOTTOM_RIGHT);
|
||||||
|
|
||||||
this.config = config;
|
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
|
||||||
@@ -71,7 +70,7 @@ class DamageOverlay extends Overlay
|
|||||||
@Override
|
@Override
|
||||||
public Dimension render(Graphics2D graphics)
|
public Dimension render(Graphics2D graphics)
|
||||||
{
|
{
|
||||||
if (config.showDamageCounter())
|
if (plugin.isShowDamageCounter())
|
||||||
{
|
{
|
||||||
panelComponent.getChildren().clear();
|
panelComponent.getChildren().clear();
|
||||||
|
|
||||||
@@ -80,8 +79,8 @@ class DamageOverlay extends Overlay
|
|||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
panelComponent.setBackgroundColor(config.bgColor());
|
panelComponent.setBackgroundColor(plugin.getBgColor());
|
||||||
panelComponent.getChildren().add(TitleComponent.builder().text("Damage Counter").color(config.titleColor()).build());
|
panelComponent.getChildren().add(TitleComponent.builder().text("Damage Counter").color(plugin.getTitleColor()).build());
|
||||||
|
|
||||||
TableComponent tableComponent = new TableComponent();
|
TableComponent tableComponent = new TableComponent();
|
||||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||||
@@ -103,17 +102,17 @@ class DamageOverlay extends Overlay
|
|||||||
String val = String.format("%.1f", map.get(name));
|
String val = String.format("%.1f", map.get(name));
|
||||||
if (client.getLocalPlayer().getName().contains(name))
|
if (client.getLocalPlayer().getName().contains(name))
|
||||||
{
|
{
|
||||||
tableComponent.addRow(ColorUtil.prependColorTag(name, config.selfColor()), ColorUtil.prependColorTag(val, config.selfColor()));
|
tableComponent.addRow(ColorUtil.prependColorTag(name, plugin.getSelfColor()), ColorUtil.prependColorTag(val, plugin.getSelfColor()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tableComponent.addRow(ColorUtil.prependColorTag(name, config.otherColor()), ColorUtil.prependColorTag(val, config.otherColor()));
|
tableComponent.addRow(ColorUtil.prependColorTag(name, plugin.getOtherColor()), ColorUtil.prependColorTag(val, plugin.getOtherColor()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!map.containsKey(local.getName()))
|
if (!map.containsKey(local.getName()))
|
||||||
{
|
{
|
||||||
tableComponent.addRow(ColorUtil.prependColorTag(local.getName(), config.selfColor()), ColorUtil.prependColorTag("0", config.selfColor()));
|
tableComponent.addRow(ColorUtil.prependColorTag(local.getName(), plugin.getSelfColor()), ColorUtil.prependColorTag("0", plugin.getSelfColor()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,17 +4,19 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
public class NPCDamageCounter
|
@Singleton
|
||||||
|
class NPCDamageCounter
|
||||||
{
|
{
|
||||||
|
|
||||||
public Map<Integer, List<String>> attackers;
|
Map<Integer, List<String>> attackers;
|
||||||
|
|
||||||
public List<Integer> damage;
|
List<Integer> damage;
|
||||||
|
|
||||||
public NPCDamageCounter()
|
NPCDamageCounter()
|
||||||
{
|
{
|
||||||
this.attackers = new TreeMap<Integer, List<String>>();
|
this.attackers = new TreeMap<>();
|
||||||
this.damage = new ArrayList<Integer>();
|
this.damage = new ArrayList<>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,6 +29,7 @@ import java.awt.Dimension;
|
|||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.Experience;
|
import net.runelite.api.Experience;
|
||||||
import net.runelite.api.Skill;
|
import net.runelite.api.Skill;
|
||||||
@@ -39,19 +40,20 @@ import net.runelite.client.ui.overlay.tooltip.Tooltip;
|
|||||||
import net.runelite.client.ui.overlay.tooltip.TooltipManager;
|
import net.runelite.client.ui.overlay.tooltip.TooltipManager;
|
||||||
import net.runelite.client.util.ColorUtil;
|
import net.runelite.client.util.ColorUtil;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
class CombatLevelOverlay extends Overlay
|
class CombatLevelOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private static final Color COMBAT_LEVEL_COLOUR = new Color(0xff981f);
|
private static final Color COMBAT_LEVEL_COLOUR = new Color(0xff981f);
|
||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final CombatLevelConfig config;
|
private final CombatLevelPlugin plugin;
|
||||||
private final TooltipManager tooltipManager;
|
private final TooltipManager tooltipManager;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private CombatLevelOverlay(Client client, CombatLevelConfig config, TooltipManager tooltipManager)
|
private CombatLevelOverlay(final Client client, final CombatLevelPlugin plugin, final TooltipManager tooltipManager)
|
||||||
{
|
{
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.config = config;
|
this.plugin = plugin;
|
||||||
this.tooltipManager = tooltipManager;
|
this.tooltipManager = tooltipManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,7 +61,7 @@ class CombatLevelOverlay extends Overlay
|
|||||||
public Dimension render(Graphics2D graphics)
|
public Dimension render(Graphics2D graphics)
|
||||||
{
|
{
|
||||||
Widget combatLevelWidget = client.getWidget(WidgetInfo.COMBAT_LEVEL);
|
Widget combatLevelWidget = client.getWidget(WidgetInfo.COMBAT_LEVEL);
|
||||||
if (!config.showLevelsUntil()
|
if (!plugin.isShowLevelsUntil()
|
||||||
|| client.getLocalPlayer().getCombatLevel() == Experience.MAX_COMBAT_LEVEL
|
|| client.getLocalPlayer().getCombatLevel() == Experience.MAX_COMBAT_LEVEL
|
||||||
|| combatLevelWidget == null || combatLevelWidget.isHidden())
|
|| combatLevelWidget == null || combatLevelWidget.isHidden())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ import java.text.DecimalFormat;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.Getter;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.Experience;
|
import net.runelite.api.Experience;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
@@ -52,6 +55,7 @@ import net.runelite.client.ui.overlay.OverlayManager;
|
|||||||
description = "Show a more accurate combat level in Combat Options panel and other combat level functions",
|
description = "Show a more accurate combat level in Combat Options panel and other combat level functions",
|
||||||
tags = {"wilderness", "attack", "range"}
|
tags = {"wilderness", "attack", "range"}
|
||||||
)
|
)
|
||||||
|
@Singleton
|
||||||
public class CombatLevelPlugin extends Plugin
|
public class CombatLevelPlugin extends Plugin
|
||||||
{
|
{
|
||||||
private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("#.###");
|
private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("#.###");
|
||||||
@@ -80,6 +84,10 @@ public class CombatLevelPlugin extends Plugin
|
|||||||
@Inject
|
@Inject
|
||||||
private OverlayManager overlayManager;
|
private OverlayManager overlayManager;
|
||||||
|
|
||||||
|
@Getter(AccessLevel.PACKAGE)
|
||||||
|
private boolean showLevelsUntil;
|
||||||
|
private boolean wildernessAttackLevelRange;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
CombatLevelConfig provideConfig(ConfigManager configManager)
|
CombatLevelConfig provideConfig(ConfigManager configManager)
|
||||||
{
|
{
|
||||||
@@ -89,9 +97,11 @@ public class CombatLevelPlugin extends Plugin
|
|||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
|
updateConfig();
|
||||||
|
|
||||||
overlayManager.add(overlay);
|
overlayManager.add(overlay);
|
||||||
|
|
||||||
if (config.wildernessAttackLevelRange())
|
if (this.wildernessAttackLevelRange)
|
||||||
{
|
{
|
||||||
appendAttackLevelRangeText();
|
appendAttackLevelRangeText();
|
||||||
}
|
}
|
||||||
@@ -151,7 +161,9 @@ public class CombatLevelPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.wildernessAttackLevelRange())
|
updateConfig();
|
||||||
|
|
||||||
|
if (this.wildernessAttackLevelRange)
|
||||||
{
|
{
|
||||||
appendAttackLevelRangeText();
|
appendAttackLevelRangeText();
|
||||||
}
|
}
|
||||||
@@ -164,7 +176,7 @@ public class CombatLevelPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onScriptCallbackEvent(ScriptCallbackEvent event)
|
public void onScriptCallbackEvent(ScriptCallbackEvent event)
|
||||||
{
|
{
|
||||||
if (config.wildernessAttackLevelRange()
|
if (this.wildernessAttackLevelRange
|
||||||
&& "wildernessWidgetTextSet".equals(event.getEventName()))
|
&& "wildernessWidgetTextSet".equals(event.getEventName()))
|
||||||
{
|
{
|
||||||
appendAttackLevelRangeText();
|
appendAttackLevelRangeText();
|
||||||
@@ -241,4 +253,10 @@ public class CombatLevelPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
return Math.max(MIN_COMBAT_LEVEL, combatLevel - wildernessLevel) + "-" + Math.min(Experience.MAX_COMBAT_LEVEL, combatLevel + wildernessLevel);
|
return Math.max(MIN_COMBAT_LEVEL, combatLevel - wildernessLevel) + "-" + Math.min(Experience.MAX_COMBAT_LEVEL, combatLevel + wildernessLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateConfig()
|
||||||
|
{
|
||||||
|
this.showLevelsUntil = config.showLevelsUntil();
|
||||||
|
this.wildernessAttackLevelRange = config.showLevelsUntil();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ import java.util.Comparator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import javax.swing.BorderFactory;
|
import javax.swing.BorderFactory;
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
@@ -113,6 +114,7 @@ import net.runelite.client.util.Text;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@Singleton
|
||||||
public class ConfigPanel extends PluginPanel
|
public class ConfigPanel extends PluginPanel
|
||||||
{
|
{
|
||||||
private static final int SPINNER_FIELD_WIDTH = 6;
|
private static final int SPINNER_FIELD_WIDTH = 6;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user