Using updated config
This commit is contained in:
@@ -13,6 +13,7 @@ import java.util.Map;
|
|||||||
public class ConfigManager {
|
public class ConfigManager {
|
||||||
|
|
||||||
private static final ObjectMapper MAPPER = new ObjectMapper();
|
private static final ObjectMapper MAPPER = new ObjectMapper();
|
||||||
|
private static File configFile;
|
||||||
|
|
||||||
// SINGLE ROOT TREE
|
// SINGLE ROOT TREE
|
||||||
private static final Map<String, Property<?>> ROOT = new LinkedHashMap<>();
|
private static final Map<String, Property<?>> ROOT = new LinkedHashMap<>();
|
||||||
@@ -23,13 +24,21 @@ public class ConfigManager {
|
|||||||
|
|
||||||
private final String[] path;
|
private final String[] path;
|
||||||
|
|
||||||
private File configFile;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a root namespace
|
* Creates a root namespace
|
||||||
*/
|
*/
|
||||||
public ConfigManager(File configFile, String namespace) {
|
public ConfigManager(File configFile, String namespace) {
|
||||||
this.configFile = configFile;
|
ConfigManager.configFile = configFile;
|
||||||
|
this.currentMap = new LinkedHashMap<>();
|
||||||
|
this.path = new String[] { namespace };
|
||||||
|
|
||||||
|
ROOT.put(namespace, Property.namespace(currentMap));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a root namespace
|
||||||
|
*/
|
||||||
|
public ConfigManager(String namespace) {
|
||||||
this.currentMap = new LinkedHashMap<>();
|
this.currentMap = new LinkedHashMap<>();
|
||||||
this.path = new String[] { namespace };
|
this.path = new String[] { namespace };
|
||||||
|
|
||||||
@@ -40,7 +49,6 @@ public class ConfigManager {
|
|||||||
* Creates a sub-namespace inside a parent
|
* Creates a sub-namespace inside a parent
|
||||||
*/
|
*/
|
||||||
public ConfigManager(ConfigManager parent, String namespace) {
|
public ConfigManager(ConfigManager parent, String namespace) {
|
||||||
this.configFile = parent.configFile;
|
|
||||||
this.currentMap = new LinkedHashMap<>();
|
this.currentMap = new LinkedHashMap<>();
|
||||||
|
|
||||||
this.path = new String[parent.path.length + 1];
|
this.path = new String[parent.path.length + 1];
|
||||||
@@ -80,7 +88,7 @@ public class ConfigManager {
|
|||||||
/**
|
/**
|
||||||
* Save entire config
|
* Save entire config
|
||||||
*/
|
*/
|
||||||
public void save() {
|
public static void save() {
|
||||||
|
|
||||||
ObjectNode rootJson = MAPPER.createObjectNode();
|
ObjectNode rootJson = MAPPER.createObjectNode();
|
||||||
saveRecursive(rootJson, ROOT);
|
saveRecursive(rootJson, ROOT);
|
||||||
|
|||||||
@@ -271,15 +271,14 @@ public class Property<T> {
|
|||||||
|
|
||||||
// ---------- Keybindings (no SaturnClient) ----------
|
// ---------- Keybindings (no SaturnClient) ----------
|
||||||
|
|
||||||
public boolean isKeyPressed(long windowHandle, boolean screenOpen) {
|
public boolean isKeyPressed() {
|
||||||
|
|
||||||
return (Integer) value != -1 &&
|
return (Integer) value != -1 &&
|
||||||
MinecraftProvider.PROVIDER.isKeyPressed((Integer) value) && !screenOpen;
|
MinecraftProvider.PROVIDER.isKeyPressed((Integer) value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean wasKeyPressed(long windowHandle, boolean screenOpen) {
|
public boolean wasKeyPressed() {
|
||||||
|
boolean pressed = isKeyPressed();
|
||||||
boolean pressed = isKeyPressed(windowHandle, screenOpen);
|
|
||||||
|
|
||||||
boolean result = pressed && !wasPressedLastTick;
|
boolean result = pressed && !wasPressedLastTick;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ package org.saturnclient.cosmetics.cloak;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.client.player.SaturnPlayer;
|
import org.saturnclient.saturnclient.client.player.SaturnPlayer;
|
||||||
import org.saturnclient.saturnclient.config.Config;
|
import org.saturnclient.config.Config;
|
||||||
|
|
||||||
import net.minecraft.client.render.OverlayTexture;
|
import net.minecraft.client.render.OverlayTexture;
|
||||||
import net.minecraft.client.render.RenderLayer;
|
import net.minecraft.client.render.RenderLayer;
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package org.saturnclient.modules;
|
|||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property.NamedProperty;
|
import org.saturnclient.config.manager.Property.NamedProperty;
|
||||||
|
|
||||||
public class ModDimensions {
|
public class ModDimensions {
|
||||||
public Property<Integer> x = Property.integer(0);
|
public Property<Integer> x = Property.integer(0);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package org.saturnclient.modules;
|
package org.saturnclient.modules;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.manager.ConfigManager;
|
import org.saturnclient.config.manager.ConfigManager;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property.NamedProperty;
|
import org.saturnclient.config.manager.Property.NamedProperty;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Textures;
|
import org.saturnclient.ui.resources.Textures;
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import org.saturnclient.modules.ModDimensions;
|
|||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
import org.saturnclient.modules.ModuleDetails;
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|
||||||
import net.minecraft.entity.EquipmentSlot;
|
import net.minecraft.entity.EquipmentSlot;
|
||||||
|
|||||||
@@ -5,18 +5,18 @@ import java.util.Objects;
|
|||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
import org.saturnclient.modules.ModuleDetails;
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
|
||||||
public class AutoSprint extends Module {
|
public class AutoSprint extends Module {
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
|
|
||||||
public AutoSprint() {
|
public AutoSprint() {
|
||||||
super(
|
super(
|
||||||
new ModuleDetails("Auto Sprint", "sprint")
|
new ModuleDetails("Auto Sprint", "sprint")
|
||||||
.description("Makes the player always sprint")
|
.description("Makes the player always sprint")
|
||||||
.tags("Movement")
|
.tags("Movement")
|
||||||
.version("v0.1.0"),
|
.version("v0.1.0"),
|
||||||
enabled.named("Enabled"));
|
enabled.named("Enabled"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -25,10 +25,10 @@ public class AutoSprint extends Module {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (SaturnClient.client.options.forwardKey.isPressed()
|
if (SaturnClient.client.options.forwardKey.isPressed()
|
||||||
&& !SaturnClient.client.options.backKey.isPressed()
|
&& !SaturnClient.client.options.backKey.isPressed()
|
||||||
&& !SaturnClient.client.player.isSneaking()
|
&& !SaturnClient.client.player.isSneaking()
|
||||||
&& !SaturnClient.client.player.horizontalCollision
|
&& !SaturnClient.client.player.horizontalCollision
|
||||||
&& !SaturnClient.client.player.isUsingItem()) {
|
&& !SaturnClient.client.player.isUsingItem()) {
|
||||||
|
|
||||||
Objects.requireNonNull(SaturnClient.client.player).setSprinting(true);
|
Objects.requireNonNull(SaturnClient.client.player).setSprinting(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import org.saturnclient.modules.HudMod;
|
|||||||
import org.saturnclient.modules.ModDimensions;
|
import org.saturnclient.modules.ModDimensions;
|
||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
import org.saturnclient.modules.ModuleDetails;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Fonts;
|
import org.saturnclient.ui.resources.Fonts;
|
||||||
|
|
||||||
@@ -19,14 +19,13 @@ public class Clock extends Module implements HudMod {
|
|||||||
|
|
||||||
public Clock() {
|
public Clock() {
|
||||||
super(new ModuleDetails("Clock", "clock")
|
super(new ModuleDetails("Clock", "clock")
|
||||||
.description("Displays the current real-world time")
|
.description("Displays the current real-world time")
|
||||||
.version("v0.1.0")
|
.version("v0.1.0")
|
||||||
.tags("Utility"),
|
.tags("Utility"),
|
||||||
enabled.named("Enabled"),
|
enabled.named("Enabled"),
|
||||||
format.named("Format"),
|
format.named("Format"),
|
||||||
seconds.named("Show seconds"),
|
seconds.named("Show seconds"),
|
||||||
dimensions.prop()
|
dimensions.prop());
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -45,17 +44,23 @@ public class Clock extends Module implements HudMod {
|
|||||||
|
|
||||||
switch (format.value) {
|
switch (format.value) {
|
||||||
case 0:
|
case 0:
|
||||||
if (seconds.value) { text = currentTime.format(DateTimeFormatter.ofPattern("HH:mm:ss")); }
|
if (seconds.value) {
|
||||||
else { text = currentTime.format(DateTimeFormatter.ofPattern("HH:mm")); }
|
text = currentTime.format(DateTimeFormatter.ofPattern("HH:mm:ss"));
|
||||||
|
} else {
|
||||||
|
text = currentTime.format(DateTimeFormatter.ofPattern("HH:mm"));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (seconds.value) { text = currentTime.format(DateTimeFormatter.ofPattern("hh:mm:ss a")); }
|
if (seconds.value) {
|
||||||
else { text = currentTime.format(DateTimeFormatter.ofPattern("hh:mm a")); }
|
text = currentTime.format(DateTimeFormatter.ofPattern("hh:mm:ss a"));
|
||||||
|
} else {
|
||||||
|
text = currentTime.format(DateTimeFormatter.ofPattern("hh:mm a"));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
scope.drawText(text,
|
scope.drawText(text,
|
||||||
0, 0, dimensions.font.value, dimensions.fgColor.value);
|
0, 0, dimensions.font.value, dimensions.fgColor.value);
|
||||||
dimensions.width = Fonts.getWidth(text, dimensions.font.value);
|
dimensions.width = Fonts.getWidth(text, dimensions.font.value);
|
||||||
dimensions.height = 18 * text.split("\n").length;
|
dimensions.height = 18 * text.split("\n").length;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import org.saturnclient.modules.ModDimensions;
|
|||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
import org.saturnclient.modules.ModuleDetails;
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Fonts;
|
import org.saturnclient.ui.resources.Fonts;
|
||||||
|
|
||||||
@@ -13,18 +13,18 @@ import net.minecraft.util.math.Vec3d;
|
|||||||
|
|
||||||
public class Coordinates extends Module implements HudMod {
|
public class Coordinates extends Module implements HudMod {
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
private static Property<Integer> displayMethod = Property.select(0, "Flat", "Flat annotated", "Newline", "Newline annotated");
|
private static Property<Integer> displayMethod = Property.select(0, "Flat", "Flat annotated", "Newline",
|
||||||
|
"Newline annotated");
|
||||||
private static ModDimensions dimensions = new ModDimensions(40, 18);
|
private static ModDimensions dimensions = new ModDimensions(40, 18);
|
||||||
|
|
||||||
public Coordinates() {
|
public Coordinates() {
|
||||||
super(new ModuleDetails("Coordinates", "coords")
|
super(new ModuleDetails("Coordinates", "coords")
|
||||||
.description("Displays your current coordinates")
|
.description("Displays your current coordinates")
|
||||||
.version("v0.1.0")
|
.version("v0.1.0")
|
||||||
.tags("Utility"),
|
.tags("Utility"),
|
||||||
enabled.named("Enabled"),
|
enabled.named("Enabled"),
|
||||||
displayMethod.named("Display Method"),
|
displayMethod.named("Display Method"),
|
||||||
dimensions.prop()
|
dimensions.prop());
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -53,7 +53,7 @@ public class Coordinates extends Module implements HudMod {
|
|||||||
}
|
}
|
||||||
String text = String.format(f, x, y, z);
|
String text = String.format(f, x, y, z);
|
||||||
scope.drawText(text,
|
scope.drawText(text,
|
||||||
0, 0, dimensions.font.value, dimensions.fgColor.value);
|
0, 0, dimensions.font.value, dimensions.fgColor.value);
|
||||||
dimensions.width = Fonts.getWidth(text, dimensions.font.value);
|
dimensions.width = Fonts.getWidth(text, dimensions.font.value);
|
||||||
dimensions.height = 18 * text.split("\n").length;
|
dimensions.height = 18 * text.split("\n").length;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package org.saturnclient.modules.mods;
|
|||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
import org.saturnclient.modules.ModuleDetails;
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Textures;
|
import org.saturnclient.ui.resources.Textures;
|
||||||
|
|
||||||
@@ -14,11 +14,11 @@ public class Crosshair extends Module {
|
|||||||
|
|
||||||
public Crosshair() {
|
public Crosshair() {
|
||||||
super(
|
super(
|
||||||
new ModuleDetails("Crosshair", "crosshair")
|
new ModuleDetails("Crosshair", "crosshair")
|
||||||
.description("Changes the crosshair if you're aiming at a entity")
|
.description("Changes the crosshair if you're aiming at a entity")
|
||||||
.tags("Visuals", "Utility")
|
.tags("Visuals", "Utility")
|
||||||
.version("v0.1.0"),
|
.version("v0.1.0"),
|
||||||
enabled.named("Enabled"));
|
enabled.named("Enabled"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import org.saturnclient.modules.ModDimensions;
|
|||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
import org.saturnclient.modules.ModuleDetails;
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Fonts;
|
import org.saturnclient.ui.resources.Fonts;
|
||||||
|
|
||||||
@@ -16,12 +16,11 @@ public class DayCounter extends Module implements HudMod {
|
|||||||
|
|
||||||
public DayCounter() {
|
public DayCounter() {
|
||||||
super(new ModuleDetails("DayCounter", "day")
|
super(new ModuleDetails("DayCounter", "day")
|
||||||
.description("Displays the number of days that have passed")
|
.description("Displays the number of days that have passed")
|
||||||
.version("v0.1.0")
|
.version("v0.1.0")
|
||||||
.tags("Utility"),
|
.tags("Utility"),
|
||||||
enabled.named("Enabled"),
|
enabled.named("Enabled"),
|
||||||
dimensions.prop()
|
dimensions.prop());
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -38,7 +37,7 @@ public class DayCounter extends Module implements HudMod {
|
|||||||
public void renderDay(long day, RenderScope scope) {
|
public void renderDay(long day, RenderScope scope) {
|
||||||
String text = "Day: " + day;
|
String text = "Day: " + day;
|
||||||
scope.drawText(text,
|
scope.drawText(text,
|
||||||
0, 0, dimensions.font.value, dimensions.fgColor.value);
|
0, 0, dimensions.font.value, dimensions.fgColor.value);
|
||||||
dimensions.width = Fonts.getWidth(text, dimensions.font.value);
|
dimensions.width = Fonts.getWidth(text, dimensions.font.value);
|
||||||
dimensions.height = 18 * text.split("\n").length;
|
dimensions.height = 18 * text.split("\n").length;
|
||||||
}
|
}
|
||||||
@@ -58,4 +57,3 @@ public class DayCounter extends Module implements HudMod {
|
|||||||
enabled.value = e;
|
enabled.value = e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import org.saturnclient.modules.ModDimensions;
|
|||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
import org.saturnclient.modules.ModuleDetails;
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Fonts;
|
import org.saturnclient.ui.resources.Fonts;
|
||||||
|
|
||||||
@@ -15,11 +15,11 @@ public class Fps extends Module implements HudMod {
|
|||||||
|
|
||||||
public Fps() {
|
public Fps() {
|
||||||
super(new ModuleDetails("FPS Display", "fps")
|
super(new ModuleDetails("FPS Display", "fps")
|
||||||
.description("Displays current FPS")
|
.description("Displays current FPS")
|
||||||
.version("v0.1.0")
|
.version("v0.1.0")
|
||||||
.tags("Utility"),
|
.tags("Utility"),
|
||||||
enabled.named("Enabled"),
|
enabled.named("Enabled"),
|
||||||
dimensions.prop());
|
dimensions.prop());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import org.lwjgl.glfw.GLFW;
|
|||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
import org.saturnclient.modules.ModuleDetails;
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
|
||||||
import net.minecraft.client.option.Perspective;
|
import net.minecraft.client.option.Perspective;
|
||||||
|
|
||||||
@@ -17,14 +17,13 @@ public class Freelook extends Module {
|
|||||||
|
|
||||||
public Freelook() {
|
public Freelook() {
|
||||||
super(
|
super(
|
||||||
new ModuleDetails("Freelook", "freelook")
|
new ModuleDetails("Freelook", "freelook")
|
||||||
.description("Allows you to look around freely without moving your character")
|
.description("Allows you to look around freely without moving your character")
|
||||||
.tags("Movement", "Camera")
|
.tags("Movement", "Camera")
|
||||||
.version("0.1.0"),
|
.version("0.1.0"),
|
||||||
enabled.named("Enabled"),
|
enabled.named("Enabled"),
|
||||||
toggle.named("Toggle freelook"),
|
toggle.named("Toggle freelook"),
|
||||||
freelookKey.named("Freelook Keybinding")
|
freelookKey.named("Freelook Keybinding"));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package org.saturnclient.modules.mods;
|
|||||||
|
|
||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
import org.saturnclient.modules.ModuleDetails;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
|
||||||
public class Fullbright extends Module {
|
public class Fullbright extends Module {
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
@@ -10,12 +10,12 @@ public class Fullbright extends Module {
|
|||||||
|
|
||||||
public Fullbright() {
|
public Fullbright() {
|
||||||
super(
|
super(
|
||||||
new ModuleDetails("Fullbright", "fullbright")
|
new ModuleDetails("Fullbright", "fullbright")
|
||||||
.description("Allows you to see in the dark")
|
.description("Allows you to see in the dark")
|
||||||
.tags("Camera")
|
.tags("Camera")
|
||||||
.version("v0.1.0"),
|
.version("v0.1.0"),
|
||||||
enabled.named("Enabled"),
|
enabled.named("Enabled"),
|
||||||
brightness.named("Brightness %"));
|
brightness.named("Brightness %"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import org.saturnclient.modules.ModDimensions;
|
|||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
import org.saturnclient.modules.ModuleDetails;
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Fonts;
|
import org.saturnclient.ui.resources.Fonts;
|
||||||
|
|
||||||
@@ -22,14 +22,13 @@ public class HealthDisplay extends Module implements HudMod {
|
|||||||
|
|
||||||
public HealthDisplay() {
|
public HealthDisplay() {
|
||||||
super(new ModuleDetails("Health display", "health")
|
super(new ModuleDetails("Health display", "health")
|
||||||
.description("Displays your current health")
|
.description("Displays your current health")
|
||||||
.version("v0.1.0")
|
.version("v0.1.0")
|
||||||
.tags("Utility"),
|
.tags("Utility"),
|
||||||
enabled.named("Enabled"),
|
enabled.named("Enabled"),
|
||||||
displayMode.named("Display mode"),
|
displayMode.named("Display mode"),
|
||||||
decimals.named("Decimals"),
|
decimals.named("Decimals"),
|
||||||
dimensions.prop()
|
dimensions.prop());
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -63,7 +62,7 @@ public class HealthDisplay extends Module implements HudMod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
scope.drawText(text,
|
scope.drawText(text,
|
||||||
0, 0, dimensions.font.value, dimensions.fgColor.value);
|
0, 0, dimensions.font.value, dimensions.fgColor.value);
|
||||||
dimensions.width = Fonts.getWidth(text, dimensions.font.value);
|
dimensions.width = Fonts.getWidth(text, dimensions.font.value);
|
||||||
dimensions.height = 18 * text.split("\n").length;
|
dimensions.height = 18 * text.split("\n").length;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import org.saturnclient.modules.Module;
|
|||||||
import org.saturnclient.modules.HudMod;
|
import org.saturnclient.modules.HudMod;
|
||||||
import org.saturnclient.modules.ModDimensions;
|
import org.saturnclient.modules.ModDimensions;
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
import org.saturnclient.modules.ModuleDetails;
|
||||||
|
|
||||||
@@ -40,8 +40,7 @@ public class Keystrokes extends Module implements HudMod {
|
|||||||
showSpace.named("Show space"),
|
showSpace.named("Show space"),
|
||||||
dimensions.prop(),
|
dimensions.prop(),
|
||||||
clickFg.named("Clicked fg"),
|
clickFg.named("Clicked fg"),
|
||||||
clickBg.named("Clicked bg")
|
clickBg.named("Clicked bg"));
|
||||||
);
|
|
||||||
|
|
||||||
dimensions.renderBackground = false;
|
dimensions.renderBackground = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package org.saturnclient.modules.mods;
|
|||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
import org.saturnclient.modules.ModuleDetails;
|
||||||
import org.saturnclient.modules.mods.utils.HealthRenderState;
|
import org.saturnclient.modules.mods.utils.HealthRenderState;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
|
||||||
import net.minecraft.client.render.entity.state.LivingEntityRenderState;
|
import net.minecraft.client.render.entity.state.LivingEntityRenderState;
|
||||||
|
|
||||||
@@ -20,65 +20,62 @@ public class Nametags extends Module {
|
|||||||
private static Property<Integer> unit = Property.select(0, "Health", "Hearts");
|
private static Property<Integer> unit = Property.select(0, "Health", "Hearts");
|
||||||
private static Property<Integer> format = Property.select(0, "Value", "Value / Total", "%");
|
private static Property<Integer> format = Property.select(0, "Value", "Value / Total", "%");
|
||||||
private static Property<Integer> nameColor = Property.select(15,
|
private static Property<Integer> nameColor = Property.select(15,
|
||||||
"Black",
|
"Black",
|
||||||
"Dark Blue",
|
"Dark Blue",
|
||||||
"Dark Green",
|
"Dark Green",
|
||||||
"Dark Aqua",
|
"Dark Aqua",
|
||||||
"Dark Red",
|
"Dark Red",
|
||||||
"Dark Purple",
|
"Dark Purple",
|
||||||
"Gold",
|
"Gold",
|
||||||
"Gray",
|
"Gray",
|
||||||
"Dark Gray",
|
"Dark Gray",
|
||||||
"Blue",
|
"Blue",
|
||||||
"Green",
|
"Green",
|
||||||
"Aqua",
|
"Aqua",
|
||||||
"Red",
|
"Red",
|
||||||
"Light Purple",
|
"Light Purple",
|
||||||
"Yellow",
|
"Yellow",
|
||||||
"White"
|
"White");
|
||||||
);
|
|
||||||
private static Property<Integer> healthColor = Property.select(12,
|
private static Property<Integer> healthColor = Property.select(12,
|
||||||
"Black",
|
"Black",
|
||||||
"Dark Blue",
|
"Dark Blue",
|
||||||
"Dark Green",
|
"Dark Green",
|
||||||
"Dark Aqua",
|
"Dark Aqua",
|
||||||
"Dark Red",
|
"Dark Red",
|
||||||
"Dark Purple",
|
"Dark Purple",
|
||||||
"Gold",
|
"Gold",
|
||||||
"Gray",
|
"Gray",
|
||||||
"Dark Gray",
|
"Dark Gray",
|
||||||
"Blue",
|
"Blue",
|
||||||
"Green",
|
"Green",
|
||||||
"Aqua",
|
"Aqua",
|
||||||
"Red",
|
"Red",
|
||||||
"Light Purple",
|
"Light Purple",
|
||||||
"Yellow",
|
"Yellow",
|
||||||
"White"
|
"White");
|
||||||
);
|
|
||||||
|
|
||||||
private static final String[] COLOR_CODES = {
|
private static final String[] COLOR_CODES = {
|
||||||
"§0", "§1", "§2", "§3", "§4", "§5", "§6", "§7",
|
"§0", "§1", "§2", "§3", "§4", "§5", "§6", "§7",
|
||||||
"§8", "§9", "§a", "§b", "§c", "§d", "§e", "§f"
|
"§8", "§9", "§a", "§b", "§c", "§d", "§e", "§f"
|
||||||
};
|
};
|
||||||
|
|
||||||
public Nametags() {
|
public Nametags() {
|
||||||
super(
|
super(
|
||||||
new ModuleDetails("Nametags", "nametags")
|
new ModuleDetails("Nametags", "nametags")
|
||||||
.description("Allows you to modify entity nametags")
|
.description("Allows you to modify entity nametags")
|
||||||
.tags("Camera", "Utility")
|
.tags("Camera", "Utility")
|
||||||
.version("0.1.0"),
|
.version("0.1.0"),
|
||||||
enabled.named("Enabled"),
|
enabled.named("Enabled"),
|
||||||
healthDisplay.named("Display health"),
|
healthDisplay.named("Display health"),
|
||||||
players.named("Players"),
|
players.named("Players"),
|
||||||
hostile.named("Hostile"),
|
hostile.named("Hostile"),
|
||||||
passive.named("Passive"),
|
passive.named("Passive"),
|
||||||
heartEmoji.named("Heart emoji"),
|
heartEmoji.named("Heart emoji"),
|
||||||
obfuscate.named("Obfuscate enemy names"),
|
obfuscate.named("Obfuscate enemy names"),
|
||||||
unit.named("Unit"),
|
unit.named("Unit"),
|
||||||
format.named("Format"),
|
format.named("Format"),
|
||||||
nameColor.named("Name color"),
|
nameColor.named("Name color"),
|
||||||
healthColor.named("Health color")
|
healthColor.named("Health color"));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -86,16 +83,18 @@ public class Nametags extends Module {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getHealthString(LivingEntityRenderState state, HealthRenderState hrs, float health, float maxHealth) {
|
public static String getHealthString(LivingEntityRenderState state, HealthRenderState hrs, float health,
|
||||||
|
float maxHealth) {
|
||||||
String ret = "";
|
String ret = "";
|
||||||
|
|
||||||
switch (format.value){
|
switch (format.value) {
|
||||||
case 0: // value
|
case 0: // value
|
||||||
ret = String.format("%.1f", health / (unit.value + 1));
|
ret = String.format("%.1f", health / (unit.value + 1));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1: // value / total
|
case 1: // value / total
|
||||||
ret = String.format("%.1f", health / (unit.value + 1)) + " / " + String.format("%.1f", maxHealth / (unit.value + 1));
|
ret = String.format("%.1f", health / (unit.value + 1)) + " / "
|
||||||
|
+ String.format("%.1f", maxHealth / (unit.value + 1));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2: // %
|
case 2: // %
|
||||||
@@ -106,20 +105,28 @@ public class Nametags extends Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getNametagString(LivingEntityRenderState state) {
|
public static String getNametagString(LivingEntityRenderState state) {
|
||||||
if (state.customName == null) return null;
|
if (state.customName == null)
|
||||||
if (!healthDisplay.value) return state.customName.getString(); // name only
|
return null;
|
||||||
if (!(state instanceof HealthRenderState hrs)) return null;
|
if (!healthDisplay.value)
|
||||||
|
return state.customName.getString(); // name only
|
||||||
|
if (!(state instanceof HealthRenderState hrs))
|
||||||
|
return null;
|
||||||
|
|
||||||
float health = hrs.saturn$getHealth();
|
float health = hrs.saturn$getHealth();
|
||||||
float maxHealth = hrs.saturn$getMaxHealth();
|
float maxHealth = hrs.saturn$getMaxHealth();
|
||||||
|
|
||||||
HealthRenderState.EntityType type = hrs.saturn$getEntityType();
|
HealthRenderState.EntityType type = hrs.saturn$getEntityType();
|
||||||
if (type == HealthRenderState.EntityType.PASSIVE && !passive.value) return null;
|
if (type == HealthRenderState.EntityType.PASSIVE && !passive.value)
|
||||||
if (type == HealthRenderState.EntityType.HOSTILE && !hostile.value) return null;
|
return null;
|
||||||
if (type == HealthRenderState.EntityType.PLAYER && !players.value) return null;
|
if (type == HealthRenderState.EntityType.HOSTILE && !hostile.value)
|
||||||
if (type == HealthRenderState.EntityType.OTHER) return null;
|
return null;
|
||||||
|
if (type == HealthRenderState.EntityType.PLAYER && !players.value)
|
||||||
|
return null;
|
||||||
|
if (type == HealthRenderState.EntityType.OTHER)
|
||||||
|
return null;
|
||||||
|
|
||||||
if (health < 0f || maxHealth < 0f || health > maxHealth) return null;
|
if (health < 0f || maxHealth < 0f || health > maxHealth)
|
||||||
|
return null;
|
||||||
|
|
||||||
String hpColor = COLOR_CODES[healthColor.value];
|
String hpColor = COLOR_CODES[healthColor.value];
|
||||||
String color = COLOR_CODES[nameColor.value];
|
String color = COLOR_CODES[nameColor.value];
|
||||||
@@ -127,7 +134,8 @@ public class Nametags extends Module {
|
|||||||
String obf = obfuscate.value ? "§k" : "";
|
String obf = obfuscate.value ? "§k" : "";
|
||||||
String reset = "§r";
|
String reset = "§r";
|
||||||
|
|
||||||
String ret = color + obf + state.customName.getString() + reset + " " + hpColor + getHealthString(state, hrs, health, maxHealth) + heart;
|
String ret = color + obf + state.customName.getString() + reset + " " + hpColor
|
||||||
|
+ getHealthString(state, hrs, health, maxHealth) + heart;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package org.saturnclient.modules.mods;
|
|||||||
|
|
||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
import org.saturnclient.modules.ModuleDetails;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
|
||||||
public class NoFog extends Module {
|
public class NoFog extends Module {
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
@@ -10,12 +10,12 @@ public class NoFog extends Module {
|
|||||||
|
|
||||||
public NoFog() {
|
public NoFog() {
|
||||||
super(
|
super(
|
||||||
new ModuleDetails("No Fog", "nofog")
|
new ModuleDetails("No Fog", "nofog")
|
||||||
.description("Stops fog from rendering")
|
.description("Stops fog from rendering")
|
||||||
.tags("Camera")
|
.tags("Camera")
|
||||||
.version("v0.1.0"),
|
.version("v0.1.0"),
|
||||||
enabled.named("Enabled"),
|
enabled.named("Enabled"),
|
||||||
liquids.named("See through liquids"));
|
liquids.named("See through liquids"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import org.saturnclient.modules.HudMod;
|
|||||||
import org.saturnclient.modules.ModDimensions;
|
import org.saturnclient.modules.ModDimensions;
|
||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
import org.saturnclient.modules.ModuleDetails;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Fonts;
|
import org.saturnclient.ui.resources.Fonts;
|
||||||
|
|
||||||
@@ -17,11 +17,11 @@ public class Ping extends Module implements HudMod {
|
|||||||
|
|
||||||
public Ping() {
|
public Ping() {
|
||||||
super(new ModuleDetails("Ping Display", "ping")
|
super(new ModuleDetails("Ping Display", "ping")
|
||||||
.description("Displays ping")
|
.description("Displays ping")
|
||||||
.version("v0.1.0")
|
.version("v0.1.0")
|
||||||
.tags("Utility"),
|
.tags("Utility"),
|
||||||
enabled.named("Enabled"),
|
enabled.named("Enabled"),
|
||||||
dimensions.prop());
|
dimensions.prop());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import org.saturnclient.modules.ModDimensions;
|
|||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
import org.saturnclient.modules.ModuleDetails;
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Fonts;
|
import org.saturnclient.ui.resources.Fonts;
|
||||||
|
|
||||||
@@ -24,15 +24,14 @@ public class Speedometer extends Module implements HudMod {
|
|||||||
|
|
||||||
public Speedometer() {
|
public Speedometer() {
|
||||||
super(new ModuleDetails("Speedometer", "speed")
|
super(new ModuleDetails("Speedometer", "speed")
|
||||||
.description("Displays your current speed")
|
.description("Displays your current speed")
|
||||||
.version("v0.1.0")
|
.version("v0.1.0")
|
||||||
.tags("Utility"),
|
.tags("Utility"),
|
||||||
enabled.named("Enabled"),
|
enabled.named("Enabled"),
|
||||||
axis.named("Speed type"),
|
axis.named("Speed type"),
|
||||||
unitText.named("Unit text"),
|
unitText.named("Unit text"),
|
||||||
speedText.named("Show speed text"),
|
speedText.named("Show speed text"),
|
||||||
dimensions.prop()
|
dimensions.prop());
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -92,7 +91,7 @@ public class Speedometer extends Module implements HudMod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
scope.drawText(text,
|
scope.drawText(text,
|
||||||
0, 0, dimensions.font.value, dimensions.fgColor.value);
|
0, 0, dimensions.font.value, dimensions.fgColor.value);
|
||||||
dimensions.width = Fonts.getWidth(text, dimensions.font.value);
|
dimensions.width = Fonts.getWidth(text, dimensions.font.value);
|
||||||
dimensions.height = 18 * text.split("\n").length;
|
dimensions.height = 18 * text.split("\n").length;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import org.saturnclient.modules.ModDimensions;
|
|||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
import org.saturnclient.modules.ModuleDetails;
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|
||||||
import net.minecraft.client.resource.language.I18n;
|
import net.minecraft.client.resource.language.I18n;
|
||||||
@@ -25,19 +25,21 @@ public class StatusEffects extends Module implements HudMod {
|
|||||||
private static ModDimensions dimensions = new ModDimensions(60, 0);
|
private static ModDimensions dimensions = new ModDimensions(60, 0);
|
||||||
|
|
||||||
private final StatusEffectInstance[] dummyEffects = {
|
private final StatusEffectInstance[] dummyEffects = {
|
||||||
new StatusEffectInstance(Registries.STATUS_EFFECT.getEntry(Identifier.ofVanilla("speed")).get(), 12000, 2),
|
new StatusEffectInstance(Registries.STATUS_EFFECT.getEntry(Identifier.ofVanilla("speed")).get(), 12000, 2),
|
||||||
new StatusEffectInstance(Registries.STATUS_EFFECT.getEntry(Identifier.ofVanilla("strength")).get(), 12000, 2),
|
new StatusEffectInstance(Registries.STATUS_EFFECT.getEntry(Identifier.ofVanilla("strength")).get(), 12000,
|
||||||
new StatusEffectInstance(Registries.STATUS_EFFECT.getEntry(Identifier.ofVanilla("fire_resistance")).get(), 12000, 2),
|
2),
|
||||||
|
new StatusEffectInstance(Registries.STATUS_EFFECT.getEntry(Identifier.ofVanilla("fire_resistance")).get(),
|
||||||
|
12000, 2),
|
||||||
};
|
};
|
||||||
|
|
||||||
public StatusEffects() {
|
public StatusEffects() {
|
||||||
super(new ModuleDetails("Status effects", "effect")
|
super(new ModuleDetails("Status effects", "effect")
|
||||||
.description("Displays status effects")
|
.description("Displays status effects")
|
||||||
.version("v0.1.0")
|
.version("v0.1.0")
|
||||||
.tags("Utility"),
|
.tags("Utility"),
|
||||||
|
|
||||||
enabled.named("Enabled"),
|
enabled.named("Enabled"),
|
||||||
dimensions.prop());
|
dimensions.prop());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderEffects(RenderScope scope, Iterable<StatusEffectInstance> effects) {
|
private void renderEffects(RenderScope scope, Iterable<StatusEffectInstance> effects) {
|
||||||
@@ -68,25 +70,26 @@ public class StatusEffects extends Module implements HudMod {
|
|||||||
renderEffects(scope, Arrays.asList(dummyEffects));
|
renderEffects(scope, Arrays.asList(dummyEffects));
|
||||||
}
|
}
|
||||||
|
|
||||||
// This code was from: https://github.com/magicus/statuseffecttimer/blob/master/src/main/java/se/icus/mag/statuseffecttimer/mixin/StatusEffectTimerMixin.java
|
// This code was from:
|
||||||
|
// https://github.com/magicus/statuseffecttimer/blob/master/src/main/java/se/icus/mag/statuseffecttimer/mixin/StatusEffectTimerMixin.java
|
||||||
private String getDurationAsString(StatusEffectInstance statusEffectInstance) {
|
private String getDurationAsString(StatusEffectInstance statusEffectInstance) {
|
||||||
if (statusEffectInstance.isInfinite()) {
|
if (statusEffectInstance.isInfinite()) {
|
||||||
return I18n.translate("effect.duration.infinite");
|
return I18n.translate("effect.duration.infinite");
|
||||||
}
|
}
|
||||||
|
|
||||||
int ticks = MathHelper.floor((float) statusEffectInstance.getDuration());
|
int ticks = MathHelper.floor((float) statusEffectInstance.getDuration());
|
||||||
int totalSeconds = ticks / 20;
|
int totalSeconds = ticks / 20;
|
||||||
|
|
||||||
if (totalSeconds >= 3600) {
|
if (totalSeconds >= 3600) {
|
||||||
return totalSeconds / 3600 + "h";
|
return totalSeconds / 3600 + "h";
|
||||||
} else if (totalSeconds >= 60) {
|
} else if (totalSeconds >= 60) {
|
||||||
int minutes = totalSeconds / 60;
|
int minutes = totalSeconds / 60;
|
||||||
int seconds = totalSeconds % 60;
|
int seconds = totalSeconds % 60;
|
||||||
return String.format("%d:%02d", minutes, seconds);
|
return String.format("%d:%02d", minutes, seconds);
|
||||||
} else {
|
} else {
|
||||||
return String.valueOf(totalSeconds) + "s";
|
return String.valueOf(totalSeconds) + "s";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ModDimensions getDimensions() {
|
public ModDimensions getDimensions() {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import org.saturnclient.modules.HudMod;
|
|||||||
import org.saturnclient.modules.ModDimensions;
|
import org.saturnclient.modules.ModDimensions;
|
||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
import org.saturnclient.modules.ModuleDetails;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Fonts;
|
import org.saturnclient.ui.resources.Fonts;
|
||||||
|
|
||||||
@@ -26,12 +26,11 @@ public class Tps extends Module implements HudMod {
|
|||||||
|
|
||||||
public Tps() {
|
public Tps() {
|
||||||
super(new ModuleDetails("TPS Display", "tps")
|
super(new ModuleDetails("TPS Display", "tps")
|
||||||
.description("Displays the TPS")
|
.description("Displays the TPS")
|
||||||
.version("v0.1.0")
|
.version("v0.1.0")
|
||||||
.tags("Utility"),
|
.tags("Utility"),
|
||||||
enabled.named("Enabled"),
|
enabled.named("Enabled"),
|
||||||
dimensions.prop()
|
dimensions.prop());
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onTimePacket(long worldAge) {
|
public static void onTimePacket(long worldAge) {
|
||||||
@@ -50,7 +49,8 @@ public class Tps extends Module implements HudMod {
|
|||||||
samplesFilled = Math.min(samplesFilled + 1, SAMPLE_COUNT);
|
samplesFilled = Math.min(samplesFilled + 1, SAMPLE_COUNT);
|
||||||
|
|
||||||
double sum = 0;
|
double sum = 0;
|
||||||
for (int i = 0; i < samplesFilled; i++) sum += samples[i];
|
for (int i = 0; i < samplesFilled; i++)
|
||||||
|
sum += samples[i];
|
||||||
currentTps = sum / samplesFilled;
|
currentTps = sum / samplesFilled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,8 @@ public class Tps extends Module implements HudMod {
|
|||||||
currentTps = 20.0;
|
currentTps = 20.0;
|
||||||
sampleIndex = 0;
|
sampleIndex = 0;
|
||||||
samplesFilled = SAMPLE_COUNT;
|
samplesFilled = SAMPLE_COUNT;
|
||||||
for (int i = 0; i < SAMPLE_COUNT; i++) samples[i] = 20.0;
|
for (int i = 0; i < SAMPLE_COUNT; i++)
|
||||||
|
samples[i] = 20.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package org.saturnclient.modules.mods;
|
|||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
import org.saturnclient.modules.ModuleDetails;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
|
||||||
public class Zoom extends Module {
|
public class Zoom extends Module {
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
@@ -15,15 +15,14 @@ public class Zoom extends Module {
|
|||||||
|
|
||||||
public Zoom() {
|
public Zoom() {
|
||||||
super(
|
super(
|
||||||
new ModuleDetails("Zoom", "zoom")
|
new ModuleDetails("Zoom", "zoom")
|
||||||
.description("Allows you to zoom in for a closer view")
|
.description("Allows you to zoom in for a closer view")
|
||||||
.tags("Camera", "Utility")
|
.tags("Camera", "Utility")
|
||||||
.version("0.1.0"),
|
.version("0.1.0"),
|
||||||
enabled.named("Enabled"),
|
enabled.named("Enabled"),
|
||||||
toggle.named("Toggle zoom"),
|
toggle.named("Toggle zoom"),
|
||||||
zoomKey.named("Zoom Keybinding"),
|
zoomKey.named("Zoom Keybinding"),
|
||||||
zoomLevel.named("Zoom Level")
|
zoomLevel.named("Zoom Level"));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import org.saturnclient.cosmetics.cloak.Cloaks;
|
|||||||
import org.saturnclient.cosmetics.hat.Hats;
|
import org.saturnclient.cosmetics.hat.Hats;
|
||||||
import org.saturnclient.modules.ModManager;
|
import org.saturnclient.modules.ModManager;
|
||||||
import org.saturnclient.saturnclient.client.ServiceClient;
|
import org.saturnclient.saturnclient.client.ServiceClient;
|
||||||
import org.saturnclient.saturnclient.config.Config;
|
import org.saturnclient.config.Config;
|
||||||
import org.saturnclient.saturnclient.config.manager.ConfigManager;
|
import org.saturnclient.config.manager.ConfigManager;
|
||||||
import org.saturnclient.saturnclient.event.KeyInputHandler;
|
import org.saturnclient.saturnclient.event.KeyInputHandler;
|
||||||
import org.saturnclient.saturnclient.mixin.DrawContextAccessor;
|
import org.saturnclient.saturnclient.mixin.DrawContextAccessor;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ package org.saturnclient.saturnclient.client.player;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.Config;
|
import org.saturnclient.config.Config;
|
||||||
|
|
||||||
import net.minecraft.util.Formatting;
|
import net.minecraft.util.Formatting;
|
||||||
|
|
||||||
|
|||||||
-55
@@ -1,55 +0,0 @@
|
|||||||
package org.saturnclient.saturnclient.config;
|
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.manager.ConfigManager;
|
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
|
||||||
|
|
||||||
public class AnimationConfig {
|
|
||||||
public static ConfigManager config;
|
|
||||||
|
|
||||||
// Logo
|
|
||||||
public static final AnimationConfig logo = new AnimationConfig(true, 700, 0);
|
|
||||||
|
|
||||||
// Main menu
|
|
||||||
public static final AnimationConfig mainMenu = new AnimationConfig(true, 700, 120);
|
|
||||||
|
|
||||||
// Mod menu
|
|
||||||
public static final AnimationConfig modMenu = new AnimationConfig(true, 700, 20);
|
|
||||||
|
|
||||||
// Shift menu
|
|
||||||
public static final AnimationConfig shiftMenu = new AnimationConfig(true, 700, 100);
|
|
||||||
|
|
||||||
// Cosmetics menu
|
|
||||||
public static final AnimationConfig cosmeticsMenu = new AnimationConfig(true, 700, 40);
|
|
||||||
|
|
||||||
// Emote wheel
|
|
||||||
public static final AnimationConfig emoteWheel = new AnimationConfig(true, 700, 40);
|
|
||||||
|
|
||||||
public static void init(ConfigManager parent) {
|
|
||||||
config = new ConfigManager(parent, "Animations");
|
|
||||||
|
|
||||||
logo.init("Logo");
|
|
||||||
mainMenu.init("Main Menu");
|
|
||||||
modMenu.init("Mod Menu");
|
|
||||||
shiftMenu.init("Shift Menu");
|
|
||||||
cosmeticsMenu.init("Cosmetics Menu");
|
|
||||||
emoteWheel.init("Emote Wheel");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Animation properties
|
|
||||||
public final Property<Integer> duration;
|
|
||||||
public final Property<Integer> stagger;
|
|
||||||
public final Property<Integer> curve;
|
|
||||||
|
|
||||||
public AnimationConfig(boolean enabled, int delay, int stagger) {
|
|
||||||
this.duration = Property.integer(delay);
|
|
||||||
this.stagger = Property.integer(stagger);
|
|
||||||
this.curve = Property.select(1, "Ease In Out Cubic", "Ease Out Cubic", "Ease In Out Back");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void init(String name) {
|
|
||||||
// config.property("Enable " + name + " Animations", this.enabled);
|
|
||||||
config.property(name + " Duration", this.duration);
|
|
||||||
config.property(name + " Stagger", this.stagger);
|
|
||||||
config.property(name + " Curve", this.curve);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package org.saturnclient.saturnclient.config;
|
|
||||||
|
|
||||||
import org.lwjgl.glfw.GLFW;
|
|
||||||
import org.saturnclient.saturnclient.config.manager.ConfigManager;
|
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
|
||||||
import org.saturnclient.ui.resources.Textures;
|
|
||||||
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
public class Config {
|
|
||||||
public static ConfigManager config;
|
|
||||||
|
|
||||||
public static Property<Boolean> realisticLogo = Property.bool(false);
|
|
||||||
public static Property<Boolean> saturnTitleScreen = Property.bool(true);
|
|
||||||
public static Property<Boolean> cloakPhysics = Property.bool(true);
|
|
||||||
public static Property<Integer> openEmoteWheel = Property.keybinding(GLFW.GLFW_KEY_B);
|
|
||||||
public static Property<Boolean> stagger = Property.bool(true);
|
|
||||||
|
|
||||||
public static Identifier getLogo() {
|
|
||||||
return realisticLogo.value ? Textures.REALISTIC_LOGO : Textures.LOGO;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void init() {
|
|
||||||
config = new ConfigManager("Saturn Client");
|
|
||||||
config.property("Realistic logo", realisticLogo);
|
|
||||||
config.property("Saturn client title screen", saturnTitleScreen);
|
|
||||||
config.property("Open Emote Wheel", openEmoteWheel);
|
|
||||||
config.property("Cloak Physics", cloakPhysics);
|
|
||||||
config.property("Stagger Animations", stagger);
|
|
||||||
|
|
||||||
// Initialize a sub namespace for theme
|
|
||||||
Theme.init(config);
|
|
||||||
|
|
||||||
// Initialize a sub namespace for animations
|
|
||||||
AnimationConfig.init(config);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
package org.saturnclient.saturnclient.config;
|
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.manager.ConfigManager;
|
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
|
||||||
|
|
||||||
public class Theme {
|
|
||||||
// Main UI background (slightly warm dark to match Saturn tone)
|
|
||||||
public static final Property<Integer> BACKGROUND = Property.color(0xFF12100D);
|
|
||||||
|
|
||||||
// Default text color
|
|
||||||
public static final Property<Integer> FOREGROUND = Property.color(0xFFF2E6D2);
|
|
||||||
|
|
||||||
// Widget default background (normal state)
|
|
||||||
public static final Property<Integer> PRIMARY = Property.color(0xFF1C1915);
|
|
||||||
|
|
||||||
// Widget text color
|
|
||||||
public static final Property<Integer> PRIMARY_FG = Property.color(0xFFEAD9B8);
|
|
||||||
|
|
||||||
// Saturn brand color (hovered / enabled / selected)
|
|
||||||
public static final Property<Integer> ACCENT = Property.color(0xFFE2BF7D);
|
|
||||||
|
|
||||||
// Text/icons shown on accent background
|
|
||||||
public static final Property<Integer> ACCENT_FG = Property.color(0xFF1A140A);
|
|
||||||
|
|
||||||
// Misc colors
|
|
||||||
public static final Property<Integer> SCROLL = Property.color(0xFFE2BF7D);
|
|
||||||
|
|
||||||
// UI metrics
|
|
||||||
public static final Property<Integer> BG_RADIUS = Property.integer(12);
|
|
||||||
public static final Property<Integer> WIDGET_RADIUS = Property.integer(10);
|
|
||||||
|
|
||||||
// Font
|
|
||||||
public static final Property<Integer> FONT = Property.font(2);
|
|
||||||
|
|
||||||
public static void init(ConfigManager parent) {
|
|
||||||
ConfigManager config = new ConfigManager(parent, "UI Style");
|
|
||||||
config.property("Background", BACKGROUND);
|
|
||||||
config.property("Foreground", FOREGROUND);
|
|
||||||
config.property("Primary", PRIMARY);
|
|
||||||
config.property("Primary Foreground", PRIMARY_FG);
|
|
||||||
config.property("Accent", ACCENT);
|
|
||||||
config.property("Accent Foreground", ACCENT_FG);
|
|
||||||
config.property("Scrollbar Color", SCROLL);
|
|
||||||
|
|
||||||
config.property("Background Radius", BG_RADIUS);
|
|
||||||
config.property("Widget Radius", WIDGET_RADIUS);
|
|
||||||
|
|
||||||
config.property("Font", FONT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* primary by default, accent if true
|
|
||||||
*/
|
|
||||||
public static int getBg(boolean hover) {
|
|
||||||
return hover ? ACCENT.value : PRIMARY.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* (Foreground) primary by default, accent if true
|
|
||||||
*/
|
|
||||||
public static int getFg(boolean hover) {
|
|
||||||
return hover ? ACCENT_FG.value : PRIMARY_FG.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Multiplies existing alpha with 0–255 alpha.
|
|
||||||
*/
|
|
||||||
public static int withAlpha(int alpha, int color) {
|
|
||||||
alpha = Math.max(0, Math.min(255, alpha));
|
|
||||||
|
|
||||||
int originalAlpha = (color >>> 24) & 0xFF;
|
|
||||||
|
|
||||||
// Merge (multiply) alphas
|
|
||||||
int merged = (originalAlpha * alpha) / 255;
|
|
||||||
|
|
||||||
return (color & 0x00FFFFFF) | (merged << 24);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Multiplies existing alpha with 0.0–1.0 alpha.
|
|
||||||
*/
|
|
||||||
public static int withAlpha(float alpha, int color) {
|
|
||||||
alpha = Math.max(0f, Math.min(1f, alpha));
|
|
||||||
|
|
||||||
int originalAlpha = (color >>> 24) & 0xFF;
|
|
||||||
|
|
||||||
int merged = (int) (originalAlpha * alpha);
|
|
||||||
|
|
||||||
return (color & 0x00FFFFFF) | (merged << 24);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-181
@@ -1,181 +0,0 @@
|
|||||||
package org.saturnclient.saturnclient.config.manager;
|
|
||||||
|
|
||||||
import com.google.gson.*;
|
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class ConfigManager {
|
|
||||||
|
|
||||||
private static final File configFile = new File(SaturnClient.client.runDirectory, "saturn.json");
|
|
||||||
|
|
||||||
// SINGLE ROOT TREE
|
|
||||||
private static final Map<String, Property<?>> ROOT = new LinkedHashMap<>();
|
|
||||||
|
|
||||||
private static JsonObject cachedJson = null;
|
|
||||||
|
|
||||||
private final Map<String, Property<?>> currentMap;
|
|
||||||
|
|
||||||
private final String[] path;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a root namespace
|
|
||||||
*/
|
|
||||||
public ConfigManager(String namespace) {
|
|
||||||
this.currentMap = new LinkedHashMap<>();
|
|
||||||
this.path = new String[] { namespace }; // Path is just ["namespace"]
|
|
||||||
ROOT.put(namespace, Property.namespace(currentMap));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a sub-namespace inside a parent
|
|
||||||
*/
|
|
||||||
public ConfigManager(ConfigManager parent, String namespace) {
|
|
||||||
this.currentMap = new LinkedHashMap<>();
|
|
||||||
|
|
||||||
// Build new path: parent path + current namespace
|
|
||||||
this.path = new String[parent.path.length + 1];
|
|
||||||
System.arraycopy(parent.path, 0, this.path, 0, parent.path.length);
|
|
||||||
this.path[this.path.length - 1] = namespace;
|
|
||||||
|
|
||||||
parent.property(namespace, Property.namespace(currentMap));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a property
|
|
||||||
*/
|
|
||||||
public <T> Property<T> property(String name, Property<T> value) {
|
|
||||||
currentMap.put(name, value);
|
|
||||||
loadSingleProperty(name, value);
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add empty namespace
|
|
||||||
*/
|
|
||||||
public ConfigManager sub(String name) {
|
|
||||||
return new ConfigManager(this, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load entire config
|
|
||||||
*/
|
|
||||||
public static void load() {
|
|
||||||
SaturnClient.LOGGER.info("Loading config...");
|
|
||||||
|
|
||||||
JsonObject json = loadAndCache();
|
|
||||||
if (json == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
loadRecursive(json, ROOT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Save entire config
|
|
||||||
*/
|
|
||||||
public static void save() {
|
|
||||||
SaturnClient.LOGGER.info("Saving config...");
|
|
||||||
|
|
||||||
JsonObject rootJson = new JsonObject();
|
|
||||||
saveRecursive(rootJson, ROOT);
|
|
||||||
|
|
||||||
try {
|
|
||||||
String formatted = new GsonBuilder()
|
|
||||||
.setPrettyPrinting()
|
|
||||||
.create()
|
|
||||||
.toJson(rootJson);
|
|
||||||
|
|
||||||
Files.writeString(configFile.toPath(), formatted);
|
|
||||||
SaturnClient.LOGGER.info("Config saved successfully.");
|
|
||||||
} catch (IOException e) {
|
|
||||||
SaturnClient.LOGGER.error("Error saving config file", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Recursive save
|
|
||||||
*/
|
|
||||||
private static void saveRecursive(JsonObject json, Map<String, Property<?>> map) {
|
|
||||||
map.forEach((name, prop) -> {
|
|
||||||
if (prop.isNamespace()) {
|
|
||||||
JsonObject child = new JsonObject();
|
|
||||||
saveRecursive(child, prop.getNamespaceMap());
|
|
||||||
json.add(name, child);
|
|
||||||
} else {
|
|
||||||
json.add(name, prop.toJson());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Recursive load
|
|
||||||
*/
|
|
||||||
private static void loadRecursive(JsonObject json, Map<String, Property<?>> map) {
|
|
||||||
map.forEach((name, prop) -> {
|
|
||||||
JsonElement element = json.get(name);
|
|
||||||
if (element == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (prop.isNamespace() && element.isJsonObject()) {
|
|
||||||
loadRecursive(element.getAsJsonObject(), prop.getNamespaceMap());
|
|
||||||
} else {
|
|
||||||
prop.loadFromJson(element);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load only a single property immediately after creation,
|
|
||||||
* traversing the JSON tree based on this manager's path.
|
|
||||||
*/
|
|
||||||
private void loadSingleProperty(String name, Property<?> prop) {
|
|
||||||
JsonObject source = cachedJson != null ? cachedJson : loadAndCache();
|
|
||||||
if (source == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Traverse the tree to the correct namespace
|
|
||||||
JsonObject currentScope = source;
|
|
||||||
for (String segment : path) {
|
|
||||||
JsonElement next = currentScope.get(segment);
|
|
||||||
if (next != null && next.isJsonObject()) {
|
|
||||||
currentScope = next.getAsJsonObject();
|
|
||||||
} else {
|
|
||||||
return; // Path doesn't exist in config yet
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now look for the property inside the correctly nested object
|
|
||||||
JsonElement element = currentScope.get(name);
|
|
||||||
if (element != null) {
|
|
||||||
prop.loadFromJson(element);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reads file and caches json
|
|
||||||
*/
|
|
||||||
private static JsonObject loadAndCache() {
|
|
||||||
try {
|
|
||||||
if (!configFile.exists()) {
|
|
||||||
Files.writeString(configFile.toPath(), "{}");
|
|
||||||
return new JsonObject();
|
|
||||||
}
|
|
||||||
|
|
||||||
String json = Files.readString(configFile.toPath());
|
|
||||||
cachedJson = JsonParser.parseString(json).getAsJsonObject();
|
|
||||||
return cachedJson;
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
|
||||||
SaturnClient.LOGGER.error("Error reading config file", e);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Property<?>> getProperties() {
|
|
||||||
return currentMap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-298
@@ -1,298 +0,0 @@
|
|||||||
package org.saturnclient.saturnclient.config.manager;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.lwjgl.glfw.GLFW;
|
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
|
||||||
|
|
||||||
import com.google.gson.JsonElement;
|
|
||||||
import com.google.gson.JsonObject;
|
|
||||||
import com.google.gson.JsonPrimitive;
|
|
||||||
|
|
||||||
public class Property<T> {
|
|
||||||
public static class NamedProperty<T> {
|
|
||||||
public String name;
|
|
||||||
public Property<T> prop;
|
|
||||||
|
|
||||||
public NamedProperty(String name, Property<T> value) {
|
|
||||||
this.name = name;
|
|
||||||
this.prop = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum PropertyType {
|
|
||||||
BOOLEAN,
|
|
||||||
INTEGER,
|
|
||||||
FLOAT,
|
|
||||||
STRING,
|
|
||||||
HEX,
|
|
||||||
NAMESPACE,
|
|
||||||
SELECT,
|
|
||||||
KEYBINDING,
|
|
||||||
}
|
|
||||||
|
|
||||||
public T value;
|
|
||||||
public boolean isReset = false;
|
|
||||||
private T defaultValue;
|
|
||||||
private String[] availableValues;
|
|
||||||
private final PropertyType type;
|
|
||||||
private boolean wasPressedLastTick = false;
|
|
||||||
|
|
||||||
private Property(T value, PropertyType type) {
|
|
||||||
this.value = value;
|
|
||||||
this.defaultValue = value;
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------- Factory Methods ----------
|
|
||||||
public static <T> Property<T> from(T value) {
|
|
||||||
if (value instanceof Boolean)
|
|
||||||
return new Property<>(value, PropertyType.BOOLEAN);
|
|
||||||
if (value instanceof Integer)
|
|
||||||
return new Property<>(value, PropertyType.INTEGER);
|
|
||||||
if (value instanceof Float)
|
|
||||||
return new Property<>(value, PropertyType.FLOAT);
|
|
||||||
if (value instanceof String)
|
|
||||||
return new Property<>(value, PropertyType.STRING);
|
|
||||||
if (valueIsNamespace(value))
|
|
||||||
return new Property<>(value, PropertyType.NAMESPACE);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Property<Integer> font(int value) {
|
|
||||||
return select(value, "Default", "Inter", "Inter bold");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Property<Integer> select(Integer value, String... availableValues) {
|
|
||||||
Property<Integer> property = new Property<>(value, PropertyType.SELECT);
|
|
||||||
property.availableValues = availableValues;
|
|
||||||
return property;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Property<Map<String, Property<?>>> namespace(Map<String, Property<?>> value) {
|
|
||||||
return new Property<>(value, PropertyType.NAMESPACE);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Property<Boolean> bool(boolean value) {
|
|
||||||
return new Property<>(value, PropertyType.BOOLEAN);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Property<Integer> integer(int value) {
|
|
||||||
return new Property<>(value, PropertyType.INTEGER);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Property<Float> floatProp(float value) {
|
|
||||||
return new Property<>(value, PropertyType.FLOAT);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Property<String> string(String value) {
|
|
||||||
return new Property<>(value, PropertyType.STRING);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Property<Integer> color(int value) {
|
|
||||||
return new Property<>(value, PropertyType.HEX);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Property<Integer> keybinding(int value) {
|
|
||||||
return new Property<>(value, PropertyType.KEYBINDING);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------- Select Helpers ----------
|
|
||||||
public void next() {
|
|
||||||
if (type == PropertyType.SELECT) {
|
|
||||||
int i = (Integer) value;
|
|
||||||
setValue((i < availableValues.length - 1) ? i + 1 : 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void prev() {
|
|
||||||
if (type == PropertyType.SELECT) {
|
|
||||||
int i = (Integer) value;
|
|
||||||
setValue((i > 0) ? i - 1 : availableValues.length - 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSelection(int selection) {
|
|
||||||
if (type == PropertyType.SELECT && selection >= 0 && selection < availableValues.length) {
|
|
||||||
setValue(selection);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSelection() {
|
|
||||||
return (type == PropertyType.SELECT) ? availableValues[(Integer) value] : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------- Lifecycle ----------
|
|
||||||
public void reset() {
|
|
||||||
value = defaultValue;
|
|
||||||
isReset = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PropertyType getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public Map<String, Property<?>> getNamespaceValue() {
|
|
||||||
if (type == PropertyType.NAMESPACE && value instanceof Map) {
|
|
||||||
return (Map<String, Property<?>>) value;
|
|
||||||
}
|
|
||||||
throw new IllegalStateException("Property is not a namespace");
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------- JSON Serialization ----------
|
|
||||||
/*
|
|
||||||
* BOOLEAN,
|
|
||||||
* INTEGER,
|
|
||||||
* FLOAT,
|
|
||||||
* STRING,
|
|
||||||
* HEX,
|
|
||||||
* NAMESPACE,
|
|
||||||
* SELECT,
|
|
||||||
* KEYBINDING,
|
|
||||||
*/
|
|
||||||
public JsonElement toJson() {
|
|
||||||
switch (type) {
|
|
||||||
case BOOLEAN:
|
|
||||||
return new JsonPrimitive((Boolean) value);
|
|
||||||
case INTEGER:
|
|
||||||
return new JsonPrimitive((Integer) value);
|
|
||||||
case FLOAT:
|
|
||||||
return new JsonPrimitive((Float) value);
|
|
||||||
case NAMESPACE:
|
|
||||||
JsonObject nested = new JsonObject();
|
|
||||||
getNamespaceValue().forEach((k, v) -> nested.add(k, v.toJson()));
|
|
||||||
return nested;
|
|
||||||
case HEX:
|
|
||||||
return new JsonPrimitive(String.format("#%08X", (Integer) value));
|
|
||||||
case KEYBINDING:
|
|
||||||
return new JsonPrimitive((Integer) value);
|
|
||||||
case SELECT:
|
|
||||||
return new JsonPrimitive((Integer) value);
|
|
||||||
default:
|
|
||||||
return new JsonPrimitive(String.valueOf(value));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void loadFromJson(JsonElement element) {
|
|
||||||
if (element == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
switch (type) {
|
|
||||||
case BOOLEAN:
|
|
||||||
if (element.isJsonPrimitive() && element.getAsJsonPrimitive().isBoolean())
|
|
||||||
setValue(element.getAsBoolean());
|
|
||||||
break;
|
|
||||||
case INTEGER:
|
|
||||||
if (element.isJsonPrimitive()) {
|
|
||||||
JsonPrimitive p = element.getAsJsonPrimitive();
|
|
||||||
if (p.isNumber())
|
|
||||||
setValue(p.getAsInt());
|
|
||||||
else if (p.isString())
|
|
||||||
setValue(parseHexToInt(p.getAsString()));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case FLOAT:
|
|
||||||
if (element.isJsonPrimitive() && element.getAsJsonPrimitive().isNumber())
|
|
||||||
setValue(element.getAsFloat());
|
|
||||||
break;
|
|
||||||
case STRING:
|
|
||||||
if (element.isJsonPrimitive() && element.getAsJsonPrimitive().isString())
|
|
||||||
setValue(element.getAsString());
|
|
||||||
break;
|
|
||||||
case HEX:
|
|
||||||
if (element.isJsonPrimitive() && element.getAsJsonPrimitive().isString())
|
|
||||||
setValue(parseHexToInt(element.getAsString()));
|
|
||||||
break;
|
|
||||||
case NAMESPACE:
|
|
||||||
if (element.isJsonObject()) {
|
|
||||||
JsonObject obj = element.getAsJsonObject();
|
|
||||||
getNamespaceValue().forEach((k, v) -> v.loadFromJson(obj.get(k)));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SELECT:
|
|
||||||
if (element.isJsonPrimitive() && element.getAsJsonPrimitive().isNumber())
|
|
||||||
setSelection(element.getAsInt());
|
|
||||||
break;
|
|
||||||
case KEYBINDING:
|
|
||||||
if (element.isJsonPrimitive() && element.getAsJsonPrimitive().isNumber())
|
|
||||||
setValue(element.getAsInt());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------- Utility ----------
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return String.valueOf(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean valueIsNamespace(Object obj) {
|
|
||||||
return obj instanceof Map;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void setValue(Object value) {
|
|
||||||
this.value = (T) value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void setValue(Object value, Object defaultValue) {
|
|
||||||
this.value = (T) value;
|
|
||||||
this.defaultValue = (T) defaultValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public NamedProperty<T> named(String name) {
|
|
||||||
return new NamedProperty<>(name, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------- Keybindings ----------
|
|
||||||
public boolean isKeyPressed() {
|
|
||||||
return (Integer) value != -1 &&
|
|
||||||
GLFW.glfwGetKey(SaturnClient.client.getWindow().getHandle(), (Integer) value) == GLFW.GLFW_PRESS &&
|
|
||||||
SaturnClient.client.currentScreen == null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean wasKeyPressed() {
|
|
||||||
boolean pressed = isKeyPressed();
|
|
||||||
boolean result = pressed && !wasPressedLastTick;
|
|
||||||
wasPressedLastTick = pressed;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------- HEX ----------
|
|
||||||
public static int parseHexToInt(String hex) {
|
|
||||||
hex = hex.replace("#", "");
|
|
||||||
if (hex.length() == 6)
|
|
||||||
hex = "FF" + hex;
|
|
||||||
if (hex.length() != 8)
|
|
||||||
throw new IllegalArgumentException("Hex must be 6 or 8 chars long, got \'" + hex + "\'");
|
|
||||||
return (int) Long.parseLong(hex, 16);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Misc
|
|
||||||
public Property<T> copy() {
|
|
||||||
return new Property<>(this.value, this.type);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void load(String name, JsonElement element) {
|
|
||||||
if (element != null && element.isJsonObject()) {
|
|
||||||
load(name, element.getAsJsonObject());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void load(String name, JsonObject element) {
|
|
||||||
JsonElement value = element.get(name);
|
|
||||||
if (value != null)
|
|
||||||
this.loadFromJson(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isNamespace() {
|
|
||||||
return type == PropertyType.NAMESPACE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public Map<String, Property<?>> getNamespaceMap() {
|
|
||||||
return isNamespace() ? (Map<String, Property<?>>) (Object) value : null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+3
-2
@@ -7,7 +7,7 @@ import net.minecraft.client.util.InputUtil;
|
|||||||
|
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.client.ServiceClient;
|
import org.saturnclient.saturnclient.client.ServiceClient;
|
||||||
import org.saturnclient.saturnclient.config.Config;
|
import org.saturnclient.config.Config;
|
||||||
import org.saturnclient.ui.screens.EmoteWheel;
|
import org.saturnclient.ui.screens.EmoteWheel;
|
||||||
import org.saturnclient.ui.screens.ShiftMenu;
|
import org.saturnclient.ui.screens.ShiftMenu;
|
||||||
|
|
||||||
@@ -39,7 +39,8 @@ public class KeyInputHandler {
|
|||||||
client.setScreen(new ShiftMenu());
|
client.setScreen(new ShiftMenu());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.openEmoteWheel.wasKeyPressed() && client.currentScreen == null && !InputUtil.isKeyPressed(client.getWindow().getHandle(), GLFW.GLFW_KEY_F3)) {
|
if (Config.openEmoteWheel.wasKeyPressed() && client.currentScreen == null
|
||||||
|
&& !InputUtil.isKeyPressed(client.getWindow().getHandle(), GLFW.GLFW_KEY_F3)) {
|
||||||
client.setScreen(new EmoteWheel());
|
client.setScreen(new EmoteWheel());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import org.saturnclient.modules.HudMod;
|
|||||||
import org.saturnclient.modules.ModDimensions;
|
import org.saturnclient.modules.ModDimensions;
|
||||||
import org.saturnclient.modules.ModManager;
|
import org.saturnclient.modules.ModManager;
|
||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.saturnclient.config.manager.ConfigManager;
|
import org.saturnclient.config.manager.ConfigManager;
|
||||||
import org.saturnclient.saturnclient.mixin.DrawContextAccessor;
|
import org.saturnclient.saturnclient.mixin.DrawContextAccessor;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.SaturnScreen;
|
import org.saturnclient.ui.SaturnScreen;
|
||||||
@@ -95,7 +95,8 @@ public class HudEditor extends Screen {
|
|||||||
SaturnScreen.ROTATING_PANORAMA_RENDERER.render(context, this.width, this.height, 1.0F, delta);
|
SaturnScreen.ROTATING_PANORAMA_RENDERER.render(context, this.width, this.height, 1.0F, delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderScope scope = new RenderScope(context.getMatrices(), ((DrawContextAccessor) context).getVertexConsumers());
|
RenderScope scope = new RenderScope(context.getMatrices(),
|
||||||
|
((DrawContextAccessor) context).getVertexConsumers());
|
||||||
|
|
||||||
for (HudMod mod : hudMods) {
|
for (HudMod mod : hudMods) {
|
||||||
ModDimensions dim = mod.getDimensions();
|
ModDimensions dim = mod.getDimensions();
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package org.saturnclient.saturnclient.mixin;
|
package org.saturnclient.saturnclient.mixin;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.Config;
|
import org.saturnclient.config.Config;
|
||||||
import org.saturnclient.ui.screens.TitleMenu;
|
import org.saturnclient.ui.screens.TitleMenu;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
|||||||
+5
-3
@@ -3,7 +3,7 @@ package org.saturnclient.saturnclient.mixin;
|
|||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Textures;
|
import org.saturnclient.ui.resources.Textures;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
@@ -33,10 +33,12 @@ public abstract class SplashOverlayMixin {
|
|||||||
@Shadow
|
@Shadow
|
||||||
private long reloadStartTime;
|
private long reloadStartTime;
|
||||||
|
|
||||||
@Shadow @Final
|
@Shadow
|
||||||
|
@Final
|
||||||
private boolean reloading;
|
private boolean reloading;
|
||||||
|
|
||||||
@Shadow @Final
|
@Shadow
|
||||||
|
@Final
|
||||||
private Consumer<Optional<Throwable>> exceptionHandler;
|
private Consumer<Optional<Throwable>> exceptionHandler;
|
||||||
|
|
||||||
@Shadow
|
@Shadow
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package org.saturnclient.ui.anim;
|
|||||||
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.AnimationConfig;
|
import org.saturnclient.config.AnimationConfig;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
|
|
||||||
public abstract class Animation {
|
public abstract class Animation {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.saturnclient.ui.anim;
|
package org.saturnclient.ui.anim;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.AnimationConfig;
|
import org.saturnclient.config.AnimationConfig;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
|
|
||||||
public class Fade extends Animation {
|
public class Fade extends Animation {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.saturnclient.ui.anim;
|
package org.saturnclient.ui.anim;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.AnimationConfig;
|
import org.saturnclient.config.AnimationConfig;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
|
|
||||||
public class FadeOut extends Animation {
|
public class FadeOut extends Animation {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.saturnclient.ui.anim;
|
package org.saturnclient.ui.anim;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.AnimationConfig;
|
import org.saturnclient.config.AnimationConfig;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
|
|
||||||
public class SlideFade extends Animation {
|
public class SlideFade extends Animation {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.saturnclient.ui.anim;
|
package org.saturnclient.ui.anim;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.AnimationConfig;
|
import org.saturnclient.config.AnimationConfig;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
|
|
||||||
public class SlideX extends Animation {
|
public class SlideX extends Animation {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.saturnclient.ui.anim;
|
package org.saturnclient.ui.anim;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.AnimationConfig;
|
import org.saturnclient.config.AnimationConfig;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
|
|
||||||
public class SlideY extends Animation {
|
public class SlideY extends Animation {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.saturnclient.ui.components;
|
package org.saturnclient.ui.components;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
import org.saturnclient.ui.ElementContext;
|
import org.saturnclient.ui.ElementContext;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package org.saturnclient.ui.components;
|
|||||||
|
|
||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
import org.saturnclient.ui.ElementContext;
|
import org.saturnclient.ui.ElementContext;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
@@ -15,151 +15,151 @@ import net.minecraft.client.render.RenderLayer;
|
|||||||
|
|
||||||
public class SaturnModule extends Element {
|
public class SaturnModule extends Element {
|
||||||
|
|
||||||
private final Module mod;
|
private final Module mod;
|
||||||
|
|
||||||
static int p = 10; // padding
|
static int p = 10; // padding
|
||||||
static int s = 14; // settings icon size
|
static int s = 14; // settings icon size
|
||||||
static int expand = 5; // settings icon click area
|
static int expand = 5; // settings icon click area
|
||||||
|
|
||||||
public SaturnModule(Module mod) {
|
public SaturnModule(Module mod) {
|
||||||
this.mod = mod;
|
this.mod = mod;
|
||||||
this.width = 160;
|
this.width = 160;
|
||||||
this.height = 50;
|
this.height = 50;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void render(RenderScope renderScope, ElementContext ctx) {
|
|
||||||
boolean hovered = ctx.isHovering();
|
|
||||||
boolean enabled = mod.isEnabled();
|
|
||||||
|
|
||||||
int iconX = width - s - p;
|
|
||||||
int iconY = height - s - p;
|
|
||||||
|
|
||||||
boolean settingsHover = ctx.isHovering(
|
|
||||||
getSettingsX(),
|
|
||||||
getSettingsY(),
|
|
||||||
getSettingsHitBox(),
|
|
||||||
getSettingsHitBox());
|
|
||||||
|
|
||||||
renderScope.setRenderLayer(RenderLayer::getGuiTextured);
|
|
||||||
|
|
||||||
// Resolve theme colors
|
|
||||||
int bgColor = Theme.PRIMARY.value;
|
|
||||||
int fgColor = hovered && !settingsHover ? Theme.ACCENT.value : Theme.PRIMARY_FG.value;
|
|
||||||
|
|
||||||
int iconBg = enabled ? Theme.ACCENT.value : Theme.PRIMARY.value;
|
|
||||||
int iconFg = enabled ? Theme.ACCENT_FG.value : fgColor;
|
|
||||||
|
|
||||||
int settingsColor = settingsHover
|
|
||||||
? Theme.ACCENT.value
|
|
||||||
: Theme.withAlpha(160, fgColor);
|
|
||||||
|
|
||||||
int h = height - (p * 2);
|
|
||||||
|
|
||||||
// Main background
|
|
||||||
renderScope.drawRoundedRectangle(
|
|
||||||
0, 0,
|
|
||||||
width, height,
|
|
||||||
Theme.WIDGET_RADIUS.value,
|
|
||||||
bgColor);
|
|
||||||
|
|
||||||
// Icon background
|
|
||||||
renderScope.drawRoundedRectangle(
|
|
||||||
p, p,
|
|
||||||
h, h,
|
|
||||||
Theme.WIDGET_RADIUS.value,
|
|
||||||
iconBg);
|
|
||||||
|
|
||||||
// Icon
|
|
||||||
renderScope.drawTexture(
|
|
||||||
mod.getIconTexture(),
|
|
||||||
p + (p / 2),
|
|
||||||
p + (p / 2),
|
|
||||||
0, 0,
|
|
||||||
h - p,
|
|
||||||
h - p,
|
|
||||||
iconFg);
|
|
||||||
|
|
||||||
// Module name
|
|
||||||
renderScope.drawText(
|
|
||||||
0.6f,
|
|
||||||
mod.getName(),
|
|
||||||
p + h + 4,
|
|
||||||
p + 1,
|
|
||||||
Theme.FONT.value,
|
|
||||||
fgColor);
|
|
||||||
|
|
||||||
// Version (right aligned)
|
|
||||||
String version = mod.getVersion();
|
|
||||||
int versionWidth = (int) (Fonts.getWidth(version, Theme.FONT.value) * 0.35f);
|
|
||||||
|
|
||||||
renderScope.drawText(
|
|
||||||
0.35f,
|
|
||||||
version,
|
|
||||||
width - p - versionWidth,
|
|
||||||
p + 1,
|
|
||||||
Theme.FONT.value,
|
|
||||||
fgColor);
|
|
||||||
|
|
||||||
// Tags
|
|
||||||
int xt = p + h + 4;
|
|
||||||
for (String tag : mod.getTags()) {
|
|
||||||
int tagWidth = (int) (Fonts.getWidth(tag, Theme.FONT.value) * 0.4f);
|
|
||||||
|
|
||||||
renderScope.drawRoundedRectangle(
|
|
||||||
xt,
|
|
||||||
p + (h / 2),
|
|
||||||
tagWidth + 6,
|
|
||||||
12,
|
|
||||||
5,
|
|
||||||
Theme.ACCENT.value);
|
|
||||||
|
|
||||||
renderScope.drawText(
|
|
||||||
0.4f,
|
|
||||||
tag,
|
|
||||||
xt + 2,
|
|
||||||
p + (h / 2) + 3,
|
|
||||||
Theme.FONT.value,
|
|
||||||
Theme.ACCENT_FG.value);
|
|
||||||
|
|
||||||
xt += tagWidth + 9;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Settings icon
|
@Override
|
||||||
renderScope.drawTexture(
|
public void render(RenderScope renderScope, ElementContext ctx) {
|
||||||
Textures.SETTINGS,
|
boolean hovered = ctx.isHovering();
|
||||||
iconX,
|
boolean enabled = mod.isEnabled();
|
||||||
iconY,
|
|
||||||
0, 0,
|
|
||||||
s, s,
|
|
||||||
settingsColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
int iconX = width - s - p;
|
||||||
public void click(int mouseX, int mouseY) {
|
int iconY = height - s - p;
|
||||||
boolean settingsHover = Utils.isHovering(
|
|
||||||
mouseX - getSettingsX(),
|
|
||||||
mouseY - getSettingsY(),
|
|
||||||
getSettingsHitBox(),
|
|
||||||
getSettingsHitBox(),
|
|
||||||
1.0f);
|
|
||||||
|
|
||||||
if (settingsHover) {
|
boolean settingsHover = ctx.isHovering(
|
||||||
SaturnClient.client.setScreen(new ConfigEditor(mod.getConfig()));
|
getSettingsX(),
|
||||||
} else {
|
getSettingsY(),
|
||||||
mod.setEnabled(!mod.isEnabled());
|
getSettingsHitBox(),
|
||||||
|
getSettingsHitBox());
|
||||||
|
|
||||||
|
renderScope.setRenderLayer(RenderLayer::getGuiTextured);
|
||||||
|
|
||||||
|
// Resolve theme colors
|
||||||
|
int bgColor = Theme.PRIMARY.value;
|
||||||
|
int fgColor = hovered && !settingsHover ? Theme.ACCENT.value : Theme.PRIMARY_FG.value;
|
||||||
|
|
||||||
|
int iconBg = enabled ? Theme.ACCENT.value : Theme.PRIMARY.value;
|
||||||
|
int iconFg = enabled ? Theme.ACCENT_FG.value : fgColor;
|
||||||
|
|
||||||
|
int settingsColor = settingsHover
|
||||||
|
? Theme.ACCENT.value
|
||||||
|
: Theme.withAlpha(160, fgColor);
|
||||||
|
|
||||||
|
int h = height - (p * 2);
|
||||||
|
|
||||||
|
// Main background
|
||||||
|
renderScope.drawRoundedRectangle(
|
||||||
|
0, 0,
|
||||||
|
width, height,
|
||||||
|
Theme.WIDGET_RADIUS.value,
|
||||||
|
bgColor);
|
||||||
|
|
||||||
|
// Icon background
|
||||||
|
renderScope.drawRoundedRectangle(
|
||||||
|
p, p,
|
||||||
|
h, h,
|
||||||
|
Theme.WIDGET_RADIUS.value,
|
||||||
|
iconBg);
|
||||||
|
|
||||||
|
// Icon
|
||||||
|
renderScope.drawTexture(
|
||||||
|
mod.getIconTexture(),
|
||||||
|
p + (p / 2),
|
||||||
|
p + (p / 2),
|
||||||
|
0, 0,
|
||||||
|
h - p,
|
||||||
|
h - p,
|
||||||
|
iconFg);
|
||||||
|
|
||||||
|
// Module name
|
||||||
|
renderScope.drawText(
|
||||||
|
0.6f,
|
||||||
|
mod.getName(),
|
||||||
|
p + h + 4,
|
||||||
|
p + 1,
|
||||||
|
Theme.FONT.value,
|
||||||
|
fgColor);
|
||||||
|
|
||||||
|
// Version (right aligned)
|
||||||
|
String version = mod.getVersion();
|
||||||
|
int versionWidth = (int) (Fonts.getWidth(version, Theme.FONT.value) * 0.35f);
|
||||||
|
|
||||||
|
renderScope.drawText(
|
||||||
|
0.35f,
|
||||||
|
version,
|
||||||
|
width - p - versionWidth,
|
||||||
|
p + 1,
|
||||||
|
Theme.FONT.value,
|
||||||
|
fgColor);
|
||||||
|
|
||||||
|
// Tags
|
||||||
|
int xt = p + h + 4;
|
||||||
|
for (String tag : mod.getTags()) {
|
||||||
|
int tagWidth = (int) (Fonts.getWidth(tag, Theme.FONT.value) * 0.4f);
|
||||||
|
|
||||||
|
renderScope.drawRoundedRectangle(
|
||||||
|
xt,
|
||||||
|
p + (h / 2),
|
||||||
|
tagWidth + 6,
|
||||||
|
12,
|
||||||
|
5,
|
||||||
|
Theme.ACCENT.value);
|
||||||
|
|
||||||
|
renderScope.drawText(
|
||||||
|
0.4f,
|
||||||
|
tag,
|
||||||
|
xt + 2,
|
||||||
|
p + (h / 2) + 3,
|
||||||
|
Theme.FONT.value,
|
||||||
|
Theme.ACCENT_FG.value);
|
||||||
|
|
||||||
|
xt += tagWidth + 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Settings icon
|
||||||
|
renderScope.drawTexture(
|
||||||
|
Textures.SETTINGS,
|
||||||
|
iconX,
|
||||||
|
iconY,
|
||||||
|
0, 0,
|
||||||
|
s, s,
|
||||||
|
settingsColor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private int getSettingsX() {
|
@Override
|
||||||
return width - s - p - expand;
|
public void click(int mouseX, int mouseY) {
|
||||||
}
|
boolean settingsHover = Utils.isHovering(
|
||||||
|
mouseX - getSettingsX(),
|
||||||
|
mouseY - getSettingsY(),
|
||||||
|
getSettingsHitBox(),
|
||||||
|
getSettingsHitBox(),
|
||||||
|
1.0f);
|
||||||
|
|
||||||
private int getSettingsY() {
|
if (settingsHover) {
|
||||||
return height - s - p - expand;
|
SaturnClient.client.setScreen(new ConfigEditor(mod.getConfig()));
|
||||||
}
|
} else {
|
||||||
|
mod.setEnabled(!mod.isEnabled());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private int getSettingsHitBox() {
|
private int getSettingsX() {
|
||||||
return s + expand * 2;
|
return width - s - p - expand;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getSettingsY() {
|
||||||
|
return height - s - p - expand;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getSettingsHitBox() {
|
||||||
|
return s + expand * 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package org.saturnclient.ui.components;
|
package org.saturnclient.ui.components;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.config.Config;
|
import org.saturnclient.config.Config;
|
||||||
import org.saturnclient.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
import org.saturnclient.ui.ElementContext;
|
import org.saturnclient.ui.ElementContext;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package org.saturnclient.ui.components.inputs;
|
package org.saturnclient.ui.components.inputs;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.manager.ConfigManager;
|
import org.saturnclient.config.manager.ConfigManager;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.resources.Fonts;
|
import org.saturnclient.ui.resources.Fonts;
|
||||||
|
|
||||||
public class FloatInput extends Input {
|
public class FloatInput extends Input {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package org.saturnclient.ui.components.inputs;
|
|||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
import org.saturnclient.ui.ElementContext;
|
import org.saturnclient.ui.ElementContext;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package org.saturnclient.ui.components.inputs;
|
|||||||
|
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
import org.saturnclient.ui.ElementContext;
|
import org.saturnclient.ui.ElementContext;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package org.saturnclient.ui.components.inputs;
|
package org.saturnclient.ui.components.inputs;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.manager.ConfigManager;
|
import org.saturnclient.config.manager.ConfigManager;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.resources.Fonts;
|
import org.saturnclient.ui.resources.Fonts;
|
||||||
|
|
||||||
public class IntInput extends Input {
|
public class IntInput extends Input {
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
package org.saturnclient.ui.components.inputs;
|
package org.saturnclient.ui.components.inputs;
|
||||||
|
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
import org.saturnclient.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
import org.saturnclient.ui.ElementContext;
|
import org.saturnclient.ui.ElementContext;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package org.saturnclient.ui.components.inputs;
|
package org.saturnclient.ui.components.inputs;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
import org.saturnclient.ui.ElementContext;
|
import org.saturnclient.ui.ElementContext;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package org.saturnclient.ui.components.inputs;
|
package org.saturnclient.ui.components.inputs;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
import org.saturnclient.ui.ElementContext;
|
import org.saturnclient.ui.ElementContext;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package org.saturnclient.ui.elements;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.AnimationConfig;
|
import org.saturnclient.config.AnimationConfig;
|
||||||
import org.saturnclient.saturnclient.config.Config;
|
import org.saturnclient.config.Config;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
import org.saturnclient.ui.ElementContext;
|
import org.saturnclient.ui.ElementContext;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.saturnclient.ui.elements;
|
package org.saturnclient.ui.elements;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
import org.saturnclient.ui.ElementContext;
|
import org.saturnclient.ui.ElementContext;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.saturnclient.ui.elements;
|
package org.saturnclient.ui.elements;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
import org.saturnclient.ui.ElementContext;
|
import org.saturnclient.ui.ElementContext;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package org.saturnclient.ui.elements;
|
package org.saturnclient.ui.elements;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
import org.saturnclient.ui.ElementContext;
|
import org.saturnclient.ui.ElementContext;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package org.saturnclient.ui.elements;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
import org.saturnclient.ui.ElementContext;
|
import org.saturnclient.ui.ElementContext;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
@@ -88,7 +88,8 @@ public class Scroll extends Element {
|
|||||||
|
|
||||||
int calculateScrollBarY() {
|
int calculateScrollBarY() {
|
||||||
int scrollBarHeight = calculateScrollBarHeight();
|
int scrollBarHeight = calculateScrollBarHeight();
|
||||||
if (maxScroll <= 0) return scrollBarPadding.value;
|
if (maxScroll <= 0)
|
||||||
|
return scrollBarPadding.value;
|
||||||
int y = (scroll * (height - scrollBarHeight - scrollBarPadding.value * 2)) / maxScroll + scrollBarPadding.value;
|
int y = (scroll * (height - scrollBarHeight - scrollBarPadding.value * 2)) / maxScroll + scrollBarPadding.value;
|
||||||
return Math.min(y, height - scrollBarHeight - scrollBarPadding.value);
|
return Math.min(y, height - scrollBarHeight - scrollBarPadding.value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.saturnclient.ui.elements;
|
package org.saturnclient.ui.elements;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
import org.saturnclient.ui.ElementContext;
|
import org.saturnclient.ui.ElementContext;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.saturnclient.ui.elements;
|
package org.saturnclient.ui.elements;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
import org.saturnclient.ui.ElementContext;
|
import org.saturnclient.ui.ElementContext;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.saturnclient.ui.elements;
|
package org.saturnclient.ui.elements;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
import org.saturnclient.ui.Element;
|
import org.saturnclient.ui.Element;
|
||||||
import org.saturnclient.ui.ElementContext;
|
import org.saturnclient.ui.ElementContext;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ package org.saturnclient.ui.screens;
|
|||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
import org.saturnclient.saturnclient.config.manager.ConfigManager;
|
import org.saturnclient.config.manager.ConfigManager;
|
||||||
import org.saturnclient.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.ui.SaturnScreen;
|
import org.saturnclient.ui.SaturnScreen;
|
||||||
import org.saturnclient.ui.components.Sidebar;
|
import org.saturnclient.ui.components.Sidebar;
|
||||||
import org.saturnclient.ui.components.inputs.FloatInput;
|
import org.saturnclient.ui.components.inputs.FloatInput;
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package org.saturnclient.ui.screens;
|
|||||||
import org.saturnclient.cosmetics.Emotes;
|
import org.saturnclient.cosmetics.Emotes;
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.client.ServiceClient;
|
import org.saturnclient.saturnclient.client.ServiceClient;
|
||||||
import org.saturnclient.saturnclient.config.AnimationConfig;
|
import org.saturnclient.config.AnimationConfig;
|
||||||
import org.saturnclient.saturnclient.config.Config;
|
import org.saturnclient.config.Config;
|
||||||
import org.saturnclient.ui.SaturnScreen;
|
import org.saturnclient.ui.SaturnScreen;
|
||||||
import org.saturnclient.ui.Utils;
|
import org.saturnclient.ui.Utils;
|
||||||
import org.saturnclient.ui.anim.Fade;
|
import org.saturnclient.ui.anim.Fade;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package org.saturnclient.ui.screens;
|
|||||||
|
|
||||||
import org.saturnclient.modules.ModManager;
|
import org.saturnclient.modules.ModManager;
|
||||||
import org.saturnclient.modules.Module;
|
import org.saturnclient.modules.Module;
|
||||||
import org.saturnclient.saturnclient.config.AnimationConfig;
|
import org.saturnclient.config.AnimationConfig;
|
||||||
import org.saturnclient.ui.SaturnScreen;
|
import org.saturnclient.ui.SaturnScreen;
|
||||||
import org.saturnclient.ui.anim.SlideFade;
|
import org.saturnclient.ui.anim.SlideFade;
|
||||||
import org.saturnclient.ui.components.SaturnModule;
|
import org.saturnclient.ui.components.SaturnModule;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package org.saturnclient.ui.screens;
|
package org.saturnclient.ui.screens;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.config.AnimationConfig;
|
import org.saturnclient.config.AnimationConfig;
|
||||||
import org.saturnclient.saturnclient.config.Config;
|
import org.saturnclient.config.Config;
|
||||||
import org.saturnclient.saturnclient.menus.HudEditor;
|
import org.saturnclient.saturnclient.menus.HudEditor;
|
||||||
import org.saturnclient.ui.SaturnScreen;
|
import org.saturnclient.ui.SaturnScreen;
|
||||||
import org.saturnclient.ui.anim.Fade;
|
import org.saturnclient.ui.anim.Fade;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package org.saturnclient.ui.screens;
|
package org.saturnclient.ui.screens;
|
||||||
|
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.config.AnimationConfig;
|
import org.saturnclient.config.AnimationConfig;
|
||||||
import org.saturnclient.saturnclient.config.Config;
|
import org.saturnclient.config.Config;
|
||||||
import org.saturnclient.saturnclient.menus.HudEditor;
|
import org.saturnclient.saturnclient.menus.HudEditor;
|
||||||
import org.saturnclient.ui.SaturnScreen;
|
import org.saturnclient.ui.SaturnScreen;
|
||||||
import org.saturnclient.ui.anim.Fade;
|
import org.saturnclient.ui.anim.Fade;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package org.saturnclient.ui.screens.cosmetics;
|
|||||||
import org.saturnclient.cosmetics.cloak.Cloaks;
|
import org.saturnclient.cosmetics.cloak.Cloaks;
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.client.player.SaturnPlayer;
|
import org.saturnclient.saturnclient.client.player.SaturnPlayer;
|
||||||
import org.saturnclient.saturnclient.config.AnimationConfig;
|
import org.saturnclient.config.AnimationConfig;
|
||||||
import org.saturnclient.ui.SaturnScreen;
|
import org.saturnclient.ui.SaturnScreen;
|
||||||
import org.saturnclient.ui.anim.Fade;
|
import org.saturnclient.ui.anim.Fade;
|
||||||
import org.saturnclient.ui.anim.SlideY;
|
import org.saturnclient.ui.anim.SlideY;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package org.saturnclient.ui.screens.cosmetics;
|
|||||||
import org.saturnclient.cosmetics.hat.Hats;
|
import org.saturnclient.cosmetics.hat.Hats;
|
||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.client.player.SaturnPlayer;
|
import org.saturnclient.saturnclient.client.player.SaturnPlayer;
|
||||||
import org.saturnclient.saturnclient.config.AnimationConfig;
|
import org.saturnclient.config.AnimationConfig;
|
||||||
import org.saturnclient.ui.SaturnScreen;
|
import org.saturnclient.ui.SaturnScreen;
|
||||||
import org.saturnclient.ui.anim.Fade;
|
import org.saturnclient.ui.anim.Fade;
|
||||||
import org.saturnclient.ui.anim.SlideY;
|
import org.saturnclient.ui.anim.SlideY;
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import org.saturnclient.cosmetics.cloak.Cloaks;
|
|||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.client.ServiceClient;
|
import org.saturnclient.saturnclient.client.ServiceClient;
|
||||||
import org.saturnclient.saturnclient.client.player.SaturnPlayer;
|
import org.saturnclient.saturnclient.client.player.SaturnPlayer;
|
||||||
import org.saturnclient.saturnclient.config.AnimationConfig;
|
import org.saturnclient.config.AnimationConfig;
|
||||||
import org.saturnclient.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
import org.saturnclient.ui.SaturnScreen;
|
import org.saturnclient.ui.SaturnScreen;
|
||||||
import org.saturnclient.ui.Utils;
|
import org.saturnclient.ui.Utils;
|
||||||
import org.saturnclient.ui.anim.Fade;
|
import org.saturnclient.ui.anim.Fade;
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import org.saturnclient.cosmetics.hat.Hats;
|
|||||||
import org.saturnclient.saturnclient.SaturnClient;
|
import org.saturnclient.saturnclient.SaturnClient;
|
||||||
import org.saturnclient.saturnclient.client.ServiceClient;
|
import org.saturnclient.saturnclient.client.ServiceClient;
|
||||||
import org.saturnclient.saturnclient.client.player.SaturnPlayer;
|
import org.saturnclient.saturnclient.client.player.SaturnPlayer;
|
||||||
import org.saturnclient.saturnclient.config.AnimationConfig;
|
import org.saturnclient.config.AnimationConfig;
|
||||||
import org.saturnclient.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
import org.saturnclient.ui.SaturnScreen;
|
import org.saturnclient.ui.SaturnScreen;
|
||||||
import org.saturnclient.ui.Utils;
|
import org.saturnclient.ui.Utils;
|
||||||
import org.saturnclient.ui.anim.Fade;
|
import org.saturnclient.ui.anim.Fade;
|
||||||
|
|||||||
Reference in New Issue
Block a user