mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 21:57:22 +01:00
potentially fix pets and summons
This commit is contained in:
parent
bd947d8f2a
commit
2e3f7aad2b
4 changed files with 62 additions and 13 deletions
|
|
@ -16,6 +16,7 @@ namespace MareSynchronos.Utils
|
|||
|
||||
public delegate void LogIn();
|
||||
public delegate void LogOut();
|
||||
public delegate void ClassJobChanged();
|
||||
|
||||
public delegate void FrameworkUpdate();
|
||||
|
||||
|
|
@ -27,6 +28,8 @@ namespace MareSynchronos.Utils
|
|||
public event LogIn? LogIn;
|
||||
public event LogOut? LogOut;
|
||||
public event FrameworkUpdate? FrameworkUpdate;
|
||||
public event ClassJobChanged? ClassJobChanged;
|
||||
private uint? classJobId = 0;
|
||||
|
||||
public unsafe bool IsGameObjectPresent(IntPtr key)
|
||||
{
|
||||
|
|
@ -51,12 +54,18 @@ namespace MareSynchronos.Utils
|
|||
_framework.Update += FrameworkOnUpdate;
|
||||
if (IsLoggedIn)
|
||||
{
|
||||
classJobId = _clientState.LocalPlayer!.ClassJob.Id;
|
||||
ClientStateOnLogin(null, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
private void FrameworkOnUpdate(Framework framework)
|
||||
{
|
||||
if(_clientState.LocalPlayer != null && _clientState.LocalPlayer.ClassJob.Id != classJobId)
|
||||
{
|
||||
classJobId = _clientState.LocalPlayer.ClassJob.Id;
|
||||
ClassJobChanged?.Invoke();
|
||||
}
|
||||
FrameworkUpdate?.Invoke();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue