aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFalkreon <falkreon@gmail.com>2019-08-18 18:45:46 -0500
committerFalkreon <falkreon@gmail.com>2019-08-18 18:45:46 -0500
commit2705f7300fa1b87a7dcb661a26897704d70dcbd9 (patch)
treea3ece862fa2e5cd9cb964b6e3b3970f14e906876
parent3640cfdcbc4fbf08a739a238fe3a52d6f8233a12 (diff)
downloadLibGui-2705f7300fa1b87a7dcb661a26897704d70dcbd9.tar.gz
LibGui-2705f7300fa1b87a7dcb661a26897704d70dcbd9.tar.bz2
LibGui-2705f7300fa1b87a7dcb661a26897704d70dcbd9.zip
Replace WToggleButton appearance, clean up config gui again
-rw-r--r--build.gradle2
-rw-r--r--gradle.properties2
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/modmenu/ConfigGui.java3
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/modmenu/WKirbSprite.java4
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WToggleButton.java8
-rw-r--r--src/main/resources/assets/libgui/textures/widget/kirb.png (renamed from src/main/resources/assets/libgui/widget/kirb.png)bin7026 -> 7026 bytes
-rw-r--r--src/main/resources/assets/libgui/textures/widget/toggle_off.pngbin0 -> 162 bytes
-rw-r--r--src/main/resources/assets/libgui/textures/widget/toggle_on.pngbin0 -> 3181 bytes
-rw-r--r--src/main/resources/assets/libgui/widget/toggle_off.pngbin288 -> 0 bytes
-rw-r--r--src/main/resources/assets/libgui/widget/toggle_on.pngbin296 -> 0 bytes
10 files changed, 8 insertions, 11 deletions
diff --git a/build.gradle b/build.gradle
index 2babfba..d321642 100644
--- a/build.gradle
+++ b/build.gradle
@@ -40,7 +40,7 @@ dependencies {
modImplementation "io.github.prospector:modmenu:1.7.9+build.118"
- modApi "io.github.prospector:modmenu:1.7.9+build.118"
+ //modApi "io.github.prospector:modmenu:1.7.9+build.118"
}
processResources {
diff --git a/gradle.properties b/gradle.properties
index 9603150..5759dc2 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.4.8+build.158
# Mod Properties
- mod_version = 1.2.5-c
+ mod_version = 1.3.0
maven_group = io.github.cottonmc
archives_base_name = LibGui
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
index eea2fc9..eea2fc9 100644
--- a/src/main/resources/assets/libgui/widget/kirb.png
+++ b/src/main/resources/assets/libgui/textures/widget/kirb.png
Binary files differ
diff --git a/src/main/resources/assets/libgui/textures/widget/toggle_off.png b/src/main/resources/assets/libgui/textures/widget/toggle_off.png
new file mode 100644
index 0000000..d62d86b
--- /dev/null
+++ b/src/main/resources/assets/libgui/textures/widget/toggle_off.png
Binary files differ
diff --git a/src/main/resources/assets/libgui/textures/widget/toggle_on.png b/src/main/resources/assets/libgui/textures/widget/toggle_on.png
new file mode 100644
index 0000000..aabd040
--- /dev/null
+++ b/src/main/resources/assets/libgui/textures/widget/toggle_on.png
Binary files differ
diff --git a/src/main/resources/assets/libgui/widget/toggle_off.png b/src/main/resources/assets/libgui/widget/toggle_off.png
deleted file mode 100644
index 18c7ed0..0000000
--- a/src/main/resources/assets/libgui/widget/toggle_off.png
+++ /dev/null
Binary files differ
diff --git a/src/main/resources/assets/libgui/widget/toggle_on.png b/src/main/resources/assets/libgui/widget/toggle_on.png
deleted file mode 100644
index 94450d4..0000000
--- a/src/main/resources/assets/libgui/widget/toggle_on.png
+++ /dev/null
Binary files differ