Files
HellionChat/HellionChat/GameFunctions/Party.cs
T
JonKazama-Hellion 699d4ede1d chore: housekeeping — linter & formatter setup
Add .prettierrc.json, .markdownlint.json, .yamllint.yaml, .gitattributes
Run CSharpier, Prettier and markdownlint across the entire codebase.
No logic changes — formatting, using order and line endings only.
2026-05-10 13:01:00 +02:00

62 lines
1.9 KiB
C#
Executable File

using Dalamud.Interface.ImGuiNotification;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using FFXIVClientStructs.FFXIV.Client.UI.Info;
using HellionChat.Resources;
using HellionChat.Util;
namespace HellionChat.GameFunctions;
internal static unsafe class Party
{
internal static void InviteSameWorld(string name, ushort world, ulong contentId)
{
// this only works if target is on the same world
fixed (byte* namePtr = name.ToTerminatedBytes())
{
InfoProxyPartyInvite.Instance()->InviteToParty(contentId, namePtr, world);
}
}
internal static void InviteOtherWorld(ulong contentId, ushort worldId = 0)
{
// third param is world, but it requires a specific world
// if they're not on that world, it will fail
// pass 0 and it will work on any world EXCEPT for the world the
// current player is on
if (contentId == 0)
{
WrapperUtil.AddNotification(Language.PartyInvite_NoId, NotificationType.Warning);
return;
}
InfoProxyPartyInvite.Instance()->InviteToPartyContentId(contentId, worldId);
}
internal static void InviteInInstance(ulong contentId)
{
if (contentId == 0)
{
WrapperUtil.AddNotification(Language.PartyInvite_NoId, NotificationType.Warning);
return;
}
InfoProxyPartyInvite.Instance()->InviteToPartyInInstanceByContentId(contentId);
}
internal static void Kick(string name, ulong contentId)
{
fixed (byte* namePtr = name.ToTerminatedBytes())
{
AgentPartyMember.Instance()->Kick(namePtr, 0, contentId);
}
}
internal static void Promote(string name, ulong contentId)
{
fixed (byte* namePtr = name.ToTerminatedBytes())
{
AgentPartyMember.Instance()->Promote(namePtr, 0, contentId);
}
}
}