diff options
author | Falkreon <falkreon@gmail.com> | 2019-08-18 18:45:46 -0500 |
---|---|---|
committer | Falkreon <falkreon@gmail.com> | 2019-08-18 18:45:46 -0500 |
commit | 2705f7300fa1b87a7dcb661a26897704d70dcbd9 (patch) | |
tree | a3ece862fa2e5cd9cb964b6e3b3970f14e906876 /src/main | |
parent | 3640cfdcbc4fbf08a739a238fe3a52d6f8233a12 (diff) | |
download | LibGui-2705f7300fa1b87a7dcb661a26897704d70dcbd9.tar.gz LibGui-2705f7300fa1b87a7dcb661a26897704d70dcbd9.tar.bz2 LibGui-2705f7300fa1b87a7dcb661a26897704d70dcbd9.zip |
Replace WToggleButton appearance, clean up config gui again
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/client/modmenu/ConfigGui.java | 3 | ||||
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/client/modmenu/WKirbSprite.java | 4 | ||||
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/WToggleButton.java | 8 | ||||
-rw-r--r-- | src/main/resources/assets/libgui/textures/widget/kirb.png (renamed from src/main/resources/assets/libgui/widget/kirb.png) | bin | 7026 -> 7026 bytes | |||
-rw-r--r-- | src/main/resources/assets/libgui/textures/widget/toggle_off.png | bin | 0 -> 162 bytes | |||
-rw-r--r-- | src/main/resources/assets/libgui/textures/widget/toggle_on.png | bin | 0 -> 3181 bytes | |||
-rw-r--r-- | src/main/resources/assets/libgui/widget/toggle_off.png | bin | 288 -> 0 bytes | |||
-rw-r--r-- | src/main/resources/assets/libgui/widget/toggle_on.png | bin | 296 -> 0 bytes |
8 files changed, 6 insertions, 9 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/modmenu/ConfigGui.java b/src/main/java/io/github/cottonmc/cotton/gui/client/modmenu/ConfigGui.java index 15c39dd..e114131 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/modmenu/ConfigGui.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/modmenu/ConfigGui.java @@ -5,7 +5,6 @@ import io.github.cottonmc.cotton.gui.client.LibGuiClient; import io.github.cottonmc.cotton.gui.client.LightweightGuiDescription; import io.github.cottonmc.cotton.gui.widget.WButton; import io.github.cottonmc.cotton.gui.widget.WGridPanel; -import io.github.cottonmc.cotton.gui.widget.WTextField; import io.github.cottonmc.cotton.gui.widget.WToggleButton; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.Screen; @@ -29,8 +28,6 @@ public class ConfigGui extends LightweightGuiDescription { root.add(new WKirbSprite(), 5, 4); - root.add(new WTextField(), 0, 3, 5, 1); - WButton doneButton = new WButton(new TranslatableText("gui.done")); doneButton.setOnClick(()->{ MinecraftClient.getInstance().openScreen(previous); diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/modmenu/WKirbSprite.java b/src/main/java/io/github/cottonmc/cotton/gui/client/modmenu/WKirbSprite.java index a51ecb5..d68b1db 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/modmenu/WKirbSprite.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/modmenu/WKirbSprite.java @@ -10,7 +10,7 @@ import net.fabricmc.api.Environment; import net.minecraft.util.Identifier; public class WKirbSprite extends WWidget { - private static final Identifier KIRB = new Identifier("libgui:widget/kirb.png"); + private static final Identifier KIRB = new Identifier("libgui:textures/widget/kirb.png"); private static final float PX = 1f/416f; private static final float KIRB_WIDTH = 32*PX; @@ -98,7 +98,7 @@ public class WKirbSprite extends WWidget { } float offset = KIRB_WIDTH * currentFrame; - ScreenDrawing.rect(KIRB, x, y, 32, 32, offset, 0, offset+KIRB_WIDTH, 1, 0xFFFFFFFF); + ScreenDrawing.rect(KIRB, x, y+8, 32, 32, offset, 0, offset+KIRB_WIDTH, 1, 0xFFFFFFFF); long elapsed = now - lastFrame; currentFrameTime += elapsed; diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WToggleButton.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WToggleButton.java index 5f1f568..846f032 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WToggleButton.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WToggleButton.java @@ -66,8 +66,8 @@ public class WToggleButton extends WWidget { Text label = null; /** Default On / Off Images */ - protected final static Identifier DEFAULT_OFF_IMAGE = new Identifier("libgui:widget/toggle_off.png"); - protected final static Identifier DEFAULT_ON_IMAGE = new Identifier("libgui:widget/toggle_on.png"); + protected final static Identifier DEFAULT_OFF_IMAGE = new Identifier("libgui:textures/widget/toggle_off.png"); + protected final static Identifier DEFAULT_ON_IMAGE = new Identifier("libgui:textures/widget/toggle_on.png"); protected Identifier onImage; protected Identifier offImage; @@ -87,11 +87,11 @@ public class WToggleButton extends WWidget { @Override public void paintBackground(int x, int y) { - ScreenDrawing.rect(isOn ? DEFAULT_ON_IMAGE : DEFAULT_OFF_IMAGE, x, y, width, height, 0xFFFFFFFF); + ScreenDrawing.rect(isOn ? DEFAULT_ON_IMAGE : DEFAULT_OFF_IMAGE, x, y, 18, 18, 0xFFFFFFFF); if (label!=null) { - ScreenDrawing.drawString(label.asFormattedString(), x + 20, y+1, LibGuiClient.config.darkMode ? darkmodeColor : color); + ScreenDrawing.drawString(label.asFormattedString(), x + 22, y+6, LibGuiClient.config.darkMode ? darkmodeColor : color); } } diff --git a/src/main/resources/assets/libgui/widget/kirb.png b/src/main/resources/assets/libgui/textures/widget/kirb.png Binary files differindex eea2fc9..eea2fc9 100644 --- a/src/main/resources/assets/libgui/widget/kirb.png +++ b/src/main/resources/assets/libgui/textures/widget/kirb.png diff --git a/src/main/resources/assets/libgui/textures/widget/toggle_off.png b/src/main/resources/assets/libgui/textures/widget/toggle_off.png Binary files differnew file mode 100644 index 0000000..d62d86b --- /dev/null +++ b/src/main/resources/assets/libgui/textures/widget/toggle_off.png diff --git a/src/main/resources/assets/libgui/textures/widget/toggle_on.png b/src/main/resources/assets/libgui/textures/widget/toggle_on.png Binary files differnew file mode 100644 index 0000000..aabd040 --- /dev/null +++ b/src/main/resources/assets/libgui/textures/widget/toggle_on.png diff --git a/src/main/resources/assets/libgui/widget/toggle_off.png b/src/main/resources/assets/libgui/widget/toggle_off.png Binary files differdeleted file mode 100644 index 18c7ed0..0000000 --- a/src/main/resources/assets/libgui/widget/toggle_off.png +++ /dev/null diff --git a/src/main/resources/assets/libgui/widget/toggle_on.png b/src/main/resources/assets/libgui/widget/toggle_on.png Binary files differdeleted file mode 100644 index 94450d4..0000000 --- a/src/main/resources/assets/libgui/widget/toggle_on.png +++ /dev/null |