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