aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/main/java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2022-06-19 03:34:11 +0800
committershedaniel <daniel@shedaniel.me>2023-05-29 21:01:19 +0800
commit37e4fbef709ae0e8badcd3f2315c7404c9ae70d0 (patch)
treede082a6da35948b67b376956cc2043823f7543d3 /runtime/src/main/java
parent8e0d9642c04e3d42af4fa62a256fb659735864eb (diff)
downloadRoughlyEnoughItems-37e4fbef709ae0e8badcd3f2315c7404c9ae70d0.tar.gz
RoughlyEnoughItems-37e4fbef709ae0e8badcd3f2315c7404c9ae70d0.tar.bz2
RoughlyEnoughItems-37e4fbef709ae0e8badcd3f2315c7404c9ae70d0.zip
Make scale indicator show on top
Diffstat (limited to 'runtime/src/main/java')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/EntryListWidget.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/EntryListWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/EntryListWidget.java
index 92ea3b49a..b0cef4aef 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/EntryListWidget.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/EntryListWidget.java
@@ -235,12 +235,15 @@ public abstract class EntryListWidget extends WidgetWithBounds implements Overla
scaleIndicator.update(delta);
if (scaleIndicator.value() > 0.04) {
+ matrices.pushPose();
+ matrices.translate(0, 0, 500);
TextComponent component = new TextComponent(Math.round(ConfigObject.getInstance().getEntrySize() * 100) + "%");
int width = font.width(component);
int backgroundColor = ((int) Math.round(0xa0 * Mth.clamp(scaleIndicator.value(), 0.0, 1.0))) << 24;
int textColor = ((int) Math.round(0xdd * Mth.clamp(scaleIndicator.value(), 0.0, 1.0))) << 24;
fillGradient(matrices, bounds.getCenterX() - width / 2 - 2, bounds.getCenterY() - 6, bounds.getCenterX() + width / 2 + 2, bounds.getCenterY() + 6, backgroundColor, backgroundColor);
font.draw(matrices, component, bounds.getCenterX() - width / 2, bounds.getCenterY() - 4, 0xFFFFFF | textColor);
+ matrices.popPose();
}
}