check for glamourer api and if not present do not use glamourer

This commit is contained in:
Stanley Dimant
2022-08-25 14:09:50 +02:00
parent cbe45a8ad6
commit 4e2d371f10
2 changed files with 41 additions and 17 deletions

View File

@@ -235,9 +235,14 @@ public class CachedPlayer
RequestedPenumbraRedraw = true; RequestedPenumbraRedraw = true;
Logger.Debug( Logger.Debug(
$"Request Redraw for {PlayerName}"); $"Request Redraw for {PlayerName}");
_ipcManager.GlamourerApplyAll(glamourerData, PlayerCharacter.Address); if (_ipcManager.CheckGlamourerApi())
// todo: remove {
_ipcManager.PenumbraRedraw(PlayerCharacter.Address); _ipcManager.GlamourerApplyAll(glamourerData, PlayerCharacter.Address);
}
else
{
_ipcManager.PenumbraRedraw(PlayerCharacter.Address);
}
} }
else if (objectKind == ObjectKind.MinionOrMount) else if (objectKind == ObjectKind.MinionOrMount)
{ {
@@ -245,9 +250,14 @@ public class CachedPlayer
if (minionOrMount != null) if (minionOrMount != null)
{ {
Logger.Debug($"Request Redraw for Minion/Mount"); Logger.Debug($"Request Redraw for Minion/Mount");
_ipcManager.GlamourerApplyAll(glamourerData, obj: (IntPtr)minionOrMount); if (_ipcManager.CheckGlamourerApi())
// todo: remove {
_ipcManager.PenumbraRedraw((IntPtr)minionOrMount); _ipcManager.GlamourerApplyAll(glamourerData, obj: (IntPtr)minionOrMount);
}
else
{
_ipcManager.PenumbraRedraw((IntPtr)minionOrMount);
}
} }
} }
else if (objectKind == ObjectKind.Pet) else if (objectKind == ObjectKind.Pet)
@@ -256,9 +266,14 @@ public class CachedPlayer
if (pet != IntPtr.Zero) if (pet != IntPtr.Zero)
{ {
Logger.Debug("Request Redraw for Pet"); Logger.Debug("Request Redraw for Pet");
_ipcManager.GlamourerApplyAll(glamourerData, pet); if (_ipcManager.CheckGlamourerApi())
// todo: remove {
_ipcManager.PenumbraRedraw(pet); _ipcManager.GlamourerApplyAll(glamourerData, pet);
}
else
{
_ipcManager.PenumbraRedraw(pet);
}
} }
} }
else if (objectKind == ObjectKind.Companion) else if (objectKind == ObjectKind.Companion)
@@ -267,9 +282,14 @@ public class CachedPlayer
if (companion != IntPtr.Zero) if (companion != IntPtr.Zero)
{ {
Logger.Debug("Request Redraw for Companion"); Logger.Debug("Request Redraw for Companion");
_ipcManager.GlamourerApplyAll(glamourerData, companion); if (_ipcManager.CheckGlamourerApi())
// todo: remove {
_ipcManager.PenumbraRedraw(companion); _ipcManager.GlamourerApplyAll(glamourerData, companion);
}
else
{
_ipcManager.PenumbraRedraw(companion);
}
} }
} }
} }
@@ -280,10 +300,15 @@ public class CachedPlayer
if (objectKind == ObjectKind.Player) if (objectKind == ObjectKind.Player)
{ {
_ipcManager.GlamourerApplyOnlyCustomization(_originalGlamourerData, PlayerCharacter); if (_ipcManager.CheckGlamourerApi())
_ipcManager.GlamourerApplyOnlyEquipment(_lastGlamourerData, PlayerCharacter); {
// todo: remove _ipcManager.GlamourerApplyOnlyCustomization(_originalGlamourerData, PlayerCharacter);
_ipcManager.PenumbraRedraw(PlayerCharacter.Address); _ipcManager.GlamourerApplyOnlyEquipment(_lastGlamourerData, PlayerCharacter);
}
else
{
_ipcManager.PenumbraRedraw(PlayerCharacter.Address);
}
} }
else if (objectKind == ObjectKind.MinionOrMount) else if (objectKind == ObjectKind.MinionOrMount)
{ {

View File

@@ -40,7 +40,6 @@ namespace MareSynchronos.UI
public static bool CtrlPressed() => (GetKeyState(0xA2) & 0x8000) != 0 || (GetKeyState(0xA3) & 0x8000) != 0; public static bool CtrlPressed() => (GetKeyState(0xA2) & 0x8000) != 0 || (GetKeyState(0xA3) & 0x8000) != 0;
// todo remove after rework
public ApiController ApiController => _apiController; public ApiController ApiController => _apiController;
public UiShared(IpcManager ipcManager, ApiController apiController, FileCacheManager fileCacheManager, FileDialogManager fileDialogManager, Configuration pluginConfiguration, DalamudUtil dalamudUtil, DalamudPluginInterface pluginInterface, Dalamud.Localization localization) public UiShared(IpcManager ipcManager, ApiController apiController, FileCacheManager fileCacheManager, FileDialogManager fileDialogManager, Configuration pluginConfiguration, DalamudUtil dalamudUtil, DalamudPluginInterface pluginInterface, Dalamud.Localization localization)