From f4a890749e07123b5b7db8200b53c943a93ede01 Mon Sep 17 00:00:00 2001 From: isXander Date: Thu, 19 Jan 2023 22:06:13 +0000 Subject: 22w03a - now with better navigation! --- .../java/dev/isxander/yacl/gui/CategoryWidget.java | 11 ++++-- .../java/dev/isxander/yacl/gui/YACLScreen.java | 2 -- .../yacl/gui/controllers/ControllerWidget.java | 22 +++++++++--- .../yacl/gui/controllers/LabelController.java | 42 ++++++++++++++++++++++ .../cycling/CyclingControllerElement.java | 4 +-- .../slider/SliderControllerElement.java | 4 +-- .../string/StringControllerElement.java | 5 +-- 7 files changed, 75 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/client/java/dev/isxander/yacl/gui/CategoryWidget.java b/src/client/java/dev/isxander/yacl/gui/CategoryWidget.java index f47a09b..60817a2 100644 --- a/src/client/java/dev/isxander/yacl/gui/CategoryWidget.java +++ b/src/client/java/dev/isxander/yacl/gui/CategoryWidget.java @@ -19,8 +19,15 @@ public class CategoryWidget extends TooltipButtonWidget { } @Override - protected int getYImage(boolean hovered) { - return super.getYImage(hovered || isCurrentCategory()); + protected int getTextureY() { + int i = 1; + if (!this.active) { + i = 0; + } else if (this.isHoveredOrFocused() || isCurrentCategory()) { + i = 2; + } + + return 46 + i * 20; } @Override diff --git a/src/client/java/dev/isxander/yacl/gui/YACLScreen.java b/src/client/java/dev/isxander/yacl/gui/YACLScreen.java index ee5c7dd..3b14544 100644 --- a/src/client/java/dev/isxander/yacl/gui/YACLScreen.java +++ b/src/client/java/dev/isxander/yacl/gui/YACLScreen.java @@ -302,12 +302,10 @@ public class YACLScreen extends Screen { 400 ); RenderSystem.enableDepthTest(); - RenderSystem.disableTexture(); RenderSystem.enableBlend(); RenderSystem.defaultBlendFunc(); BufferUploader.drawWithShader(bufferBuilder.end()); RenderSystem.disableBlend(); - RenderSystem.enableTexture(); matrices.translate(0.0, 0.0, 400.0); text.renderLeftAligned(matrices, drawX, drawY, lineHeight, -1); diff --git a/src/client/java/dev/isxander/yacl/gui/controllers/ControllerWidget.java b/src/client/java/dev/isxander/yacl/gui/controllers/ControllerWidget.java index 90c0e20..22c469d 100644 --- a/src/client/java/dev/isxander/yacl/gui/controllers/ControllerWidget.java +++ b/src/client/java/dev/isxander/yacl/gui/controllers/ControllerWidget.java @@ -7,11 +7,14 @@ import dev.isxander.yacl.gui.AbstractWidget; import dev.isxander.yacl.gui.YACLScreen; import dev.isxander.yacl.gui.utils.GuiUtils; import net.minecraft.ChatFormatting; +import net.minecraft.client.gui.ComponentPath; import net.minecraft.client.gui.GuiComponent; import net.minecraft.client.gui.components.MultiLineLabel; import net.minecraft.client.gui.narration.NarratedElementType; import net.minecraft.client.gui.narration.NarrationElementOutput; +import net.minecraft.client.gui.navigation.FocusNavigationEvent; import net.minecraft.network.chat.Component; +import org.jetbrains.annotations.Nullable; public abstract class ControllerWidget> extends AbstractWidget { protected final T control; @@ -126,13 +129,22 @@ public abstract class ControllerWidget> extends Abstract return getDimension().y() + getDimension().height() / 2f - textRenderer.lineHeight / 2f; } + @Nullable @Override - public boolean changeFocus(boolean lookForwards) { - if (!isAvailable()) - return false; + public ComponentPath nextFocusPath(FocusNavigationEvent focusNavigationEvent) { + if (!this.isAvailable()) + return null; + return !this.isFocused() ? ComponentPath.leaf(this) : null; + } - this.focused = !this.focused; - return this.focused; + @Override + public boolean isFocused() { + return focused; + } + + @Override + public void setFocused(boolean focused) { + this.focused = focused; } @Override diff --git a/src/client/java/dev/isxander/yacl/gui/controllers/LabelController.java b/src/client/java/dev/isxander/yacl/gui/controllers/LabelController.java index 0017b59..dd0048d 100644 --- a/src/client/java/dev/isxander/yacl/gui/controllers/LabelController.java +++ b/src/client/java/dev/isxander/yacl/gui/controllers/LabelController.java @@ -6,12 +6,18 @@ import dev.isxander.yacl.api.Option; import dev.isxander.yacl.api.utils.Dimension; import dev.isxander.yacl.gui.AbstractWidget; import dev.isxander.yacl.gui.YACLScreen; +import net.minecraft.client.gui.ComponentPath; +import net.minecraft.client.gui.GuiComponent; import net.minecraft.client.gui.components.MultiLineLabel; +import net.minecraft.client.gui.narration.NarratedElementType; +import net.minecraft.client.gui.narration.NarrationElementOutput; +import net.minecraft.client.gui.navigation.FocusNavigationEvent; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.HoverEvent; import net.minecraft.network.chat.Style; import net.minecraft.util.FormattedCharSequence; import net.minecraft.world.item.ItemStack; +import org.jetbrains.annotations.Nullable; import java.util.List; @@ -50,6 +56,7 @@ public class LabelController implements Controller { public class LabelControllerElement extends AbstractWidget { private List wrappedText; protected MultiLineLabel wrappedTooltip; + protected boolean focused; protected final YACLScreen screen; @@ -70,6 +77,13 @@ public class LabelController implements Controller { textRenderer.drawShadow(matrices, text, getDimension().x() + getXPadding(), y + getYPadding(), option().available() ? -1 : 0xFFA0A0A0); y += textRenderer.lineHeight; } + + if (isFocused()) { + GuiComponent.fill(matrices, getDimension().x() - 2, getDimension().y() - 2, getDimension().xLimit() + 2, getDimension().y(), -1); + GuiComponent.fill(matrices, getDimension().x() - 2, getDimension().y() - 2, getDimension().x(), getDimension().yLimit() + 2, -1); + GuiComponent.fill(matrices, getDimension().x() - 2, getDimension().yLimit(), getDimension().xLimit() + 2, getDimension().yLimit() + 2, -1); + GuiComponent.fill(matrices, getDimension().xLimit(), getDimension().y() - 2, getDimension().xLimit() + 2, getDimension().yLimit() + 2, -1); + } } @Override @@ -147,5 +161,33 @@ public class LabelController implements Controller { public boolean matchesSearch(String query) { return formatValue().getString().toLowerCase().contains(query.toLowerCase()); } + + @Nullable + @Override + public ComponentPath nextFocusPath(FocusNavigationEvent focusNavigationEvent) { + if (!option().available()) + return null; + return !this.isFocused() ? ComponentPath.leaf(this) : null; + } + + @Override + public boolean isFocused() { + return focused; + } + + @Override + public void setFocused(boolean focused) { + this.focused = focused; + } + + @Override + public void updateNarration(NarrationElementOutput builder) { + builder.add(NarratedElementType.TITLE, formatValue()); + } + + @Override + public NarrationPriority narrationPriority() { + return NarrationPriority.FOCUSED; + } } } diff --git a/src/client/java/dev/isxander/yacl/gui/controllers/cycling/CyclingControllerElement.java b/src/client/java/dev/isxander/yacl/gui/controllers/cycling/CyclingControllerElement.java index b2fa776..ff20039 100644 --- a/src/client/java/dev/isxander/yacl/gui/controllers/cycling/CyclingControllerElement.java +++ b/src/client/java/dev/isxander/yacl/gui/controllers/cycling/CyclingControllerElement.java @@ -39,9 +39,9 @@ public class CyclingControllerElement extends ControllerWidget + case InputConstants.KEY_LEFT -> cycleValue(-1); - case InputConstants.KEY_RIGHT, InputConstants.KEY_UP -> + case InputConstants.KEY_RIGHT -> cycleValue(1); case InputConstants.KEY_RETURN, InputConstants.KEY_SPACE, InputConstants.KEY_NUMPADENTER -> cycleValue(Screen.hasControlDown() || Screen.hasShiftDown() ? -1 : 1); diff --git a/src/client/java/dev/isxander/yacl/gui/controllers/slider/SliderControllerElement.java b/src/client/java/dev/isxander/yacl/gui/controllers/slider/SliderControllerElement.java index ddfdd4d..2d6f1ea 100644 --- a/src/client/java/dev/isxander/yacl/gui/controllers/slider/SliderControllerElement.java +++ b/src/client/java/dev/isxander/yacl/gui/controllers/slider/SliderControllerElement.java @@ -104,8 +104,8 @@ public class SliderControllerElement extends ControllerWidget incrementValue(-1); - case InputConstants.KEY_RIGHT, InputConstants.KEY_UP -> incrementValue(1); + case InputConstants.KEY_LEFT -> incrementValue(-1); + case InputConstants.KEY_RIGHT -> incrementValue(1); default -> { return false; } diff --git a/src/client/java/dev/isxander/yacl/gui/controllers/string/StringControllerElement.java b/src/client/java/dev/isxander/yacl/gui/controllers/string/StringControllerElement.java index 2723089..ce9d252 100644 --- a/src/client/java/dev/isxander/yacl/gui/controllers/string/StringControllerElement.java +++ b/src/client/java/dev/isxander/yacl/gui/controllers/string/StringControllerElement.java @@ -355,8 +355,9 @@ public class StringControllerElement extends ControllerWidget Date: Sun, 29 Jan 2023 22:00:13 +0000 Subject: 22w04a --- build.gradle.kts | 6 +++--- gradle.properties | 4 ++-- .../java/dev/isxander/yacl/gui/controllers/LabelController.java | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/build.gradle.kts b/build.gradle.kts index 616e452..8517bd4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,10 +1,10 @@ plugins { java - id("fabric-loom") version "[1.0.16, 1.1.0)" // 1.0.+ but patch must be 16 or higher + id("fabric-loom") version "1.1.+" // 1.0.+ but patch must be 16 or higher id("io.github.juuxel.loom-quiltflower") version "1.8.+" - id("com.modrinth.minotaur") version "2.5.+" + id("com.modrinth.minotaur") version "2.6.+" id("me.hypherionmc.cursegradle") version "2.+" id("com.github.breadmoirai.github-release") version "2.+" `maven-publish` @@ -75,7 +75,7 @@ dependencies { }) modImplementation("net.fabricmc:fabric-loader:$fabricLoaderVersion") - "modClientImplementation"(fabricApi.module("fabric-resource-loader-v0", "0.72.1+1.19.4")) + "modClientImplementation"(fabricApi.module("fabric-resource-loader-v0", "0.73.1+1.19.4")) "testmodImplementation"(sourceSets.main.get().output) "testmodImplementation"(sourceSets["client"].output) diff --git a/gradle.properties b/gradle.properties index 439a116..358c97d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,8 @@ org.gradle.jvmargs=-Xmx3G -minecraftVersion=23w03a +minecraftVersion=23w04a fabricLoaderVersion=0.14.13 -qmBuild=3 +qmBuild=5 modId=yet-another-config-lib modName=YetAnotherConfigLib diff --git a/src/client/java/dev/isxander/yacl/gui/controllers/LabelController.java b/src/client/java/dev/isxander/yacl/gui/controllers/LabelController.java index dd0048d..1dfae0b 100644 --- a/src/client/java/dev/isxander/yacl/gui/controllers/LabelController.java +++ b/src/client/java/dev/isxander/yacl/gui/controllers/LabelController.java @@ -79,10 +79,10 @@ public class LabelController implements Controller { } if (isFocused()) { - GuiComponent.fill(matrices, getDimension().x() - 2, getDimension().y() - 2, getDimension().xLimit() + 2, getDimension().y(), -1); - GuiComponent.fill(matrices, getDimension().x() - 2, getDimension().y() - 2, getDimension().x(), getDimension().yLimit() + 2, -1); - GuiComponent.fill(matrices, getDimension().x() - 2, getDimension().yLimit(), getDimension().xLimit() + 2, getDimension().yLimit() + 2, -1); - GuiComponent.fill(matrices, getDimension().xLimit(), getDimension().y() - 2, getDimension().xLimit() + 2, getDimension().yLimit() + 2, -1); + GuiComponent.fill(matrices, getDimension().x() - 1, getDimension().y() - 1, getDimension().xLimit() + 1, getDimension().y(), -1); + GuiComponent.fill(matrices, getDimension().x() - 1, getDimension().y() - 1, getDimension().x(), getDimension().yLimit() + 1, -1); + GuiComponent.fill(matrices, getDimension().x() - 1, getDimension().yLimit(), getDimension().xLimit() + 1, getDimension().yLimit() + 1, -1); + GuiComponent.fill(matrices, getDimension().xLimit(), getDimension().y() - 1, getDimension().xLimit() + 1, getDimension().yLimit() + 1, -1); } } -- cgit From 4422d7d648d2968060e3ecdbd34b01b7796ab18f Mon Sep 17 00:00:00 2001 From: isXander Date: Thu, 2 Feb 2023 20:24:39 +0000 Subject: 22w05a button changes --- gradle.properties | 4 ++-- .../dev/isxander/yacl/gui/LowProfileButtonWidget.java | 6 +++--- .../java/dev/isxander/yacl/gui/SearchFieldWidget.java | 4 ++-- .../dev/isxander/yacl/gui/TextScaledButtonWidget.java | 15 +++------------ 4 files changed, 10 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/gradle.properties b/gradle.properties index 358c97d..d624cb9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,8 @@ org.gradle.jvmargs=-Xmx3G -minecraftVersion=23w04a +minecraftVersion=23w05a fabricLoaderVersion=0.14.13 -qmBuild=5 +qmBuild=1 modId=yet-another-config-lib modName=YetAnotherConfigLib diff --git a/src/client/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java b/src/client/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java index 3b66b6a..15257e3 100644 --- a/src/client/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java +++ b/src/client/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java @@ -18,12 +18,12 @@ public class LowProfileButtonWidget extends Button { } @Override - public void renderButton(PoseStack matrices, int mouseX, int mouseY, float delta) { + public void renderButton(PoseStack matrices, int mouseX, int mouseY) { if (!isHoveredOrFocused() || !active) { int j = this.active ? 0xFFFFFF : 0xA0A0A0; - drawCenteredString(matrices, Minecraft.getInstance().font, this.getMessage(), this.getX() + this.width / 2, this.getY() + (this.height - 8) / 2, j | Mth.ceil(this.alpha * 255.0F) << 24); + this.renderString(matrices, Minecraft.getInstance().font, this.getX() + this.width / 2, this.getY() + (this.height - 8) / 2, j); } else { - super.renderButton(matrices, mouseX, mouseY, delta); + super.renderButton(matrices, mouseX, mouseY); } } } diff --git a/src/client/java/dev/isxander/yacl/gui/SearchFieldWidget.java b/src/client/java/dev/isxander/yacl/gui/SearchFieldWidget.java index 103831d..72cf549 100644 --- a/src/client/java/dev/isxander/yacl/gui/SearchFieldWidget.java +++ b/src/client/java/dev/isxander/yacl/gui/SearchFieldWidget.java @@ -22,8 +22,8 @@ public class SearchFieldWidget extends EditBox { } @Override - public void renderButton(PoseStack matrices, int mouseX, int mouseY, float delta) { - super.renderButton(matrices, mouseX, mouseY, delta); + public void renderWidget(PoseStack matrices, int mouseX, int mouseY, float delta) { + super.renderWidget(matrices, mouseX, mouseY, delta); if (isVisible() && isEmpty()) { font.drawShadow(matrices, emptyText, getX() + 4, this.getY() + (this.height - 8) / 2f, 0x707070); } diff --git a/src/client/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java b/src/client/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java index 76ba14f..e52174a 100644 --- a/src/client/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java +++ b/src/client/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java @@ -23,22 +23,13 @@ public class TextScaledButtonWidget extends Button { } @Override - public void renderButton(PoseStack matrices, int mouseX, int mouseY, float delta) { - // prevents super from rendering text - Component message = getMessage(); - setMessage(Component.empty()); - - super.renderButton(matrices, mouseX, mouseY, delta); - - setMessage(message); - int j = this.active ? 16777215 : 10526880; - FormattedCharSequence orderedText = getMessage().getVisualOrderText(); + public void renderString(PoseStack matrices, Font textRenderer, int x, int y, int color) { Font font = Minecraft.getInstance().font; matrices.pushPose(); - matrices.translate(((this.getX() + this.width / 2f) - font.width(orderedText) * textScale / 2), (float)this.getY() + (this.height - 8 * textScale) / 2f / textScale, 0); + matrices.translate(((this.getX() + this.width / 2f) - font.width(getMessage()) * textScale / 2), (float)this.getY() + (this.height - 8 * textScale) / 2f / textScale, 0); matrices.scale(textScale, textScale, 1); - font.drawShadow(matrices, orderedText, 0, 0, j | Mth.ceil(this.alpha * 255.0F) << 24); + font.drawShadow(matrices, getMessage(), 0, 0, color | Mth.ceil(this.alpha * 255.0F) << 24); matrices.popPose(); } } -- cgit From 6c08419a6fcd683bab987699f2e73c1ce912980d Mon Sep 17 00:00:00 2001 From: isXander Date: Wed, 8 Feb 2023 20:02:39 +0000 Subject: fix sliders not showing tooltip when focused --- .../isxander/yacl/gui/controllers/slider/SliderControllerElement.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/client/java/dev/isxander/yacl/gui/controllers/slider/SliderControllerElement.java b/src/client/java/dev/isxander/yacl/gui/controllers/slider/SliderControllerElement.java index 2d6f1ea..d00f3d7 100644 --- a/src/client/java/dev/isxander/yacl/gui/controllers/slider/SliderControllerElement.java +++ b/src/client/java/dev/isxander/yacl/gui/controllers/slider/SliderControllerElement.java @@ -158,7 +158,7 @@ public class SliderControllerElement extends ControllerWidget Date: Wed, 8 Feb 2023 21:29:52 +0000 Subject: fix ArrayIndexOutOfBoundsException when navigating to end of option list with keyboard/mouse navigation --- .../mixin/client/AbstractSelectionListMixin.java | 26 ++++++++++++++++++++++ .../yet-another-config-lib.client.mixins.json | 3 +++ src/main/resources/yacl.accesswidener | 1 + 3 files changed, 30 insertions(+) create mode 100644 src/client/java/dev/isxander/yacl/mixin/client/AbstractSelectionListMixin.java (limited to 'src') diff --git a/src/client/java/dev/isxander/yacl/mixin/client/AbstractSelectionListMixin.java b/src/client/java/dev/isxander/yacl/mixin/client/AbstractSelectionListMixin.java new file mode 100644 index 0000000..978fd16 --- /dev/null +++ b/src/client/java/dev/isxander/yacl/mixin/client/AbstractSelectionListMixin.java @@ -0,0 +1,26 @@ +package dev.isxander.yacl.mixin.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.components.AbstractSelectionList; +import org.objectweb.asm.Opcodes; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import java.util.List; + +@Mixin(AbstractSelectionList.class) +public abstract class AbstractSelectionListMixin> { + @Shadow public abstract List children(); + + /** + * Mojang use the field access of children to get max index to loop through keyboard navigation to find the next entry. + * YACL modifies these children() method to filter out hidden entries, so we need to redirect the field access to the + * method, so we don't get ArrayIndexOutOfBoundsException. + */ + @Redirect(method = "nextEntry(Lnet/minecraft/client/gui/navigation/ScreenDirection;Ljava/util/function/Predicate;Lnet/minecraft/client/gui/components/AbstractSelectionList$Entry;)Lnet/minecraft/client/gui/components/AbstractSelectionList$Entry;", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/components/AbstractSelectionList;children:Ljava/util/List;", opcode = Opcodes.GETFIELD)) + private List modifyChildrenCall(AbstractSelectionList instance) { + return children(); + } +} diff --git a/src/client/resources/yet-another-config-lib.client.mixins.json b/src/client/resources/yet-another-config-lib.client.mixins.json index 6aeab10..69c0f25 100644 --- a/src/client/resources/yet-another-config-lib.client.mixins.json +++ b/src/client/resources/yet-another-config-lib.client.mixins.json @@ -7,5 +7,8 @@ }, "client": [ "OptionInstanceAccessor" + ], + "mixins": [ + "AbstractSelectionListMixin" ] } diff --git a/src/main/resources/yacl.accesswidener b/src/main/resources/yacl.accesswidener index 99093ea..35ebaa6 100644 --- a/src/main/resources/yacl.accesswidener +++ b/src/main/resources/yacl.accesswidener @@ -2,3 +2,4 @@ accessWidener v1 named extendable method net/minecraft/client/gui/components/AbstractSelectionList children ()Ljava/util/List; extendable method net/minecraft/client/gui/components/AbstractSelectionList getEntryAtPosition (DD)Lnet/minecraft/client/gui/components/AbstractSelectionList$Entry; +accessible class net/minecraft/client/gui/components/AbstractSelectionList$Entry -- cgit From 19573b50098696028bdb9c7df941ce9ea2628523 Mon Sep 17 00:00:00 2001 From: isXander Date: Wed, 22 Feb 2023 21:43:35 +0000 Subject: 1.19.4-pre1 --- build.gradle.kts | 4 ++-- gradle.properties | 6 +++--- src/client/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java | 6 +++--- src/client/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java | 3 +-- src/main/resources/fabric.mod.json | 2 +- src/main/resources/yacl.accesswidener | 1 + 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/build.gradle.kts b/build.gradle.kts index cd80b24..2787c5f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,7 +16,7 @@ plugins { val ciRun = System.getenv().containsKey("GITHUB_ACTIONS") group = "dev.isxander" -version = "2.3.0+beta.2" +version = "2.3.0+beta.3" if (ciRun) version = "$version+${grgit.branch.current().name.replace('/', '.')}-SNAPSHOT" @@ -75,7 +75,7 @@ dependencies { }) modImplementation("net.fabricmc:fabric-loader:$fabricLoaderVersion") - "modClientImplementation"(fabricApi.module("fabric-resource-loader-v0", "0.73.1+1.19.4")) + "modClientImplementation"(fabricApi.module("fabric-resource-loader-v0", "0.74.2+1.19.4")) "testmodImplementation"(sourceSets.main.get().output) "testmodImplementation"(sourceSets["client"].output) diff --git a/gradle.properties b/gradle.properties index c4eb190..b76e012 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,8 @@ org.gradle.jvmargs=-Xmx3G -minecraftVersion=23w06a -fabricLoaderVersion=0.14.14 -qmBuild=4 +minecraftVersion=1.19.4-pre1 +fabricLoaderVersion=0.14.15 +qmBuild=1 modId=yet-another-config-lib modName=YetAnotherConfigLib diff --git a/src/client/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java b/src/client/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java index 15257e3..7e17aac 100644 --- a/src/client/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java +++ b/src/client/java/dev/isxander/yacl/gui/LowProfileButtonWidget.java @@ -18,12 +18,12 @@ public class LowProfileButtonWidget extends Button { } @Override - public void renderButton(PoseStack matrices, int mouseX, int mouseY) { + public void renderWidget(PoseStack matrices, int mouseX, int mouseY, float deltaTicks) { if (!isHoveredOrFocused() || !active) { int j = this.active ? 0xFFFFFF : 0xA0A0A0; - this.renderString(matrices, Minecraft.getInstance().font, this.getX() + this.width / 2, this.getY() + (this.height - 8) / 2, j); + this.renderString(matrices, Minecraft.getInstance().font, j); } else { - super.renderButton(matrices, mouseX, mouseY); + super.renderWidget(matrices, mouseX, mouseY, deltaTicks); } } } diff --git a/src/client/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java b/src/client/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java index e52174a..b955912 100644 --- a/src/client/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java +++ b/src/client/java/dev/isxander/yacl/gui/TextScaledButtonWidget.java @@ -6,7 +6,6 @@ import net.minecraft.client.gui.Font; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.Tooltip; import net.minecraft.network.chat.Component; -import net.minecraft.util.FormattedCharSequence; import net.minecraft.util.Mth; public class TextScaledButtonWidget extends Button { @@ -23,7 +22,7 @@ public class TextScaledButtonWidget extends Button { } @Override - public void renderString(PoseStack matrices, Font textRenderer, int x, int y, int color) { + public void renderString(PoseStack matrices, Font textRenderer, int color) { Font font = Minecraft.getInstance().font; matrices.pushPose(); diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index f7cd01a..a7148c8 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -20,7 +20,7 @@ }, "depends": { "fabricloader": ">=0.14.0", - "minecraft": "~1.19.3", + "minecraft": "~1.19.4-beta.1", "java": ">=17", "fabric-resource-loader-v0": "*" }, diff --git a/src/main/resources/yacl.accesswidener b/src/main/resources/yacl.accesswidener index 35ebaa6..3a65a38 100644 --- a/src/main/resources/yacl.accesswidener +++ b/src/main/resources/yacl.accesswidener @@ -3,3 +3,4 @@ accessWidener v1 named extendable method net/minecraft/client/gui/components/AbstractSelectionList children ()Ljava/util/List; extendable method net/minecraft/client/gui/components/AbstractSelectionList getEntryAtPosition (DD)Lnet/minecraft/client/gui/components/AbstractSelectionList$Entry; accessible class net/minecraft/client/gui/components/AbstractSelectionList$Entry +extendable method net/minecraft/client/gui/components/AbstractButton getTextureY ()I -- cgit From e51e9bc95e2e271c8d55b063f9117eda0a100ab0 Mon Sep 17 00:00:00 2001 From: isXander Date: Wed, 15 Mar 2023 18:06:37 +0000 Subject: update to 1.19.4 release --- build.gradle.kts | 8 ++++---- gradle.properties | 4 ++-- src/main/resources/fabric.mod.json | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/build.gradle.kts b/build.gradle.kts index 2787c5f..1d0d437 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,7 +16,7 @@ plugins { val ciRun = System.getenv().containsKey("GITHUB_ACTIONS") group = "dev.isxander" -version = "2.3.0+beta.3" +version = "2.3.0" if (ciRun) version = "$version+${grgit.branch.current().name.replace('/', '.')}-SNAPSHOT" @@ -75,7 +75,7 @@ dependencies { }) modImplementation("net.fabricmc:fabric-loader:$fabricLoaderVersion") - "modClientImplementation"(fabricApi.module("fabric-resource-loader-v0", "0.74.2+1.19.4")) + "modClientImplementation"(fabricApi.module("fabric-resource-loader-v0", "0.76.0+1.19.4")) "testmodImplementation"(sourceSets.main.get().output) "testmodImplementation"(sourceSets["client"].output) @@ -133,7 +133,7 @@ if (modrinthId.isNotEmpty()) { versionNumber.set("${project.version}") versionType.set("release") uploadFile.set(tasks["remapJar"]) - gameVersions.set(listOf("1.19.3")) + gameVersions.set(listOf("1.19.4")) loaders.set(listOf("fabric", "quilt")) dependencies { required.project("fabric-api") @@ -154,7 +154,7 @@ if (hasProperty("CURSEFORGE_TOKEN") && curseforgeId.isNotEmpty()) { id = curseforgeId releaseType = "release" - addGameVersion("1.19.3") + addGameVersion("1.19.4") addGameVersion("Fabric") addGameVersion("Java 17") diff --git a/gradle.properties b/gradle.properties index b76e012..866cd28 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.jvmargs=-Xmx3G -minecraftVersion=1.19.4-pre1 -fabricLoaderVersion=0.14.15 +minecraftVersion=1.19.4 +fabricLoaderVersion=0.14.17 qmBuild=1 modId=yet-another-config-lib diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index a7148c8..cc2e6b9 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -20,7 +20,7 @@ }, "depends": { "fabricloader": ">=0.14.0", - "minecraft": "~1.19.4-beta.1", + "minecraft": "~1.19.4", "java": ">=17", "fabric-resource-loader-v0": "*" }, -- cgit