From 14c68eb5ba16774f581d95a39e64a7b303954ffc Mon Sep 17 00:00:00 2001 From: Arslaan Pathan Date: Sat, 26 Sep 2026 17:05:36 +1200 Subject: migration to 26.2 - run migrateMappings with old loom then bring it back to new --- .../screens/clickgui/ModuleButton.java | 99 ---------------------- 1 file changed, 99 deletions(-) delete mode 100644 src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/ModuleButton.java (limited to 'src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/ModuleButton.java') diff --git a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/ModuleButton.java b/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/ModuleButton.java deleted file mode 100644 index 777c88c..0000000 --- a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/ModuleButton.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.arslaancodes.arslaansmagichax.screens.clickgui; - -import com.arslaancodes.arslaansmagichax.modules.Module; -import com.arslaancodes.arslaansmagichax.modules.settings.BooleanSetting; -import com.arslaancodes.arslaansmagichax.modules.settings.ModeSetting; -import com.arslaancodes.arslaansmagichax.modules.settings.NumberSetting; -import com.arslaancodes.arslaansmagichax.modules.settings.Setting; -import com.arslaancodes.arslaansmagichax.screens.clickgui.setting.*; -import net.minecraft.client.gui.DrawContext; -import net.minecraft.text.Text; - -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; - -public class ModuleButton { - - public Module module; - public Frame parent; - public int offset; - public List components; - public boolean extended; - - public ModuleButton(Module module, Frame parent, int offset) { - this.module = module; - this.parent = parent; - this.offset = offset; - this.extended = false; - this.components = new ArrayList<>(); - - int setOffset = parent.height; - components.add(new KeybindingSelector(this, setOffset)); - setOffset += parent.height; - for (Setting setting : module.getSettings()) { - if (setting instanceof BooleanSetting) { - components.add(new CheckBox(setting, this, setOffset)); - } else if (setting instanceof ModeSetting) { - components.add(new ModeBox(setting, this, setOffset)); - } else if (setting instanceof NumberSetting) { - components.add(new Slider(setting, this, setOffset)); - } - setOffset += parent.height; - } - } - - public void render(DrawContext context, int mouseX, int mouseY, float deltaTicks) { - int alpha = isHovered(mouseX, mouseY) ? 230 : 160; - - context.fill(parent.x, parent.y + offset, parent.x + parent.width, parent.y + offset + parent.height, new Color(30, 30, 47, alpha).getRGB()); - - if (isHovered(mouseX, mouseY)) { - context.drawTooltip(Text.literal(module.getDescription()), mouseX, mouseY); - } - - String text = module.getName(); - - int textX = parent.x + 5; - int textY = parent.y + offset + (parent.height - parent.mc.textRenderer.fontHeight) / 2; - - int textColor = module.isEnabled() ? new Color(252, 210, 77, 255).getRGB() : Color.white.getRGB(); - - context.drawTextWithShadow(parent.mc.textRenderer, Text.literal(text), textX, textY, textColor); - - if (extended) { - for (Component component : components) { - component.render(context, mouseX, mouseY, deltaTicks); - } - } - } - - public void mouseClicked(double mouseX, double mouseY, int button) { - if (isHovered(mouseX, mouseY)) { - if (button == 0) { - module.toggle(); - } - else if (button == 1) { - extended = !extended; - parent.updateButtons(); - } - } - - for (Component component : components) { - component.mouseClicked(mouseX, mouseY, button); - } - } - - public void mouseReleased(double mouseX, double mouseY, int button) { - // luigi wins by doing absolutely nothing - - // nevermind we did something - for (Component component : components) { - component.mouseReleased(mouseX, mouseY, button); - } - } - - public boolean isHovered(double mouseX, double mouseY) { - return mouseX > parent.x && mouseX < parent.x + parent.width && mouseY > parent.y + offset && mouseY < parent.y + offset + parent.height; - } -} -- cgit v1.2.3