Skip to content

Commit

Permalink
standardize menu-settings path
Browse files Browse the repository at this point in the history
  • Loading branch information
HSGamer committed Oct 18, 2023
1 parent 4068555 commit 2415416
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/main/java/me/hsgamer/bettergui/api/menu/Menu.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
* The menu
*/
public abstract class Menu {
/**
* The path of the menu settings
*/
public static final String MENU_SETTINGS_PATH = "menu-settings";

protected final Config config;
protected final VariableManager variableManager = new VariableManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public abstract class StandardMenu extends Menu {
/**
* The path of the menu settings
*/
public static final CaseInsensitivePathString MENU_SETTINGS_PATH = new CaseInsensitivePathString(new PathString("menu-settings"));
public static final CaseInsensitivePathString MENU_SETTINGS_PATH = new CaseInsensitivePathString(new PathString(Menu.MENU_SETTINGS_PATH));
/**
* The menu settings
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void register(Function<Config, Menu> creator, String... type) {
String menu = "simple";
for (Map.Entry<PathString, Object> entry : input.getNormalizedValues(true).entrySet()) {
String[] path = entry.getKey().getPath();
if (path.length == 2 && path[0].equalsIgnoreCase("menu-settings") && path[1].equalsIgnoreCase("menu-type")) {
if (path.length == 2 && path[0].equalsIgnoreCase(Menu.MENU_SETTINGS_PATH) && path[1].equalsIgnoreCase("menu-type")) {
menu = Objects.toString(entry.getValue(), "simple");
break;
}
Expand Down

0 comments on commit 2415416

Please sign in to comment.