feat: settings window rework

This commit is contained in:
goaaats 2023-01-06 22:32:44 +01:00
parent 0dc58cce56
commit bc3dcdfad7
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
22 changed files with 1724 additions and 1084 deletions

View file

@ -363,7 +363,7 @@ public sealed unsafe class GameGui : IDisposable, IServiceType
/// </summary>
/// <param name="addonPtr">The addon address.</param>
/// <returns>A pointer to the agent interface.</returns>
public unsafe IntPtr FindAgentInterface(IntPtr addonPtr)
public IntPtr FindAgentInterface(IntPtr addonPtr)
{
if (addonPtr == IntPtr.Zero)
return IntPtr.Zero;
@ -411,11 +411,26 @@ public sealed unsafe class GameGui : IDisposable, IServiceType
this.utf8StringFromSequenceHook.Dispose();
}
/// <summary>
/// Indicates if the game is on the title screen.
/// </summary>
/// <returns>A value indicating whether or not the game is on the title screen.</returns>
internal bool IsOnTitleScreen()
{
var charaSelect = this.GetAddonByName("CharaSelect", 1);
var charaMake = this.GetAddonByName("CharaMake", 1);
var titleDcWorldMap = this.GetAddonByName("TitleDCWorldMap", 1);
if (charaMake != nint.Zero || charaSelect != nint.Zero || titleDcWorldMap != nint.Zero)
return false;
return !Service<ClientState.ClientState>.Get().IsLoggedIn;
}
/// <summary>
/// Set the current background music.
/// </summary>
/// <param name="bgmKey">The background music key.</param>
public void SetBgm(ushort bgmKey) => this.setGlobalBgmHook.Original(bgmKey, 0, 0, 0, 0, 0);
internal void SetBgm(ushort bgmKey) => this.setGlobalBgmHook.Original(bgmKey, 0, 0, 0, 0, 0);
/// <summary>
/// Reset the stored "UI hide" state.