Skip to content

Commit

Permalink
Customizable Language Selection Panel (#2254)
Browse files Browse the repository at this point in the history
* Customizable Language Selection Panel

This implements customizable Language Selection Panel. By default, panel is generated in `/plugins/bentobox/panels` folder, however, if GameModeAddon has a specific panel defined in their folder, then that panel is taken.

* Migrate LanguagePanelTest to customizable panel.

* Remove original LanguagePanel

* Save language_panel.yml on server starting.

* Fixes some bugs in LanguagePanel.
  • Loading branch information
BONNe authored Jan 4, 2024
1 parent e8e1d61 commit 3be034b
Show file tree
Hide file tree
Showing 8 changed files with 763 additions and 113 deletions.
4 changes: 4 additions & 0 deletions src/main/java/world/bentobox/bentobox/BentoBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,10 @@ public boolean loadSettings() {
getPluginLoader().disablePlugin(this);
return false;
}

log("Saving default panels...");
this.saveResource("panels/language_panel.yml", false);

return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.panels.LanguagePanel;
import world.bentobox.bentobox.panels.customizable.LanguagePanel;
import world.bentobox.bentobox.util.Util;

/**
Expand Down Expand Up @@ -46,7 +46,7 @@ public boolean execute(User user, String label, List<String> args) {
return false;
}
} else {
LanguagePanel.openPanel(user);
LanguagePanel.openPanel(this, user);
}
return true;
}
Expand Down
68 changes: 0 additions & 68 deletions src/main/java/world/bentobox/bentobox/panels/LanguagePanel.java

This file was deleted.

Loading

0 comments on commit 3be034b

Please sign in to comment.