diff --git a/assets/gui.png b/assets/gui.png index 20fa246..edb7b0d 100644 Binary files a/assets/gui.png and b/assets/gui.png differ diff --git a/gradle.properties b/gradle.properties index 6287ec5..d4cd95c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G loader_version=0.15.11 # Mod Properties - mod_version = 4.0-1.20.2-fabric + mod_version = 5.0-1.20.2-fabric maven_group=net.i_no_am.view_model archives_base_name=view-model diff --git a/src/main/java/net/i_no_am/viewmodel/ViewModel.java b/src/main/java/net/i_no_am/viewmodel/ViewModel.java index 72558ae..dabcc6d 100644 --- a/src/main/java/net/i_no_am/viewmodel/ViewModel.java +++ b/src/main/java/net/i_no_am/viewmodel/ViewModel.java @@ -1,12 +1,12 @@ package net.i_no_am.viewmodel; import net.i_no_am.viewmodel.client.Global; -import net.i_no_am.viewmodel.gui.MenuCallbacks; +import net.i_no_am.viewmodel.gui.events.MenuCallbacks; import io.github.itzispyder.improperui.ImproperUIAPI; import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; -import net.i_no_am.viewmodel.util.ViewModelSettings; +import net.i_no_am.viewmodel.config.ViewModelSettings; import net.minecraft.client.option.KeyBinding; import net.minecraft.client.util.InputUtil; import org.lwjgl.glfw.GLFW; diff --git a/src/main/java/net/i_no_am/viewmodel/gui/Config.java b/src/main/java/net/i_no_am/viewmodel/config/Config.java similarity index 96% rename from src/main/java/net/i_no_am/viewmodel/gui/Config.java rename to src/main/java/net/i_no_am/viewmodel/config/Config.java index 4cac2c8..4d7c23b 100644 --- a/src/main/java/net/i_no_am/viewmodel/gui/Config.java +++ b/src/main/java/net/i_no_am/viewmodel/config/Config.java @@ -1,4 +1,4 @@ -package net.i_no_am.viewmodel.gui; +package net.i_no_am.viewmodel.config; import net.i_no_am.viewmodel.client.Global; import io.github.itzispyder.improperui.config.ConfigKey; diff --git a/src/main/java/net/i_no_am/viewmodel/util/ViewModelSettings.java b/src/main/java/net/i_no_am/viewmodel/config/ViewModelSettings.java similarity index 91% rename from src/main/java/net/i_no_am/viewmodel/util/ViewModelSettings.java rename to src/main/java/net/i_no_am/viewmodel/config/ViewModelSettings.java index af51c2b..5d03985 100644 --- a/src/main/java/net/i_no_am/viewmodel/util/ViewModelSettings.java +++ b/src/main/java/net/i_no_am/viewmodel/config/ViewModelSettings.java @@ -1,9 +1,8 @@ -package net.i_no_am.viewmodel.util; - -import net.i_no_am.viewmodel.gui.Config; +package net.i_no_am.viewmodel.config; public class ViewModelSettings { + public static int normal_division = 10; private static float main_rotation_x; private static float main_position_x; private static float main_rotation_z; @@ -20,17 +19,17 @@ public class ViewModelSettings { public static void loadConfigValues() { main_rotation_x = (float) Config.readDouble("main-rotation-x"); - main_position_x = (float) Config.readDouble("main-position-x"); + main_position_x = (float) Config.readDouble("main-position-x") / normal_division; main_rotation_z = (float) Config.readDouble("main-rotation-z"); - main_position_z = (float) Config.readDouble("main-position-z"); + main_position_z = (float) Config.readDouble("main-position-z") / normal_division; main_rotation_y = (float) Config.readDouble("main-rotation-y"); - main_position_y = (float) Config.readDouble("main-position-y"); + main_position_y = (float) Config.readDouble("main-position-y") / normal_division; off_rotation_x = (float) Config.readDouble("off-rotation-x"); - off_position_x = (float) Config.readDouble("off-position-x"); + off_position_x = (float) Config.readDouble("off-position-x") / normal_division; off_rotation_z = (float) Config.readDouble("off-rotation-z"); - off_position_z = (float) Config.readDouble("off-position-z"); + off_position_z = (float) Config.readDouble("off-position-z") / normal_division; off_rotation_y = (float) Config.readDouble("off-rotation-y"); - off_position_y = (float) Config.readDouble("off-position-y"); + off_position_y = (float) Config.readDouble("off-position-y") / normal_division; } public static float getMainRotationX() { @@ -80,4 +79,4 @@ public static float getOffRotationY() { public static float getOffPositionY() { return off_position_y; } -} +} \ No newline at end of file diff --git a/src/main/java/net/i_no_am/viewmodel/gui/MenuCallbacks.java b/src/main/java/net/i_no_am/viewmodel/gui/events/MenuCallbacks.java similarity index 94% rename from src/main/java/net/i_no_am/viewmodel/gui/MenuCallbacks.java rename to src/main/java/net/i_no_am/viewmodel/gui/events/MenuCallbacks.java index 2857d98..4d4b65a 100644 --- a/src/main/java/net/i_no_am/viewmodel/gui/MenuCallbacks.java +++ b/src/main/java/net/i_no_am/viewmodel/gui/events/MenuCallbacks.java @@ -1,4 +1,4 @@ -package net.i_no_am.viewmodel.gui; +package net.i_no_am.viewmodel.gui.events; import io.github.itzispyder.improperui.script.CallbackHandler; import io.github.itzispyder.improperui.script.CallbackListener; diff --git a/src/main/java/net/i_no_am/viewmodel/mixin/MixinHeldItemRenderer.java b/src/main/java/net/i_no_am/viewmodel/mixin/MixinHeldItemRenderer.java index 62f81c5..3a0b6bd 100644 --- a/src/main/java/net/i_no_am/viewmodel/mixin/MixinHeldItemRenderer.java +++ b/src/main/java/net/i_no_am/viewmodel/mixin/MixinHeldItemRenderer.java @@ -1,7 +1,7 @@ package net.i_no_am.viewmodel.mixin; import net.i_no_am.viewmodel.client.Global; -import net.i_no_am.viewmodel.util.ViewModelSettings; +import net.i_no_am.viewmodel.config.ViewModelSettings; import net.minecraft.client.network.AbstractClientPlayerEntity; import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.render.item.HeldItemRenderer; diff --git a/src/main/resources/assets/viewmodel/improperui/screen.ui b/src/main/resources/assets/viewmodel/improperui/screen.ui index 2b1b889..f8fe489 100644 --- a/src/main/resources/assets/viewmodel/improperui/screen.ui +++ b/src/main/resources/assets/viewmodel/improperui/screen.ui @@ -4,131 +4,196 @@ div #background { opacity: 0.1 } -div #main { - size: 300 237 - background-color: black - opacity: 0.6 - border-radius: 5 - shadow-distance: 5 +div #content { + size: 420 200 + background-color: none - center: both + child-align: grid + grid-columns: 2 - div #title { - size: 100% 10 - inner-text: "View model" - text-scale: 1.2 - text-shadow: true - text-color: #0ea13a + center: both +div {} +div #title { + size: 100% 25 text-align: center - background-color: #00000000 - margin-top: 7 - } - div #small-title { - size: 100% 10 - inner-text: "Made By I-No-oNe!" - text-scale: 0.7 - text-shadow: true + text-scale: 2 text-color: green + text-shadow: true + background-color: none + inner-text: "&aView-Model" + center: horizontal +} + div {} + div #I-No-oNe { + size: 100% 10 text-align: center - background-color: #00000000 - margin-top: 18 + text-scale: 0.8 + text-color: green + text-shadow: true + background-color: none + inner-text: "&2Made By I-No-oNe!" + center: horizontal } - div #config { - size: 80% 120% - margin-top: 1% - child-align: grid - grid-columns: 2 - opacity: 0 - margin: 10% - margin-top: 14% - - div { inner-text: "Main Hand Position X axis"; height: 1; margin-top: 0; } - slider -viewmodel:config.properties:main-position-x { + div #panel -right { + margin: 5 + size: 200 140 + background-color: #80000000 + background-clip: margin + border-radius: 3 + shadow-distance: 3 + shadow-color: green + + div #title-shadow { + size: 100% 20 + background-color: none + shadow-distance: 3 + shadow-color: none + opacity: 0.2 + } + + h4 { + inner-text: "Off Hand" + inner-text-prefix: "&a" + text-shadow: true + text-color: orange + margin-top: 6 + center: horizontal + } + + div #settings { + size: 100% + margin-top: 27 + margin-left: 7 + background-color: none + + child-align: grid + grid-columns: 2 + + + div { inner-text: "Position X axis"; height: 0; margin-top: 0; } + slider -viewmodel:config.properties:off-position-x { min: -45 max: 45 val: 0 - width: 95% + width: 75% } - - div { inner-text: "Main Hand Position Y axis"; height: 1; margin-top: 0; } - slider -viewmodel:config.properties:main-position-y { + div { inner-text: "Position Y axis"; height: 0; margin-top: 0; } + slider -viewmodel:config.properties:off-position-y { min: -45 max: 45 val: 0 - width: 95% + width: 75% } - div { inner-text: "Main Hand Position Z axis"; height: 1; margin-top: 0; } - slider -viewmodel:config.properties:main-position-z { + div { inner-text: "Position Z axis"; height: 0; margin-top: 0; } + slider -viewmodel:config.properties:off-position-z { min: -30 max: 30 val: 0 - width: 95% + width: 75% } - div { inner-text: "Main Hand Rotation X axis"; height: 1; margin-top: 0; } - slider -viewmodel:config.properties:main-rotation-x { + div { inner-text: "Rotation X axis"; height: 0; margin-top: 0; } + slider -viewmodel:config.properties:off-rotation-x { min: -70 max: 70 val: 0 - width: 95% + width: 75% } - - - div { inner-text: "Main Hand Rotation Y axis"; height: 1; margin-top: 0; } - slider -viewmodel:config.properties:main-rotation-y { + div { inner-text: "Rotation Y axis"; height: 0; margin-top: 0; } + slider -viewmodel:config.properties:off-rotation-y { min: -60 max: 60 val: 0 - width: 95% + width: 75% } - div { inner-text: "Main Hand Rotation Z axis"; height: 1; margin-top: 0; } - slider -viewmodel:config.properties:main-rotation-z { - min: -45 + div { inner-text: "Rotation Z axis"; height: 0; margin-top: 0; } + slider -viewmodel:config.properties:off-rotation-z { + min: -45 max: 45 val: 0 - width: 95% + width: 75% + } + } +} + + div #panel -left { + margin: 5 + size: 200 140 + background-color: #80000000 + background-clip: margin + border-radius: 3 + shadow-distance: 3 + shadow-color: green + + div #title-shadow { + size: 100% + background-color: none + shadow-distance: 3 + shadow-color: none + opacity: 0.2 } - div { inner-text: "Off Hand Position X axis"; height: 1; margin-top: 0; } - slider -viewmodel:config.properties:off-position-x { + h4 { + inner-text: "Main Hand" + inner-text-prefix: "&a" + text-shadow: true + text-color: green + margin-top: 6 + center: horizontal + } + + div #settings { + size: 100% + margin-top: 27 + margin-left: 7 + background-color: none + + child-align: grid + grid-columns: 2 + + div { inner-text: "Position X axis"; height: 0; margin-top: 0; } + slider -viewmodel:config.properties:main-position-x { min: -45 max: 45 + width: 75% val: 0 - width: 95% } - div { inner-text: "Off Hand Position Y axis"; height: 1; margin-top: 0; } - slider -viewmodel:config.properties:off-position-y { + + div { inner-text: "Position Y axis"; height: 0; margin-top: 0; } + slider -viewmodel:config.properties:main-position-y { min: -45 max: 45 val: 0 - width: 95% + width: 75% } - div { inner-text: "Off Hand Position Z axis"; height: 1; margin-top: 0; } - slider -viewmodel:config.properties:off-position-z { + div { inner-text: "Position Z axis"; height: 0; margin-top: 0; } + slider -viewmodel:config.properties:main-position-z { min: -30 max: 30 val: 0 - width: 95% + width: 75% } - div { inner-text: "Off Hand Rotation X axis"; height: 1; margin-top: 0; } - slider -viewmodel:config.properties:off-rotation-x { + div { inner-text: "Rotation X axis"; height: 0; margin-top: 0; } + slider -viewmodel:config.properties:main-rotation-x { min: -70 max: 70 val: 0 - width: 95% + width: 75% } - div { inner-text: "Off Hand Rotation Y axis"; height: 1; margin-top: 0; } - slider -viewmodel:config.properties:off-rotation-y { + + div { inner-text: "Rotation Y axis"; height: 0; margin-top: 0; } + slider -viewmodel:config.properties:main-rotation-y { min: -60 max: 60 val: 0 - width: 95% + width: 75% } - div { inner-text: "Off Hand Rotation Z axis"; height: 1; margin-top: 0; } - slider -viewmodel:config.properties:off-rotation-z { - min: -45 + div { inner-text: "Rotation Z axis"; height: 0; margin-top: 0; } + slider -viewmodel:config.properties:main-rotation-z { + min: -45 max: 45 val: 0 - width: 95% + width: 75% + } } } } \ No newline at end of file