DoubleSetting working, new icon
This commit is contained in:
parent
0ebc2f3512
commit
95ed46fff0
6 changed files with 94 additions and 23 deletions
|
@ -2,12 +2,32 @@ package me.kawaiizenbo.moonlight.module.settings;
|
|||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.gui.DrawableHelper;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
public class Setting
|
||||
{
|
||||
public String name;
|
||||
protected TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer;
|
||||
|
||||
public void render(MatrixStack matrices, int x, int y, int mouseX, int mouseY) { }
|
||||
int x = 0, y = 0;
|
||||
public void render(MatrixStack matrices, int x, int y, int mouseX, int mouseY)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
DrawableHelper.fill(matrices, x, y, x+192, y+24, hovered(mouseX, mouseY) ? 0xFF444444: 0xFF222222);
|
||||
DrawableHelper.drawTextWithShadow(matrices, textRenderer, Text.literal(name), x+2, y+2, 0xFFFFFF);
|
||||
}
|
||||
|
||||
public void mouseClicked(double mouseX, double mouseY, int button) { }
|
||||
|
||||
public void mouseReleased(double mouseX, double mouseY, int button) { }
|
||||
|
||||
public void keyPressed(int keyCode, int scanCode, int modifiers) { }
|
||||
|
||||
protected boolean hovered(int mouseX, int mouseY)
|
||||
{
|
||||
return mouseX >= x && mouseX <= x + 192 && mouseY >= y && mouseY <= y + 24;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue