Add startUp method for attack indicators plugin

Add startup method that will load attack style settings from config
and client (in case attack indicators is started after game loads)

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-01-15 09:43:01 +01:00
committed by Adam
parent b7d8b75647
commit 1cea7436e1

View File

@@ -91,6 +91,25 @@ public class AttackIndicatorPlugin extends Plugin
return overlay;
}
@Override
protected void startUp() throws Exception
{
if (client.getGameState() == GameState.LOGGED_IN)
{
updateWarnedSkills(config.warnForAttack(), Skill.ATTACK);
updateWarnedSkills(config.warnForStrength(), Skill.STRENGTH);
updateWarnedSkills(config.warnForDefensive(), Skill.DEFENCE);
updateWarnedSkills(config.warnForRanged(), Skill.RANGED);
updateWarnedSkills(config.warnForMagic(), Skill.MAGIC);
updateAttackStyle(
client.getSetting(Varbits.EQUIPPED_WEAPON_TYPE),
client.getSetting(Varbits.ATTACK_STYLE),
client.getSetting(Varbits.DEFENSIVE_CASTING_MODE));
updateWarning(false);
}
}
public AttackStyle getAttackStyle()
{
return attackStyle;