make indexsetting visually distinct from stringsetting
This commit is contained in:
parent
bd5573c48f
commit
fd96ca5d42
4 changed files with 10 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
package me.kawaiizenbo.moonlight.module.settings;
|
package me.kawaiizenbo.moonlight.module.settings;
|
||||||
|
|
||||||
import me.kawaiizenbo.moonlight.Moonlight;
|
import me.kawaiizenbo.moonlight.Moonlight;
|
||||||
|
import me.kawaiizenbo.moonlight.util.DrawUtils;
|
||||||
import net.minecraft.client.font.TextRenderer;
|
import net.minecraft.client.font.TextRenderer;
|
||||||
import net.minecraft.client.gui.DrawContext;
|
import net.minecraft.client.gui.DrawContext;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
@ -25,6 +26,7 @@ public class IndexSetting extends Setting
|
||||||
drawContext.fill(x+96, y+5, x+190, y+19, Moonlight.THEME.border.getRGB());
|
drawContext.fill(x+96, y+5, x+190, y+19, Moonlight.THEME.border.getRGB());
|
||||||
drawContext.fill(x+97, y+6, x+189, y+18, hovered(mouseX, mouseY) ? Moonlight.THEME.hover.getRGB() : Moonlight.THEME.background.getRGB());
|
drawContext.fill(x+97, y+6, x+189, y+18, hovered(mouseX, mouseY) ? Moonlight.THEME.hover.getRGB() : Moonlight.THEME.background.getRGB());
|
||||||
drawContext.drawText(textRenderer, elements[index], x+98, y+8, Moonlight.THEME.text.getRGB(), false);
|
drawContext.drawText(textRenderer, elements[index], x+98, y+8, Moonlight.THEME.text.getRGB(), false);
|
||||||
|
drawContext.drawGuiTexture(DrawUtils.getThemedGUIIcon("updown", Moonlight.THEME.background), x+177, y+6, 12, 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,10 +1,18 @@
|
||||||
package me.kawaiizenbo.moonlight.util;
|
package me.kawaiizenbo.moonlight.util;
|
||||||
|
|
||||||
import me.kawaiizenbo.moonlight.Moonlight;
|
import me.kawaiizenbo.moonlight.Moonlight;
|
||||||
|
import me.kawaiizenbo.moonlight.theme.ThemeColor;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
public class DrawUtils
|
public class DrawUtils
|
||||||
{
|
{
|
||||||
|
public static Identifier getThemedGUIIcon(String textureName, ThemeColor invert)
|
||||||
|
{
|
||||||
|
boolean mode = ((invert.r + invert.g + invert.b) / 3) > 77;
|
||||||
|
String addition = mode ? "_light" : "";
|
||||||
|
return Identifier.of("moonlight", textureName+addition);
|
||||||
|
}
|
||||||
|
|
||||||
public static Identifier getThemedGUIIcon(String textureName)
|
public static Identifier getThemedGUIIcon(String textureName)
|
||||||
{
|
{
|
||||||
String addition = Moonlight.THEME.useDarkIcons ? "_light" : "";
|
String addition = Moonlight.THEME.useDarkIcons ? "_light" : "";
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 355 B |
Binary file not shown.
After Width: | Height: | Size: 350 B |
Loading…
Add table
Reference in a new issue