0.2.0 work in progress

This commit is contained in:
kawaiizenbo 2024-01-14 11:27:19 -07:00
parent 08031c32ba
commit c68631010d
24 changed files with 89 additions and 14 deletions

View file

@ -7,6 +7,7 @@ import me.kawaiizenbo.moonlight.module.ModuleManager;
import me.kawaiizenbo.moonlight.module.Module;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.util.Identifier;
public class CategoryPane
{
@ -16,6 +17,7 @@ public class CategoryPane
boolean dragging = false;
public boolean collapsed = false;
ArrayList<ModuleButton> moduleButtons;
Identifier icon;
public CategoryPane(Category category, int initialX, int initialY, boolean collapsed)
{
@ -24,6 +26,7 @@ public class CategoryPane
this.y = initialY;
this.collapsed = collapsed;
moduleButtons = new ArrayList<ModuleButton>();
icon = new Identifier("moonlight", category.name.toLowerCase());
for (Module m : ModuleManager.INSTANCE.getModulesByCategory(category))
{
moduleButtons.add(new ModuleButton(m));
@ -41,7 +44,8 @@ public class CategoryPane
}
drawContext.fill(x, y, x+width, collapsed ? y+16 : y+height, category.color);
drawContext.fill(x+2, y+2, x+(width-2), y+14, hovered(mouseX, mouseY) ? 0xFF333333 : 0xFF222222);
drawContext.drawText(textRenderer, category.name, x+4, y+4, 0xFFFFFFFF, false);
drawContext.drawGuiTexture(icon, x+2, y+2, 12, 12);
drawContext.drawText(textRenderer, category.name, x+16, y+4, 0xFFFFFFFF, false);
if (!collapsed)
{
int buttonYOffset = y+16;