mirror of
https://github.com/FabricMC/fabric.git
synced 2025-04-21 03:10:54 -04:00
Co-authored-by: Matthew Periut <matthewperiut@gmail.com>
This commit is contained in:
parent
cb2ae4691b
commit
def88e3a72
4 changed files with 6 additions and 6 deletions
fabric-item-group-api-v1/src
client/java/net/fabricmc/fabric
impl/client/itemgroup
mixin/itemgroup/client
main/resources
assets/fabric/textures/gui
programmer_art/assets/fabric/textures/gui
|
@ -49,7 +49,7 @@ public class FabricCreativeGuiComponents {
|
|||
final Type type;
|
||||
|
||||
public ItemGroupButtonWidget(int x, int y, Type type, CreativeInventoryScreen screen) {
|
||||
super(x, y, 11, 12, type.text, (bw) -> type.clickConsumer.accept(screen), ButtonWidget.DEFAULT_NARRATION_SUPPLIER);
|
||||
super(x, y, 10, 12, type.text, (bw) -> type.clickConsumer.accept(screen), ButtonWidget.DEFAULT_NARRATION_SUPPLIER);
|
||||
this.type = type;
|
||||
this.screen = screen;
|
||||
}
|
||||
|
@ -63,9 +63,9 @@ public class FabricCreativeGuiComponents {
|
|||
return;
|
||||
}
|
||||
|
||||
int u = active && this.isHovered() ? 22 : 0;
|
||||
int u = active && this.isHovered() ? 20 : 0;
|
||||
int v = active ? 0 : 12;
|
||||
drawContext.drawTexture(BUTTON_TEX, this.getX(), this.getY(), u + (type == Type.NEXT ? 11 : 0), v, 11, 12);
|
||||
drawContext.drawTexture(BUTTON_TEX, this.getX(), this.getY(), u + (type == Type.NEXT ? 10 : 0), v, 10, 12, 256, 256);
|
||||
|
||||
if (this.isHovered()) {
|
||||
drawContext.drawTooltip(MinecraftClient.getInstance().textRenderer, Text.translatable("fabric.gui.creativeTabPage", screen.getCurrentPage() + 1, getPageCount()), mouseX, mouseY);
|
||||
|
|
|
@ -68,15 +68,15 @@ public abstract class CreativeInventoryScreenMixin<T extends ScreenHandler> exte
|
|||
}
|
||||
}
|
||||
|
||||
@Inject(method = "init", at = @At("RETURN"))
|
||||
@Inject(method = "init", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/TextFieldWidget;setEditableColor(I)V", shift = At.Shift.AFTER))
|
||||
private void init(CallbackInfo info) {
|
||||
currentPage = getPage(selectedTab);
|
||||
|
||||
int xpos = x + 170;
|
||||
int xpos = x + 171;
|
||||
int ypos = y + 4;
|
||||
|
||||
CreativeInventoryScreen self = (CreativeInventoryScreen) (Object) this;
|
||||
addDrawableChild(new FabricCreativeGuiComponents.ItemGroupButtonWidget(xpos + 11, ypos, FabricCreativeGuiComponents.Type.NEXT, self));
|
||||
addDrawableChild(new FabricCreativeGuiComponents.ItemGroupButtonWidget(xpos + 10, ypos, FabricCreativeGuiComponents.Type.NEXT, self));
|
||||
addDrawableChild(new FabricCreativeGuiComponents.ItemGroupButtonWidget(xpos, ypos, FabricCreativeGuiComponents.Type.PREVIOUS, self));
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
Before ![]() (image error) Size: 5.4 KiB After ![]() (image error) Size: 345 B ![]() ![]() |
Binary file not shown.
After ![]() (image error) Size: 736 B |
Loading…
Add table
Add a link
Reference in a new issue