diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-07-06 17:36:15 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2023-05-29 21:07:48 +0800 |
| commit | 8ff331a4d8a5e8fc6e900345b51e3b234fc228db (patch) | |
| tree | c88cf09a60f594242d633239484616d501d23744 /default-plugin/src/main/java/me | |
| parent | e5437b7e733aa492888e79ea21648e85c77ead02 (diff) | |
| download | RoughlyEnoughItems-8ff331a4d8a5e8fc6e900345b51e3b234fc228db.tar.gz RoughlyEnoughItems-8ff331a4d8a5e8fc6e900345b51e3b234fc228db.tar.bz2 RoughlyEnoughItems-8ff331a4d8a5e8fc6e900345b51e3b234fc228db.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.java | 20 |
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 0e56ea5b3..94a387ffc 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 @@ -115,9 +115,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; } @@ -163,9 +163,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; @@ -203,8 +203,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); } } |
