mirror of
https://github.com/TeamMidnightDust/MidnightControls.git
synced 2025-12-14 07:35:10 +01:00
fix: button category names
This commit is contained in:
@@ -413,7 +413,7 @@ public class ButtonBinding {
|
||||
}
|
||||
|
||||
static {
|
||||
MOVEMENT_CATEGORY = InputManager.registerDefaultCategory("key.categories.movement", category -> category.registerAllBindings(
|
||||
MOVEMENT_CATEGORY = InputManager.registerDefaultCategory("movement", category -> category.registerAllBindings(
|
||||
ButtonBinding.FORWARD,
|
||||
ButtonBinding.BACK,
|
||||
ButtonBinding.LEFT,
|
||||
@@ -421,12 +421,12 @@ public class ButtonBinding {
|
||||
ButtonBinding.JUMP,
|
||||
ButtonBinding.SNEAK,
|
||||
ButtonBinding.SPRINT));
|
||||
GAMEPLAY_CATEGORY = InputManager.registerDefaultCategory("key.categories.gameplay", category -> category.registerAllBindings(
|
||||
GAMEPLAY_CATEGORY = InputManager.registerDefaultCategory("gameplay", category -> category.registerAllBindings(
|
||||
ButtonBinding.ATTACK,
|
||||
ButtonBinding.PICK_BLOCK,
|
||||
ButtonBinding.USE
|
||||
));
|
||||
INVENTORY_CATEGORY = InputManager.registerDefaultCategory("key.categories.inventory", category -> category.registerAllBindings(
|
||||
INVENTORY_CATEGORY = InputManager.registerDefaultCategory("inventory", category -> category.registerAllBindings(
|
||||
ButtonBinding.EXIT,
|
||||
ButtonBinding.DROP_ITEM,
|
||||
ButtonBinding.HOTBAR_LEFT,
|
||||
@@ -445,9 +445,9 @@ public class ButtonBinding {
|
||||
ButtonBinding.SLOT_LEFT,
|
||||
ButtonBinding.SLOT_RIGHT
|
||||
));
|
||||
MULTIPLAYER_CATEGORY = InputManager.registerDefaultCategory("key.categories.multiplayer",
|
||||
MULTIPLAYER_CATEGORY = InputManager.registerDefaultCategory("multiplayer",
|
||||
category -> category.registerAllBindings(ButtonBinding.CHAT, ButtonBinding.PLAYER_LIST));
|
||||
MISC_CATEGORY = InputManager.registerDefaultCategory("key.categories.misc", category -> category.registerAllBindings(
|
||||
MISC_CATEGORY = InputManager.registerDefaultCategory("misc", category -> category.registerAllBindings(
|
||||
ButtonBinding.SCREENSHOT,
|
||||
ButtonBinding.TOGGLE_PERSPECTIVE,
|
||||
ButtonBinding.PAUSE_GAME,
|
||||
|
||||
@@ -38,15 +38,6 @@ public class ButtonCategory {
|
||||
public ButtonCategory(@NotNull Identifier id) {
|
||||
this(id, 100);
|
||||
}
|
||||
@Deprecated
|
||||
public ButtonCategory(@NotNull org.aperlambda.lambdacommon.Identifier id, int priority) {
|
||||
this(Identifier.of(id.getNamespace(), id.getName()), priority);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public ButtonCategory(@NotNull org.aperlambda.lambdacommon.Identifier id) {
|
||||
this(id, 100);
|
||||
}
|
||||
|
||||
public void registerBinding(@NotNull ButtonBinding binding) {
|
||||
if (this.bindings.contains(binding))
|
||||
@@ -74,15 +65,12 @@ public class ButtonCategory {
|
||||
/**
|
||||
* Gets the translated name of this category.
|
||||
* <p>
|
||||
* The translation key should be `modid.identifier_name`.
|
||||
* The translation key should be `key.category.modid.identifier_name`.
|
||||
*
|
||||
* @return the translated name
|
||||
*/
|
||||
public @NotNull String getTranslatedName() {
|
||||
if (this.id.getNamespace().equals("minecraft"))
|
||||
return I18n.translate(this.id.getPath());
|
||||
else
|
||||
return I18n.translate(this.id.getNamespace() + "." + this.id.getPath());
|
||||
return I18n.translate("key.category.%s.%s".formatted(id.getNamespace(), id.getPath()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user