Added some missing config items

This commit is contained in:
nossr50 2019-01-11 07:31:17 -08:00
parent d141a28747
commit 1d62f8b177
4 changed files with 18 additions and 27 deletions

View File

@ -695,31 +695,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
/* Interaction Settings */ /* Interaction Settings */
public boolean doesNotificationUseActionBar(NotificationType notificationType) public boolean doesNotificationUseActionBar(NotificationType notificationType)
{ {
String key = ""; return config.getBoolean("Skills.FeedBack.ActionBarNotifications."+notificationType.toString(), true);
switch(notificationType)
{
case XP_GAIN:
key = "ExperienceGain";
break;
case LEVEL_UP_MESSAGE:
key = "LevelUp";
break;
case SUBSKILL_MESSAGE:
key = "SubSkillInteraction";
break;
case SUBSKILL_UNLOCKED:
key = "SubSkillUnlocked";
break;
case TOOL:
key = "ToolReady";
break;
case SUPER_ABILITY:
key = "SuperAbilityInteraction";
break;
}
return config.getBoolean("Skills.FeedBack.ActionBarNotifications."+key, true);
} }
/* /*

View File

@ -4,6 +4,7 @@ import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.datatypes.interactions.NotificationType; import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkill; import com.gmail.nossr50.datatypes.skills.PrimarySkill;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
import com.gmail.nossr50.datatypes.skills.subskills.interfaces.InteractType; import com.gmail.nossr50.datatypes.skills.subskills.interfaces.InteractType;
import com.gmail.nossr50.datatypes.skills.subskills.interfaces.Interaction; import com.gmail.nossr50.datatypes.skills.subskills.interfaces.Interaction;
@ -172,6 +173,16 @@ public class InteractionManager {
return subSkillList; return subSkillList;
} }
public static boolean hasSubSkill(String name)
{
return getAbstractByName(name) != null;
}
public static boolean hasSubSkill(SubSkillType subSkillType)
{
return hasSubSkill(subSkillType.getNiceNameNoSpaces(subSkillType));
}
/** /**
* Returns the associative map which contains all registered interactions * Returns the associative map which contains all registered interactions
* @return the interact register * @return the interact register

View File

@ -580,7 +580,7 @@ public class TextComponentFactory {
{ {
if(Permissions.isSubSkillEnabled(player, subSkillType)) if(Permissions.isSubSkillEnabled(player, subSkillType))
{ {
if(InteractionManager.getInteractRegister().get(subSkillType.getNiceNameNoSpaces(subSkillType)) == null) if(!InteractionManager.hasSubSkill(subSkillType))
textComponents.add(TextComponentFactory.getSubSkillTextComponent(player, subSkillType)); textComponents.add(TextComponentFactory.getSubSkillTextComponent(player, subSkillType));
} }
} }

View File

@ -17,11 +17,15 @@ Skills:
Feedback: Feedback:
# Turning these to false will have them printed in chat instead # Turning these to false will have them printed in chat instead
ActionBarNotifications: ActionBarNotifications:
AbilityOff: true
LevelRequirementNotMet: true
AbilityCoolDown: true
LevelUps: true LevelUps: true
ToolReady: true ToolReady: true
SubSkillInteraction: true SubSkillInteraction: true
SubSkillUnlocked: true SubSkillUnlocked: true
SuperAbilityInteraction: true SuperAbilityInteraction: true
SuperAbilityAlertOthers: true
ExperienceGain: true ExperienceGain: true
General: General:
Ability: Ability: