PvP nameplates: correct GC icons (62601/62602/62603), configurable GC IDs, Role/Job icon for enemy players
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -550,6 +550,53 @@ namespace HSUI.Interface.Nameplates
|
||||
|
||||
}
|
||||
|
||||
// company icon (PvP Frontline: Maelstrom, Flames, Adders)
|
||||
var gcIconOverrides = (Config.CompanyIconConfig.IconIdTeam1, Config.CompanyIconConfig.IconIdTeam2, Config.CompanyIconConfig.IconIdTeam3);
|
||||
if (Config.CompanyIconConfig.Enabled && Utils.GrandCompanyIconIdForPvPEnemy(data.GameObject, gcIconOverrides) is uint gcIconId)
|
||||
{
|
||||
anchor = anchors.GetAnchor(Config.CompanyIconConfig.NameplateLabelAnchor, Config.CompanyIconConfig.PrioritizeHealthBarAnchor);
|
||||
anchor = anchor ?? new NameplateAnchor(data.ScreenPosition, Vector2.Zero);
|
||||
|
||||
var pos = Utils.GetAnchoredPosition(_config.Position + anchor.Value.Position, -anchor.Value.Size, Config.CompanyIconConfig.FrameAnchor);
|
||||
var iconPos = Utils.GetAnchoredPosition(pos + Config.CompanyIconConfig.Position, Config.CompanyIconConfig.Size, Config.CompanyIconConfig.Anchor);
|
||||
|
||||
drawActions.Add((Config.CompanyIconConfig.StrataLevel, () =>
|
||||
{
|
||||
DrawHelper.DrawInWindow(_config.ID + "_enemyCompanyIcon", iconPos, Config.CompanyIconConfig.Size, false, (drawList) =>
|
||||
{
|
||||
DrawHelper.DrawIcon(gcIconId, iconPos, Config.CompanyIconConfig.Size, false, alpha, drawList);
|
||||
});
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
// role/job icon (enemy players only; has ClassJob)
|
||||
if (Config.RoleIconConfig.Enabled && data.GameObject is IPlayerCharacter playerCharacter)
|
||||
{
|
||||
uint jobId = playerCharacter.ClassJob.RowId;
|
||||
uint iconId = Config.RoleIconConfig.UseRoleIcons
|
||||
? JobsHelper.RoleIconIDForJob(jobId, Config.RoleIconConfig.UseSpecificDPSRoleIcons)
|
||||
: JobsHelper.IconIDForJob(jobId, (uint)Config.RoleIconConfig.Style);
|
||||
|
||||
if (iconId > 0)
|
||||
{
|
||||
anchor = anchors.GetAnchor(Config.RoleIconConfig.NameplateLabelAnchor, Config.RoleIconConfig.PrioritizeHealthBarAnchor);
|
||||
anchor = anchor ?? new NameplateAnchor(data.ScreenPosition, Vector2.Zero);
|
||||
|
||||
var pos = Utils.GetAnchoredPosition(_config.Position + anchor.Value.Position, -anchor.Value.Size, Config.RoleIconConfig.FrameAnchor);
|
||||
var iconPos = Utils.GetAnchoredPosition(pos + Config.RoleIconConfig.Position, Config.RoleIconConfig.Size, Config.RoleIconConfig.Anchor);
|
||||
|
||||
drawActions.Add((Config.RoleIconConfig.StrataLevel, () =>
|
||||
{
|
||||
DrawHelper.DrawInWindow(_config.ID + "_enemyRoleJobIcon", iconPos, Config.RoleIconConfig.Size, false, (drawList) =>
|
||||
{
|
||||
DrawHelper.DrawIcon(iconId, iconPos, Config.RoleIconConfig.Size, false, alpha, drawList);
|
||||
});
|
||||
}
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
return drawActions;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,10 @@ namespace HSUI.Interface.GeneralElements
|
||||
[Order(21)]
|
||||
public bool AlwaysShowTargetNameplate = true;
|
||||
|
||||
[Checkbox("In PvP, show only enemy player nameplates", spacing = true, help = "When in Frontlines, Rival Wings, or Crystal Conflict, hide ally player nameplates (party, alliance, teammates) and show only enemy players. Uses Enemy nameplate styling for PvP enemies.")]
|
||||
[Order(22)]
|
||||
public bool PvPShowOnlyEnemyPlayers = false;
|
||||
|
||||
public int RaycastFlag() => OcclusionType == NameplatesOcclusionType.WallsAndObjects ? 0x2000 : 0x4000;
|
||||
}
|
||||
|
||||
@@ -490,6 +494,24 @@ namespace HSUI.Interface.GeneralElements
|
||||
)
|
||||
{ PrioritizeHealthBarAnchor = true, Strata = StrataLevel.LOWEST };
|
||||
|
||||
[NestedConfig("Company Icon (PvP)", 46, collapsingHeader = false)]
|
||||
public NameplateCompanyIconConfig CompanyIconConfig = new NameplateCompanyIconConfig(
|
||||
new Vector2(-5, 0),
|
||||
new Vector2(24, 24),
|
||||
DrawAnchor.Right,
|
||||
DrawAnchor.Left
|
||||
)
|
||||
{ PrioritizeHealthBarAnchor = true, Strata = StrataLevel.LOWEST };
|
||||
|
||||
[NestedConfig("Role/Job Icon (enemy players)", 47)]
|
||||
public NameplateRoleJobIconConfig RoleIconConfig = new NameplateRoleJobIconConfig(
|
||||
new Vector2(-35, 0),
|
||||
new Vector2(24, 24),
|
||||
DrawAnchor.Right,
|
||||
DrawAnchor.Left
|
||||
)
|
||||
{ PrioritizeHealthBarAnchor = true, Strata = StrataLevel.LOWEST };
|
||||
|
||||
[NestedConfig("Debuffs", 50)]
|
||||
public EnemyNameplateStatusEffectsListConfig DebuffsConfig = null!;
|
||||
|
||||
|
||||
@@ -128,17 +128,34 @@ namespace HSUI.Interface.Nameplates
|
||||
return _playerHud;
|
||||
}
|
||||
|
||||
if (data.GameObject is ICharacter character)
|
||||
// In PvP, optionally show only enemy player nameplates (hide allies)
|
||||
if (Config.PvPShowOnlyEnemyPlayers && Plugin.ClientState.IsPvP)
|
||||
{
|
||||
if ((character.StatusFlags & StatusFlags.PartyMember) != 0) // PartyMember
|
||||
if (data.GameObject is ICharacter character)
|
||||
{
|
||||
if ((character.StatusFlags & StatusFlags.PartyMember) != 0 ||
|
||||
(character.StatusFlags & StatusFlags.AllianceMember) != 0 ||
|
||||
(character.StatusFlags & StatusFlags.Friend) != 0)
|
||||
{
|
||||
return null; // Hide party, alliance, and friend nameplates
|
||||
}
|
||||
}
|
||||
// Other players: show only hostile (enemy team), hide allies
|
||||
if (data.GameObject == null) { return null; }
|
||||
return Utils.IsHostile(data.GameObject) ? _enemyHud : null;
|
||||
}
|
||||
|
||||
if (data.GameObject is ICharacter character2)
|
||||
{
|
||||
if ((character2.StatusFlags & StatusFlags.PartyMember) != 0) // PartyMember
|
||||
{
|
||||
return _partyMemberHud;
|
||||
}
|
||||
else if ((character.StatusFlags & StatusFlags.AllianceMember) != 0) // AllianceMember
|
||||
else if ((character2.StatusFlags & StatusFlags.AllianceMember) != 0) // AllianceMember
|
||||
{
|
||||
return _allianceMemberHud;
|
||||
}
|
||||
else if ((character.StatusFlags & StatusFlags.Friend) != 0) // Friend
|
||||
else if ((character2.StatusFlags & StatusFlags.Friend) != 0) // Friend
|
||||
{
|
||||
return _friendsHud;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user