spec counter: add config option for infoboxes
This commit is contained in:
@@ -66,6 +66,17 @@ public interface SpecialCounterConfig extends Config
|
||||
return Color.WHITE;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = 3,
|
||||
keyName = "infobox",
|
||||
name = "Infobox",
|
||||
description = "Adds an infobox counting special attacks"
|
||||
)
|
||||
default boolean infobox()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = 10,
|
||||
keyName = "dragonWarhammerThreshold",
|
||||
|
||||
@@ -293,7 +293,10 @@ public class SpecialCounterPlugin extends Plugin
|
||||
int hit = getHit(specialWeapon, hitsplat);
|
||||
int localPlayerId = client.getLocalPlayer().getId();
|
||||
|
||||
if (config.infobox())
|
||||
{
|
||||
updateCounter(specialWeapon, null, hit);
|
||||
}
|
||||
|
||||
if (!party.getMembers().isEmpty())
|
||||
{
|
||||
@@ -358,9 +361,12 @@ public class SpecialCounterPlugin extends Plugin
|
||||
|
||||
// Otherwise we only add the count if it is against a npc we are already tracking
|
||||
if (interactedNpcIds.contains(event.getNpcId()))
|
||||
{
|
||||
if (config.infobox())
|
||||
{
|
||||
updateCounter(event.getWeapon(), name, event.getHit());
|
||||
}
|
||||
}
|
||||
|
||||
if (event.getWorld() == client.getWorld())
|
||||
{
|
||||
|
||||
@@ -115,6 +115,8 @@ public class SpecialCounterPluginTest
|
||||
{
|
||||
Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
|
||||
|
||||
when(specialCounterConfig.infobox()).thenReturn(true);
|
||||
|
||||
// Set up spec weapon
|
||||
ItemContainer equipment = mock(ItemContainer.class);
|
||||
when(equipment.getItem(EquipmentInventorySlot.WEAPON.getSlotIdx())).thenReturn(new Item(ItemID.BANDOS_GODSWORD, 1));
|
||||
|
||||
Reference in New Issue
Block a user