diff options
| author | shedaniel <daniel@shedaniel.me> | 2024-04-16 03:30:29 +0900 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2024-04-16 03:30:29 +0900 |
| commit | e29f11ef35729271299b7f23218e3c29e5e4bde3 (patch) | |
| tree | cda59fcaf8134bb7ad4b71f5ae071c4478362010 /runtime/src | |
| parent | f105040ca748544101f4fb829af8604d036447ed (diff) | |
| download | RoughlyEnoughItems-e29f11ef35729271299b7f23218e3c29e5e4bde3.tar.gz RoughlyEnoughItems-e29f11ef35729271299b7f23218e3c29e5e4bde3.tar.bz2 RoughlyEnoughItems-e29f11ef35729271299b7f23218e3c29e5e4bde3.zip | |
Fix boundaries screen
Diffstat (limited to 'runtime/src')
| -rw-r--r-- | runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/options/configure/PanelBoundariesConfiguration.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/options/configure/PanelBoundariesConfiguration.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/options/configure/PanelBoundariesConfiguration.java index 8e00929e0..38c259e8c 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/options/configure/PanelBoundariesConfiguration.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/options/configure/PanelBoundariesConfiguration.java @@ -79,7 +79,7 @@ public enum PanelBoundariesConfiguration implements OptionValueEntry.Configurato public void init() { super.init(); PanelBoundary boundary = access.get(option); - addRenderableWidget(horizontalLimit = Checkbox.builder(literal("config.rei.options.layout.boundaries.desc.limit_by_percentage"), font).pos(0, 0).selected(this.horizontalUsePercentage).onValueChange((checkbox, opt) -> { + addRenderableWidget(horizontalLimit = Checkbox.builder(Component.empty(), font).pos(0, 0).selected(this.horizontalUsePercentage).onValueChange((checkbox, opt) -> { horizontalUsePercentage = opt; PanelBoundary newBoundary = access.get(option); access.set(option, new PanelBoundary(1.0, newBoundary.verticalPercentage(), 50, newBoundary.verticalLimit(), 1.0, newBoundary.verticalAlign())); @@ -141,8 +141,8 @@ public enum PanelBoundariesConfiguration implements OptionValueEntry.Configurato if (!isReducedMotion()) innerAlphaAnimator.setTo(-1.0F, 200); } }); - addRenderableWidget(verticalLimit = Checkbox.builder(literal("config.rei.options.layout.boundaries.desc.limit_by_percentage"), font).pos(0, 0).selected(this.verticalUsePercentage).onValueChange((checkbox, opt) -> { - verticalUsePercentage = !opt; + addRenderableWidget(verticalLimit = Checkbox.builder(Component.empty(), font).pos(0, 0).selected(this.verticalUsePercentage).onValueChange((checkbox, opt) -> { + verticalUsePercentage = opt; PanelBoundary newBoundary = access.get(option); access.set(option, new PanelBoundary(newBoundary.horizontalPercentage(), 1.0, newBoundary.horizontalLimit(), 1000, newBoundary.horizontalAlign(), 0.5)); if (!isReducedMotion()) innerAlphaAnimator.setTo(-1.0F, 200); @@ -262,12 +262,18 @@ public enum PanelBoundariesConfiguration implements OptionValueEntry.Configurato } @Override + public void renderBackground(GuiGraphics graphics, int mouseX, int mouseY, float delta) { + super.renderBackground(graphics, mouseX, mouseY, delta); + Rectangle panelBounds = new Rectangle(this.width * 3 / 10, this.height * 4 / 40, this.width * 4 / 10, this.height * 32 / 40); + Widgets.createCategoryBase(panelBounds).render(graphics, mouseX, mouseY, delta); + } + + @Override public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) { this.innerAlphaAnimator.setTarget(this.innerAlphaAnimator.target() + (1.0F - this.innerAlphaAnimator.target()) * 0.06F); this.innerAlphaAnimator.update(delta); super.render(graphics, mouseX, mouseY, delta); Rectangle panelBounds = new Rectangle(this.width * 3 / 10, this.height * 4 / 40, this.width * 4 / 10, this.height * 32 / 40); - Widgets.createCategoryBase(panelBounds).render(graphics, mouseX, mouseY, delta); int y = panelBounds.y + 6; graphics.drawString(this.font, translatable("config.rei.options.layout.boundaries.desc.configure").withStyle(ChatFormatting.UNDERLINE), panelBounds.x + 6, y, 0xff404040, false); y += 14; |
