using System; using System.ComponentModel; using System.Drawing; using System.Numerics; using System.Text.Json.Serialization; using Dalamud.Interface; using KamiLib.Configuration; namespace Mappy.Data; public enum CenterTarget { [Description("Disabled")] Disabled = 0, [Description("Player")] Player = 1, [Description("Map")] Map = 2, } [Flags] public enum FadeMode { [Description("Always")] Always = 1 << 0, [Description("When Moving")] WhenMoving = 1 << 2, [Description("When Focused")] WhenFocused = 1 << 3, [Description("When Unfocused")] WhenUnFocused = 1 << 4, } public class SystemConfig : CharacterConfiguration { public bool UseLinearZoom = false; public float ZoomSpeed = 0.25f; public float IconScale = 0.50f; public bool ShowMiscTooltips = true; public bool HideWithGameGui = true; public bool HideBetweenAreas = false; public bool HideInCombat = false; public bool KeepOpen = false; public bool FollowOnOpen = false; public bool FollowPlayer = true; public CenterTarget CenterOnOpen = CenterTarget.Disabled; public bool ScalePlayerCone = false; public float ConeSize = 150.0f; public bool ShowRadar = true; public bool ShowRadarInDuties = false; public Vector4 RadarColor = KnownColor.Gray.Vector() with { W = 0.10f }; public Vector4 RadarOutlineColor = KnownColor.Gray.Vector() with { W = 0.30f }; public bool HideWindowFrame = false; public bool HideWindowBackground = false; public bool EnableShiftDragMove = false; public bool LockWindow = false; public float FadePercent = 0.60f; public FadeMode FadeMode = FadeMode.WhenUnFocused | FadeMode.WhenMoving; public Vector2 WindowPosition = new(1024.0f, 700.0f); public Vector2 WindowSize = new(500.0f, 500.0f); public bool AlwaysShowToolbar = false; public bool ShowToolbarOnHover = true; public bool ScaleWithZoom = true; public bool AcceptedSpoilerWarning = false; public Vector4 AreaColor = KnownColor.CornflowerBlue.Vector() with { W = 0.33f }; public Vector4 AreaOutlineColor = KnownColor.CornflowerBlue.Vector() with { W = 0.30f }; public Vector4 PlayerConeColor = KnownColor.CornflowerBlue.Vector() with { W = 0.33f }; public Vector4 PlayerConeOutlineColor = KnownColor.CornflowerBlue.Vector() with { W = 1.0f }; public bool CenterOnFlag = true; public bool CenterOnGathering = true; public bool CenterOnQuest = true; public bool LockCenterOnMap = false; public bool ShowCoordinateBar = true; public float ToolbarFade = 0.33f; public float CoordinateBarFade = 0.66f; public Vector4 CoordinateTextColor = KnownColor.White.Vector(); public bool ZoomLocked = false; public bool ShowPlayers = true; public bool SetFlagOnFateClick = false; public bool ShowPlayerIcon = true; public float PlayerIconScale = 1.0f; public float MapScale = 1.0f; public bool AutoZoom = false; public bool ShowRegionLabel = true; public bool ShowMapLabel = true; public bool ShowAreaLabel = true; public bool ShowSubAreaLabel = true; public bool NoFocusOnAppear = false; public float LargeAreaTextScale = 1.5f; public float SmallAreaTextScale = 1.0f; public bool ShowTextLabels = true; public bool ShowFogOfWar = true; public bool ScaleTextWithZoom = true; public float AutoZoomScaleFactor = 0.33f; public bool SuppressNativeMapOpenSound = true; // Minimap public bool ShowMinimap = false; public float MinimapSize = 200.0f; public Vector2 MinimapPosition = new(50.0f, 50.0f); public float MinimapOpacity = 0.85f; public float MinimapZoom = 0.112f; // 0.112 = max zoom out (see more map), lower = zoomed in (down to 0.03) public bool MinimapShowPlayerCone = true; public bool MinimapLockPosition = false; /// Show an arrow at the edge of the minimap pointing toward the current quest objective or waymark (like the default minimap). public bool MinimapShowQuestDirectionArrow = true; /// Show direction arrows for nearby FATEs on the minimap (purple, matching FATE marker). public bool MinimapShowFateDirectionArrows = true; /// Show a red direction arrow pointing toward the player flag when it's off the minimap. public bool MinimapShowFlagDirectionArrow = true; /// Show quest objective area radius circles on the minimap (same as Area Map). public bool MinimapShowQuestAreaRadius = true; /// When true, minimap hides with the game GUI (dialogue, interaction, nameplates off). When false, minimap stays visible during dialogue and object interaction. public bool MinimapHideWithGameGui = false; /// Show Player/NPC tracking (other players, enemies, bosses, etc.) on the minimap, matching the main map display. public bool MinimapShowPlayersAndNpcs = true; /// Icon ID for other players on the minimap (default 60403, distinct from party 60421). Override if you prefer a different look. public uint MinimapOtherPlayerIconId = 60403; /// Show current map info (region, map, area, sub-area) at the top of the minimap. public bool MinimapShowMapInfoBar = true; /// Order of map info: 0=Region, 1=Map, 2=Area, 3=SubArea. e.g. {0,1,2,3} = Region, Map, Area, SubArea. public int[] MinimapMapInfoOrder = [0, 1, 2, 3]; /// Font scale multiplier for map info bar (0.5-2.0). public float MinimapMapInfoFontScale = 1.0f; /// Text color for map info bar. public Vector4 MinimapMapInfoColor = KnownColor.White.Vector(); /// Font type for map info: 0=Default, 1=Axis12, 2=Axis18. public int MinimapMapInfoFontType = 0; /// Background color (RGBA) for map info bar. Alpha = opacity. public Vector4 MinimapMapInfoBarBackground = new(0f, 0f, 0f, 0.2f); /// Show player coordinates at the bottom of the minimap. public bool MinimapShowCoordinateBar = true; /// Show coordinates in the bottom bar. public bool MinimapCoordBarShowCoordinates = true; /// Show local time in the bottom bar. public bool MinimapCoordBarShowTime = true; /// Show repair % (lowest equipped item condition) in the bottom bar. public bool MinimapCoordBarShowRepairPercent = true; /// Order of bottom bar elements: 0=Coordinates, 1=Repair %, 2=Local Time. public int[] MinimapBottomBarOrder = [0, 1, 2]; /// Font scale multiplier for coordinate bar (0.5-2.0). public float MinimapCoordBarFontScale = 1.0f; /// Text color for coordinate bar. public Vector4 MinimapCoordBarColor = KnownColor.White.Vector(); /// Font type for coord bar: 0=Default, 1=Axis12, 2=Axis18. public int MinimapCoordBarFontType = 0; /// Background color (RGBA) for coordinate bar. Alpha = opacity. public Vector4 MinimapCoordBarBackground = new(0f, 0f, 0f, 0.2f); // Movement Trail (Carbonite-style: show where you've been) /// Draw a red trail of dots on the map showing where you've been. public bool ShowMovementTrail = false; /// Minimum distance (world units) before adding a new trail point. public float MovementTrailMinDistance = 2f; /// How long (seconds) trail points stay visible before fading out. public float MovementTrailFadeTimeSeconds = 60f; /// Maximum number of trail points to keep. public int MovementTrailMaxPoints = 100; // Do not persist this setting [JsonIgnore] public bool DebugMode = false; public static SystemConfig Load() => Service.PluginInterface.LoadConfigFile("System.config.json"); public static void Save() => Service.PluginInterface.SaveConfigFile("System.config.json", System.SystemConfig); }