aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2024-04-25 22:29:22 +0900
committershedaniel <daniel@shedaniel.me>2024-04-25 22:29:22 +0900
commitd372f03dbec88fedb9e0e3cffb766c2bb3b0f8a4 (patch)
tree0109ba9dace1b1ae12fa996bb292abca5be20a3b /runtime
parent1a86c46219b873313085ba384903b1077c832c4e (diff)
downloadRoughlyEnoughItems-d372f03dbec88fedb9e0e3cffb766c2bb3b0f8a4.tar.gz
RoughlyEnoughItems-d372f03dbec88fedb9e0e3cffb766c2bb3b0f8a4.tar.bz2
RoughlyEnoughItems-d372f03dbec88fedb9e0e3cffb766c2bb3b0f8a4.zip
Update to 1.20.5
Diffstat (limited to 'runtime')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/REIConfigScreen.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/components/ConfigCategoryEntryWidget.java4
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/HoleWidget.java34
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/ScrollableViewWidget.java2
4 files changed, 37 insertions, 5 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/REIConfigScreen.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/REIConfigScreen.java
index 72881c62e..5f95d3417 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/REIConfigScreen.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/REIConfigScreen.java
@@ -138,7 +138,7 @@ public class REIConfigScreen extends Screen implements ConfigAccess {
if (this.searching) {
this.widgets.add(Widgets.createButton(new Rectangle(8, 32, sideWidth, 20), literal("↩ ").append(translatable("gui.back")))
.onClick(button -> setSearching(false)));
- this.widgets.add(HoleWidget.createBackground(new Rectangle(8 + sideWidth + 4, 32, width - 16 - sideWidth - 4, 20), () -> 0, 32));
+ this.widgets.add(HoleWidget.createMenuBackground(new Rectangle(8 + sideWidth + 4, 32, width - 16 - sideWidth - 4, 20)));
TextFieldWidget textField = new TextFieldWidget(new Rectangle(8 + sideWidth + 4 + 6, 32 + 6, width - 16 - sideWidth - 4 - 10, 12)) {
@Override
protected void renderSuggestion(GuiGraphics graphics, int x, int y) {
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/components/ConfigCategoryEntryWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/components/ConfigCategoryEntryWidget.java
index e6f7332ae..e701eac07 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/components/ConfigCategoryEntryWidget.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/components/ConfigCategoryEntryWidget.java
@@ -46,9 +46,9 @@ public class ConfigCategoryEntryWidget {
Label label = Widgets.createLabel(new Point(21, hasDescription ? 5 : 7), category.getName().copy().withStyle(style -> style.withColor(0xFFC0C0C0)))
.leftAligned();
Font font = Minecraft.getInstance().font;
- MutableComponent description = category.getDescription().copy().withStyle(style -> style.withColor(0xFF909090));
+ MutableComponent description = category.getDescription().copy().withStyle(style -> style.withColor(0xFFB0B0B0));
Widget descriptionLabel = Widgets.createDrawableWidget((graphics, mouseX, mouseY, delta) -> {
- renderTextScrolling(graphics, description, 0, 0, (int) ((width - 21 - 6) / 0.75), 0xFF909090);
+ renderTextScrolling(graphics, description, 0, 0, (int) ((width - 21 - 6) / 0.75), 0xFFB0B0B0);
});
Rectangle bounds = new Rectangle(0, 0, label.getBounds().getMaxX(), hasDescription ? 24 : 7 * 3);
return Widgets.concatWithBounds(
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/HoleWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/HoleWidget.java
index 3a8b0ed25..cf5f675ee 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/HoleWidget.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/HoleWidget.java
@@ -32,7 +32,7 @@ import me.shedaniel.math.Rectangle;
import me.shedaniel.rei.api.client.gui.widgets.Widget;
import me.shedaniel.rei.api.client.gui.widgets.Widgets;
import me.shedaniel.rei.impl.client.gui.InternalTextures;
-import net.minecraft.client.gui.screens.Screen;
+import net.minecraft.client.gui.screens.worldselection.CreateWorldScreen;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.resources.ResourceLocation;
import org.joml.Matrix4f;
@@ -41,6 +41,7 @@ import java.util.function.IntSupplier;
public class HoleWidget {
// 32 for list background, 64 for header and footer
+ @Deprecated(forRemoval = true)
public static Widget create(Rectangle bounds, IntSupplier yOffset, int colorIntensity) {
return Widgets.withBounds(
Widgets.concat(
@@ -51,6 +52,7 @@ public class HoleWidget {
);
}
+ @Deprecated(forRemoval = true)
public static Widget create(Rectangle bounds, ResourceLocation backgroundLocation, IntSupplier yOffset, int colorIntensity) {
return Widgets.withBounds(
Widgets.concat(
@@ -61,10 +63,22 @@ public class HoleWidget {
);
}
+ public static Widget create(Rectangle bounds) {
+ return Widgets.withBounds(
+ Widgets.concat(
+ createMenuBackground(bounds),
+ createListBorders(bounds)
+ ),
+ bounds
+ );
+ }
+
+ @Deprecated(forRemoval = true)
public static Widget createBackground(Rectangle bounds, IntSupplier yOffset, int colorIntensity) {
return createBackground(bounds, InternalTextures.LEGACY_DIRT, yOffset, colorIntensity);
}
+ @Deprecated(forRemoval = true)
public static Widget createBackground(Rectangle bounds, ResourceLocation backgroundLocation, IntSupplier yOffset, int colorIntensity) {
return Widgets.withBounds(Widgets.createDrawableWidget((graphics, mouseX, mouseY, delta) -> {
Tesselator tesselator = Tesselator.getInstance();
@@ -73,6 +87,15 @@ public class HoleWidget {
}), bounds);
}
+ public static Widget createMenuBackground(Rectangle bounds) {
+ return Widgets.withBounds(Widgets.createDrawableWidget((graphics, mouseX, mouseY, delta) -> {
+ RenderSystem.enableBlend();
+ graphics.blit(new ResourceLocation("textures/gui/menu_list_background.png"), bounds.x, bounds.y, bounds.getMaxX(), bounds.getMaxY(), bounds.width, bounds.height, 32, 32);
+ RenderSystem.disableBlend();
+ }), bounds);
+ }
+
+ @Deprecated(forRemoval = true)
public static Widget createInnerShadow(Rectangle bounds) {
return Widgets.withBounds(Widgets.createDrawableWidget((graphics, mouseX, mouseY, delta) -> {
Tesselator tesselator = Tesselator.getInstance();
@@ -96,4 +119,13 @@ public class HoleWidget {
RenderSystem.disableBlend();
}), bounds);
}
+
+ public static Widget createListBorders(Rectangle bounds) {
+ return Widgets.withBounds(Widgets.createDrawableWidget((graphics, mouseX, mouseY, delta) -> {
+ RenderSystem.enableBlend();
+ graphics.blit(CreateWorldScreen.HEADER_SEPARATOR, bounds.x, bounds.y - 2, 0.0F, 0.0F, bounds.width, 2, 32, 2);
+ graphics.blit(CreateWorldScreen.FOOTER_SEPARATOR, bounds.x, bounds.getMaxY(), 0.0F, 0.0F, bounds.width, 2, 32, 2);
+ RenderSystem.disableBlend();
+ }), bounds);
+ }
}
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/ScrollableViewWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/ScrollableViewWidget.java
index 126576f49..ec8147b87 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/ScrollableViewWidget.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/ScrollableViewWidget.java
@@ -58,7 +58,7 @@ public class ScrollableViewWidget {
List<Widget> widgets = new ArrayList<>();
if (background) {
- widgets.add(HoleWidget.create(bounds, scrollingRef[0]::scrollAmountInt, 32));
+ widgets.add(HoleWidget.create(bounds));
}
widgets.add(Widgets.scissored(scrollingRef[0].getScissorBounds(), Widgets.withTranslate(inner,