mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Merge branch 'net5' of ssh://github.com/goatcorp/Dalamud into net5
This commit is contained in:
commit
08ad57aa6c
2 changed files with 8 additions and 23 deletions
|
|
@ -2,7 +2,6 @@ using System;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
using Dalamud.Configuration.Internal;
|
|
||||||
using Dalamud.Game.Gui.ContextMenus;
|
using Dalamud.Game.Gui.ContextMenus;
|
||||||
using Dalamud.Game.Gui.Dtr;
|
using Dalamud.Game.Gui.Dtr;
|
||||||
using Dalamud.Game.Gui.FlyText;
|
using Dalamud.Game.Gui.FlyText;
|
||||||
|
|
@ -15,7 +14,6 @@ using Dalamud.IoC;
|
||||||
using Dalamud.IoC.Internal;
|
using Dalamud.IoC.Internal;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using FFXIVClientStructs.FFXIV.Client.System.String;
|
using FFXIVClientStructs.FFXIV.Client.System.String;
|
||||||
using FFXIVClientStructs.FFXIV.Client.UI;
|
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
|
|
@ -95,8 +93,6 @@ namespace Dalamud.Game.Gui
|
||||||
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
|
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
|
||||||
private unsafe delegate bool ScreenToWorldNativeDelegate(float* camPos, float* clipPos, float rayDistance, float* worldPos, int* unknown);
|
private unsafe delegate bool ScreenToWorldNativeDelegate(float* camPos, float* clipPos, float rayDistance, float* worldPos, int* unknown);
|
||||||
|
|
||||||
private delegate IntPtr GetAgentModuleDelegate(IntPtr uiModule);
|
|
||||||
|
|
||||||
// Hooked delegates
|
// Hooked delegates
|
||||||
|
|
||||||
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
|
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
|
||||||
|
|
@ -394,36 +390,25 @@ namespace Dalamud.Game.Gui
|
||||||
if (addon == IntPtr.Zero)
|
if (addon == IntPtr.Zero)
|
||||||
return IntPtr.Zero;
|
return IntPtr.Zero;
|
||||||
|
|
||||||
var uiModule = (UIModule*)Service<GameGui>.Get().GetUIModule();
|
var uiModule = (FFXIVClientStructs.FFXIV.Client.UI.UIModule*)this.GetUIModule();
|
||||||
if (uiModule == null)
|
if (uiModule == null)
|
||||||
{
|
|
||||||
return IntPtr.Zero;
|
return IntPtr.Zero;
|
||||||
}
|
|
||||||
|
|
||||||
var agentModule = uiModule->GetAgentModule();
|
var agentModule = uiModule->GetAgentModule();
|
||||||
if (agentModule == null)
|
if (agentModule == null)
|
||||||
{
|
|
||||||
return IntPtr.Zero;
|
return IntPtr.Zero;
|
||||||
}
|
|
||||||
|
|
||||||
var unitBase = (FFXIVClientStructs.FFXIV.Component.GUI.AtkUnitBase*)addon;
|
var unitBase = (FFXIVClientStructs.FFXIV.Component.GUI.AtkUnitBase*)addon;
|
||||||
var id = unitBase->ParentID;
|
var id = unitBase->ParentID;
|
||||||
if (id == 0)
|
if (id == 0)
|
||||||
id = unitBase->ID;
|
|
||||||
|
|
||||||
if (id == 0)
|
|
||||||
return IntPtr.Zero;
|
|
||||||
|
|
||||||
// Patch 6.1, 398 agents
|
|
||||||
for (var i = 0; i < 398; i++)
|
|
||||||
{
|
{
|
||||||
var agent = &agentModule->AgentArray[i];
|
id = unitBase->ID;
|
||||||
|
if (id == 0)
|
||||||
if (agent->AddonId == id)
|
return IntPtr.Zero;
|
||||||
return new IntPtr(agent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return IntPtr.Zero;
|
var agent = agentModule->GetAgentByInternalID(id);
|
||||||
|
return (IntPtr)agent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -353,7 +353,7 @@ namespace Dalamud.Interface.Internal.Windows
|
||||||
interfaceManager.RebuildFonts();
|
interfaceManager.RebuildFonts();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.DragFloat("##DalamudSettingsGlobalUiScaleDrag", ref this.globalUiScale, 0.005f, MinScale, MaxScale, "%.2f"))
|
if (ImGui.DragFloat("##DalamudSettingsGlobalUiScaleDrag", ref this.globalUiScale, 0.005f, MinScale, MaxScale, "%.2f", ImGuiSliderFlags.AlwaysClamp))
|
||||||
{
|
{
|
||||||
ImGui.GetIO().FontGlobalScale = this.globalUiScale;
|
ImGui.GetIO().FontGlobalScale = this.globalUiScale;
|
||||||
interfaceManager.RebuildFonts();
|
interfaceManager.RebuildFonts();
|
||||||
|
|
@ -440,7 +440,7 @@ namespace Dalamud.Interface.Internal.Windows
|
||||||
interfaceManager.RebuildFonts();
|
interfaceManager.RebuildFonts();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.DragFloat("##DalamudSettingsFontGammaDrag", ref this.fontGamma, 0.005f, MinScale, MaxScale, "%.2f"))
|
if (ImGui.DragFloat("##DalamudSettingsFontGammaDrag", ref this.fontGamma, 0.005f, MinScale, MaxScale, "%.2f", ImGuiSliderFlags.AlwaysClamp))
|
||||||
{
|
{
|
||||||
interfaceManager.FontGammaOverride = this.fontGamma;
|
interfaceManager.FontGammaOverride = this.fontGamma;
|
||||||
interfaceManager.RebuildFonts();
|
interfaceManager.RebuildFonts();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue