attack indicator plugin: process hidden styles on startup/shutdown and config changes

This commit is contained in:
Adam
2018-02-26 18:28:08 -05:00
parent e7a09d00dd
commit ec9dbf47b3

View File

@@ -103,9 +103,17 @@ public class AttackIndicatorPlugin extends Plugin
client.getSetting(Setting.ATTACK_STYLE),
client.getSetting(Varbits.DEFENSIVE_CASTING_MODE));
updateWarning(false);
processWidgets();
}
}
@Override
protected void shutDown()
{
hideWarnedStyles(false);
processWidgets();
}
public AttackStyle getAttackStyle()
{
return attackStyle;
@@ -129,6 +137,14 @@ public class AttackIndicatorPlugin extends Plugin
return;
}
processWidgets();
}
/**
* Hide or unhide widgets depending on widgetsToHide
*/
private void processWidgets()
{
WeaponType equippedWeaponType = WeaponType.getWeaponType(equippedWeaponTypeVarbit);
if (widgetsToHide.containsRow(equippedWeaponType))
@@ -214,6 +230,7 @@ public class AttackIndicatorPlugin extends Plugin
break;
case "removeWarnedStyles":
hideWarnedStyles(enabled);
processWidgets();
break;
}
}
@@ -240,7 +257,6 @@ public class AttackIndicatorPlugin extends Plugin
{
if (enabled)
{
warnedSkills.remove(skill);
warnedSkills.add(skill);
}
else