Better Buttons in Cosmetics

This commit is contained in:
kirillsaint 2023-08-06 17:09:13 +06:00
parent 443b4b29ab
commit 6ec3475ed2
2 changed files with 14 additions and 14 deletions

View File

@ -61,32 +61,32 @@ public class CosmeticsGui extends SilentScreen {
int height = addY * 2;
int tabId = 1;
this.buttonList.add(new Button(tabId, x + 5, y + categoryOffsetY, 75, 15, "Capes", false, selectedCategory == "capes" ? new SelectedButtonTheme() : new DefaultButtonTheme()));
categoryOffsetY +=20;
this.buttonList.add(new Button(tabId, x + 5, y + categoryOffsetY, 75, 18, "Capes", false, selectedCategory == "capes" ? new SelectedButtonTheme() : new DefaultButtonTheme()));
categoryOffsetY +=23;
tabId++;
this.buttonList.add(new Button(tabId, x + 5, y + categoryOffsetY, 75, 15, "Wings", false, selectedCategory == "wings" ? new SelectedButtonTheme() : new DefaultButtonTheme()));
categoryOffsetY +=20;
this.buttonList.add(new Button(tabId, x + 5, y + categoryOffsetY, 75, 18, "Wings", false, selectedCategory == "wings" ? new SelectedButtonTheme() : new DefaultButtonTheme()));
categoryOffsetY +=23;
tabId++;
this.buttonList.add(new Button(tabId, x + 5, y + categoryOffsetY, 75, 15, "Bandanas", false, selectedCategory == "bandanas" ? new SelectedButtonTheme() : new DefaultButtonTheme()));
categoryOffsetY +=20;
this.buttonList.add(new Button(tabId, x + 5, y + categoryOffsetY, 75, 18, "Bandanas", false, selectedCategory == "bandanas" ? new SelectedButtonTheme() : new DefaultButtonTheme()));
categoryOffsetY +=23;
tabId++;
this.buttonList.add(new Button(tabId, x + 5, y + categoryOffsetY, 75, 15, "Hats", false, selectedCategory == "hats" ? new SelectedButtonTheme() : new DefaultButtonTheme()));
categoryOffsetY +=20;
this.buttonList.add(new Button(tabId, x + 5, y + categoryOffsetY, 75, 18, "Hats", false, selectedCategory == "hats" ? new SelectedButtonTheme() : new DefaultButtonTheme()));
categoryOffsetY +=23;
tabId++;
this.buttonList.add(new Button(tabId, x + 5, y + categoryOffsetY, 75, 15, "Shields", false, selectedCategory == "shields" ? new SelectedButtonTheme() : new DefaultButtonTheme()));
categoryOffsetY +=20;
this.buttonList.add(new Button(tabId, x + 5, y + categoryOffsetY, 75, 18, "Shields", false, selectedCategory == "shields" ? new SelectedButtonTheme() : new DefaultButtonTheme()));
categoryOffsetY +=23;
tabId++;
this.buttonList.add(new Button(tabId, x + 5, y + categoryOffsetY, 75, 15, "Icons", false, selectedCategory == "icons" ? new SelectedButtonTheme() : new DefaultButtonTheme()));
this.buttonList.add(new Button(tabId, x + 5, y + categoryOffsetY, 75, 18, "Icons", false, selectedCategory == "icons" ? new SelectedButtonTheme() : new DefaultButtonTheme()));
tabId++;
this.buttonList.add(new Button(tabId, x + 5, (y + height) - 26, 75, 20, "Store"));
this.buttonList.add(new Button(tabId, x + 5, (y + height) - 24, 75, 18, "Store"));
this.buttonList.add(new Button(88, x + 380 - 140, y + 220 - 22, 135, 20, "Outfits"));
this.buttonList.add(new Button(88, x + 380 - 140, (y + height) - 24, 135, 18, "Outfits"));
}
@Override

View File

@ -124,7 +124,7 @@ public class ClickGUI extends SilentScreen {
if(selectedCategory != ModCategory.PLUS && selectedCategory != ModCategory.CONFIGS) {
for(Mod m : getMods()) {
if(mouseInContent(x, (int) (modOffsetY - scrollAnimation.getValue()), y + 25, height - 25) || mouseInContent(x, (int) (modOffsetY - scrollAnimation.getValue() + 70), y + 25, height - 25)) {
if(mouseInContent(x, (int) (modOffsetY - scrollAnimation.getValue()), y, height - 25) || mouseInContent(x, (int) (modOffsetY - scrollAnimation.getValue() + 70), y, height - 25)) {
float switchX = modOffsetX + ((65 / 2) - (15 / 2));
float switchY = y + modOffsetY - scrollAnimation.getValue() + 55;
boolean switchHovered = selectedCategory.equals(ModCategory.MODS) && Switch.isHovered(mouseX, mouseY, switchX, switchY) && !headerHovered;