Initial HSMappy release (fork of Mappy)
Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using Dalamud.Interface.Textures.TextureWraps;
|
||||
using Dalamud.Utility;
|
||||
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
||||
using KamiLib.Configuration;
|
||||
using Lumina.Excel.Sheets;
|
||||
using Mappy.Classes.SelectionWindowComponents;
|
||||
|
||||
namespace Mappy.Data;
|
||||
|
||||
public unsafe record Flag(uint Territory, uint Map, float X, float Y, uint IconId)
|
||||
{
|
||||
public IDalamudTextureWrap? GetMapTexture() => MapDrawableOption.GetMapTexture(Map);
|
||||
|
||||
public Map GetMap() => Service.DataManager.GetExcelSheet<Map>().GetRow(Map);
|
||||
|
||||
public TerritoryType GetTerritoryType() => Service.DataManager.GetExcelSheet<TerritoryType>().GetRow(Territory);
|
||||
|
||||
public void PlaceFlag()
|
||||
{
|
||||
AgentMap.Instance()->FlagMarkerCount = 0;
|
||||
AgentMap.Instance()->SetFlagMapMarker(Territory, Map, X, Y, IconId);
|
||||
|
||||
if (System.SystemConfig.CenterOnFlag) {
|
||||
Focus();
|
||||
}
|
||||
}
|
||||
|
||||
public string GetIdString() => $"{Territory}_{Map}_{X}_{Y}_{IconId}";
|
||||
|
||||
public Vector2 GetCoordinate() => new(X, Y);
|
||||
|
||||
public Vector2 GetMapCoordinate() => MapUtil.WorldToMap(GetCoordinate());
|
||||
|
||||
public void Focus()
|
||||
{
|
||||
System.SystemConfig.FollowPlayer = false;
|
||||
System.IntegrationsController.OpenMap(Map);
|
||||
System.MapRenderer.CenterOnCoordinate(GetCoordinate());
|
||||
}
|
||||
|
||||
public bool IsFlagSet()
|
||||
{
|
||||
if (AgentMap.Instance()->FlagMarkerCount is 0) return false;
|
||||
ref var setMarker = ref AgentMap.Instance()->FlagMapMarkers[0];
|
||||
|
||||
if (setMarker.TerritoryId != Territory) return false;
|
||||
if (setMarker.MapId != Map) return false;
|
||||
if (Math.Abs(setMarker.XFloat - X) > 0.01f) return false;
|
||||
if (Math.Abs(setMarker.YFloat - Y) > 0.01f) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class FlagConfig
|
||||
{
|
||||
public LinkedList<Flag> FlagHistory = [];
|
||||
|
||||
// Not exposed to users, might be in the future.
|
||||
public int HistoryLimit = 10;
|
||||
|
||||
public static FlagConfig Load() => Service.PluginInterface.LoadConfigFile<FlagConfig>("Flags.data.json");
|
||||
|
||||
public void Save() => Service.PluginInterface.SaveConfigFile("Flags.data.json", System.FlagConfig);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Numerics;
|
||||
using Dalamud.Interface;
|
||||
using KamiLib.Configuration;
|
||||
|
||||
namespace Mappy.Data;
|
||||
|
||||
public class IconSetting
|
||||
{
|
||||
public required uint IconId { get; set; }
|
||||
public bool Hide;
|
||||
public bool AllowTooltip = true;
|
||||
public float Scale = 1.0f;
|
||||
public bool AllowClick = true;
|
||||
public Vector4 Color = KnownColor.White.Vector();
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
Hide = false;
|
||||
AllowTooltip = true;
|
||||
Scale = 1.0f;
|
||||
AllowClick = true;
|
||||
Color = KnownColor.White.Vector();
|
||||
}
|
||||
}
|
||||
|
||||
public class IconConfig
|
||||
{
|
||||
public Dictionary<uint, IconSetting> IconSettingMap = [];
|
||||
|
||||
public static IconConfig Load() => Service.PluginInterface.LoadConfigFile<IconConfig>("Icons.config.json");
|
||||
|
||||
public void Save() => Service.PluginInterface.SaveConfigFile("Icons.config.json", System.IconConfig);
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
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;
|
||||
/// <summary>Show an arrow at the edge of the minimap pointing toward the current quest objective or waymark (like the default minimap).</summary>
|
||||
public bool MinimapShowQuestDirectionArrow = true;
|
||||
/// <summary>Show direction arrows for nearby FATEs on the minimap (purple, matching FATE marker).</summary>
|
||||
public bool MinimapShowFateDirectionArrows = true;
|
||||
/// <summary>Show quest objective area radius circles on the minimap (same as Area Map).</summary>
|
||||
public bool MinimapShowQuestAreaRadius = true;
|
||||
/// <summary>When true, minimap hides with the game GUI (dialogue, interaction, nameplates off). When false, minimap stays visible during dialogue and object interaction.</summary>
|
||||
public bool MinimapHideWithGameGui = false;
|
||||
|
||||
// Do not persist this setting
|
||||
[JsonIgnore]
|
||||
public bool DebugMode = false;
|
||||
|
||||
public static SystemConfig Load() => Service.PluginInterface.LoadConfigFile<SystemConfig>("System.config.json");
|
||||
|
||||
public static void Save() => Service.PluginInterface.SaveConfigFile("System.config.json", System.SystemConfig);
|
||||
}
|
||||
Reference in New Issue
Block a user