aboutsummaryrefslogtreecommitdiff
path: root/default-plugin/src/main/java/me
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2022-07-06 17:36:15 +0800
committershedaniel <daniel@shedaniel.me>2022-07-06 17:36:20 +0800
commitabcaf82709f1c39c6e3059daa2ecb5c0867d24a6 (patch)
tree77e9a3d323ddf72742e7f3558129e450f45497ec /default-plugin/src/main/java/me
parent831746d10e92ce5cd9075117399009c8cd1dd181 (diff)
downloadRoughlyEnoughItems-abcaf82709f1c39c6e3059daa2ecb5c0867d24a6.tar.gz
RoughlyEnoughItems-abcaf82709f1c39c6e3059daa2ecb5c0867d24a6.tar.bz2
RoughlyEnoughItems-abcaf82709f1c39c6e3059daa2ecb5c0867d24a6.zip
Update information page design
Diffstat (limited to 'default-plugin/src/main/java/me')
-rw-r--r--default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java20
1 files changed, 14 insertions, 6 deletions
diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java
index 0f7baf641..d3e348c6d 100644
--- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java
+++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java
@@ -116,9 +116,9 @@ public class DefaultInformationCategory implements DisplayCategory<DefaultInform
@Override
public List<Widget> setupDisplay(DefaultInformationDisplay display, Rectangle bounds) {
List<Widget> widgets = Lists.newArrayList();
+ widgets.add(Widgets.createRecipeBase(bounds));
widgets.add(Widgets.createSlot(new Point(bounds.getCenterX() - 8, bounds.y + 15 - 9)).entries(display.getEntryStacks()));
- Rectangle rectangle = new Rectangle(bounds.getCenterX() - (bounds.width / 2), bounds.y + 35 - 9, bounds.width, bounds.height - 40 + 9);
- widgets.add(Widgets.createSlotBase(rectangle));
+ Rectangle rectangle = new Rectangle(bounds.getCenterX() - (bounds.width * 0.95 / 2), bounds.y + 35 - 9, bounds.width * 0.95, bounds.height - 40 + 9);
widgets.add(new ScrollableTextWidget(rectangle, display.getTexts()));
return widgets;
}
@@ -164,9 +164,9 @@ public class DefaultInformationCategory implements DisplayCategory<DefaultInform
}
@Override
- public boolean mouseScrolled(double double_1, double double_2, double double_3) {
- if (containsMouse(double_1, double_2)) {
- scrolling.offset(ClothConfigInitializer.getScrollStep() * -double_3, true);
+ public boolean mouseScrolled(double mouseX, double mouseY, double amount) {
+ if (containsMouse(mouseX, mouseY)) {
+ scrolling.offset(ClothConfigInitializer.getScrollStep() * -amount, true);
return true;
}
return false;
@@ -204,8 +204,16 @@ public class DefaultInformationCategory implements DisplayCategory<DefaultInform
currentY += text == null ? 4 : font.lineHeight;
}
}
+ if (scrolling.hasScrollBar()) {
+ if (scrolling.scrollAmount() > 8) {
+ fillGradient(matrices, innerBounds.x, innerBounds.y, innerBounds.getMaxX(), innerBounds.y + 16, 0xFFC6C6C6, 0x00C6C6C6);
+ }
+ if (scrolling.getMaxScroll() - scrolling.scrollAmount() > 8) {
+ fillGradient(matrices, innerBounds.x, innerBounds.getMaxY() - 16, innerBounds.getMaxX(), innerBounds.getMaxY(), 0x00C6C6C6, 0xFFC6C6C6);
+ }
+ }
try (CloseableScissors scissors = scissor(matrices, scrolling.getBounds())) {
- scrolling.renderScrollBar(0xff000000, 1, REIRuntime.getInstance().isDarkThemeEnabled() ? 0.8f : 1f);
+ scrolling.renderScrollBar(0, 1, 1f);
}
}