Hud Component Modifications

This commit is contained in:
Kam committed 2025-02-23 15:50:45 -05:00
1 parent 3e23893e78
commit 2640a6c7e0
3 files changed
+35 -9

No files matched your search

@@ -66,6 +66,7 @@ public class CompassHudComponent extends HudComponent {
@Override
public void load() {
enabled = ConfigClient.CompassEnabled;
posX = ConfigClient.CompassOverlayX;
posY = ConfigClient.CompassOverlayY;
scale = ConfigClient.CompassOverlayScale;
@@ -74,11 +75,23 @@ public class CompassHudComponent extends HudComponent {
@Override
public void save() {
ConfigClient.CompassEnabled = enabled;
ConfigClient.CompassEnabledProperty.set(ConfigClient.CompassEnabled);
ConfigClient.CompassOverlayX = posX;
ConfigClient.CompassOverlayXProperty.set(ConfigClient.CompassOverlayX);
ConfigClient.CompassOverlayY = posY;
ConfigClient.CompassOverlayYProperty.set(ConfigClient.CompassOverlayY);
ConfigClient.CompassOverlayScale = scale;
ConfigClient.CompassOverlayScaleProperty.set(ConfigClient.CompassOverlayScale);
ConfigClient.CompassOverlayWidth = overlayWidth;
ConfigClient.config.save();
ConfigClient.CompassOverlayWidthProperty.set(ConfigClient.CompassOverlayWidth);
if(ConfigClient.config.hasChanged())
ConfigClient.config.save();
}
@Override
@@ -15,7 +15,6 @@ public class ConfigClient
public final static String GENERAL = "General";
public final static String VISUAL = "Visual";
public final static String QUESTING = "Questing";
public final static String MODEL = "Model";
public final static String TEXTURE = "Texture";
public final static String HUD = "Hud";
@@ -79,16 +78,20 @@ public class ConfigClient
public static Property QuestOverlayTextAlignProperty;
public static int QuestOverlayTextAlign = 1; // 0: Left, 1: Center, 2: Right
public static Property CompassEnabledProperty;
public static boolean CompassEnabled;
public static Property CompassOverlayXProperty;
public static Property CompassOverlayYProperty;
public static Property CompassOverlayScaleProperty;
public static Property CompassOverlayWidthProperty;
public static int CompassOverlayX;
public static int CompassOverlayY;
public static int CompassOverlayScale;
public static int CompassOverlayWidth;
public static Property CompassOverlayYProperty;
public static int CompassOverlayY;
public static Property CompassOverlayScaleProperty;
public static int CompassOverlayScale;
public static Property CompassOverlayWidthProperty;
public static int CompassOverlayWidth;
/**
* Texture Properties
@@ -133,6 +136,14 @@ public class ConfigClient
QuestOverlayTextAlignProperty = config.get(HUD, "Quest Hud Text Alignment", 1, "Text alignment in quest overlay (0: Left, 1: Center, 2: Right).");
QuestOverlayTextAlign = QuestOverlayTextAlignProperty.getInt(1);
CompassEnabledProperty = config.get(
HUD,
"Compass Hud Enabled",
true,
"Enable Compass Hud Component"
);
CompassEnabled = CompassEnabledProperty.getBoolean();
// Compass HUD Configs
CompassOverlayXProperty = config.get(
HUD,
@@ -1,5 +1,7 @@
package noppes.npcs.config;
import net.minecraftforge.common.config.Property;
import java.io.File;
public class LoadConfiguration {