1.20
This commit is contained in:
parent
f90a15a48f
commit
6e7d77dea3
11 changed files with 35 additions and 35 deletions
|
@ -3,7 +3,7 @@ package me.kawaiizenbo.moonlight.ui;
|
|||
import me.kawaiizenbo.moonlight.ui.clickgui.ClickGUIScreen;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.gui.DrawableHelper;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
|
@ -23,8 +23,8 @@ public class TextButton
|
|||
public void render(MatrixStack matrices, TextRenderer textRenderer, int mouseX, int mouseY)
|
||||
{
|
||||
width = textRenderer.getWidth(text);
|
||||
DrawableHelper.fill(matrices, x-1, y-1, x + width + 1, y + 10, hovered(mouseX, mouseY) ? 0xFF444444 : 0xFF222222);
|
||||
DrawableHelper.drawTextWithShadow(matrices, textRenderer, Text.literal(text), x, y, color);
|
||||
DrawContext.fill(matrices, x-1, y-1, x + width + 1, y + 10, hovered(mouseX, mouseY) ? 0xFF444444 : 0xFF222222);
|
||||
DrawContext.drawTextWithShadow(matrices, textRenderer, Text.literal(text), x, y, color);
|
||||
}
|
||||
|
||||
public boolean hovered(int mouseX, int mouseY)
|
||||
|
|
|
@ -3,7 +3,7 @@ package me.kawaiizenbo.moonlight.ui.clickgui;
|
|||
import me.kawaiizenbo.moonlight.module.Module_;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.gui.DrawableHelper;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
public class ModuleButton
|
||||
|
@ -24,7 +24,7 @@ public class ModuleButton
|
|||
public void render(MatrixStack matrices, int mouseX, int mouseY)
|
||||
{
|
||||
TextRenderer textRenderer = mc.textRenderer;
|
||||
DrawableHelper.fill(matrices, x, y, x + width, y + height, hovered(mouseX, mouseY) ? 0xFF333333 : 0xFF222222);
|
||||
DrawContext.fill(matrices, x, y, x + width, y + height, hovered(mouseX, mouseY) ? 0xFF333333 : 0xFF222222);
|
||||
textRenderer.draw(matrices, module.name, x+3, y+3, module.enabled ? 0x55FFFF : 0xFFFFFF);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import me.kawaiizenbo.moonlight.module.Module_;
|
|||
import me.kawaiizenbo.moonlight.module.settings.Setting;
|
||||
import me.kawaiizenbo.moonlight.ui.TextButton;
|
||||
import me.kawaiizenbo.moonlight.util.ColorUtils;
|
||||
import net.minecraft.client.gui.DrawableHelper;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.Text;
|
||||
|
@ -24,9 +24,9 @@ public class SettingsScreen extends Screen
|
|||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta)
|
||||
{
|
||||
this.renderBackground(matrices);
|
||||
DrawableHelper.fill(matrices, (width/2)-112, (height/2)-96, (width/2)+112, (height/2)+96, 0xFF222222);
|
||||
DrawableHelper.drawCenteredText(matrices, textRenderer, module.name, width/2, (height/2)-88, 0xFFFFFF);
|
||||
DrawableHelper.drawTextWithShadow(matrices, textRenderer, Text.literal(module.description), (width/2)-104, (height/2)-72, 0xFFFFFF);
|
||||
DrawContext.fill(matrices, (width/2)-112, (height/2)-96, (width/2)+112, (height/2)+96, 0xFF222222);
|
||||
DrawContext.drawCenteredTextWithShadow(matrices, textRenderer, module.name, width/2, (height/2)-88, 0xFFFFFF);
|
||||
DrawContext.drawTextWithShadow(matrices, textRenderer, Text.literal(module.description), (width/2)-104, (height/2)-72, 0xFFFFFF);
|
||||
backButton = new TextButton(ColorUtils.underline + "< Back", (width/2)-104, (height/2)-88, 0xFFFFFF);
|
||||
backButton.render(matrices, textRenderer, mouseX, mouseY);
|
||||
int yOffset = (height/2)-56;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue