aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisXander <xander@isxander.dev>2024-03-01 20:35:13 +0000
committerisXander <xander@isxander.dev>2024-03-01 20:35:13 +0000
commite0fac3798200c9c718281c2b9bb6cc5da04a47d1 (patch)
treee0ab2071722300b1a5fa916dcaf5a4c30870bf96
parent308d882fc015fd448deb059b2a814246f7a32f05 (diff)
parent9dce73ba8c10960e6502825b14c91e6ec56393a4 (diff)
downloadYetAnotherConfigLib-e0fac3798200c9c718281c2b9bb6cc5da04a47d1.tar.gz
YetAnotherConfigLib-e0fac3798200c9c718281c2b9bb6cc5da04a47d1.tar.bz2
YetAnotherConfigLib-e0fac3798200c9c718281c2b9bb6cc5da04a47d1.zip
Merge branch '1.20.x/dev' into update/1.20.5
# Conflicts: # common/src/main/java/dev/isxander/yacl3/gui/ElementListWidgetExt.java
-rw-r--r--build.gradle.kts2
-rw-r--r--changelogs/3.3.3+1.20.4.md3
-rw-r--r--common/src/main/java/dev/isxander/yacl3/gui/ElementListWidgetExt.java14
3 files changed, 18 insertions, 1 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index d1c7c3e..b879642 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -12,7 +12,7 @@ architectury {
minecraft = libs.versions.minecraft.get()
}
-version = "3.3.2+1.20.4"
+version = "3.3.3+1.20.4"
val isBeta = "beta" in version.toString()
val changelogText = rootProject.file("changelogs/${project.version}.md").takeIf { it.exists() }?.readText() ?: "No changelog provided."
diff --git a/changelogs/3.3.3+1.20.4.md b/changelogs/3.3.3+1.20.4.md
new file mode 100644
index 0000000..9c863fc
--- /dev/null
+++ b/changelogs/3.3.3+1.20.4.md
@@ -0,0 +1,3 @@
+# YetAnotherConfigLib v3.3.3 for 1.20.4
+
+- Fix keyboard/controller navigation not properly scrolling when overflowing
diff --git a/common/src/main/java/dev/isxander/yacl3/gui/ElementListWidgetExt.java b/common/src/main/java/dev/isxander/yacl3/gui/ElementListWidgetExt.java
index 56dcfcc..a9a978f 100644
--- a/common/src/main/java/dev/isxander/yacl3/gui/ElementListWidgetExt.java
+++ b/common/src/main/java/dev/isxander/yacl3/gui/ElementListWidgetExt.java
@@ -123,6 +123,20 @@ public class ElementListWidgetExt<E extends ElementListWidgetExt.Entry<E>> exten
}
@Override
+ protected void ensureVisible(E entry) {
+ int i = this.getRowTop(this.children().indexOf(entry));
+ int j = i - this.getY() - 4 - entry.getItemHeight();
+ if (j < 0) {
+ this.setScrollAmount(this.getScrollAmount() + j);
+ }
+
+ int k = this.getBottom() - i - entry.getItemHeight() * 2;
+ if (k < 0) {
+ this.setScrollAmount(this.getScrollAmount() - k);
+ }
+ }
+
+ @Override
protected void renderListItems(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
int left = this.getRowLeft();
int right = this.getRowWidth();