boosts: add config to not display combat boosts

This commit is contained in:
chestnut1693
2019-08-29 00:30:24 +02:00
committed by Adam
parent a93cb5f471
commit 596100fbeb
2 changed files with 30 additions and 13 deletions

View File

@@ -38,15 +38,23 @@ public interface BoostsConfig extends Config
NEVER NEVER
} }
enum DisplayBoosts
{
NONE,
COMBAT,
NON_COMBAT,
BOTH
}
@ConfigItem( @ConfigItem(
keyName = "enableSkill", keyName = "displayBoosts",
name = "Enable Skill Boosts", name = "Display Boosts",
description = "Configures whether or not to display skill boost information", description = "Configures which skill boosts to display",
position = 1 position = 1
) )
default boolean enableSkill() default DisplayBoosts displayBoosts()
{ {
return true; return DisplayBoosts.BOTH;
} }
@ConfigItem( @ConfigItem(

View File

@@ -263,16 +263,25 @@ public class BoostsPlugin extends Plugin
private void updateShownSkills() private void updateShownSkills()
{ {
if (config.enableSkill()) switch (config.displayBoosts())
{ {
shownSkills.addAll(BOOSTABLE_NON_COMBAT_SKILLS); case NONE:
shownSkills.removeAll(BOOSTABLE_COMBAT_SKILLS);
shownSkills.removeAll(BOOSTABLE_NON_COMBAT_SKILLS);
break;
case COMBAT:
shownSkills.addAll(BOOSTABLE_COMBAT_SKILLS);
shownSkills.removeAll(BOOSTABLE_NON_COMBAT_SKILLS);
break;
case NON_COMBAT:
shownSkills.removeAll(BOOSTABLE_COMBAT_SKILLS);
shownSkills.addAll(BOOSTABLE_NON_COMBAT_SKILLS);
break;
case BOTH:
shownSkills.addAll(BOOSTABLE_COMBAT_SKILLS);
shownSkills.addAll(BOOSTABLE_NON_COMBAT_SKILLS);
break;
} }
else
{
shownSkills.removeAll(BOOSTABLE_NON_COMBAT_SKILLS);
}
shownSkills.addAll(BOOSTABLE_COMBAT_SKILLS);
} }
private void updateBoostedStats() private void updateBoostedStats()