forked from Clones/Controlify
Use translations for new UI
This commit is contained in:
@ -44,7 +44,7 @@ public class ControllerCarouselScreen extends Screen {
|
||||
private Animator animator;
|
||||
|
||||
private ControllerCarouselScreen(Screen parent) {
|
||||
super(Component.literal("Controllers"));
|
||||
super(Component.translatable("controlify.gui.carousel.title"));
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ public class ControllerCarouselScreen extends Screen {
|
||||
|
||||
GridLayout grid = new GridLayout().columnSpacing(10);
|
||||
GridLayout.RowHelper rowHelper = grid.createRowHelper(2);
|
||||
rowHelper.addChild(Button.builder(Component.literal("Global Settings"), btn -> minecraft.setScreen(GlobalSettingsGui.createGlobalSettingsScreen(this))).build());
|
||||
rowHelper.addChild(Button.builder(Component.translatable("controlify.gui.global_settings.title"), btn -> minecraft.setScreen(GlobalSettingsGui.createGlobalSettingsScreen(this))).build());
|
||||
rowHelper.addChild(Button.builder(CommonComponents.GUI_DONE, btn -> this.onClose()).build());
|
||||
grid.visitWidgets(widget -> {
|
||||
widget.setTabOrderGroup(1);
|
||||
@ -124,7 +124,7 @@ public class ControllerCarouselScreen extends Screen {
|
||||
}
|
||||
|
||||
if (carouselEntries.isEmpty()) {
|
||||
graphics.drawCenteredString(font, Component.literal("No controllers connected."), this.width / 2, (this.height - 36) / 2 - 10, 0xFFAAAAAA);
|
||||
graphics.drawCenteredString(font, Component.translatable("controlify.gui.carousel.no_controllers"), this.width / 2, (this.height - 36) / 2 - 10, 0xFFAAAAAA);
|
||||
}
|
||||
|
||||
super.render(graphics, mouseX, mouseY, delta);
|
||||
@ -187,6 +187,7 @@ public class ControllerCarouselScreen extends Screen {
|
||||
|
||||
private Button useControllerButton;
|
||||
private Button settingsButton;
|
||||
private ImmutableList<? extends GuiEventListener> children;
|
||||
|
||||
private int overlayColor = 0x90000000;
|
||||
|
||||
@ -197,8 +198,9 @@ public class ControllerCarouselScreen extends Screen {
|
||||
this.controller = controller;
|
||||
this.hasNickname = this.controller.config().customName != null;
|
||||
|
||||
this.settingsButton = Button.builder(Component.literal("Settings"), btn -> minecraft.setScreen(ControllerConfigGui.generateConfigScreen(ControllerCarouselScreen.this, controller))).width(getWidth() / 2 - 4).build();
|
||||
this.useControllerButton = Button.builder(Component.literal("Use"), btn -> Controlify.instance().setCurrentController(controller)).width(settingsButton.getWidth()).build();
|
||||
this.settingsButton = Button.builder(Component.translatable("controlify.gui.carousel.entry.settings"), btn -> minecraft.setScreen(ControllerConfigGui.generateConfigScreen(ControllerCarouselScreen.this, controller))).width(getWidth() / 2 - 4).build();
|
||||
this.useControllerButton = Button.builder(Component.translatable("controlify.gui.carousel.entry.use"), btn -> Controlify.instance().setCurrentController(controller)).width(settingsButton.getWidth()).build();
|
||||
this.children = ImmutableList.of(settingsButton, useControllerButton);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -222,7 +224,7 @@ public class ControllerCarouselScreen extends Screen {
|
||||
|
||||
if (Controlify.instance().getCurrentController().orElse(null) == controller) {
|
||||
graphics.blit(CHECKMARK, x + 4, y + 4, 0f, 0f, 9, 8, 9, 8);
|
||||
graphics.drawString(font, Component.literal("Currently in use").withStyle(ChatFormatting.GREEN), x + 17, y + 4, -1);
|
||||
graphics.drawString(font, Component.translatable("controlify.gui.carousel.entry.in_use").withStyle(ChatFormatting.GREEN), x + 17, y + 4, -1);
|
||||
}
|
||||
|
||||
int iconWidth = width - 6;
|
||||
@ -266,7 +268,7 @@ public class ControllerCarouselScreen extends Screen {
|
||||
|
||||
@Override
|
||||
public List<? extends GuiEventListener> children() {
|
||||
return ImmutableList.of(useControllerButton, settingsButton);
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setX(float x) {
|
||||
|
@ -50,7 +50,7 @@ public class ControllerConfigGui {
|
||||
|
||||
private static ConfigCategory createBasicCategory(Controller<?, ?> controller, ControllerConfig def, ControllerConfig config) {
|
||||
return ConfigCategory.createBuilder()
|
||||
.name(Component.literal("Basic"))
|
||||
.name(Component.translatable("controlify.gui.config.category.basic"))
|
||||
.option(Option.<String>createBuilder()
|
||||
.name(Component.translatable("controlify.gui.custom_name"))
|
||||
.description(OptionDescription.of(Component.translatable("controlify.gui.custom_name.tooltip")))
|
||||
@ -66,7 +66,7 @@ public class ControllerConfigGui {
|
||||
|
||||
private static OptionGroup makeSensitivityGroup(Controller<?, ?> controller, ControllerConfig def, ControllerConfig config) {
|
||||
return OptionGroup.createBuilder()
|
||||
.name(Component.literal("Sensitivity"))
|
||||
.name(Component.translatable("controlify.gui.config.group.sensitivity"))
|
||||
.option(Option.<Float>createBuilder()
|
||||
.name(Component.translatable("controlify.gui.horizontal_look_sensitivity"))
|
||||
.description(OptionDescription.createBuilder()
|
||||
@ -110,7 +110,7 @@ public class ControllerConfigGui {
|
||||
Function<Boolean, Component> holdToggleFormatter = v -> Component.translatable("controlify.gui.format.hold_toggle." + (v ? "toggle" : "hold"));
|
||||
|
||||
return OptionGroup.createBuilder()
|
||||
.name(Component.literal("Controls"))
|
||||
.name(Component.translatable("controlify.gui.config.group.controls"))
|
||||
.option(Option.<Boolean>createBuilder()
|
||||
.name(Component.translatable("controlify.gui.toggle_sprint"))
|
||||
.description(OptionDescription.createBuilder()
|
||||
@ -145,7 +145,7 @@ public class ControllerConfigGui {
|
||||
|
||||
private static OptionGroup makeAccessibilityGroup(Controller<?, ?> controller, ControllerConfig def, ControllerConfig config) {
|
||||
return OptionGroup.createBuilder()
|
||||
.name(Component.literal("Accessibility"))
|
||||
.name(Component.translatable("controlify.config.group.accessibility"))
|
||||
.option(Option.<Boolean>createBuilder()
|
||||
.name(Component.translatable("controlify.gui.show_ingame_guide"))
|
||||
.description(OptionDescription.createBuilder()
|
||||
@ -178,7 +178,7 @@ public class ControllerConfigGui {
|
||||
|
||||
private static OptionGroup makeDeadzoneGroup(Controller<?, ?> controller, ControllerConfig def, ControllerConfig config) {
|
||||
var group = OptionGroup.createBuilder()
|
||||
.name(Component.literal("Deadzones"));
|
||||
.name(Component.translatable("controlify.config.group.deadzones"));
|
||||
if (controller instanceof GamepadController gamepad) {
|
||||
var gpCfg = gamepad.config();
|
||||
var gpCfgDef = gamepad.defaultConfig();
|
||||
@ -269,7 +269,7 @@ public class ControllerConfigGui {
|
||||
|
||||
private static ConfigCategory createAdvancedCategory(Controller<?, ?> controller) {
|
||||
return ConfigCategory.createBuilder()
|
||||
.name(Component.literal("Advanced"))
|
||||
.name(Component.translatable("controlify.config.category.advanced"))
|
||||
.group(makeVibrationGroup(controller))
|
||||
.group(makeGyroGroup(controller))
|
||||
.build();
|
||||
|
@ -16,9 +16,9 @@ public class GlobalSettingsGui {
|
||||
public static Screen createGlobalSettingsScreen(Screen parent) {
|
||||
var globalSettings = Controlify.instance().config().globalSettings();
|
||||
return YetAnotherConfigLib.createBuilder()
|
||||
.title(Component.literal("Controlify Global Settings"))
|
||||
.title(Component.translatable("controlify.gui.global_settings.title"))
|
||||
.category(ConfigCategory.createBuilder()
|
||||
.name(Component.literal("Global Settings"))
|
||||
.name(Component.translatable("controlify.gui.global_settings.title"))
|
||||
.option(Option.<Boolean>createBuilder()
|
||||
.name(Component.translatable("controlify.gui.load_vibration_natives"))
|
||||
.description(OptionDescription.createBuilder()
|
||||
|
@ -1,7 +1,11 @@
|
||||
{
|
||||
"controlify.gui.category.global": "Global",
|
||||
"controlify.gui.current_controller": "Current Controller",
|
||||
"controlify.gui.current_controller.tooltip": "In Controlify's infancy, only one controller can be used at a time, this selects which one you want to use.",
|
||||
"controlify.gui.carousel.title": "Controllers",
|
||||
"controlify.gui.carousel.no_controllers": "No controllers connected.",
|
||||
"controlify.gui.carousel.entry.settings": "Settings",
|
||||
"controlify.gui.carousel.entry.use": "Use",
|
||||
"controlify.gui.carousel.entry.in_use": "Currently in use",
|
||||
|
||||
"controlify.gui.global_settings.title": "Global Settings",
|
||||
"controlify.gui.load_vibration_natives": "Load Natives",
|
||||
"controlify.gui.load_vibration_natives.tooltip": "If enabled, Controlify will download and load native libraries on launch to enable support for enhanced features such as vibration and gyro. The download process only happens once and only downloads for your specific OS. Disabling this will not delete the natives, it just won't load them.",
|
||||
"controlify.gui.load_vibration_natives.tooltip.warning": "You must enable vibration support per-controller as well as this setting.",
|
||||
@ -24,37 +28,50 @@
|
||||
"controlify.gui.open_issue_tracker": "Open Issue Tracker",
|
||||
|
||||
"controlify.gui.battery_level": "Your controller battery is currently %s.",
|
||||
"controlify.gui.group.basic": "Basic",
|
||||
"controlify.gui.group.basic.tooltip": "Adjust how your controller behaves.",
|
||||
"controlify.gui.custom_name": "Display Name",
|
||||
"controlify.gui.custom_name.tooltip": "Name to display for this controller throughout Minecraft.",
|
||||
"controlify.gui.config.category.basic": "Basic",
|
||||
"controlify.gui.config.group.sensitivity": "Sensitivity",
|
||||
"controlify.gui.horizontal_look_sensitivity": "Horizontal Look Sensitivity",
|
||||
"controlify.gui.horizontal_look_sensitivity.tooltip": "How fast the camera moves horizontally when looking around.",
|
||||
"controlify.gui.vertical_look_sensitivity": "Vertical Look Sensitivity",
|
||||
"controlify.gui.vertical_look_sensitivity.tooltip": "How fast the camera moves vertically when looking around.",
|
||||
"controlify.gui.vmouse_sensitivity": "Virtual Mouse Sensitivity",
|
||||
"controlify.gui.vmouse_sensitivity.tooltip": "How fast the virtual mouse moves.",
|
||||
"controlify.gui.reduce_aiming_sensitivity": "Reduce Aiming Sensitivity",
|
||||
"controlify.gui.reduce_aiming_sensitivity.tooltip": "Reduce the sensitivity when aiming.",
|
||||
"controlify.gui.config.group.controls": "Controls",
|
||||
"controlify.gui.toggle_sneak": "Sneak",
|
||||
"controlify.gui.toggle_sneak.tooltip": "How the state of the sneak button behaves.",
|
||||
"controlify.gui.toggle_sprint": "Sprint",
|
||||
"controlify.gui.toggle_sprint.tooltip": "How the state of the sprint button behaves.",
|
||||
"controlify.gui.auto_jump": "Auto Jump",
|
||||
"controlify.gui.auto_jump.tooltip": "If the player should automatically jump when you reach a block.",
|
||||
"controlify.gui.allow_vibrations": "Allow Vibration",
|
||||
"controlify.gui.allow_vibrations.tooltip": "If the controller should vibrate when you do certain actions.",
|
||||
"controlify.gui.allow_vibrations.not_available": "You controller does not support vibration or the vibration natives are not loaded.",
|
||||
"controlify.config.group.accessibility": "Accessibility",
|
||||
"controlify.gui.show_ingame_guide": "Show Ingame Button Guide",
|
||||
"controlify.gui.show_ingame_guide.tooltip": "Show a HUD in-game displaying actions you can do with controller buttons.",
|
||||
"controlify.gui.show_screen_guide": "Show Screen Button Guide",
|
||||
"controlify.gui.show_screen_guide.tooltip": "Show various helpers in GUIs to assist in using controller input.",
|
||||
"controlify.gui.vmouse_sensitivity": "Virtual Mouse Sensitivity",
|
||||
"controlify.gui.vmouse_sensitivity.tooltip": "How fast the virtual mouse moves.",
|
||||
"controlify.gui.chat_screen_offset": "On-screen keyboard height",
|
||||
"controlify.gui.chat_screen_offset.tooltip": "How far up the system on-screen keyboard is. This shifts up the chat box so you can see the chat whilst typing.\nThis is extremely useful on the steamdeck.",
|
||||
"controlify.gui.controller_theme": "Controller Theme",
|
||||
"controlify.gui.controller_theme.tooltip": "The theme to use for rendering controller buttons.",
|
||||
"controlify.gui.reduce_aiming_sensitivity": "Reduce Aiming Sensitivity",
|
||||
"controlify.gui.reduce_aiming_sensitivity.tooltip": "Reduce the sensitivity when aiming.",
|
||||
"controlify.gui.custom_name": "Display Name",
|
||||
"controlify.gui.custom_name.tooltip": "Name to display for this controller throughout Minecraft.",
|
||||
"controlify.config.group.deadzones": "Deadzones",
|
||||
"controlify.gui.left_stick": "Left Stick",
|
||||
"controlify.gui.right_stick": "Right Stick",
|
||||
"controlify.gui.axis_deadzone": "%s Deadzone",
|
||||
"controlify.gui.axis_deadzone.tooltip": "How far '%s' axis needs to be pushed before registering input.",
|
||||
"controlify.gui.stickdrift_warning": "Warning: Setting this too low will cause stickdrift! This is where the internals of your controller become mis-calibrated and register small amounts of input when there shouldn't be.",
|
||||
"controlify.gui.auto_calibration": "Automatic Deadzone Calibration",
|
||||
"controlify.gui.auto_calibration.tooltip": "Automatically calibrate the deadzone of your controller.",
|
||||
"controlify.gui.button_activation_threshold": "Button Activation Threshold",
|
||||
"controlify.gui.button_activation_threshold.tooltip": "How far a button needs to be pushed before registering as pressed.",
|
||||
"controlify.config.category.advanced": "Advanced",
|
||||
"controlify.gui.group.vibration": "Vibration",
|
||||
"controlify.gui.group.vibration.tooltip": "Adjust how your controller vibrates.",
|
||||
"controlify.gui.allow_vibrations": "Allow Vibration",
|
||||
"controlify.gui.allow_vibrations.tooltip": "If the controller should vibrate when you do certain actions.",
|
||||
"controlify.gui.allow_vibrations.not_available": "You controller does not support vibration or the vibration natives are not loaded.",
|
||||
"controlify.gui.group.gyro": "Gyro",
|
||||
"controlify.gui.group.gyro.tooltip": "Adjust how Controlify treats your controller's built in gyroscope.\nA gyroscope determines how the controller is rotated.",
|
||||
"controlify.gui.group.gyro.no_gyro.tooltip": "This controller does not support Gyro. You must have a DualSense™ controller or other compatible controller to use this feature.",
|
||||
@ -68,15 +85,6 @@
|
||||
"controlify.gui.group.advanced.tooltip": "Settings you probably shouldn't touch!.",
|
||||
"controlify.gui.screen_repeat_navi_delay": "Screen Repeat Navigation Delay",
|
||||
"controlify.gui.screen_repeat_navi_delay.tooltip": "How fast a screen navigation action repeats.",
|
||||
"controlify.gui.left_stick": "Left Stick",
|
||||
"controlify.gui.right_stick": "Right Stick",
|
||||
"controlify.gui.axis_deadzone": "%s Deadzone",
|
||||
"controlify.gui.axis_deadzone.tooltip": "How far '%s' axis needs to be pushed before registering input.",
|
||||
"controlify.gui.stickdrift_warning": "Warning: Setting this too low will cause stickdrift! This is where the internals of your controller become mis-calibrated and register small amounts of input when there shouldn't be.",
|
||||
"controlify.gui.auto_calibration": "Automatic Deadzone Calibration",
|
||||
"controlify.gui.auto_calibration.tooltip": "Automatically calibrate the deadzone of your controller.",
|
||||
"controlify.gui.button_activation_threshold": "Button Activation Threshold",
|
||||
"controlify.gui.button_activation_threshold.tooltip": "How far a button needs to be pushed before registering as pressed.",
|
||||
"controlify.gui.test_vibration": "Test Vibration",
|
||||
"controlify.gui.test_vibration.tooltip": "Test the vibration of your controller.",
|
||||
|
||||
|
Reference in New Issue
Block a user