From bb4806d09e06758a765773be55a728dae6c9e541 Mon Sep 17 00:00:00 2001 From: Falkreon Date: Sat, 14 Sep 2019 21:50:18 -0500 Subject: More snapshot work --- GuiTest/gradle.properties | 8 ++++---- GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java | 2 +- build.gradle | 14 +++++++++----- gradle.properties | 10 +++++----- .../cottonmc/cotton/gui/client/CottonInventoryScreen.java | 3 ++- .../io/github/cottonmc/cotton/gui/client/LibGuiClient.java | 1 + .../github/cottonmc/cotton/gui/client/ScreenDrawing.java | 7 +++---- .../io/github/cottonmc/cotton/gui/style/StyleEntry.java | 9 +++++++++ .../io/github/cottonmc/cotton/gui/widget/WTextField.java | 5 ++--- 9 files changed, 36 insertions(+), 23 deletions(-) create mode 100644 src/main/java/io/github/cottonmc/cotton/gui/style/StyleEntry.java diff --git a/GuiTest/gradle.properties b/GuiTest/gradle.properties index 8dea5d3..9ae5f8f 100644 --- a/GuiTest/gradle.properties +++ b/GuiTest/gradle.properties @@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version=19w35a - yarn_mappings=19w35a+build.1 - loader_version=0.6.1+build.164 + minecraft_version=19w37a + yarn_mappings=19w37a+build.9 + loader_version=0.6.1+build.165 # Mod Properties mod_version = 1.3.1 @@ -14,5 +14,5 @@ org.gradle.jvmargs=-Xmx1G # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric - fabric_version=0.3.2+build.217-1.15 + fabric_version=0.3.2+build.230-1.15 jankson_version=1.0.0+j1.1.2 diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java b/GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java index b777361..37b98f6 100644 --- a/GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java +++ b/GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java @@ -25,6 +25,6 @@ public class GuiItem extends Item { MinecraftClient.getInstance().openScreen(new CottonClientScreen(new TestClientGui())); } - return new TypedActionResult(ActionResult.SUCCESS, (hand==Hand.MAIN_HAND) ? player.getMainHandStack() : player.getOffHandStack()); + return new TypedActionResult(ActionResult.SUCCESS, (hand==Hand.MAIN_HAND) ? player.getMainHandStack() : player.getOffHandStack(), false); } } diff --git a/build.gradle b/build.gradle index c453a51..820a3cc 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,10 @@ buildscript { repositories { jcenter() + maven { + name = 'Modmuss' + url = 'https://maven.modmuss50.me/' + } maven { name = 'Fabric' url = 'https://maven.fabricmc.net/' @@ -11,7 +15,7 @@ buildscript { System.out.println(rootProject.name); if (rootProject.name=="LibGUI") { System.out.println("Added libgui to classpath"); - classpath 'fabric-loom:fabric-loom.gradle.plugin:0.2.4-SNAPSHOT' + classpath 'fabric-loom:fabric-loom.gradle.plugin:0.2.5-SNAPSHOT' } } } @@ -48,15 +52,15 @@ repositories { dependencies { minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}" - modApi "net.fabricmc:fabric-loader:${project.loader_version}" - modApi "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - modApi "io.github.cottonmc:Jankson:${project.jankson_version}" + modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" + modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" + modImplementation "io.github.cottonmc:Jankson:${project.jankson_version}" include "io.github.cottonmc:Jankson:${project.jankson_version}" compileOnly ("com.google.code.findbugs:jsr305:3.0.2") { transitive = false } - modImplementation "io.github.prospector:modmenu:1.7.9+build.118" + modImplementation "io.github.prospector:modmenu:1.7.10-unstable.19w35a+build.2" //modApi "io.github.prospector:modmenu:1.7.9+build.118" } diff --git a/gradle.properties b/gradle.properties index df07e23..9d0c91d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,16 +3,16 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version=19w35a - yarn_mappings=19w35a+build.1 - loader_version=0.6.1+build.164 + minecraft_version=19w37a + yarn_mappings=19w37a+build.9 + loader_version=0.6.1+build.165 # Mod Properties - mod_version = 1.3.3-beta.1 + mod_version = 1.3.3-beta.2 maven_group = io.github.cottonmc archives_base_name = LibGui # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric - fabric_version=0.3.2+build.217-1.15 + fabric_version=0.3.2+build.230-1.15 jankson_version=1.0.0+j1.1.2 diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java index 3a7f5c2..c18fc88 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java @@ -80,7 +80,8 @@ public class CottonInventoryScreen extends A @Override public boolean keyPressed(int ch, int keyCode, int modifiers) { - if (keyCode==GLFW.GLFW_KEY_ESCAPE) { + //System.out.println("Key " + Integer.toHexString(ch)+" "+Integer.toHexString(keyCode)); + if (ch==GLFW.GLFW_KEY_ESCAPE) { this.minecraft.player.closeContainer(); return true; } else { diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/LibGuiClient.java b/src/main/java/io/github/cottonmc/cotton/gui/client/LibGuiClient.java index 985cb2d..b06369a 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/LibGuiClient.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/LibGuiClient.java @@ -6,6 +6,7 @@ import blue.endless.jankson.JsonObject; import io.github.cottonmc.jankson.JanksonFactory; import net.fabricmc.api.ClientModInitializer; import net.fabricmc.loader.api.FabricLoader; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java b/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java index 31ab670..3377b2c 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java @@ -2,11 +2,10 @@ package io.github.cottonmc.cotton.gui.client; import org.lwjgl.opengl.GL11; +import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.systems.RenderSystem; import io.github.cottonmc.cotton.gui.widget.data.Alignment; -import net.minecraft.class_4493.class_4534; -import net.minecraft.class_4493.class_4535; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.render.BufferBuilder; @@ -36,7 +35,7 @@ public class ScreenDrawing { BufferBuilder buffer = tessellator.getBufferBuilder(); RenderSystem.enableBlend(); //GlStateManager.disableTexture2D(); - RenderSystem.blendFuncSeparate(class_4535.SRC_ALPHA, class_4534.ONE_MINUS_SRC_ALPHA, class_4535.ONE, class_4534.ZERO); + RenderSystem.blendFuncSeparate(GlStateManager.class_4535.SRC_ALPHA, GlStateManager.class_4534.ONE_MINUS_SRC_ALPHA, GlStateManager.class_4535.ONE, GlStateManager.class_4534.ZERO); RenderSystem.color4f(r, g, b, 1.0f); buffer.begin(GL11.GL_QUADS, VertexFormats.POSITION_UV); //I thought GL_QUADS was deprecated but okay, sure. buffer.vertex(x, y + height, 0).texture(u1, v2).next(); @@ -83,7 +82,7 @@ public class ScreenDrawing { BufferBuilder buffer = tessellator.getBufferBuilder(); RenderSystem.enableBlend(); RenderSystem.disableTexture(); - RenderSystem.blendFuncSeparate(class_4535.SRC_ALPHA, class_4534.ONE_MINUS_SRC_ALPHA, class_4535.ONE, class_4534.ZERO); + RenderSystem.blendFuncSeparate(GlStateManager.class_4535.SRC_ALPHA, GlStateManager.class_4534.ONE_MINUS_SRC_ALPHA, GlStateManager.class_4535.ONE, GlStateManager.class_4534.ZERO); RenderSystem.color4f(r, g, b, a); buffer.begin(GL11.GL_QUADS, VertexFormats.POSITION); //I thought GL_QUADS was deprecated but okay, sure. buffer.vertex(left, top + height, 0.0D).next(); diff --git a/src/main/java/io/github/cottonmc/cotton/gui/style/StyleEntry.java b/src/main/java/io/github/cottonmc/cotton/gui/style/StyleEntry.java new file mode 100644 index 0000000..0af23ad --- /dev/null +++ b/src/main/java/io/github/cottonmc/cotton/gui/style/StyleEntry.java @@ -0,0 +1,9 @@ +package io.github.cottonmc.cotton.gui.style; + +import java.util.HashMap; + +public class StyleEntry { + private HashMap customEntries = new HashMap<>(); + + +} diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java index d8d5955..cf7e444 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java @@ -8,16 +8,15 @@ import javax.annotation.Nullable; import org.lwjgl.glfw.GLFW; import org.lwjgl.opengl.GL11; +import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.systems.RenderSystem; import io.github.cottonmc.cotton.gui.client.BackgroundPainter; import io.github.cottonmc.cotton.gui.client.ScreenDrawing; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.class_4493; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; -import net.minecraft.client.gl.GlProgramManager; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.render.BufferBuilder; import net.minecraft.client.render.Tessellator; @@ -407,7 +406,7 @@ public class WTextField extends WWidget { RenderSystem.color4f(0.0F, 0.0F, 255.0F, 255.0F); RenderSystem.disableTexture(); RenderSystem.enableColorLogicOp(); - RenderSystem.logicOp(class_4493.LogicOp.OR_REVERSE); + RenderSystem.logicOp(GlStateManager.LogicOp.OR_REVERSE); bufferBuilder_1.begin(GL11.GL_QUADS, VertexFormats.POSITION); bufferBuilder_1.vertex(x, y+height, 0.0D).next(); bufferBuilder_1.vertex(x+width, y+height, 0.0D).next(); -- cgit