From 09e8dbf8d81ddf0b4978a6f7e273335229675309 Mon Sep 17 00:00:00 2001 From: kirillsaint Date: Sun, 5 Nov 2023 20:30:37 +0600 Subject: [PATCH] Scroll Problems Fix --- .../net/silentclient/client/cosmetics/gui/CosmeticsGui.java | 6 ++++++ .../net/silentclient/client/cosmetics/gui/OutfitsGui.java | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/silentclient/client/cosmetics/gui/CosmeticsGui.java b/src/main/java/net/silentclient/client/cosmetics/gui/CosmeticsGui.java index 3d5864a..e36218d 100644 --- a/src/main/java/net/silentclient/client/cosmetics/gui/CosmeticsGui.java +++ b/src/main/java/net/silentclient/client/cosmetics/gui/CosmeticsGui.java @@ -110,6 +110,7 @@ public class CosmeticsGui extends SilentScreen { ((Button) button).setTheme(new SelectedButtonTheme()); selectedCategory = "capes"; rotate = 144; + scrollHelper.resetScroll(); break; case 2: this.buttonList.forEach(oldButton -> { @@ -120,6 +121,7 @@ public class CosmeticsGui extends SilentScreen { ((Button) button).setTheme(new SelectedButtonTheme()); selectedCategory = "wings"; rotate = 144; + scrollHelper.resetScroll(); break; case 3: this.buttonList.forEach(oldButton -> { @@ -130,6 +132,7 @@ public class CosmeticsGui extends SilentScreen { ((Button) button).setTheme(new SelectedButtonTheme()); selectedCategory = "bandanas"; rotate = 340; + scrollHelper.resetScroll(); break; case 4: this.buttonList.forEach(oldButton -> { @@ -140,6 +143,7 @@ public class CosmeticsGui extends SilentScreen { ((Button) button).setTheme(new SelectedButtonTheme()); selectedCategory = "hats"; rotate = 340; + scrollHelper.resetScroll(); break; case 5: this.buttonList.forEach(oldButton -> { @@ -150,6 +154,7 @@ public class CosmeticsGui extends SilentScreen { ((Button) button).setTheme(new SelectedButtonTheme()); selectedCategory = "shields"; rotate = 340; + scrollHelper.resetScroll(); break; case 6: this.buttonList.forEach(oldButton -> { @@ -159,6 +164,7 @@ public class CosmeticsGui extends SilentScreen { }); ((Button) button).setTheme(new SelectedButtonTheme()); selectedCategory = "icons"; + scrollHelper.resetScroll(); break; } diff --git a/src/main/java/net/silentclient/client/cosmetics/gui/OutfitsGui.java b/src/main/java/net/silentclient/client/cosmetics/gui/OutfitsGui.java index 957d8ae..a565639 100644 --- a/src/main/java/net/silentclient/client/cosmetics/gui/OutfitsGui.java +++ b/src/main/java/net/silentclient/client/cosmetics/gui/OutfitsGui.java @@ -70,7 +70,7 @@ public class OutfitsGui extends SilentScreen { int x = this.width / 2 - (width / 2); int y = this.height / 2 - (height / 2); scrollHelper.setStep(5); - scrollHelper.setElementsHeight((float) Math.ceil((Outfits.getOutfits().size() + 2) / 3) * 85); + scrollHelper.setElementsHeight((float) Math.ceil((Outfits.getOutfits().size() + 3) / 3) * 85); scrollHelper.setMaxScroll(height - 20); scrollHelper.setSpeed(100); scrollHelper.setFlag(true);