v1.0.0.15: Top/Bottom Info Bars, Repair %, order, fonts, colors
Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game;
|
||||
|
||||
namespace Mappy.Data;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the condition percentage of the player's most damaged equipped item.
|
||||
/// Uses the same logic as RepairMe (chalkos/RepairMe): raw condition / 300.
|
||||
/// </summary>
|
||||
public static class EquipmentConditionHelper
|
||||
{
|
||||
private const uint EquipmentContainerSize = 13;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the lowest condition percent among equipped items (0–100+).
|
||||
/// Returns 100 if no gear or unavailable (e.g. not logged in).
|
||||
/// </summary>
|
||||
public static unsafe float GetLowestConditionPercent()
|
||||
{
|
||||
var inventoryManager = InventoryManager.Instance();
|
||||
if (inventoryManager == null) return 100f;
|
||||
|
||||
var equipmentContainer = inventoryManager->GetInventoryContainer(InventoryType.EquippedItems);
|
||||
if (equipmentContainer == null) return 100f;
|
||||
|
||||
var inventoryItem = equipmentContainer->GetInventorySlot(0);
|
||||
if (inventoryItem == null) return 100f;
|
||||
|
||||
ushort lowestCondition = 60000; // max raw condition is 30000
|
||||
var foundAny = false;
|
||||
|
||||
for (var i = 0; i < EquipmentContainerSize; i++, inventoryItem++)
|
||||
{
|
||||
if (inventoryItem->ItemId == 0) continue;
|
||||
|
||||
foundAny = true;
|
||||
if (lowestCondition > inventoryItem->Condition)
|
||||
lowestCondition = inventoryItem->Condition;
|
||||
}
|
||||
|
||||
return foundAny ? lowestCondition / 300f : 100f;
|
||||
}
|
||||
}
|
||||
@@ -122,6 +122,36 @@ public class SystemConfig : CharacterConfiguration
|
||||
public bool MinimapShowPlayersAndNpcs = true;
|
||||
/// <summary>Icon ID for other players on the minimap (default 60403, distinct from party 60421). Override if you prefer a different look.</summary>
|
||||
public uint MinimapOtherPlayerIconId = 60403;
|
||||
/// <summary>Show current map info (region, map, area, sub-area) at the top of the minimap.</summary>
|
||||
public bool MinimapShowMapInfoBar = true;
|
||||
/// <summary>Order of map info: 0=Region, 1=Map, 2=Area, 3=SubArea. e.g. {0,1,2,3} = Region, Map, Area, SubArea.</summary>
|
||||
public int[] MinimapMapInfoOrder = [0, 1, 2, 3];
|
||||
/// <summary>Font scale multiplier for map info bar (0.5-2.0).</summary>
|
||||
public float MinimapMapInfoFontScale = 1.0f;
|
||||
/// <summary>Text color for map info bar.</summary>
|
||||
public Vector4 MinimapMapInfoColor = KnownColor.White.Vector();
|
||||
/// <summary>Font type for map info: 0=Default, 1=Axis12, 2=Axis18.</summary>
|
||||
public int MinimapMapInfoFontType = 0;
|
||||
/// <summary>Background color (RGBA) for map info bar. Alpha = opacity.</summary>
|
||||
public Vector4 MinimapMapInfoBarBackground = new(0f, 0f, 0f, 0.2f);
|
||||
/// <summary>Show player coordinates at the bottom of the minimap.</summary>
|
||||
public bool MinimapShowCoordinateBar = true;
|
||||
/// <summary>Show coordinates in the bottom bar.</summary>
|
||||
public bool MinimapCoordBarShowCoordinates = true;
|
||||
/// <summary>Show local time in the bottom bar.</summary>
|
||||
public bool MinimapCoordBarShowTime = true;
|
||||
/// <summary>Show repair % (lowest equipped item condition) in the bottom bar.</summary>
|
||||
public bool MinimapCoordBarShowRepairPercent = true;
|
||||
/// <summary>Order of bottom bar elements: 0=Coordinates, 1=Repair %, 2=Local Time.</summary>
|
||||
public int[] MinimapBottomBarOrder = [0, 1, 2];
|
||||
/// <summary>Font scale multiplier for coordinate bar (0.5-2.0).</summary>
|
||||
public float MinimapCoordBarFontScale = 1.0f;
|
||||
/// <summary>Text color for coordinate bar.</summary>
|
||||
public Vector4 MinimapCoordBarColor = KnownColor.White.Vector();
|
||||
/// <summary>Font type for coord bar: 0=Default, 1=Axis12, 2=Axis18.</summary>
|
||||
public int MinimapCoordBarFontType = 0;
|
||||
/// <summary>Background color (RGBA) for coordinate bar. Alpha = opacity.</summary>
|
||||
public Vector4 MinimapCoordBarBackground = new(0f, 0f, 0f, 0.2f);
|
||||
|
||||
// Movement Trail (Carbonite-style: show where you've been)
|
||||
/// <summary>Draw a red trail of dots on the map showing where you've been.</summary>
|
||||
|
||||
Reference in New Issue
Block a user