aboutsummaryrefslogtreecommitdiff
path: root/default-plugin/src/main/java/me/shedaniel
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2022-07-06 17:36:15 +0800
committershedaniel <daniel@shedaniel.me>2022-07-06 17:38:32 +0800
commit224e5ab8f6ca1912c2627e700439f695b3c92b32 (patch)
tree445946b551201883f5ab1802c387391964633220 /default-plugin/src/main/java/me/shedaniel
parentea4e6db37e519c140d5f5baa23111605eac99df3 (diff)
downloadRoughlyEnoughItems-224e5ab8f6ca1912c2627e700439f695b3c92b32.tar.gz
RoughlyEnoughItems-224e5ab8f6ca1912c2627e700439f695b3c92b32.tar.bz2
RoughlyEnoughItems-224e5ab8f6ca1912c2627e700439f695b3c92b32.zip
Update information page design
Diffstat (limited to 'default-plugin/src/main/java/me/shedaniel')
-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 615269b80..8d8fbf8dd 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
@@ -114,9 +114,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;
}
@@ -162,9 +162,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;
@@ -202,8 +202,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);
}
}