FFXIVClientStructs icon indicating copy to clipboard operation
FFXIVClientStructs copied to clipboard

Add UIGlobals struct

Open Haselnussbomber opened this issue 1 year ago • 0 comments

This PR adds the UIGlobals struct, which serves as a central place for storing global static functions from the Client::UI namespace.

Some of these global functions were added to other structs in the past, which is why they have been moved to UIGlobals:

  • GameMain.IsInSanctuary, moved as CanApplyGlamourPlates (see also: #1123)
  • UIModule.PlaySound, moved as PlaySoundEffect
  • UIModule.IsPlayerCharacterName, moved as IsValidPlayerCharacterName
  • UIModule.PlayChatSoundEffect

The entries in the data.yml have also been renamed accordingly, though I did not add the namespace prefix if it was missing.

I've also added the IsExportedGatheringPointTimed function (formerly named IsGatheringTypeRare by me in the data.yml) to this struct (because I need it myself), and tried to add some xmldocs to these functions.

While I did not dig into the PlaySoundEffect function, which is why I didn't add a comment there, I changed the unknown argument types from long to nint, because from what I could see both are pointers: a2 is an out parameter for a string and a3 is an out parameter for some kind of instance of a sound effect struct. 🤷‍♂️

Since this is a new struct and the old functions have been obsoleted, there are no breaking changes in this PR. Please let me know if I did something wrong.

Haselnussbomber avatar Oct 18 '24 17:10 Haselnussbomber