diff options
| author | shedaniel <daniel@shedaniel.me> | 2024-04-18 14:54:13 +0900 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2024-04-25 22:33:24 +0900 |
| commit | eb6ef8b13fe5842f51a0cd7fa8a646d0fb63ed72 (patch) | |
| tree | 9ad317982f789553c26d7fdea3561919c8e3d543 /runtime/src | |
| parent | 6cc0322aacd36bbf325d3e08b7fa0b76d2eb0e5a (diff) | |
| download | RoughlyEnoughItems-eb6ef8b13fe5842f51a0cd7fa8a646d0fb63ed72.tar.gz RoughlyEnoughItems-eb6ef8b13fe5842f51a0cd7fa8a646d0fb63ed72.tar.bz2 RoughlyEnoughItems-eb6ef8b13fe5842f51a0cd7fa8a646d0fb63ed72.zip | |
Add option for rainbow
Diffstat (limited to 'runtime/src')
7 files changed, 15 insertions, 3 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java index b08ad02ef..7840fa6cd 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java @@ -625,6 +625,7 @@ public class ConfigObjectImpl implements ConfigObject, ConfigData { public boolean scrollingEntryListWidget = false; @Comment("Declares whether entry panel should be invisible when not searching") public boolean hideEntryPanelIfIdle = false; + public boolean rainbow = false; public static class Layout { @Comment("Declares the position of the search field.") diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/components/ConfigOptionWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/components/ConfigOptionWidget.java index f2a47a332..668583711 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/components/ConfigOptionWidget.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/components/ConfigOptionWidget.java @@ -36,6 +36,7 @@ import me.shedaniel.rei.api.client.gui.widgets.WidgetWithBounds; import me.shedaniel.rei.api.client.gui.widgets.Widgets; import me.shedaniel.rei.api.client.util.MatrixUtils; import me.shedaniel.rei.impl.client.gui.config.ConfigAccess; +import me.shedaniel.rei.impl.client.gui.config.options.AllREIConfigOptions; import me.shedaniel.rei.impl.client.gui.config.options.CompositeOption; import me.shedaniel.rei.impl.client.gui.config.options.ConfigUtils; import me.shedaniel.rei.impl.client.gui.text.TextTransformations; @@ -48,6 +49,7 @@ import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import static me.shedaniel.rei.impl.client.gui.config.options.ConfigUtils.literal; import static me.shedaniel.rei.impl.client.gui.config.options.ConfigUtils.translatable; @@ -59,7 +61,8 @@ public class ConfigOptionWidget { int[] height = {12}; Label fieldNameLabel; widgets.add(fieldNameLabel = Widgets.createLabel(new Point(0, 0), TextTransformations.highlightText(option.getName().copy(), option.getOptionNameHighlight(), style -> style.withColor(0xFFC0C0C0))) - .leftAligned()); + .leftAligned() + .rainbow(Objects.equals(option.getId(), AllREIConfigOptions.RAINBOW.getId()))); WidgetWithBounds optionValue = ConfigOptionValueWidget.create(access, option, width - 10 - fieldNameLabel.getBounds().width); widgets.add(Widgets.withTranslate(optionValue, () -> Matrix4f.createTranslateMatrix(width - optionValue.getBounds().width - optionValue.getBounds().x, 0, 0))); widgets.add(new WidgetWithBounds() { diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/options/AllREIConfigCategories.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/options/AllREIConfigCategories.java index 9122bf1d4..40e94ae10 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/options/AllREIConfigCategories.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/options/AllREIConfigCategories.java @@ -40,7 +40,8 @@ public interface AllREIConfigCategories { OptionCategory APPEARANCE = make("appearance") .add(APPEARANCE_INTERFACE) - .add(APPEARANCE_TOOLTIPS); + .add(APPEARANCE_TOOLTIPS) + .add(APPEARANCE_ADVANCED); OptionCategory INPUT = make("input") .add(INPUT_KEYBINDS) /*.add(KEYBINDS_ADVANCED)*/; diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/options/AllREIConfigGroups.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/options/AllREIConfigGroups.java index a661862a6..28b83e639 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/options/AllREIConfigGroups.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/options/AllREIConfigGroups.java @@ -39,6 +39,8 @@ public interface AllREIConfigGroups { OptionGroup APPEARANCE_TOOLTIPS = make("appearance.tooltips") .add(APPEND_MOD_NAMES) .add(APPEND_FAVORITES_HINT); + OptionGroup APPEARANCE_ADVANCED = make("appearance.advanced") + .add(RAINBOW); OptionGroup INPUT_KEYBINDS = make("input.keybinds") .add(RECIPE_KEYBIND) .add(USAGE_KEYBIND) diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/options/AllREIConfigOptions.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/options/AllREIConfigOptions.java index 241bd41f1..30340bfba 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/options/AllREIConfigOptions.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/options/AllREIConfigOptions.java @@ -69,6 +69,8 @@ public interface AllREIConfigOptions { CompositeOption<DisplayScreenType> RECIPE_LOOKUP_STYLE = make("appearance.recipe_lookup_style", i -> i.appearance.recipeScreenType, (i, v) -> i.appearance.recipeScreenType = v) .options(DisplayScreenType.ORIGINAL, DisplayScreenType.COMPOSITE) .defaultValue(() -> DisplayScreenType.ORIGINAL); + CompositeOption<Boolean> RAINBOW = make("appearance.rainbow", i -> i.appearance.rainbow, (i, v) -> i.appearance.rainbow = v) + .enabledDisabled(); CompositeOption<Boolean> APPEND_MOD_NAMES = make("appearance.append_mod_names", i -> i.advanced.tooltips.appendModNames, (i, v) -> i.advanced.tooltips.appendModNames = v) .enabledDisabled(); CompositeOption<Boolean> APPEND_FAVORITES_HINT = make("appearance.append_favorites_hint", i -> i.advanced.tooltips.displayFavoritesTooltip, (i, v) -> i.advanced.tooltips.displayFavoritesTooltip = v) diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/PaginatedEntryListWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/PaginatedEntryListWidget.java index 9e54d023c..ee44b082f 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/PaginatedEntryListWidget.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/PaginatedEntryListWidget.java @@ -39,6 +39,7 @@ import me.shedaniel.rei.api.client.gui.widgets.Widgets; import me.shedaniel.rei.api.common.entry.EntryStack; import me.shedaniel.rei.api.common.util.CollectionUtils; import me.shedaniel.rei.impl.client.ClientHelperImpl; +import me.shedaniel.rei.impl.client.config.ConfigManagerImpl; import me.shedaniel.rei.impl.client.gui.InternalTextures; import me.shedaniel.rei.impl.client.gui.ScreenOverlayImpl; import me.shedaniel.rei.impl.client.gui.widget.BatchedEntryRendererManager; @@ -247,7 +248,7 @@ public class PaginatedEntryListWidget extends CollapsingEntryListWidget { }).tooltip(Component.translatable("text.rei.go_back_first_page"), Component.literal(" "), Component.translatable("text.rei.shift_click_to", Component.translatable("text.rei.choose_page")).withStyle(ChatFormatting.GRAY)).focusable(false).onRender((matrices, label) -> { label.setClickable(getTotalPages() > 1); label.setMessage(Component.literal(String.format("%s/%s", getPage() + 1, Math.max(getTotalPages(), 1)))); - }).rainbow(new Random().nextFloat() < 1.0E-4D || ClientHelperImpl.getInstance().isAprilFools.get())); + }).rainbow(new Random().nextFloat() < 1.0E-4D || ClientHelperImpl.getInstance().isAprilFools.get() || ConfigManagerImpl.getInstance().getConfig().appearance.rainbow)); } @Override diff --git a/runtime/src/main/resources/assets/roughlyenoughitems/lang/en_us.json b/runtime/src/main/resources/assets/roughlyenoughitems/lang/en_us.json index fa6f3dbd4..0146868cf 100755 --- a/runtime/src/main/resources/assets/roughlyenoughitems/lang/en_us.json +++ b/runtime/src/main/resources/assets/roughlyenoughitems/lang/en_us.json @@ -271,6 +271,8 @@ "config.rei.options.appearance.append_mod_names.desc": "Appends the containing namespace for entries. The appended line will be in italisised light blue.", "config.rei.options.appearance.append_favorites_hint": "Append Favorites Hint", "config.rei.options.appearance.append_favorites_hint.desc": "Shows a hint on how to favorite an entry, or a recipe.", + "config.rei.options.groups.appearance.advanced": "Advanced", + "config.rei.options.appearance.rainbow": "Rainbow o(ãīšã)o", "config.rei.options.groups.input.keybinds": "Keybinds", "config.rei.options.input.recipe": "View Recipes", "config.rei.options.input.usage": "View Usages", |
