Skip to content

Commit

Permalink
Version 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
I-No-oNe committed Jun 5, 2024
1 parent 7a1cce8 commit 37b2d68
Show file tree
Hide file tree
Showing 8 changed files with 153 additions and 89 deletions.
Binary file modified assets/gui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/i_no_am/viewmodel/ViewModel.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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() {
Expand Down Expand Up @@ -80,4 +79,4 @@ public static float getOffRotationY() {
public static float getOffPositionY() {
return off_position_y;
}
}
}
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
211 changes: 138 additions & 73 deletions src/main/resources/assets/viewmodel/improperui/screen.ui
Original file line number Diff line number Diff line change
Expand Up @@ -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%
}
}
}
}

0 comments on commit 37b2d68

Please sign in to comment.