Skip to content

Commit

Permalink
Add boss icon
Browse files Browse the repository at this point in the history
  • Loading branch information
MidoriKami committed Aug 13, 2024
1 parent 4de52ef commit 7d351b1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Mappy/Classes/DrawHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ private static void DrawIcon(MarkerInfo markerInfo) {

var iconScale = System.SystemConfig.IconScale;

// Make boss markers a bit chonkier because it looks better that way
if (markerInfo.IconId is 60401 or 60402) {
scale *= 3.0f;
scale /= GetMapScaleFactor();
}

// Fixed scale not supported for map region markers
if (IsRegionIcon(markerInfo.IconId)) {
scale = markerInfo.Scale;
Expand Down
7 changes: 7 additions & 0 deletions Mappy/MapRenderer/MapRenderer.GameObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using FFXIVClientStructs.FFXIV.Client.Game.Object;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using ImGuiNET;
using Lumina.Excel.GeneratedSheets2;
using Mappy.Classes;
using Mappy.Extensions;
using ObjectKind = Dalamud.Game.ClientState.Objects.Enums.ObjectKind;
Expand Down Expand Up @@ -39,6 +40,8 @@ private unsafe void DrawGameObjects() {
IconId = obj.ObjectKind switch {
ObjectKind.Player when GroupManager.Instance()->MainGroup.MemberCount is 0 && System.SystemConfig.ShowPlayers => 60421,
ObjectKind.Player when System.SystemConfig.ShowPlayers => 60444,
ObjectKind.BattleNpc when IsBoss(obj) && obj.TargetObject is null => 60402,
ObjectKind.BattleNpc when IsBoss(obj) && obj.TargetObject is not null => 60401,
ObjectKind.BattleNpc when obj is { SubKind: (int) BattleNpcSubKind.Enemy, TargetObject: not null } => 60422,
ObjectKind.BattleNpc when obj is { SubKind: (int) BattleNpcSubKind.Enemy, TargetObject: null } => 60424,
ObjectKind.BattleNpc when obj.SubKind == (int) BattleNpcSubKind.Pet => 60961,
Expand All @@ -52,6 +55,7 @@ ObjectKind.EventObj when IsAetherCurrent(obj) => 60653,
});
}
}

private void DrawRadar(IPlayerCharacter gameObjectCenter) {
var position = ImGui.GetWindowPos() +
DrawPosition +
Expand Down Expand Up @@ -85,4 +89,7 @@ private unsafe bool IsAetherCurrent(IGameObject gameObject) {
if (csEventObject->EventHandler is null) return false;
return csEventObject->EventHandler->Info.EventId.ContentId == EventHandlerType.AetherCurrent;
}

private bool IsBoss(IGameObject chara)
=> Service.DataManager.GetExcelSheet<BNpcBase>()!.GetRow(chara.DataId)?.Rank is 1 or 2 or 6;
}

0 comments on commit 7d351b1

Please sign in to comment.