mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-31 21:03:43 +01:00
Merge branch 'master' of https://github.com/goatcorp/Dalamud
This commit is contained in:
commit
09124a598c
7 changed files with 24 additions and 7 deletions
|
|
@ -78,7 +78,10 @@ namespace Dalamud.Game.Internal
|
||||||
|
|
||||||
// "Close Addon"
|
// "Close Addon"
|
||||||
if (cmd == 12 && WindowSystem.HasAnyWindowSystemFocus)
|
if (cmd == 12 && WindowSystem.HasAnyWindowSystemFocus)
|
||||||
|
{
|
||||||
|
Log.Verbose($"Cancelling global event CloseAddon command due to WindowSystem {WindowSystem.FocusedWindowSystemNamespace}");
|
||||||
return IntPtr.Zero;
|
return IntPtr.Zero;
|
||||||
|
}
|
||||||
|
|
||||||
return this.hookAtkUnitBaseReceiveGlobalEvent.Original(thisPtr, cmd, a3, a4, a5);
|
return this.hookAtkUnitBaseReceiveGlobalEvent.Original(thisPtr, cmd, a3, a4, a5);
|
||||||
}
|
}
|
||||||
|
|
@ -86,7 +89,10 @@ namespace Dalamud.Game.Internal
|
||||||
private void AgentHudOpenSystemMenuDetour(void* thisPtr, AtkValue* atkValueArgs, uint menuSize)
|
private void AgentHudOpenSystemMenuDetour(void* thisPtr, AtkValue* atkValueArgs, uint menuSize)
|
||||||
{
|
{
|
||||||
if (WindowSystem.HasAnyWindowSystemFocus)
|
if (WindowSystem.HasAnyWindowSystemFocus)
|
||||||
|
{
|
||||||
|
Log.Verbose($"Cancelling OpenSystemMenu due to WindowSystem {WindowSystem.FocusedWindowSystemNamespace}");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var configuration = Service<DalamudConfiguration>.Get();
|
var configuration = Service<DalamudConfiguration>.Get();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ namespace Dalamud.Game.Network
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Event that is called when a network message is sent/received.
|
/// Event that is called when a network message is sent/received.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event OnNetworkMessageDelegate OnNetworkMessage;
|
public event OnNetworkMessageDelegate NetworkMessage;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enable this module.
|
/// Enable this module.
|
||||||
|
|
@ -109,7 +109,7 @@ namespace Dalamud.Game.Network
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Call events
|
// Call events
|
||||||
this.OnNetworkMessage?.Invoke(dataPtr + 0x20, (ushort)Marshal.ReadInt16(dataPtr, 0x12), 0, targetId, NetworkMessageDirection.ZoneDown);
|
this.NetworkMessage?.Invoke(dataPtr + 0x20, (ushort)Marshal.ReadInt16(dataPtr, 0x12), 0, targetId, NetworkMessageDirection.ZoneDown);
|
||||||
|
|
||||||
this.processZonePacketDownHook.Original(a, targetId, dataPtr + 0x10);
|
this.processZonePacketDownHook.Original(a, targetId, dataPtr + 0x10);
|
||||||
}
|
}
|
||||||
|
|
@ -139,7 +139,7 @@ namespace Dalamud.Game.Network
|
||||||
{
|
{
|
||||||
// Call events
|
// Call events
|
||||||
// TODO: Implement actor IDs
|
// TODO: Implement actor IDs
|
||||||
this.OnNetworkMessage?.Invoke(dataPtr + 0x20, (ushort)Marshal.ReadInt16(dataPtr), 0x0, 0x0, NetworkMessageDirection.ZoneUp);
|
this.NetworkMessage?.Invoke(dataPtr + 0x20, (ushort)Marshal.ReadInt16(dataPtr), 0x0, 0x0, NetworkMessageDirection.ZoneUp);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ namespace Dalamud.Game.Network.Internal
|
||||||
|
|
||||||
this.uploader = new UniversalisMarketBoardUploader();
|
this.uploader = new UniversalisMarketBoardUploader();
|
||||||
|
|
||||||
Service<GameNetwork>.Get().OnNetworkMessage += this.OnNetworkMessage;
|
Service<GameNetwork>.Get().NetworkMessage += this.OnNetworkMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -648,6 +648,7 @@ namespace Dalamud.Interface.Internal
|
||||||
this.lastWantCapture = this.LastImGuiIoPtr.WantCaptureMouse;
|
this.lastWantCapture = this.LastImGuiIoPtr.WantCaptureMouse;
|
||||||
|
|
||||||
WindowSystem.HasAnyWindowSystemFocus = false;
|
WindowSystem.HasAnyWindowSystemFocus = false;
|
||||||
|
WindowSystem.FocusedWindowSystemNamespace = string.Empty;
|
||||||
|
|
||||||
this.Draw?.Invoke();
|
this.Draw?.Invoke();
|
||||||
Service<NotificationManager>.Get().Draw();
|
Service<NotificationManager>.Get().Draw();
|
||||||
|
|
|
||||||
|
|
@ -1184,7 +1184,10 @@ namespace Dalamud.Interface.Internal.Windows
|
||||||
// Available commands (if loaded)
|
// Available commands (if loaded)
|
||||||
if (plugin.IsLoaded)
|
if (plugin.IsLoaded)
|
||||||
{
|
{
|
||||||
var commands = commandManager.Commands.Where(cInfo => cInfo.Value.ShowInHelp && cInfo.Value.LoaderAssemblyName == plugin.Manifest.InternalName);
|
var commands = commandManager.Commands
|
||||||
|
.Where(cInfo => cInfo.Value.ShowInHelp && cInfo.Value.LoaderAssemblyName == plugin.Manifest.InternalName)
|
||||||
|
.ToArray();
|
||||||
|
|
||||||
if (commands.Any())
|
if (commands.Any())
|
||||||
{
|
{
|
||||||
ImGui.Dummy(ImGuiHelpers.ScaledVector2(10f, 10f));
|
ImGui.Dummy(ImGuiHelpers.ScaledVector2(10f, 10f));
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,12 @@ namespace Dalamud.Interface.Windowing
|
||||||
/// Gets a value indicating whether any <see cref="WindowSystem"/> contains any <see cref="Window"/>
|
/// Gets a value indicating whether any <see cref="WindowSystem"/> contains any <see cref="Window"/>
|
||||||
/// that has focus and is not marked to be excluded from consideration.
|
/// that has focus and is not marked to be excluded from consideration.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool HasAnyWindowSystemFocus { get; internal set; }
|
public static bool HasAnyWindowSystemFocus { get; internal set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the name of the currently focused window system that is redirecting normal escape functionality.
|
||||||
|
/// </summary>
|
||||||
|
public static string FocusedWindowSystemNamespace { get; internal set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the timespan since the last time any window was focused.
|
/// Gets the timespan since the last time any window was focused.
|
||||||
|
|
@ -109,6 +114,8 @@ namespace Dalamud.Interface.Windowing
|
||||||
}
|
}
|
||||||
|
|
||||||
HasAnyWindowSystemFocus = true;
|
HasAnyWindowSystemFocus = true;
|
||||||
|
FocusedWindowSystemNamespace = this.Namespace;
|
||||||
|
|
||||||
lastAnyFocus = DateTimeOffset.Now;
|
lastAnyFocus = DateTimeOffset.Now;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ namespace Dalamud.Plugin.Internal
|
||||||
this.instance?.Dispose();
|
this.instance?.Dispose();
|
||||||
this.instance = null;
|
this.instance = null;
|
||||||
|
|
||||||
this.DalamudInterface.Dispose();
|
this.DalamudInterface?.Dispose();
|
||||||
this.DalamudInterface = null;
|
this.DalamudInterface = null;
|
||||||
|
|
||||||
this.pluginType = null;
|
this.pluginType = null;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue