aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2022-06-26 04:10:01 +0800
committershedaniel <daniel@shedaniel.me>2022-06-26 04:10:01 +0800
commit8ac9c1a1accad5aee0898aa129de8c0c9620003e (patch)
treefc9d0a55d8c0f05b10244ac0552c53922d162324 /runtime
parentf4ec48ad1539bdc0ea5f54931740adf4bcb0560b (diff)
downloadRoughlyEnoughItems-8ac9c1a1accad5aee0898aa129de8c0c9620003e.tar.gz
RoughlyEnoughItems-8ac9c1a1accad5aee0898aa129de8c0c9620003e.tar.bz2
RoughlyEnoughItems-8ac9c1a1accad5aee0898aa129de8c0c9620003e.zip
Change page buttons texture
Diffstat (limited to 'runtime')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/ScreenOverlayImpl.java28
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/textures/gui/arrow_left.pngbin0 -> 117 bytes
-rw-r--r--runtime/src/main/resources/assets/roughlyenoughitems/textures/gui/arrow_right.pngbin0 -> 104 bytes
3 files changed, 25 insertions, 3 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/ScreenOverlayImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/ScreenOverlayImpl.java
index 2784fd5d1..0e3680cf1 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/ScreenOverlayImpl.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/ScreenOverlayImpl.java
@@ -79,6 +79,7 @@ import me.shedaniel.rei.impl.client.gui.widget.search.OverlaySearchField;
import me.shedaniel.rei.impl.common.util.Weather;
import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.GuiComponent;
import net.minecraft.client.gui.chat.NarratorChatListener;
import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.client.gui.screens.Screen;
@@ -108,6 +109,8 @@ import static me.shedaniel.rei.impl.client.gui.widget.entrylist.EntryListWidget.
@ApiStatus.Internal
public class ScreenOverlayImpl extends ScreenOverlay {
private static final ResourceLocation CHEST_GUI_TEXTURE = new ResourceLocation("roughlyenoughitems", "textures/gui/recipecontainer.png");
+ private static final ResourceLocation ARROW_LEFT_TEXTURE = new ResourceLocation("roughlyenoughitems", "textures/gui/arrow_left.png");
+ private static final ResourceLocation ARROW_RIGHT_TEXTURE = new ResourceLocation("roughlyenoughitems", "textures/gui/arrow_right.png");
private static final List<Tooltip> TOOLTIPS = Lists.newArrayList();
private static final List<Runnable> AFTER_RENDER = Lists.newArrayList();
private static EntryListWidget entryListWidget = null;
@@ -278,7 +281,7 @@ public class ScreenOverlayImpl extends ScreenOverlay {
this.widgets.add(REIRuntimeImpl.getSearchField());
REIRuntimeImpl.getSearchField().setResponder(s -> getEntryListWidget().updateSearch(s, false));
if (!ConfigObject.getInstance().isEntryListWidgetScrolled()) {
- widgets.add(leftButton = Widgets.createButton(new Rectangle(bounds.x, bounds.y + (ConfigObject.getInstance().getSearchFieldLocation() == SearchFieldLocation.TOP_SIDE ? 24 : 0) + 5, 16, 16), new TranslatableComponent("text.rei.left_arrow"))
+ widgets.add(leftButton = Widgets.createButton(new Rectangle(bounds.x, bounds.y + (ConfigObject.getInstance().getSearchFieldLocation() == SearchFieldLocation.TOP_SIDE ? 24 : 0) + 5, 16, 16), new TextComponent(""))
.onClick(button -> {
getEntryListWidget().previousPage();
if (getEntryListWidget().getPage() < 0)
@@ -288,8 +291,17 @@ public class ScreenOverlayImpl extends ScreenOverlay {
.containsMousePredicate((button, point) -> button.getBounds().contains(point) && isNotInExclusionZones(point.x, point.y))
.tooltipLine(new TranslatableComponent("text.rei.previous_page"))
.focusable(false));
+ widgets.add(Widgets.createDrawableWidget((helper, matrices, mouseX, mouseY, delta) -> {
+ helper.setBlitOffset(helper.getBlitOffset() + 1);
+ RenderSystem.setShaderTexture(0, ARROW_LEFT_TEXTURE);
+ Rectangle bounds = leftButton.getBounds();
+ matrices.pushPose();
+ blit(matrices, bounds.x + 4, bounds.y + 4, 0, 0, 9, 9, 9, 9);
+ matrices.popPose();
+ helper.setBlitOffset(helper.getBlitOffset() - 1);
+ }));
Button changelogButton;
- widgets.add(changelogButton = Widgets.createButton(new Rectangle(bounds.x + bounds.width - 18 - 18, bounds.y + (ConfigObject.getInstance().getSearchFieldLocation() == SearchFieldLocation.TOP_SIDE ? 24 : 0) + 5, 16, 16), new TranslatableComponent(""))
+ widgets.add(changelogButton = Widgets.createButton(new Rectangle(bounds.x + bounds.width - 18 - 18, bounds.y + (ConfigObject.getInstance().getSearchFieldLocation() == SearchFieldLocation.TOP_SIDE ? 24 : 0) + 5, 16, 16), new TextComponent(""))
.onClick(button -> {
ChangelogLoader.show();
})
@@ -306,7 +318,7 @@ public class ScreenOverlayImpl extends ScreenOverlay {
matrices.popPose();
helper.setBlitOffset(helper.getBlitOffset() - 1);
}));
- widgets.add(rightButton = Widgets.createButton(new Rectangle(bounds.x + bounds.width - 18, bounds.y + (ConfigObject.getInstance().getSearchFieldLocation() == SearchFieldLocation.TOP_SIDE ? 24 : 0) + 5, 16, 16), new TranslatableComponent("text.rei.right_arrow"))
+ widgets.add(rightButton = Widgets.createButton(new Rectangle(bounds.x + bounds.width - 18, bounds.y + (ConfigObject.getInstance().getSearchFieldLocation() == SearchFieldLocation.TOP_SIDE ? 24 : 0) + 5, 16, 16), new TextComponent(""))
.onClick(button -> {
getEntryListWidget().nextPage();
if (getEntryListWidget().getPage() >= getEntryListWidget().getTotalPages())
@@ -316,6 +328,16 @@ public class ScreenOverlayImpl extends ScreenOverlay {
.containsMousePredicate((button, point) -> button.getBounds().contains(point) && isNotInExclusionZones(point.x, point.y))
.tooltipLine(new TranslatableComponent("text.rei.next_page"))
.focusable(false));
+ widgets.add(Widgets.createDrawableWidget((helper, matrices, mouseX, mouseY, delta) -> {
+ helper.setBlitOffset(helper.getBlitOffset() + 1);
+ RenderSystem.setShaderTexture(0, ARROW_RIGHT_TEXTURE);
+ Rectangle bounds = rightButton.getBounds();
+ matrices.pushPose();
+ matrices.translate(-0.5, 0, 0);
+ blit(matrices, bounds.x + 4, bounds.y + 4, 0, 0, 9, 9, 9, 9);
+ matrices.popPose();
+ helper.setBlitOffset(helper.getBlitOffset() - 1);
+ }));
}
final Rectangle configButtonArea = getConfigButtonArea();
diff --git a/runtime/src/main/resources/assets/roughlyenoughitems/textures/gui/arrow_left.png b/runtime/src/main/resources/assets/roughlyenoughitems/textures/gui/arrow_left.png
new file mode 100644
index 000000000..912d3784f
--- /dev/null
+++ b/runtime/src/main/resources/assets/roughlyenoughitems/textures/gui/arrow_left.png
Binary files differ
diff --git a/runtime/src/main/resources/assets/roughlyenoughitems/textures/gui/arrow_right.png b/runtime/src/main/resources/assets/roughlyenoughitems/textures/gui/arrow_right.png
new file mode 100644
index 000000000..46b33d08e
--- /dev/null
+++ b/runtime/src/main/resources/assets/roughlyenoughitems/textures/gui/arrow_right.png
Binary files differ