From d960950df9505e0db6b0e1b94fb4777b3341b056 Mon Sep 17 00:00:00 2001 From: axolotlmaid Date: Tue, 2 Jul 2024 01:45:08 +0100 Subject: [PATCH] Add layouts to screens Also minor changes and fixes: - Localization and colors for "All ON" and "All OFF" buttons - Code cleanup - Change Y position for entries in list widgets --- .../gui/EditProfileScreen.java | 115 +++++++++------ .../gui/OptionsToggleList.java | 139 ++++++++++++++++++ .../gui/OptionsToggleScreen.java | 65 ++++++++ .../optionsprofiles/gui/ProfilesList.java | 41 ++++-- .../optionsprofiles/gui/ProfilesScreen.java | 52 +++---- .../mixin/MixinOptionsScreen.java | 3 +- .../assets/optionsprofiles/lang/en_us.json | 9 +- .../assets/optionsprofiles/lang/ru_ru.json | 7 +- .../assets/optionsprofiles/lang/tt_ru.json | 7 +- .../assets/optionsprofiles/lang/zh_cn.json | 9 +- 10 files changed, 349 insertions(+), 98 deletions(-) create mode 100644 common/src/main/java/com/axolotlmaid/optionsprofiles/gui/OptionsToggleList.java create mode 100644 common/src/main/java/com/axolotlmaid/optionsprofiles/gui/OptionsToggleScreen.java diff --git a/common/src/main/java/com/axolotlmaid/optionsprofiles/gui/EditProfileScreen.java b/common/src/main/java/com/axolotlmaid/optionsprofiles/gui/EditProfileScreen.java index f7b8ff8..44c506e 100644 --- a/common/src/main/java/com/axolotlmaid/optionsprofiles/gui/EditProfileScreen.java +++ b/common/src/main/java/com/axolotlmaid/optionsprofiles/gui/EditProfileScreen.java @@ -1,95 +1,112 @@ package com.axolotlmaid.optionsprofiles.gui; -import com.axolotlmaid.optionsprofiles.profiles.ProfileConfiguration; import com.axolotlmaid.optionsprofiles.profiles.Profiles; import net.minecraft.ChatFormatting; -import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.Button; -import net.minecraft.client.gui.components.Checkbox; import net.minecraft.client.gui.components.EditBox; +import net.minecraft.client.gui.components.StringWidget; +import net.minecraft.client.gui.components.Tooltip; +import net.minecraft.client.gui.layouts.HeaderAndFooterLayout; +import net.minecraft.client.gui.layouts.LayoutSettings; +import net.minecraft.client.gui.layouts.LinearLayout; import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.CommonComponents; import net.minecraft.network.chat.Component; public class EditProfileScreen extends Screen { - private final Screen lastScreen; + private final ProfilesScreen profilesScreen; + private final HeaderAndFooterLayout layout = new HeaderAndFooterLayout(this, 24, 33); + private final Component profileName; - private EditBox profileNameEdit; - private Checkbox keybindingsOnlyCheckbox; - public EditProfileScreen(Screen screen, Component profileName) { + public EditProfileScreen(ProfilesScreen profilesScreen, Component profileName) { super(Component.literal(Component.translatable("gui.optionsprofiles.editing-profile-title").getString() + profileName.getString())); - this.lastScreen = screen; + this.profilesScreen = profilesScreen; this.profileName = profileName; } protected void init() { - ProfileConfiguration profileConfiguration = ProfileConfiguration.get(profileName.getString()); + LinearLayout linearLayoutHeader = this.layout.addToHeader(LinearLayout.vertical()); + linearLayoutHeader.addChild(new StringWidget(this.title, this.font), LayoutSettings::alignHorizontallyCenter); this.profileNameEdit = new EditBox(this.font, this.width / 2 - 102, 116, 204, 20, Component.empty()); this.profileNameEdit.setValue(profileName.getString()); - this.addWidget(this.profileNameEdit); - this.keybindingsOnlyCheckbox = Checkbox.builder( - Component.translatable("gui.optionsprofiles.keybindings-only"), - this.font) - .pos(5, this.height - 45) - .selected(profileConfiguration.isKeybindingsOnly()) - .build(); - this.addRenderableWidget(this.keybindingsOnlyCheckbox); + LinearLayout linearLayoutContent = this.layout.addToContents(LinearLayout.vertical().spacing(12), LayoutSettings::alignHorizontallyCenter); - this.addRenderableWidget( + LinearLayout linearLayoutEditBox = linearLayoutContent.addChild(LinearLayout.vertical().spacing(6), LayoutSettings::alignHorizontallyCenter); + linearLayoutEditBox.addChild(new StringWidget(Component.translatable("gui.optionsprofiles.profile-name-text"), this.font), LayoutSettings::alignHorizontallyCenter); + linearLayoutEditBox.addChild(this.profileNameEdit); + + LinearLayout linearLayoutButtons = linearLayoutContent.addChild(LinearLayout.vertical().spacing(1), LayoutSettings::alignHorizontallyCenter); + + linearLayoutButtons.addChild( Button.builder( Component.translatable("gui.optionsprofiles.overwrite-options"), (button) -> { Profiles.writeProfile(profileName.getString(), true); - this.minecraft.setScreen(this.lastScreen); + this.onClose(); }) - .size(100, 20) - .pos(this.width / 2 - 50, 145) - .build()); - - this.addRenderableWidget( + .size(150, 20) + .pos(this.width / 2 - 75, 145) + .tooltip(Tooltip.create(Component.translatable("gui.optionsprofiles.overwrite-options.tooltip"))) + .build(), + LayoutSettings::alignHorizontallyCenter + ); + linearLayoutButtons.addChild( Button.builder( Component.translatable("gui.optionsprofiles.rename-profile"), (button) -> { Profiles.renameProfile(profileName.getString(), this.profileNameEdit.getValue()); - this.minecraft.setScreen(new EditProfileScreen(lastScreen, Component.literal(this.profileNameEdit.getValue()))); + this.minecraft.setScreen(new EditProfileScreen(profilesScreen, Component.literal(this.profileNameEdit.getValue()))); }) - .size(100, 20) - .pos(this.width / 2 - 50, 166) - .build()); + .size(150, 20) + .pos(this.width / 2 - 75, 166) + .build(), + LayoutSettings::alignHorizontallyCenter + ); + linearLayoutButtons.addChild( + Button.builder( + Component.translatable("gui.optionsprofiles.options-toggle").append("..."), + (button) -> this.minecraft.setScreen(new OptionsToggleScreen(this, profileName))) + .size(150, 20) + .pos(this.width / 2 - 75, 187) + .tooltip(Tooltip.create(Component.translatable("gui.optionsprofiles.options-toggle.tooltip"))) + .build(), + LayoutSettings::alignHorizontallyCenter + ); - this.addRenderableWidget( + this.layout.addToFooter( + Button.builder( + CommonComponents.GUI_DONE, + (button) -> this.onClose()) + .width(200) + .build() + ); + this.layout.addToFooter( Button.builder( Component.translatable("gui.optionsprofiles.delete-profile") .withStyle(ChatFormatting.RED), (button) -> { Profiles.deleteProfile(profileName.getString()); - this.minecraft.setScreen(this.lastScreen); + this.onClose(); }) - .size(100, 20) - .pos(5, this.height - 25) - .build()); + .width(50) + .build(), + (layoutSettings) -> layoutSettings.alignHorizontallyLeft().paddingLeft(5) + ); - this.addRenderableWidget( - Button.builder( - CommonComponents.GUI_DONE, - (button) -> { - profileConfiguration.setKeybindingsOnly(keybindingsOnlyCheckbox.selected()); - profileConfiguration.save(); - this.minecraft.setScreen(this.lastScreen); - }) - .size(100, 20) - .pos(this.width / 2 - 50, this.height - 40) - .build()); + this.layout.visitWidgets(this::addRenderableWidget); + this.repositionElements(); } - public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float delta) { - super.render(guiGraphics, mouseX, mouseY, delta); - this.profileNameEdit.render(guiGraphics, mouseX, mouseY, delta); - guiGraphics.drawCenteredString(this.font, this.title, this.width / 2, 8, 16777215); - guiGraphics.drawCenteredString(this.font, Component.translatable("gui.optionsprofiles.profile-name-text"), this.width / 2, 100, 16777215); + protected void repositionElements() { + this.layout.arrangeElements(); + } + + public void onClose() { + this.minecraft.setScreen(this.profilesScreen); + this.profilesScreen.profilesList.refreshEntries(); } } \ No newline at end of file diff --git a/common/src/main/java/com/axolotlmaid/optionsprofiles/gui/OptionsToggleList.java b/common/src/main/java/com/axolotlmaid/optionsprofiles/gui/OptionsToggleList.java new file mode 100644 index 0000000..0f80ae2 --- /dev/null +++ b/common/src/main/java/com/axolotlmaid/optionsprofiles/gui/OptionsToggleList.java @@ -0,0 +1,139 @@ +package com.axolotlmaid.optionsprofiles.gui; + +import com.axolotlmaid.optionsprofiles.OptionsProfilesMod; +import com.axolotlmaid.optionsprofiles.profiles.ProfileConfiguration; +import com.axolotlmaid.optionsprofiles.profiles.Profiles; +import com.google.common.collect.ImmutableList; +import net.minecraft.ChatFormatting; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Font; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.gui.components.ContainerObjectSelectionList; +import net.minecraft.client.gui.components.CycleButton; +import net.minecraft.client.gui.components.Tooltip; +import net.minecraft.client.gui.components.events.GuiEventListener; +import net.minecraft.client.gui.narration.NarratableEntry; +import net.minecraft.network.chat.Component; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; + +public class OptionsToggleList extends ContainerObjectSelectionList { + private final String profileName; + private final ProfileConfiguration profileConfiguration; + + public OptionsToggleList(OptionsToggleScreen optionsToggleScreen, Minecraft minecraft, String profileName) { + super(minecraft, optionsToggleScreen.width, optionsToggleScreen.layout.getContentHeight(), optionsToggleScreen.layout.getHeaderHeight(), 20); + this.profileConfiguration = optionsToggleScreen.profileConfiguration; + this.profileName = profileName; + + refreshEntries(false, false); + } + + // If overriding boolean is set to true then this function will set every option in the list to overrideToggle (false or true) + public void refreshEntries(boolean overriding, boolean overrideToggle) { + this.clearEntries(); + + Path profile = Profiles.PROFILES_DIRECTORY.resolve(profileName); + Path optionsFile = profile.resolve("options.txt"); + + if (overriding) { + if (!overrideToggle) { // If set to false, just set the list to nothing instead of removing them one by one. + profileConfiguration.setOptionsToLoad(new ArrayList<>()); + } + } + + try (Stream lines = Files.lines(optionsFile)) { + lines.forEach((line) -> { + String[] option = line.split(":"); + + if (option.length > 1) { // If the option value exists (e.g. "lastServer") + if (overrideToggle) { // We don't need to check for the overriding boolean since this should never be true while the overriding boolean is false. + List optionsToLoad = profileConfiguration.getOptionsToLoad(); + optionsToLoad.add(option[0]); // Add every option because overrideToggle is set to true + + profileConfiguration.setOptionsToLoad(optionsToLoad); // Configuration is saved in the OptionsToggleScreen.java when the player presses "Done" + } + + // Add entry with option key and value and if the key is in the profile configuration + this.addEntry(new OptionEntry(option[0], option[1], profileConfiguration.getOptionsToLoad().contains(option[0]))); + } else { + this.addEntry(new OptionEntry(option[0], "", profileConfiguration.getOptionsToLoad().contains(option[0]))); + } + }); + } catch (IOException e) { + OptionsProfilesMod.LOGGER.error("An error occurred when listing options", e); + } + } + + protected int getScrollbarPosition() { + return super.getScrollbarPosition() + 15; + } + + public int getRowWidth() { + return 340; + } + + public class OptionEntry extends Entry { + private final Component optionKey; + private final CycleButton toggleButton; + + OptionEntry(String optionKey, String optionValue, boolean toggled) { + this.optionKey = Component.literal(optionKey); + + this.toggleButton = CycleButton.onOffBuilder(toggled).displayOnlyValue().create(0, 0, 44, 20, Component.empty(), (button, boolean_) -> { + List optionsToLoad = profileConfiguration.getOptionsToLoad(); + + // If toggled to true + if (boolean_) { + button.setMessage(button.getMessage().copy().withStyle(ChatFormatting.GREEN)); // Set the button's color to green + optionsToLoad.add(optionKey); + } else { + button.setMessage(button.getMessage().copy().withStyle(ChatFormatting.RED)); // Set the button's color to red + optionsToLoad.remove(optionKey); + } + + profileConfiguration.setOptionsToLoad(optionsToLoad); + }); + + // Set tooltip to the option value (e.g. "ao" will show "true") + this.toggleButton.setTooltip(Tooltip.create(Component.literal(optionValue))); + + if (toggled) { + this.toggleButton.setMessage(this.toggleButton.getMessage().copy().withStyle(ChatFormatting.GREEN)); // Set the button's color to green + } else { + this.toggleButton.setMessage(this.toggleButton.getMessage().copy().withStyle(ChatFormatting.RED)); // Set the button's color to red + } + } + + public void render(GuiGraphics guiGraphics, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) { + Font fontRenderer = OptionsToggleList.this.minecraft.font; + + int posX = OptionsToggleList.this.getScrollbarPosition() - this.toggleButton.getWidth() - 10; + int posY = y - 2; + int textY = y + entryHeight / 2; + + guiGraphics.drawString(fontRenderer, this.optionKey, x, textY - 9 / 2, 16777215, false); + + this.toggleButton.setPosition(posX, posY); + this.toggleButton.render(guiGraphics, mouseX, mouseY, tickDelta); + } + + public List children() { + return ImmutableList.of(this.toggleButton); + } + + public List narratables() { + return ImmutableList.of(this.toggleButton); + } + } + + public abstract static class Entry extends ContainerObjectSelectionList.Entry { + public Entry() { + } + } +} \ No newline at end of file diff --git a/common/src/main/java/com/axolotlmaid/optionsprofiles/gui/OptionsToggleScreen.java b/common/src/main/java/com/axolotlmaid/optionsprofiles/gui/OptionsToggleScreen.java new file mode 100644 index 0000000..364e131 --- /dev/null +++ b/common/src/main/java/com/axolotlmaid/optionsprofiles/gui/OptionsToggleScreen.java @@ -0,0 +1,65 @@ +package com.axolotlmaid.optionsprofiles.gui; + +import com.axolotlmaid.optionsprofiles.profiles.ProfileConfiguration; +import net.minecraft.ChatFormatting; +import net.minecraft.client.gui.components.Button; +import net.minecraft.client.gui.layouts.LinearLayout; +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.client.gui.screens.options.OptionsSubScreen; +import net.minecraft.network.chat.CommonComponents; +import net.minecraft.network.chat.Component; + +public class OptionsToggleScreen extends OptionsSubScreen { + private final Component profileName; + private OptionsToggleList optionsToggleList; + public ProfileConfiguration profileConfiguration; + + protected OptionsToggleScreen(Screen lastScreen, Component profileName) { + super(lastScreen, null, Component.literal(Component.translatable("gui.optionsprofiles.options-toggle").append(": ").getString() + profileName.getString())); + this.profileName = profileName; + this.profileConfiguration = ProfileConfiguration.get(profileName.getString()); + } + + protected void addOptions() {} + + protected void addContents() { + this.layout.setHeaderHeight(24); + this.optionsToggleList = this.layout.addToContents(new OptionsToggleList(this, this.minecraft, profileName.getString())); + } + + protected void addFooter() { + LinearLayout linearLayout = this.layout.addToFooter(LinearLayout.horizontal().spacing(8)); + + LinearLayout linearLayoutAllButtons = linearLayout.addChild(LinearLayout.horizontal().spacing(1)); + linearLayoutAllButtons.addChild( + Button.builder( + Component.translatable("gui.optionsprofiles.all-off").withStyle(ChatFormatting.RED), + (button) -> this.optionsToggleList.refreshEntries(true, false)) + .size(75, 20) + .build() + ); + linearLayoutAllButtons.addChild( + Button.builder( + Component.translatable("gui.optionsprofiles.all-on").withStyle(ChatFormatting.GREEN), + (button) -> this.optionsToggleList.refreshEntries(true, true)) + .size(75, 20) + .build() + ); + + linearLayout.addChild( + Button.builder( + CommonComponents.GUI_DONE, + (button -> this.onClose()) + ).build() + ); + } + + public void removed() { + profileConfiguration.save(); + } + + protected void repositionElements() { + this.layout.arrangeElements(); + this.optionsToggleList.updateSize(this.width, this.layout); + } +} diff --git a/common/src/main/java/com/axolotlmaid/optionsprofiles/gui/ProfilesList.java b/common/src/main/java/com/axolotlmaid/optionsprofiles/gui/ProfilesList.java index fedf12f..a2d809f 100644 --- a/common/src/main/java/com/axolotlmaid/optionsprofiles/gui/ProfilesList.java +++ b/common/src/main/java/com/axolotlmaid/optionsprofiles/gui/ProfilesList.java @@ -1,6 +1,7 @@ package com.axolotlmaid.optionsprofiles.gui; import com.axolotlmaid.optionsprofiles.OptionsProfilesMod; +import com.axolotlmaid.optionsprofiles.profiles.ProfileConfiguration; import com.axolotlmaid.optionsprofiles.profiles.Profiles; import com.google.common.collect.ImmutableList; import net.minecraft.client.Minecraft; @@ -15,15 +16,15 @@ import net.minecraft.network.chat.Component; import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Comparator; import java.util.List; -import java.util.Objects; public class ProfilesList extends ContainerObjectSelectionList { - final ProfilesScreen profilesScreen; + private final ProfilesScreen profilesScreen; public ProfilesList(ProfilesScreen profilesScreen, Minecraft minecraft) { - super(minecraft, profilesScreen.width + 45, profilesScreen.height - 52, 20, 20); + super(minecraft, profilesScreen.width, profilesScreen.layout.getContentHeight(), profilesScreen.layout.getHeaderHeight(), 20); this.profilesScreen = profilesScreen; refreshEntries(); @@ -32,10 +33,16 @@ public class ProfilesList extends ContainerObjectSelectionList directoryStream = Files.newDirectoryStream(profilesDirectory)) { + try (DirectoryStream directoryStream = Files.newDirectoryStream(Profiles.PROFILES_DIRECTORY)) { + List profileList = new ArrayList<>(); for (Path profile : directoryStream) { + profileList.add(profile); + } + + // Sort the list alphabetically based on the profile names + profileList.sort(Comparator.comparing(p -> p.getFileName().toString())); + + for (Path profile : profileList) { this.addEntry(new ProfilesList.ProfileEntry(Component.literal(profile.getFileName().toString()))); } } catch (Exception e) { @@ -48,7 +55,7 @@ public class ProfilesList extends ContainerObjectSelectionList { + (button -> { Profiles.createProfile(); this.profilesList.refreshEntries(); - }) - .size(150, 20) - .pos(this.width / 2 - 155, this.height - 29) - .build()); - - this.addRenderableWidget( + })) + .build() + ); + linearLayout.addChild( Button.builder( CommonComponents.GUI_DONE, - (button) -> this.minecraft.setScreen(this.lastScreen)) - .size(150, 20) - .pos(this.width / 2 + 5, this.height - 29) - .build()); + (button -> this.onClose())) + .build() + ); } - public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float delta) { - super.render(guiGraphics, mouseX, mouseY, delta); - this.profilesList.render(guiGraphics, mouseX, mouseY, delta); - guiGraphics.drawCenteredString(this.font, this.title, this.width / 2, 8, 16777215); + protected void repositionElements() { + this.layout.arrangeElements(); + this.profilesList.updateSize(this.width, this.layout); } } \ No newline at end of file diff --git a/common/src/main/java/com/axolotlmaid/optionsprofiles/mixin/MixinOptionsScreen.java b/common/src/main/java/com/axolotlmaid/optionsprofiles/mixin/MixinOptionsScreen.java index 9afa6a7..2a3135a 100644 --- a/common/src/main/java/com/axolotlmaid/optionsprofiles/mixin/MixinOptionsScreen.java +++ b/common/src/main/java/com/axolotlmaid/optionsprofiles/mixin/MixinOptionsScreen.java @@ -24,6 +24,7 @@ public class MixinOptionsScreen extends Screen { (button) -> this.minecraft.setScreen(new ProfilesScreen(this))) .width(100) .pos(5, 5) - .build()); + .build() + ); } } \ No newline at end of file diff --git a/common/src/main/resources/assets/optionsprofiles/lang/en_us.json b/common/src/main/resources/assets/optionsprofiles/lang/en_us.json index f24917f..e3b4a31 100644 --- a/common/src/main/resources/assets/optionsprofiles/lang/en_us.json +++ b/common/src/main/resources/assets/optionsprofiles/lang/en_us.json @@ -7,7 +7,12 @@ "gui.optionsprofiles.editing-profile-title": "Editing Profile: ", "gui.optionsprofiles.profile-name-text": "Profile Name", "gui.optionsprofiles.overwrite-options": "Overwrite", + "gui.optionsprofiles.overwrite-options.tooltip": "Replaces the profile's options with your current options", "gui.optionsprofiles.rename-profile": "Rename", - "gui.optionsprofiles.keybindings-only": "Keybindings Only", - "gui.optionsprofiles.delete-profile": "Delete" + "gui.optionsprofiles.delete-profile": "Delete", + + "gui.optionsprofiles.options-toggle": "Select options to toggle", + "gui.optionsprofiles.options-toggle.tooltip": "Select the options you want to load in this profile", + "gui.optionsprofiles.all-on": "All ON", + "gui.optionsprofiles.all-off": "All OFF" } \ No newline at end of file diff --git a/common/src/main/resources/assets/optionsprofiles/lang/ru_ru.json b/common/src/main/resources/assets/optionsprofiles/lang/ru_ru.json index fae0d60..d625136 100644 --- a/common/src/main/resources/assets/optionsprofiles/lang/ru_ru.json +++ b/common/src/main/resources/assets/optionsprofiles/lang/ru_ru.json @@ -7,10 +7,15 @@ "gui.optionsprofiles.editing-profile-title": "Изменение профиля: ", "gui.optionsprofiles.profile-name-text": "Имя профиля", "gui.optionsprofiles.overwrite-options": "Перезаписать", + "gui.optionsprofiles.overwrite-options.tooltip": "Заменяет параметры профиля на ваши текущие параметры", "gui.optionsprofiles.rename-profile": "Переименовать", - "gui.optionsprofiles.keybindings-only": "Только элементы управления", "gui.optionsprofiles.delete-profile": "удалить", + "gui.optionsprofiles.options-toggle": "Выберите параметры для переключения", + "gui.optionsprofiles.options-toggle.tooltip": "Выберите параметры, которые вы хотите загрузить в этот профиль", + "gui.optionsprofiles.all-on": "Включи всё", + "gui.optionsprofiles.all-off": "Все выключить", + "modmenu.summaryTranslation.options-profiles": "Cохраняйте и загружайте профили настроек, не выходя из игры.", "modmenu.descriptionTranslation.options-profiles": "Мод, позволяющий сохранять профили текущих настроек и загружать их, не выходя из игры." } \ No newline at end of file diff --git a/common/src/main/resources/assets/optionsprofiles/lang/tt_ru.json b/common/src/main/resources/assets/optionsprofiles/lang/tt_ru.json index 7c1bec2..652e987 100644 --- a/common/src/main/resources/assets/optionsprofiles/lang/tt_ru.json +++ b/common/src/main/resources/assets/optionsprofiles/lang/tt_ru.json @@ -7,10 +7,15 @@ "gui.optionsprofiles.editing-profile-title": "Профильне үзгәртү: ", "gui.optionsprofiles.profile-name-text": "Профиль исеме", "gui.optionsprofiles.overwrite-options": "перезапись", + "gui.optionsprofiles.overwrite-options.tooltip": "Профиль вариантларын хәзерге вариантларыгыз белән алыштыра", "gui.optionsprofiles.rename-profile": "переименовывать", - "gui.optionsprofiles.keybindings-only": "Контрольләр генә", "gui.optionsprofiles.delete-profile": "бетерү", + "gui.optionsprofiles.options-toggle": "Күчерү вариантларын сайлагыз", + "gui.optionsprofiles.options-toggle.tooltip": "Бу профильгә йөгерергә теләгән вариантларны сайлагыз", + "gui.optionsprofiles.all-on": "Барысын да кабызыгыз", + "gui.optionsprofiles.all-off": "Барысын да сүндерегез", + "modmenu.summaryTranslation.options-profiles": "Хәзерге көйләүләр профильләрен саклагыз һәм уеннан чыгусыз йөкләгез.", "modmenu.descriptionTranslation.options-profiles": "Хәзерге көйләүләр профильләрен сакларга һәм уеннан чыгусыз йөкләргә рөхсәт итә торган мод." } diff --git a/common/src/main/resources/assets/optionsprofiles/lang/zh_cn.json b/common/src/main/resources/assets/optionsprofiles/lang/zh_cn.json index 6387ec5..22b1010 100644 --- a/common/src/main/resources/assets/optionsprofiles/lang/zh_cn.json +++ b/common/src/main/resources/assets/optionsprofiles/lang/zh_cn.json @@ -7,7 +7,12 @@ "gui.optionsprofiles.editing-profile-title": "正在编辑:", "gui.optionsprofiles.profile-name-text": "预设名", "gui.optionsprofiles.overwrite-options": "覆盖", + "gui.optionsprofiles.overwrite-options.tooltip": "将配置文件选项替换为您当前的选项", "gui.optionsprofiles.rename-profile": "重命名", - "gui.optionsprofiles.keybindings-only": "仅按键绑定", - "gui.optionsprofiles.delete-profile": "删除" + "gui.optionsprofiles.delete-profile": "删除", + + "gui.optionsprofiles.options-toggle": "选择要切换的选项", + "gui.optionsprofiles.options-toggle.tooltip": "选择您要加载到此配置文件中的选项", + "gui.optionsprofiles.all-on": "全部开启", + "gui.optionsprofiles.all-off": "关掉一切" }