Adapt the existing creative inventory page button texture to new position ()

This commit is contained in:
Juuz 2022-12-11 15:51:51 +02:00 committed by GitHub
parent e9dee004f1
commit bdbead01ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions
fabric-item-group-api-v1/src
client/java/net/fabricmc/fabric
main/resources/assets/fabric/textures/gui

View file

@ -41,7 +41,7 @@ public class FabricCreativeGuiComponents {
final Type type;
public ItemGroupButtonWidget(int x, int y, Type type, CreativeGuiExtensions extensions) {
super(x, y, 11, 10, type.text, (bw) -> type.clickConsumer.accept(extensions), ButtonWidget.DEFAULT_NARRATION_SUPPLIER);
super(x, y, 11, 12, type.text, (bw) -> type.clickConsumer.accept(extensions), ButtonWidget.DEFAULT_NARRATION_SUPPLIER);
this.extensions = extensions;
this.type = type;
this.gui = (CreativeInventoryScreen) extensions;
@ -55,11 +55,11 @@ public class FabricCreativeGuiComponents {
if (this.visible) {
int u = active && this.isHovered() ? 22 : 0;
int v = active ? 0 : 10;
int v = active ? 0 : 12;
RenderSystem.setShaderTexture(0, BUTTON_TEX);
RenderSystem.setShaderColor(1F, 1F, 1F, 1F);
this.drawTexture(matrixStack, this.getX(), this.getY(), u + (type == Type.NEXT ? 11 : 0), v, 11, 10);
this.drawTexture(matrixStack, this.getX(), this.getY(), u + (type == Type.NEXT ? 11 : 0), v, 11, 12);
if (this.hovered) {
int pageCount = (int) Math.ceil((ItemGroups.getGroupsToDisplay().size() - COMMON_GROUPS.size()) / 9D);

View file

@ -99,7 +99,7 @@ public abstract class CreativeInventoryScreenMixin<T extends ScreenHandler> exte
fabric_updateSelection();
int xpos = x + 170;
int ypos = y + 5;
int ypos = y + 4;
addDrawableChild(new FabricCreativeGuiComponents.ItemGroupButtonWidget(xpos + 11, ypos, FabricCreativeGuiComponents.Type.NEXT, this));
addDrawableChild(new FabricCreativeGuiComponents.ItemGroupButtonWidget(xpos, ypos, FabricCreativeGuiComponents.Type.PREVIOUS, this));

Binary file not shown.

Before

(image error) Size: 552 B

After

(image error) Size: 5.4 KiB