aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2024-04-16 01:55:46 +0900
committershedaniel <daniel@shedaniel.me>2024-04-16 01:55:46 +0900
commit3cca3e4ea7d9c0b16a713191f8a1b81f5cfeaef9 (patch)
treececdfbcab225be9da6f8ded962abe0222ea4f43a /runtime
parent9358912411e2566cd00def93930ae94da5da6df0 (diff)
downloadRoughlyEnoughItems-3cca3e4ea7d9c0b16a713191f8a1b81f5cfeaef9.tar.gz
RoughlyEnoughItems-3cca3e4ea7d9c0b16a713191f8a1b81f5cfeaef9.tar.bz2
RoughlyEnoughItems-3cca3e4ea7d9c0b16a713191f8a1b81f5cfeaef9.zip
Fix merge conflicts
Diffstat (limited to 'runtime')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/options/configure/PanelBoundariesConfiguration.java34
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/collapsible/CollapsibleEntryWidget.java4
2 files changed, 16 insertions, 22 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 9c040f00e..8e00929e0 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,16 +79,13 @@ public enum PanelBoundariesConfiguration implements OptionValueEntry.Configurato
public void init() {
super.init();
PanelBoundary boundary = access.get(option);
- addRenderableWidget(horizontalLimit = new Checkbox(0, 0, 20, 20, literal("config.rei.options.layout.boundaries.desc.limit_by_percentage"), this.horizontalUsePercentage, false) {
- @Override
- public void onPress() {
- horizontalUsePercentage = !horizontalUsePercentage;
- PanelBoundary boundary = access.get(option);
- access.set(option, new PanelBoundary(1.0, boundary.verticalPercentage(), 50, boundary.verticalLimit(), 1.0, boundary.verticalAlign()));
- if (!isReducedMotion()) innerAlphaAnimator.setTo(-1.0F, 200);
- init(minecraft, BoundariesScreen.this.width, BoundariesScreen.this.height);
- }
- });
+ addRenderableWidget(horizontalLimit = Checkbox.builder(literal("config.rei.options.layout.boundaries.desc.limit_by_percentage"), 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()));
+ if (!isReducedMotion()) innerAlphaAnimator.setTo(-1.0F, 200);
+ init(minecraft, BoundariesScreen.this.width, BoundariesScreen.this.height);
+ }).build());
double v = horizontalUsePercentage ? boundary.horizontalPercentage() : boundary.horizontalLimit() / 50.0;
addRenderableWidget(horizontalSlider = new AbstractSliderButton(0, 0, 20, 20, getSliderMessage("config.rei.options.layout.boundaries.desc.limit", horizontalUsePercentage, v, 50), v) {
@Override
@@ -144,16 +141,13 @@ public enum PanelBoundariesConfiguration implements OptionValueEntry.Configurato
if (!isReducedMotion()) innerAlphaAnimator.setTo(-1.0F, 200);
}
});
- addRenderableWidget(verticalLimit = new Checkbox(0, 0, 20, 20, literal("config.rei.options.layout.boundaries.desc.limit_by_percentage"), this.verticalUsePercentage, false) {
- @Override
- public void onPress() {
- verticalUsePercentage = !verticalUsePercentage;
- PanelBoundary boundary = access.get(option);
- access.set(option, new PanelBoundary(boundary.horizontalPercentage(), 1.0, boundary.horizontalLimit(), 1000, boundary.horizontalAlign(), 0.5));
- if (!isReducedMotion()) innerAlphaAnimator.setTo(-1.0F, 200);
- init(minecraft, BoundariesScreen.this.width, BoundariesScreen.this.height);
- }
- });
+ 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;
+ 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);
+ init(minecraft, BoundariesScreen.this.width, BoundariesScreen.this.height);
+ }).build());
v = verticalUsePercentage ? boundary.verticalPercentage() : boundary.verticalLimit() / 1000.0;
addRenderableWidget(verticalSlider = new AbstractSliderButton(0, 0, 20, 20, getSliderMessage("config.rei.options.layout.boundaries.desc.limit", verticalUsePercentage, v, 1000), v) {
@Override
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/collapsible/CollapsibleEntryWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/collapsible/CollapsibleEntryWidget.java
index fda57ba57..1eee64113 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/collapsible/CollapsibleEntryWidget.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/collapsible/CollapsibleEntryWidget.java
@@ -122,8 +122,8 @@ public class CollapsibleEntryWidget extends WidgetWithBounds {
CollapsibleEntriesScreen.setupCustom(this.id, this.component.getString(), new ArrayList<>(stacks), this.configObject, markDirty);
}, Supplier::get) {
@Override
- public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
- super.render(graphics, mouseX, mouseY, delta);
+ protected void renderWidget(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
+ super.renderWidget(graphics, mouseX, mouseY, delta);
RenderSystem.setShaderTexture(0, InternalTextures.CHEST_GUI_TEXTURE);
graphics.blit(InternalTextures.CHEST_GUI_TEXTURE, x + 3, y + 3, 0, 0, 14, 14);
}