Refact module to feature
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
package org.saturnclient.common.provider;
|
package org.saturnclient.common.provider;
|
||||||
|
|
||||||
public interface GLFWProvider {
|
public interface GLFWProvider {
|
||||||
public abstract boolean isKeyPressed(int key);
|
public boolean isKeyPressed(int key);
|
||||||
|
|
||||||
public abstract String getKeyName(int key);
|
public String getKeyName(int key);
|
||||||
|
|
||||||
/** Printable keys. */
|
/** Printable keys. */
|
||||||
public static final int GLFW_KEY_SPACE = 32,
|
public static final int GLFW_KEY_SPACE = 32,
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package org.saturnclient.common.provider;
|
||||||
|
|
||||||
|
public interface ModuleProvider {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,9 +4,9 @@ import org.saturnclient.common.ref.asset.IdentifierRef;
|
|||||||
import org.saturnclient.common.ref.render.TextRef;
|
import org.saturnclient.common.ref.render.TextRef;
|
||||||
|
|
||||||
public interface RefConstructorProvider {
|
public interface RefConstructorProvider {
|
||||||
public abstract IdentifierRef identifier(String namespace, String path);
|
public IdentifierRef identifier(String namespace, String path);
|
||||||
|
|
||||||
public abstract IdentifierRef identifier(String fullPath);
|
public IdentifierRef identifier(String fullPath);
|
||||||
|
|
||||||
public abstract TextRef text(String text);
|
public TextRef text(String text);
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -1,4 +1,4 @@
|
|||||||
package org.saturnclient.modules;
|
package org.saturnclient.feature;
|
||||||
|
|
||||||
import org.saturnclient.common.ref.asset.IdentifierRef;
|
import org.saturnclient.common.ref.asset.IdentifierRef;
|
||||||
import org.saturnclient.config.manager.ConfigManager;
|
import org.saturnclient.config.manager.ConfigManager;
|
||||||
@@ -6,11 +6,11 @@ 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;
|
||||||
|
|
||||||
public abstract class Module {
|
public abstract class Feature {
|
||||||
private final ModuleDetails details;
|
private final FeatureDetails details;
|
||||||
private final ConfigManager configManager;
|
private final ConfigManager configManager;
|
||||||
|
|
||||||
public Module(ModuleDetails details, NamedProperty<?>... props) {
|
public Feature(FeatureDetails details, NamedProperty<?>... props) {
|
||||||
this.details = details;
|
this.details = details;
|
||||||
configManager = new ConfigManager(details.name);
|
configManager = new ConfigManager(details.name);
|
||||||
for (NamedProperty<?> prop : props) {
|
for (NamedProperty<?> prop : props) {
|
||||||
@@ -28,7 +28,7 @@ public abstract class Module {
|
|||||||
|
|
||||||
public final void setEnabled(boolean e) {
|
public final void setEnabled(boolean e) {
|
||||||
onEnabled(e);
|
onEnabled(e);
|
||||||
ModManager.updateEnabledModules();
|
FeatureManager.updateEnabledModules();
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void onEnabled(boolean e);
|
public abstract void onEnabled(boolean e);
|
||||||
+8
-8
@@ -1,38 +1,38 @@
|
|||||||
package org.saturnclient.modules;
|
package org.saturnclient.feature;
|
||||||
|
|
||||||
public class ModuleDetails {
|
public class FeatureDetails {
|
||||||
public String name;
|
public String name;
|
||||||
public String namespace;
|
public String namespace;
|
||||||
public String description;
|
public String description;
|
||||||
public String version;
|
public String version;
|
||||||
public String[] tags = {};
|
public String[] tags = {};
|
||||||
|
|
||||||
public ModuleDetails(String name, String namespace) {
|
public FeatureDetails(String name, String namespace) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.namespace = namespace;
|
this.namespace = namespace;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ModuleDetails name(String name) {
|
public FeatureDetails name(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ModuleDetails namespace(String namespace) {
|
public FeatureDetails namespace(String namespace) {
|
||||||
this.namespace = namespace;
|
this.namespace = namespace;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ModuleDetails description(String description) {
|
public FeatureDetails description(String description) {
|
||||||
this.description = description;
|
this.description = description;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ModuleDetails version(String version) {
|
public FeatureDetails version(String version) {
|
||||||
this.version = version;
|
this.version = version;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ModuleDetails tags(String... tags) {
|
public FeatureDetails tags(String... tags) {
|
||||||
this.tags = tags;
|
this.tags = tags;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
+6
-6
@@ -1,11 +1,11 @@
|
|||||||
package org.saturnclient.modules;
|
package org.saturnclient.feature;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.config.manager.Property.NamedProperty;
|
import org.saturnclient.config.manager.Property.NamedProperty;
|
||||||
|
|
||||||
public class ModDimensions {
|
public class FeatureLayout {
|
||||||
public Property<Integer> x = Property.integer(0);
|
public Property<Integer> x = Property.integer(0);
|
||||||
public Property<Integer> y = Property.integer(0);
|
public Property<Integer> y = Property.integer(0);
|
||||||
public Property<Float> scale = Property.floatProp(1.0f);
|
public Property<Float> scale = Property.floatProp(1.0f);
|
||||||
@@ -29,22 +29,22 @@ public class ModDimensions {
|
|||||||
"Font", font)).named("In-Game Display");
|
"Font", font)).named("In-Game Display");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ModDimensions() {
|
public FeatureLayout() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ModDimensions(int width, int height) {
|
public FeatureLayout(int width, int height) {
|
||||||
this.width = width;
|
this.width = width;
|
||||||
this.height = height;
|
this.height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ModDimensions(int x, int y, int width, int height) {
|
public FeatureLayout(int x, int y, int width, int height) {
|
||||||
this.x.value = x;
|
this.x.value = x;
|
||||||
this.y.value = y;
|
this.y.value = y;
|
||||||
this.width = width;
|
this.width = width;
|
||||||
this.height = height;
|
this.height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ModDimensions(int x, int y, int width, int height, float scale) {
|
public FeatureLayout(int x, int y, int width, int height, float scale) {
|
||||||
this.x.value = x;
|
this.x.value = x;
|
||||||
this.y.value = y;
|
this.y.value = y;
|
||||||
this.scale.value = scale;
|
this.scale.value = scale;
|
||||||
+7
-7
@@ -1,11 +1,11 @@
|
|||||||
package org.saturnclient.modules;
|
package org.saturnclient.feature;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ModManager {
|
public class FeatureManager {
|
||||||
public static List<Module> ENABLED_MODS = new ArrayList<>();
|
public static List<Feature> ENABLED_MODS = new ArrayList<>();
|
||||||
public static Module[] MODS = {};
|
public static Feature[] MODS = {};
|
||||||
|
|
||||||
public static void init(ModuleProvider provider) {
|
public static void init(ModuleProvider provider) {
|
||||||
MODS = provider.getMods();
|
MODS = provider.getMods();
|
||||||
@@ -14,18 +14,18 @@ public class ModManager {
|
|||||||
|
|
||||||
public static synchronized void updateEnabledModules() {
|
public static synchronized void updateEnabledModules() {
|
||||||
ENABLED_MODS.clear();
|
ENABLED_MODS.clear();
|
||||||
for (Module m : MODS) {
|
for (Feature m : MODS) {
|
||||||
if (m.isEnabled()) {
|
if (m.isEnabled()) {
|
||||||
ENABLED_MODS.add(m);
|
ENABLED_MODS.add(m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Module[] getAllMods() {
|
public static Feature[] getAllMods() {
|
||||||
return MODS;
|
return MODS;
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface ModuleProvider {
|
public interface ModuleProvider {
|
||||||
Module[] getMods();
|
Feature[] getMods();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
package org.saturnclient.modules;
|
package org.saturnclient.feature;
|
||||||
|
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|
||||||
public interface HudMod {
|
public interface HudFeature {
|
||||||
public ModDimensions getDimensions();
|
public FeatureLayout getDimensions();
|
||||||
|
|
||||||
public void renderDummy(RenderScope scope);
|
public void renderDummy(RenderScope scope);
|
||||||
|
|
||||||
+10
-10
@@ -1,24 +1,24 @@
|
|||||||
package org.saturnclient.modules.mods;
|
package org.saturnclient.feature.features;
|
||||||
|
|
||||||
import org.saturnclient.modules.HudMod;
|
|
||||||
import org.saturnclient.modules.ModDimensions;
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
|
||||||
import org.saturnclient.modules.interfaces.ArmorDisplayInterface;
|
|
||||||
import org.saturnclient.common.ref.game.ItemStackRef;
|
import org.saturnclient.common.ref.game.ItemStackRef;
|
||||||
import org.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
import org.saturnclient.feature.HudFeature;
|
||||||
|
import org.saturnclient.feature.FeatureLayout;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
|
import org.saturnclient.feature.FeatureDetails;
|
||||||
|
import org.saturnclient.feature.interfaces.ArmorDisplayInterface;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|
||||||
public class ArmorDisplay extends Module implements HudMod {
|
public class ArmorDisplay extends Feature implements HudFeature {
|
||||||
|
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
private static ModDimensions dimensions = new ModDimensions(40, 75);
|
private static FeatureLayout dimensions = new FeatureLayout(40, 75);
|
||||||
private static Property<Boolean> useMainHand = Property.bool(true);
|
private static Property<Boolean> useMainHand = Property.bool(true);
|
||||||
|
|
||||||
private final ArmorDisplayInterface minecraft;
|
private final ArmorDisplayInterface minecraft;
|
||||||
|
|
||||||
public ArmorDisplay(ArmorDisplayInterface minecraft) {
|
public ArmorDisplay(ArmorDisplayInterface minecraft) {
|
||||||
super(new ModuleDetails("Armor Display", "armor")
|
super(new FeatureDetails("Armor Display", "armor")
|
||||||
.description("Displays armor durability")
|
.description("Displays armor durability")
|
||||||
.version("v0.1.0")
|
.version("v0.1.0")
|
||||||
.tags("Utility"),
|
.tags("Utility"),
|
||||||
@@ -102,7 +102,7 @@ public class ArmorDisplay extends Module implements HudMod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ModDimensions getDimensions() {
|
public FeatureLayout getDimensions() {
|
||||||
return dimensions;
|
return dimensions;
|
||||||
}
|
}
|
||||||
|
|
||||||
+6
-6
@@ -1,11 +1,11 @@
|
|||||||
package org.saturnclient.modules.mods;
|
package org.saturnclient.feature.features;
|
||||||
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
|
||||||
import org.saturnclient.modules.interfaces.AutoSprintInterface;
|
|
||||||
import org.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
|
import org.saturnclient.feature.FeatureDetails;
|
||||||
|
import org.saturnclient.feature.interfaces.AutoSprintInterface;
|
||||||
|
|
||||||
public class AutoSprint extends Module {
|
public class AutoSprint extends Feature {
|
||||||
|
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ public class AutoSprint extends Module {
|
|||||||
|
|
||||||
public AutoSprint(AutoSprintInterface minecraft) {
|
public AutoSprint(AutoSprintInterface minecraft) {
|
||||||
super(
|
super(
|
||||||
new ModuleDetails("Auto Sprint", "sprint")
|
new FeatureDetails("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"),
|
||||||
+9
-9
@@ -1,24 +1,24 @@
|
|||||||
package org.saturnclient.modules.mods;
|
package org.saturnclient.feature.features;
|
||||||
|
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
|
|
||||||
import org.saturnclient.modules.HudMod;
|
|
||||||
import org.saturnclient.modules.ModDimensions;
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
|
||||||
import org.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
import org.saturnclient.feature.HudFeature;
|
||||||
|
import org.saturnclient.feature.FeatureLayout;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
|
import org.saturnclient.feature.FeatureDetails;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Fonts;
|
import org.saturnclient.ui.resources.Fonts;
|
||||||
|
|
||||||
public class Clock extends Module implements HudMod {
|
public class Clock extends Feature implements HudFeature {
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
private static Property<Integer> format = Property.select(0, "24 hour", "12 hour");
|
private static Property<Integer> format = Property.select(0, "24 hour", "12 hour");
|
||||||
private static Property<Boolean> seconds = Property.bool(false);
|
private static Property<Boolean> seconds = Property.bool(false);
|
||||||
private static ModDimensions dimensions = new ModDimensions(60, Fonts.getHeight());
|
private static FeatureLayout dimensions = new FeatureLayout(60, Fonts.getHeight());
|
||||||
|
|
||||||
public Clock() {
|
public Clock() {
|
||||||
super(new ModuleDetails("Clock", "clock")
|
super(new FeatureDetails("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"),
|
||||||
@@ -71,7 +71,7 @@ public class Clock extends Module implements HudMod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ModDimensions getDimensions() {
|
public FeatureLayout getDimensions() {
|
||||||
return dimensions;
|
return dimensions;
|
||||||
}
|
}
|
||||||
|
|
||||||
+10
-10
@@ -1,15 +1,15 @@
|
|||||||
package org.saturnclient.modules.mods;
|
package org.saturnclient.feature.features;
|
||||||
|
|
||||||
import org.saturnclient.modules.HudMod;
|
|
||||||
import org.saturnclient.modules.ModDimensions;
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
|
||||||
import org.saturnclient.modules.interfaces.CoordinatesInterface;
|
|
||||||
import org.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
import org.saturnclient.feature.HudFeature;
|
||||||
|
import org.saturnclient.feature.FeatureLayout;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
|
import org.saturnclient.feature.FeatureDetails;
|
||||||
|
import org.saturnclient.feature.interfaces.CoordinatesInterface;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Fonts;
|
import org.saturnclient.ui.resources.Fonts;
|
||||||
|
|
||||||
public class Coordinates extends Module implements HudMod {
|
public class Coordinates extends Feature implements HudFeature {
|
||||||
|
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
|
|
||||||
@@ -20,12 +20,12 @@ public class Coordinates extends Module implements HudMod {
|
|||||||
"Newline",
|
"Newline",
|
||||||
"Newline annotated");
|
"Newline annotated");
|
||||||
|
|
||||||
private static ModDimensions dimensions = new ModDimensions(40, 18);
|
private static FeatureLayout dimensions = new FeatureLayout(40, 18);
|
||||||
|
|
||||||
private final CoordinatesInterface minecraft;
|
private final CoordinatesInterface minecraft;
|
||||||
|
|
||||||
public Coordinates(CoordinatesInterface minecraft) {
|
public Coordinates(CoordinatesInterface minecraft) {
|
||||||
super(new ModuleDetails("Coordinates", "coords")
|
super(new FeatureDetails("Coordinates", "coords")
|
||||||
.description("Displays your current coordinates")
|
.description("Displays your current coordinates")
|
||||||
.version("v0.1.0")
|
.version("v0.1.0")
|
||||||
.tags("Utility"),
|
.tags("Utility"),
|
||||||
@@ -87,7 +87,7 @@ public class Coordinates extends Module implements HudMod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ModDimensions getDimensions() {
|
public FeatureLayout getDimensions() {
|
||||||
return dimensions;
|
return dimensions;
|
||||||
}
|
}
|
||||||
|
|
||||||
+6
-6
@@ -1,13 +1,13 @@
|
|||||||
package org.saturnclient.modules.mods;
|
package org.saturnclient.feature.features;
|
||||||
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
|
||||||
import org.saturnclient.modules.interfaces.CrosshairInterface;
|
|
||||||
import org.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
|
import org.saturnclient.feature.FeatureDetails;
|
||||||
|
import org.saturnclient.feature.interfaces.CrosshairInterface;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Textures;
|
import org.saturnclient.ui.resources.Textures;
|
||||||
|
|
||||||
public class Crosshair extends Module {
|
public class Crosshair extends Feature {
|
||||||
|
|
||||||
public static Property<Boolean> enabled = Property.bool(false);
|
public static Property<Boolean> enabled = Property.bool(false);
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ public class Crosshair extends Module {
|
|||||||
|
|
||||||
public Crosshair(CrosshairInterface minecraft) {
|
public Crosshair(CrosshairInterface minecraft) {
|
||||||
super(
|
super(
|
||||||
new ModuleDetails("Crosshair", "crosshair")
|
new FeatureDetails("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"),
|
||||||
+10
-10
@@ -1,25 +1,25 @@
|
|||||||
package org.saturnclient.modules.mods;
|
package org.saturnclient.feature.features;
|
||||||
|
|
||||||
import org.saturnclient.modules.HudMod;
|
|
||||||
import org.saturnclient.modules.ModDimensions;
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
|
||||||
import org.saturnclient.modules.interfaces.DayCounterInterface;
|
|
||||||
import org.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
import org.saturnclient.feature.HudFeature;
|
||||||
|
import org.saturnclient.feature.FeatureLayout;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
|
import org.saturnclient.feature.FeatureDetails;
|
||||||
|
import org.saturnclient.feature.interfaces.DayCounterInterface;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Fonts;
|
import org.saturnclient.ui.resources.Fonts;
|
||||||
|
|
||||||
public class DayCounter extends Module implements HudMod {
|
public class DayCounter extends Feature implements HudFeature {
|
||||||
|
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
private static ModDimensions dimensions = new ModDimensions(40, 18);
|
private static FeatureLayout dimensions = new FeatureLayout(40, 18);
|
||||||
|
|
||||||
private final DayCounterInterface minecraft;
|
private final DayCounterInterface minecraft;
|
||||||
|
|
||||||
long day = 0;
|
long day = 0;
|
||||||
|
|
||||||
public DayCounter(DayCounterInterface minecraft) {
|
public DayCounter(DayCounterInterface minecraft) {
|
||||||
super(new ModuleDetails("DayCounter", "day")
|
super(new FeatureDetails("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"),
|
||||||
@@ -60,7 +60,7 @@ public class DayCounter extends Module implements HudMod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ModDimensions getDimensions() {
|
public FeatureLayout getDimensions() {
|
||||||
return dimensions;
|
return dimensions;
|
||||||
}
|
}
|
||||||
|
|
||||||
+10
-10
@@ -1,23 +1,23 @@
|
|||||||
package org.saturnclient.modules.mods;
|
package org.saturnclient.feature.features;
|
||||||
|
|
||||||
import org.saturnclient.modules.HudMod;
|
|
||||||
import org.saturnclient.modules.ModDimensions;
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
|
||||||
import org.saturnclient.modules.interfaces.FpsInterface;
|
|
||||||
import org.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
import org.saturnclient.feature.HudFeature;
|
||||||
|
import org.saturnclient.feature.FeatureLayout;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
|
import org.saturnclient.feature.FeatureDetails;
|
||||||
|
import org.saturnclient.feature.interfaces.FpsInterface;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Fonts;
|
import org.saturnclient.ui.resources.Fonts;
|
||||||
|
|
||||||
public class Fps extends Module implements HudMod {
|
public class Fps extends Feature implements HudFeature {
|
||||||
|
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
private static ModDimensions dimensions = new ModDimensions(60, Fonts.getHeight());
|
private static FeatureLayout dimensions = new FeatureLayout(60, Fonts.getHeight());
|
||||||
|
|
||||||
private final FpsInterface minecraft;
|
private final FpsInterface minecraft;
|
||||||
|
|
||||||
public Fps(FpsInterface minecraft) {
|
public Fps(FpsInterface minecraft) {
|
||||||
super(new ModuleDetails("FPS Display", "fps")
|
super(new FeatureDetails("FPS Display", "fps")
|
||||||
.description("Displays current FPS")
|
.description("Displays current FPS")
|
||||||
.version("v0.1.0")
|
.version("v0.1.0")
|
||||||
.tags("Utility"),
|
.tags("Utility"),
|
||||||
@@ -58,7 +58,7 @@ public class Fps extends Module implements HudMod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ModDimensions getDimensions() {
|
public FeatureLayout getDimensions() {
|
||||||
return dimensions;
|
return dimensions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+6
-6
@@ -1,12 +1,12 @@
|
|||||||
package org.saturnclient.modules.mods;
|
package org.saturnclient.feature.features;
|
||||||
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
|
||||||
import org.saturnclient.modules.interfaces.FreelookInterface;
|
|
||||||
import org.saturnclient.common.provider.GLFWProvider;
|
import org.saturnclient.common.provider.GLFWProvider;
|
||||||
import org.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
|
import org.saturnclient.feature.FeatureDetails;
|
||||||
|
import org.saturnclient.feature.interfaces.FreelookInterface;
|
||||||
|
|
||||||
public class Freelook extends Module {
|
public class Freelook extends Feature {
|
||||||
|
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
private static Property<Boolean> toggle = Property.bool(true);
|
private static Property<Boolean> toggle = Property.bool(true);
|
||||||
@@ -20,7 +20,7 @@ public class Freelook extends Module {
|
|||||||
|
|
||||||
public Freelook(FreelookInterface minecraft) {
|
public Freelook(FreelookInterface minecraft) {
|
||||||
super(
|
super(
|
||||||
new ModuleDetails("Freelook", "freelook")
|
new FeatureDetails("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"),
|
||||||
+5
-5
@@ -1,16 +1,16 @@
|
|||||||
package org.saturnclient.modules.mods;
|
package org.saturnclient.feature.features;
|
||||||
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
|
||||||
import org.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
|
import org.saturnclient.feature.FeatureDetails;
|
||||||
|
|
||||||
public class Fullbright extends Module {
|
public class Fullbright extends Feature {
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
private static Property<Integer> brightness = Property.integer(100);
|
private static Property<Integer> brightness = Property.integer(100);
|
||||||
|
|
||||||
public Fullbright() {
|
public Fullbright() {
|
||||||
super(
|
super(
|
||||||
new ModuleDetails("Fullbright", "fullbright")
|
new FeatureDetails("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"),
|
||||||
+11
-12
@@ -1,26 +1,26 @@
|
|||||||
package org.saturnclient.modules.mods;
|
package org.saturnclient.feature.features;
|
||||||
|
|
||||||
import org.saturnclient.modules.HudMod;
|
|
||||||
import org.saturnclient.modules.ModDimensions;
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
|
||||||
import org.saturnclient.modules.interfaces.HealthDisplayInterface;
|
|
||||||
import org.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
import org.saturnclient.feature.HudFeature;
|
||||||
|
import org.saturnclient.feature.FeatureLayout;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
|
import org.saturnclient.feature.FeatureDetails;
|
||||||
|
import org.saturnclient.feature.interfaces.HealthDisplayInterface;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Fonts;
|
import org.saturnclient.ui.resources.Fonts;
|
||||||
|
|
||||||
public class HealthDisplay extends Module implements HudMod {
|
public class HealthDisplay extends Feature implements HudFeature {
|
||||||
|
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
private static Property<Integer> displayMode = Property.select(0, "Health", "Hearts");
|
private static Property<Integer> displayMode = Property.select(0, "Health", "Hearts");
|
||||||
private static Property<Integer> decimals = Property.select(0, "0", "1", "2");
|
private static Property<Integer> decimals = Property.select(0, "0", "1", "2");
|
||||||
|
|
||||||
private static ModDimensions dimensions = new ModDimensions(40, 18);
|
private static FeatureLayout dimensions = new FeatureLayout(40, 18);
|
||||||
|
|
||||||
private final HealthDisplayInterface minecraft;
|
private final HealthDisplayInterface minecraft;
|
||||||
|
|
||||||
public HealthDisplay(HealthDisplayInterface minecraft) {
|
public HealthDisplay(HealthDisplayInterface minecraft) {
|
||||||
super(new ModuleDetails("Health display", "health")
|
super(new FeatureDetails("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"),
|
||||||
@@ -73,8 +73,7 @@ public class HealthDisplay extends Module implements HudMod {
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
dimensions.font.value,
|
dimensions.font.value,
|
||||||
dimensions.fgColor.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;
|
||||||
@@ -86,7 +85,7 @@ public class HealthDisplay extends Module implements HudMod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ModDimensions getDimensions() {
|
public FeatureLayout getDimensions() {
|
||||||
return dimensions;
|
return dimensions;
|
||||||
}
|
}
|
||||||
|
|
||||||
+10
-10
@@ -1,14 +1,14 @@
|
|||||||
package org.saturnclient.modules.mods;
|
package org.saturnclient.feature.features;
|
||||||
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.modules.HudMod;
|
|
||||||
import org.saturnclient.modules.ModDimensions;
|
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
|
||||||
import org.saturnclient.modules.interfaces.KeystrokesInterface;
|
|
||||||
import org.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
import org.saturnclient.feature.HudFeature;
|
||||||
|
import org.saturnclient.feature.FeatureLayout;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
|
import org.saturnclient.feature.FeatureDetails;
|
||||||
|
import org.saturnclient.feature.interfaces.KeystrokesInterface;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|
||||||
public class Keystrokes extends Module implements HudMod {
|
public class Keystrokes extends Feature implements HudFeature {
|
||||||
|
|
||||||
private static final Property<Boolean> enabled = Property.bool(false);
|
private static final Property<Boolean> enabled = Property.bool(false);
|
||||||
private static final Property<Boolean> showMouse = Property.bool(true);
|
private static final Property<Boolean> showMouse = Property.bool(true);
|
||||||
@@ -17,7 +17,7 @@ public class Keystrokes extends Module implements HudMod {
|
|||||||
private static final Property<Integer> clickBg = Property.color(0xFFCCCCCC);
|
private static final Property<Integer> clickBg = Property.color(0xFFCCCCCC);
|
||||||
private static final Property<Integer> clickFg = Property.color(0xFFFFFFFF);
|
private static final Property<Integer> clickFg = Property.color(0xFFFFFFFF);
|
||||||
|
|
||||||
private static final ModDimensions dimensions = new ModDimensions(78, 54);
|
private static final FeatureLayout dimensions = new FeatureLayout(78, 54);
|
||||||
|
|
||||||
private final KeystrokesInterface minecraft;
|
private final KeystrokesInterface minecraft;
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ public class Keystrokes extends Module implements HudMod {
|
|||||||
private static final int SPACE_HEIGHT = 19;
|
private static final int SPACE_HEIGHT = 19;
|
||||||
|
|
||||||
public Keystrokes(KeystrokesInterface minecraft) {
|
public Keystrokes(KeystrokesInterface minecraft) {
|
||||||
super(new ModuleDetails("Keystrokes", "keystrokes")
|
super(new FeatureDetails("Keystrokes", "keystrokes")
|
||||||
.description("Displays movement keystrokes")
|
.description("Displays movement keystrokes")
|
||||||
.version("v0.2.0")
|
.version("v0.2.0")
|
||||||
.tags("Utility"),
|
.tags("Utility"),
|
||||||
@@ -145,7 +145,7 @@ public class Keystrokes extends Module implements HudMod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ModDimensions getDimensions() {
|
public FeatureLayout getDimensions() {
|
||||||
return dimensions;
|
return dimensions;
|
||||||
}
|
}
|
||||||
|
|
||||||
+10
-10
@@ -1,11 +1,11 @@
|
|||||||
package org.saturnclient.modules.mods;
|
package org.saturnclient.feature.features;
|
||||||
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
|
||||||
import org.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.modules.interfaces.NametagsInterface;
|
import org.saturnclient.feature.Feature;
|
||||||
|
import org.saturnclient.feature.FeatureDetails;
|
||||||
|
import org.saturnclient.feature.interfaces.NametagsInterface;
|
||||||
|
|
||||||
public class Nametags extends Module {
|
public class Nametags extends Feature {
|
||||||
|
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
private static Property<Boolean> healthDisplay = Property.bool(false);
|
private static Property<Boolean> healthDisplay = Property.bool(false);
|
||||||
@@ -17,11 +17,11 @@ 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","Dark Blue","Dark Green","Dark Aqua","Dark Red","Dark Purple","Gold","Gray",
|
"Black", "Dark Blue", "Dark Green", "Dark Aqua", "Dark Red", "Dark Purple", "Gold", "Gray",
|
||||||
"Dark Gray","Blue","Green","Aqua","Red","Light Purple","Yellow","White");
|
"Dark Gray", "Blue", "Green", "Aqua", "Red", "Light Purple", "Yellow", "White");
|
||||||
private static Property<Integer> healthColor = Property.select(12,
|
private static Property<Integer> healthColor = Property.select(12,
|
||||||
"Black","Dark Blue","Dark Green","Dark Aqua","Dark Red","Dark Purple","Gold","Gray",
|
"Black", "Dark Blue", "Dark Green", "Dark Aqua", "Dark Red", "Dark Purple", "Gold", "Gray",
|
||||||
"Dark Gray","Blue","Green","Aqua","Red","Light Purple","Yellow","White");
|
"Dark Gray", "Blue", "Green", "Aqua", "Red", "Light Purple", "Yellow", "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",
|
||||||
@@ -29,7 +29,7 @@ public class Nametags extends Module {
|
|||||||
};
|
};
|
||||||
|
|
||||||
public Nametags(NametagsInterface minecraft) {
|
public Nametags(NametagsInterface minecraft) {
|
||||||
super(new ModuleDetails("Nametags", "nametags")
|
super(new FeatureDetails("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"),
|
||||||
+5
-5
@@ -1,16 +1,16 @@
|
|||||||
package org.saturnclient.modules.mods;
|
package org.saturnclient.feature.features;
|
||||||
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
|
||||||
import org.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
|
import org.saturnclient.feature.FeatureDetails;
|
||||||
|
|
||||||
public class NoFog extends Module {
|
public class NoFog extends Feature {
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
private static Property<Boolean> liquids = Property.bool(false);
|
private static Property<Boolean> liquids = Property.bool(false);
|
||||||
|
|
||||||
public NoFog() {
|
public NoFog() {
|
||||||
super(
|
super(
|
||||||
new ModuleDetails("No Fog", "nofog")
|
new FeatureDetails("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"),
|
||||||
+10
-10
@@ -1,23 +1,23 @@
|
|||||||
package org.saturnclient.modules.mods;
|
package org.saturnclient.feature.features;
|
||||||
|
|
||||||
import org.saturnclient.modules.HudMod;
|
|
||||||
import org.saturnclient.modules.ModDimensions;
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
|
||||||
import org.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.modules.interfaces.PingInterface;
|
import org.saturnclient.feature.HudFeature;
|
||||||
|
import org.saturnclient.feature.FeatureLayout;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
|
import org.saturnclient.feature.FeatureDetails;
|
||||||
|
import org.saturnclient.feature.interfaces.PingInterface;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Fonts;
|
import org.saturnclient.ui.resources.Fonts;
|
||||||
|
|
||||||
public class Ping extends Module implements HudMod {
|
public class Ping extends Feature implements HudFeature {
|
||||||
|
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
private static ModDimensions dimensions = new ModDimensions(60, Fonts.getHeight());
|
private static FeatureLayout dimensions = new FeatureLayout(60, Fonts.getHeight());
|
||||||
|
|
||||||
private final PingInterface pingProvider;
|
private final PingInterface pingProvider;
|
||||||
|
|
||||||
public Ping(PingInterface pingProvider) {
|
public Ping(PingInterface pingProvider) {
|
||||||
super(new ModuleDetails("Ping Display", "ping")
|
super(new FeatureDetails("Ping Display", "ping")
|
||||||
.description("Displays ping")
|
.description("Displays ping")
|
||||||
.version("v0.1.0")
|
.version("v0.1.0")
|
||||||
.tags("Utility"),
|
.tags("Utility"),
|
||||||
@@ -53,7 +53,7 @@ public class Ping extends Module implements HudMod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ModDimensions getDimensions() {
|
public FeatureLayout getDimensions() {
|
||||||
return dimensions;
|
return dimensions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+10
-10
@@ -1,27 +1,27 @@
|
|||||||
package org.saturnclient.modules.mods;
|
package org.saturnclient.feature.features;
|
||||||
|
|
||||||
import org.saturnclient.modules.HudMod;
|
|
||||||
import org.saturnclient.modules.ModDimensions;
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
|
||||||
import org.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
import org.saturnclient.modules.interfaces.SpeedometerInterface;
|
import org.saturnclient.feature.HudFeature;
|
||||||
|
import org.saturnclient.feature.FeatureLayout;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
|
import org.saturnclient.feature.FeatureDetails;
|
||||||
|
import org.saturnclient.feature.interfaces.SpeedometerInterface;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Fonts;
|
import org.saturnclient.ui.resources.Fonts;
|
||||||
|
|
||||||
public class Speedometer extends Module implements HudMod {
|
public class Speedometer extends Feature implements HudFeature {
|
||||||
|
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
private static Property<Integer> axis = Property.select(1, "Absolute", "X axis", "Y axis");
|
private static Property<Integer> axis = Property.select(1, "Absolute", "X axis", "Y axis");
|
||||||
private static Property<Integer> unitText = Property.select(0, "None", "Blocks/s", "blocks/s", "b/s");
|
private static Property<Integer> unitText = Property.select(0, "None", "Blocks/s", "blocks/s", "b/s");
|
||||||
private static Property<Boolean> speedText = Property.bool(true);
|
private static Property<Boolean> speedText = Property.bool(true);
|
||||||
private static ModDimensions dimensions = new ModDimensions(40, 18);
|
private static FeatureLayout dimensions = new FeatureLayout(40, 18);
|
||||||
|
|
||||||
private final SpeedometerInterface provider;
|
private final SpeedometerInterface provider;
|
||||||
private double speed = 0.;
|
private double speed = 0.;
|
||||||
|
|
||||||
public Speedometer(SpeedometerInterface provider) {
|
public Speedometer(SpeedometerInterface provider) {
|
||||||
super(new ModuleDetails("Speedometer", "speed")
|
super(new FeatureDetails("Speedometer", "speed")
|
||||||
.description("Displays your current speed")
|
.description("Displays your current speed")
|
||||||
.version("v0.1.0")
|
.version("v0.1.0")
|
||||||
.tags("Utility"),
|
.tags("Utility"),
|
||||||
@@ -85,7 +85,7 @@ public class Speedometer extends Module implements HudMod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ModDimensions getDimensions() {
|
public FeatureLayout getDimensions() {
|
||||||
return dimensions;
|
return dimensions;
|
||||||
}
|
}
|
||||||
|
|
||||||
+12
-11
@@ -1,24 +1,24 @@
|
|||||||
package org.saturnclient.modules.mods;
|
package org.saturnclient.feature.features;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.saturnclient.modules.HudMod;
|
|
||||||
import org.saturnclient.modules.ModDimensions;
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
|
||||||
import org.saturnclient.modules.interfaces.StatusEffectsInterface;
|
|
||||||
import org.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
import org.saturnclient.feature.HudFeature;
|
||||||
|
import org.saturnclient.feature.FeatureLayout;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
|
import org.saturnclient.feature.FeatureDetails;
|
||||||
|
import org.saturnclient.feature.interfaces.StatusEffectsInterface;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
|
|
||||||
public class StatusEffects extends Module implements HudMod {
|
public class StatusEffects extends Feature implements HudFeature {
|
||||||
|
|
||||||
public static Property<Boolean> enabled = Property.bool(false);
|
public static Property<Boolean> enabled = Property.bool(false);
|
||||||
private static ModDimensions dimensions = new ModDimensions(60, 0);
|
private static FeatureLayout dimensions = new FeatureLayout(60, 0);
|
||||||
|
|
||||||
private final StatusEffectsInterface provider;
|
private final StatusEffectsInterface provider;
|
||||||
|
|
||||||
public StatusEffects(StatusEffectsInterface provider) {
|
public StatusEffects(StatusEffectsInterface provider) {
|
||||||
super(new ModuleDetails("Status effects", "effect")
|
super(new FeatureDetails("Status effects", "effect")
|
||||||
.description("Displays status effects")
|
.description("Displays status effects")
|
||||||
.version("v0.1.0")
|
.version("v0.1.0")
|
||||||
.tags("Utility"),
|
.tags("Utility"),
|
||||||
@@ -32,7 +32,8 @@ public class StatusEffects extends Module implements HudMod {
|
|||||||
int row = 0;
|
int row = 0;
|
||||||
|
|
||||||
for (StatusEffectsInterface.Effect effect : effects) {
|
for (StatusEffectsInterface.Effect effect : effects) {
|
||||||
if (!effect.shouldShowIcon()) continue;
|
if (!effect.shouldShowIcon())
|
||||||
|
continue;
|
||||||
|
|
||||||
scope.drawSpriteStretched(effect.getIcon(), 0, 18 * row, 16, 16);
|
scope.drawSpriteStretched(effect.getIcon(), 0, 18 * row, 16, 16);
|
||||||
scope.drawText(0.5f, getDurationAsString(effect), 18, 18 * row + 3, dimensions.font.value, -1);
|
scope.drawText(0.5f, getDurationAsString(effect), 18, 18 * row + 3, dimensions.font.value, -1);
|
||||||
@@ -70,7 +71,7 @@ public class StatusEffects extends Module implements HudMod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ModDimensions getDimensions() {
|
public FeatureLayout getDimensions() {
|
||||||
return dimensions;
|
return dimensions;
|
||||||
}
|
}
|
||||||
|
|
||||||
+9
-9
@@ -1,16 +1,16 @@
|
|||||||
package org.saturnclient.modules.mods;
|
package org.saturnclient.feature.features;
|
||||||
|
|
||||||
import org.saturnclient.modules.HudMod;
|
|
||||||
import org.saturnclient.modules.ModDimensions;
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
|
||||||
import org.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
import org.saturnclient.feature.HudFeature;
|
||||||
|
import org.saturnclient.feature.FeatureLayout;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
|
import org.saturnclient.feature.FeatureDetails;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.resources.Fonts;
|
import org.saturnclient.ui.resources.Fonts;
|
||||||
|
|
||||||
public class Tps extends Module implements HudMod {
|
public class Tps extends Feature implements HudFeature {
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
private static ModDimensions dimensions = new ModDimensions(60, Fonts.getHeight());
|
private static FeatureLayout dimensions = new FeatureLayout(60, Fonts.getHeight());
|
||||||
|
|
||||||
private static long lastWorldAge = -1;
|
private static long lastWorldAge = -1;
|
||||||
private static long lastRealTime = -1;
|
private static long lastRealTime = -1;
|
||||||
@@ -25,7 +25,7 @@ public class Tps extends Module implements HudMod {
|
|||||||
private static int samplesFilled = 0;
|
private static int samplesFilled = 0;
|
||||||
|
|
||||||
public Tps() {
|
public Tps() {
|
||||||
super(new ModuleDetails("TPS Display", "tps")
|
super(new FeatureDetails("TPS Display", "tps")
|
||||||
.description("Displays the TPS")
|
.description("Displays the TPS")
|
||||||
.version("v0.1.0")
|
.version("v0.1.0")
|
||||||
.tags("Utility"),
|
.tags("Utility"),
|
||||||
@@ -94,7 +94,7 @@ public class Tps extends Module implements HudMod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ModDimensions getDimensions() {
|
public FeatureLayout getDimensions() {
|
||||||
return dimensions;
|
return dimensions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+5
-5
@@ -1,11 +1,11 @@
|
|||||||
package org.saturnclient.modules.mods;
|
package org.saturnclient.feature.features;
|
||||||
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.modules.ModuleDetails;
|
|
||||||
import org.saturnclient.common.provider.GLFWProvider;
|
import org.saturnclient.common.provider.GLFWProvider;
|
||||||
import org.saturnclient.config.manager.Property;
|
import org.saturnclient.config.manager.Property;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
|
import org.saturnclient.feature.FeatureDetails;
|
||||||
|
|
||||||
public class Zoom extends Module {
|
public class Zoom extends Feature {
|
||||||
private static Property<Boolean> enabled = Property.bool(false);
|
private static Property<Boolean> enabled = Property.bool(false);
|
||||||
private static Property<Boolean> toggle = Property.bool(false);
|
private static Property<Boolean> toggle = Property.bool(false);
|
||||||
public static Property<Integer> zoomKey = Property.keybinding(GLFWProvider.GLFW_KEY_C);
|
public static Property<Integer> zoomKey = Property.keybinding(GLFWProvider.GLFW_KEY_C);
|
||||||
@@ -15,7 +15,7 @@ public class Zoom extends Module {
|
|||||||
|
|
||||||
public Zoom() {
|
public Zoom() {
|
||||||
super(
|
super(
|
||||||
new ModuleDetails("Zoom", "zoom")
|
new FeatureDetails("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"),
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.saturnclient.modules.interfaces;
|
package org.saturnclient.feature.interfaces;
|
||||||
|
|
||||||
import org.saturnclient.common.ref.game.ItemStackRef;
|
import org.saturnclient.common.ref.game.ItemStackRef;
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.saturnclient.modules.interfaces;
|
package org.saturnclient.feature.interfaces;
|
||||||
|
|
||||||
public interface AutoSprintInterface {
|
public interface AutoSprintInterface {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.saturnclient.modules.interfaces;
|
package org.saturnclient.feature.interfaces;
|
||||||
|
|
||||||
public interface CoordinatesInterface {
|
public interface CoordinatesInterface {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.saturnclient.modules.interfaces;
|
package org.saturnclient.feature.interfaces;
|
||||||
|
|
||||||
public interface CrosshairInterface {
|
public interface CrosshairInterface {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.saturnclient.modules.interfaces;
|
package org.saturnclient.feature.interfaces;
|
||||||
|
|
||||||
public interface DayCounterInterface {
|
public interface DayCounterInterface {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.saturnclient.modules.interfaces;
|
package org.saturnclient.feature.interfaces;
|
||||||
|
|
||||||
public interface FpsInterface {
|
public interface FpsInterface {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.saturnclient.modules.interfaces;
|
package org.saturnclient.feature.interfaces;
|
||||||
|
|
||||||
public interface FreelookInterface {
|
public interface FreelookInterface {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.saturnclient.modules.interfaces;
|
package org.saturnclient.feature.interfaces;
|
||||||
|
|
||||||
public interface HealthDisplayInterface {
|
public interface HealthDisplayInterface {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.saturnclient.modules.interfaces;
|
package org.saturnclient.feature.interfaces;
|
||||||
|
|
||||||
public interface KeystrokesInterface {
|
public interface KeystrokesInterface {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.saturnclient.modules.interfaces;
|
package org.saturnclient.feature.interfaces;
|
||||||
|
|
||||||
public interface NametagsInterface {
|
public interface NametagsInterface {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.saturnclient.modules.interfaces;
|
package org.saturnclient.feature.interfaces;
|
||||||
|
|
||||||
public interface PingInterface {
|
public interface PingInterface {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.saturnclient.modules.interfaces;
|
package org.saturnclient.feature.interfaces;
|
||||||
|
|
||||||
public interface SpeedometerInterface {
|
public interface SpeedometerInterface {
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.saturnclient.modules.interfaces;
|
package org.saturnclient.feature.interfaces;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package org.saturnclient.ui.components;
|
package org.saturnclient.ui.components;
|
||||||
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.common.provider.Providers;
|
import org.saturnclient.common.provider.Providers;
|
||||||
import org.saturnclient.config.Theme;
|
import org.saturnclient.config.Theme;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
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;
|
||||||
@@ -13,149 +13,149 @@ import org.saturnclient.ui.screens.ConfigEditor;
|
|||||||
|
|
||||||
public class SaturnModule extends Element {
|
public class SaturnModule extends Element {
|
||||||
|
|
||||||
private final Module mod;
|
private final Feature 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(Feature 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());
|
|
||||||
|
|
||||||
// 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(
|
||||||
Providers.saturn.getClient().setScreen(new ConfigEditor(mod.getConfig()));
|
getSettingsX(),
|
||||||
} else {
|
getSettingsY(),
|
||||||
mod.setEnabled(!mod.isEnabled());
|
getSettingsHitBox(),
|
||||||
|
getSettingsHitBox());
|
||||||
|
|
||||||
|
// 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;
|
Providers.saturn.getClient().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,11 +1,11 @@
|
|||||||
package org.saturnclient.ui.screens;
|
package org.saturnclient.ui.screens;
|
||||||
|
|
||||||
import org.saturnclient.modules.HudMod;
|
|
||||||
import org.saturnclient.modules.ModDimensions;
|
|
||||||
import org.saturnclient.modules.ModManager;
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.common.ref.render.MatrixStackRef;
|
import org.saturnclient.common.ref.render.MatrixStackRef;
|
||||||
import org.saturnclient.config.manager.ConfigManager;
|
import org.saturnclient.config.manager.ConfigManager;
|
||||||
|
import org.saturnclient.feature.HudFeature;
|
||||||
|
import org.saturnclient.feature.FeatureLayout;
|
||||||
|
import org.saturnclient.feature.FeatureManager;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
import org.saturnclient.ui.RenderScope;
|
import org.saturnclient.ui.RenderScope;
|
||||||
import org.saturnclient.ui.SaturnScreen;
|
import org.saturnclient.ui.SaturnScreen;
|
||||||
|
|
||||||
@@ -13,17 +13,17 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class HudEditor extends SaturnScreen {
|
public class HudEditor extends SaturnScreen {
|
||||||
private final List<HudMod> hudMods = new ArrayList<>();
|
private final List<HudFeature> hudMods = new ArrayList<>();
|
||||||
private HudMod draggingMod = null;
|
private HudFeature draggingMod = null;
|
||||||
private boolean resizing = false;
|
private boolean resizing = false;
|
||||||
private int offsetX, offsetY;
|
private int offsetX, offsetY;
|
||||||
private static final int RESIZE_MARGIN = 3;
|
private static final int RESIZE_MARGIN = 3;
|
||||||
|
|
||||||
public HudEditor() {
|
public HudEditor() {
|
||||||
super("HUD Editor");
|
super("HUD Editor");
|
||||||
for (Module m : ModManager.ENABLED_MODS) {
|
for (Feature m : FeatureManager.ENABLED_MODS) {
|
||||||
if (m.isEnabled() && m instanceof HudMod) {
|
if (m.isEnabled() && m instanceof HudFeature) {
|
||||||
hudMods.add((HudMod) m);
|
hudMods.add((HudFeature) m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,8 +32,8 @@ public class HudEditor extends SaturnScreen {
|
|||||||
public boolean mouseClicked(double mouseX, double mouseY, int button) {
|
public boolean mouseClicked(double mouseX, double mouseY, int button) {
|
||||||
if (button == 0) {
|
if (button == 0) {
|
||||||
for (int m = hudMods.size() - 1; m >= 0; m--) {
|
for (int m = hudMods.size() - 1; m >= 0; m--) {
|
||||||
HudMod mod = hudMods.get(m);
|
HudFeature mod = hudMods.get(m);
|
||||||
ModDimensions dim = mod.getDimensions();
|
FeatureLayout dim = mod.getDimensions();
|
||||||
|
|
||||||
// Check if clicking the corner for resizing
|
// Check if clicking the corner for resizing
|
||||||
if (isCorner(mouseX, mouseY, dim)) {
|
if (isCorner(mouseX, mouseY, dim)) {
|
||||||
@@ -69,7 +69,7 @@ public class HudEditor extends SaturnScreen {
|
|||||||
@Override
|
@Override
|
||||||
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) {
|
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) {
|
||||||
if (draggingMod != null) {
|
if (draggingMod != null) {
|
||||||
ModDimensions dim = draggingMod.getDimensions();
|
FeatureLayout dim = draggingMod.getDimensions();
|
||||||
|
|
||||||
if (resizing) {
|
if (resizing) {
|
||||||
// Scale based on cursor movement
|
// Scale based on cursor movement
|
||||||
@@ -90,8 +90,8 @@ public class HudEditor extends SaturnScreen {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(RenderScope renderScope, int mouseX, int mouseY, float delta, long elapsed) {
|
public void render(RenderScope renderScope, int mouseX, int mouseY, float delta, long elapsed) {
|
||||||
for (HudMod mod : hudMods) {
|
for (HudFeature mod : hudMods) {
|
||||||
ModDimensions dim = mod.getDimensions();
|
FeatureLayout dim = mod.getDimensions();
|
||||||
MatrixStackRef matrices = renderScope.getMatrixStack();
|
MatrixStackRef matrices = renderScope.getMatrixStack();
|
||||||
matrices.push();
|
matrices.push();
|
||||||
|
|
||||||
@@ -113,12 +113,12 @@ public class HudEditor extends SaturnScreen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isInside(double mouseX, double mouseY, ModDimensions dim) {
|
private boolean isInside(double mouseX, double mouseY, FeatureLayout dim) {
|
||||||
return mouseX >= dim.x.value && mouseX <= dim.x.value + (dim.width * dim.scale.value) &&
|
return mouseX >= dim.x.value && mouseX <= dim.x.value + (dim.width * dim.scale.value) &&
|
||||||
mouseY >= dim.y.value && mouseY <= dim.y.value + (dim.height * dim.scale.value);
|
mouseY >= dim.y.value && mouseY <= dim.y.value + (dim.height * dim.scale.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isCorner(double mouseX, double mouseY, ModDimensions dim) {
|
private boolean isCorner(double mouseX, double mouseY, FeatureLayout dim) {
|
||||||
float rightX = dim.x.value + dim.width * dim.scale.value;
|
float rightX = dim.x.value + dim.width * dim.scale.value;
|
||||||
float bottomY = dim.y.value + dim.height * dim.scale.value;
|
float bottomY = dim.y.value + dim.height * dim.scale.value;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package org.saturnclient.ui.screens;
|
package org.saturnclient.ui.screens;
|
||||||
|
|
||||||
import org.saturnclient.modules.ModManager;
|
|
||||||
import org.saturnclient.modules.Module;
|
|
||||||
import org.saturnclient.config.AnimationConfig;
|
import org.saturnclient.config.AnimationConfig;
|
||||||
|
import org.saturnclient.feature.FeatureManager;
|
||||||
|
import org.saturnclient.feature.Feature;
|
||||||
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;
|
||||||
@@ -29,7 +29,7 @@ public class ModMenu extends SaturnScreen {
|
|||||||
|
|
||||||
AnimationStagger moduleStagger = new AnimationStagger(AnimationConfig.modMenu);
|
AnimationStagger moduleStagger = new AnimationStagger(AnimationConfig.modMenu);
|
||||||
|
|
||||||
for (Module mod : ModManager.MODS) {
|
for (Feature mod : FeatureManager.MODS) {
|
||||||
moduleStagger.draw(
|
moduleStagger.draw(
|
||||||
new SaturnModule(mod)
|
new SaturnModule(mod)
|
||||||
.position((160 + g) * col, (50 + g) * row)
|
.position((160 + g) * col, (50 + g) * row)
|
||||||
|
|||||||
Reference in New Issue
Block a user