Merge pull request #81 from Silent-Client/TEST2

Scroll Problems Fix
This commit is contained in:
kirillsaint 2023-11-05 20:31:06 +06:00 committed by GitHub
commit 2cd52cadd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -110,6 +110,7 @@ public class CosmeticsGui extends SilentScreen {
((Button) button).setTheme(new SelectedButtonTheme()); ((Button) button).setTheme(new SelectedButtonTheme());
selectedCategory = "capes"; selectedCategory = "capes";
rotate = 144; rotate = 144;
scrollHelper.resetScroll();
break; break;
case 2: case 2:
this.buttonList.forEach(oldButton -> { this.buttonList.forEach(oldButton -> {
@ -120,6 +121,7 @@ public class CosmeticsGui extends SilentScreen {
((Button) button).setTheme(new SelectedButtonTheme()); ((Button) button).setTheme(new SelectedButtonTheme());
selectedCategory = "wings"; selectedCategory = "wings";
rotate = 144; rotate = 144;
scrollHelper.resetScroll();
break; break;
case 3: case 3:
this.buttonList.forEach(oldButton -> { this.buttonList.forEach(oldButton -> {
@ -130,6 +132,7 @@ public class CosmeticsGui extends SilentScreen {
((Button) button).setTheme(new SelectedButtonTheme()); ((Button) button).setTheme(new SelectedButtonTheme());
selectedCategory = "bandanas"; selectedCategory = "bandanas";
rotate = 340; rotate = 340;
scrollHelper.resetScroll();
break; break;
case 4: case 4:
this.buttonList.forEach(oldButton -> { this.buttonList.forEach(oldButton -> {
@ -140,6 +143,7 @@ public class CosmeticsGui extends SilentScreen {
((Button) button).setTheme(new SelectedButtonTheme()); ((Button) button).setTheme(new SelectedButtonTheme());
selectedCategory = "hats"; selectedCategory = "hats";
rotate = 340; rotate = 340;
scrollHelper.resetScroll();
break; break;
case 5: case 5:
this.buttonList.forEach(oldButton -> { this.buttonList.forEach(oldButton -> {
@ -150,6 +154,7 @@ public class CosmeticsGui extends SilentScreen {
((Button) button).setTheme(new SelectedButtonTheme()); ((Button) button).setTheme(new SelectedButtonTheme());
selectedCategory = "shields"; selectedCategory = "shields";
rotate = 340; rotate = 340;
scrollHelper.resetScroll();
break; break;
case 6: case 6:
this.buttonList.forEach(oldButton -> { this.buttonList.forEach(oldButton -> {
@ -159,6 +164,7 @@ public class CosmeticsGui extends SilentScreen {
}); });
((Button) button).setTheme(new SelectedButtonTheme()); ((Button) button).setTheme(new SelectedButtonTheme());
selectedCategory = "icons"; selectedCategory = "icons";
scrollHelper.resetScroll();
break; break;
} }

View File

@ -70,7 +70,7 @@ public class OutfitsGui extends SilentScreen {
int x = this.width / 2 - (width / 2); int x = this.width / 2 - (width / 2);
int y = this.height / 2 - (height / 2); int y = this.height / 2 - (height / 2);
scrollHelper.setStep(5); 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.setMaxScroll(height - 20);
scrollHelper.setSpeed(100); scrollHelper.setSpeed(100);
scrollHelper.setFlag(true); scrollHelper.setFlag(true);