Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into net9-rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow committed Nov 16, 2024
2 parents e187749 + aa450a7 commit e039273
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 33 deletions.
4 changes: 2 additions & 2 deletions Dalamud.CorePlugin/Dalamud.CorePlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Lumina" Version="5.2.1" />
<PackageReference Include="Lumina.Excel" Version="7.1.0" />
<PackageReference Include="Lumina" Version="5.3.0" />
<PackageReference Include="Lumina.Excel" Version="7.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.333">
<PrivateAssets>all</PrivateAssets>
Expand Down
4 changes: 2 additions & 2 deletions Dalamud/Dalamud.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
<PackageReference Include="goaaats.Reloaded.Hooks" Version="4.2.0-goat.4" />
<PackageReference Include="goaaats.Reloaded.Assembler" Version="1.0.14-goat.2" />
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0" />
<PackageReference Include="Lumina" Version="5.2.1" />
<PackageReference Include="Lumina.Excel" Version="7.1.0" />
<PackageReference Include="Lumina" Version="5.3.0" />
<PackageReference Include="Lumina.Excel" Version="7.1.1" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="9.0.0-preview.1.24081.5" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.46-beta">
<PrivateAssets>all</PrivateAssets>
Expand Down
2 changes: 1 addition & 1 deletion Dalamud/Game/ClientState/JobGauge/JobGauges.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private JobGauges()
}

/// <inheritdoc/>
public unsafe IntPtr Address => (nint)(CSJobGaugeManager.Instance()->CurrentGauge);
public unsafe IntPtr Address => (nint)(&CSJobGaugeManager.Instance()->EmptyGauge);

/// <inheritdoc/>
public T Get<T>() where T : JobGaugeBase
Expand Down
42 changes: 42 additions & 0 deletions Dalamud/Game/Config/SystemConfigOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1436,4 +1436,46 @@ public enum SystemConfigOption
/// </summary>
[GameConfigOption("PadButton_R3", ConfigType.String)]
PadButton_R3,

/// <summary>
/// System option with the internal name ActiveInstanceGuid.
/// This option is a String.
/// </summary>
[GameConfigOption("ActiveInstanceGuid", ConfigType.String)]
ActiveInstanceGuid,

/// <summary>
/// System option with the internal name ActiveProductGuid.
/// This option is a String.
/// </summary>
[GameConfigOption("ActiveProductGuid", ConfigType.String)]
ActiveProductGuid,

/// <summary>
/// System option with the internal name MsqProgress.
/// This option is a UInt.
/// </summary>
[GameConfigOption("MsqProgress", ConfigType.UInt)]
MsqProgress,

/// <summary>
/// System option with the internal name PromptConfigUpdate.
/// This option is a UInt.
/// </summary>
[GameConfigOption("PromptConfigUpdate", ConfigType.UInt)]
PromptConfigUpdate,

/// <summary>
/// System option with the internal name TitleScreenType.
/// This option is a UInt.
/// </summary>
[GameConfigOption("TitleScreenType", ConfigType.UInt)]
TitleScreenType,

/// <summary>
/// System option with the internal name FirstConfigBackup.
/// This option is a UInt.
/// </summary>
[GameConfigOption("FirstConfigBackup", ConfigType.UInt)]
FirstConfigBackup,
}
22 changes: 22 additions & 0 deletions Dalamud/Game/Config/UiConfigOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public enum UiConfigOption
/// System option with the internal name LockonDefaultZoom_179.
/// This option is a Float.
/// </summary>
[Obsolete("This option won't work. Use LockonDefaultZoom.")]
[GameConfigOption("LockonDefaultZoom_179", ConfigType.Float)]
LockonDefaultZoom_179,

Expand Down Expand Up @@ -3578,4 +3579,25 @@ public enum UiConfigOption
/// </summary>
[GameConfigOption("PadMode", ConfigType.UInt)]
PadMode,

/// <summary>
/// System option with the internal name EnableMoveTiltCharacter.
/// This option is a UInt.
/// </summary>
[GameConfigOption("EnableMoveTiltCharacter", ConfigType.UInt)]
EnableMoveTiltCharacter,

/// <summary>
/// System option with the internal name EnableMoveTiltMountGround.
/// This option is a UInt.
/// </summary>
[GameConfigOption("EnableMoveTiltMountGround", ConfigType.UInt)]
EnableMoveTiltMountGround,

/// <summary>
/// System option with the internal name EnableMoveTiltMountFly.
/// This option is a UInt.
/// </summary>
[GameConfigOption("EnableMoveTiltMountFly", ConfigType.UInt)]
EnableMoveTiltMountFly,
}
74 changes: 49 additions & 25 deletions Dalamud/Game/Gui/GameGui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ internal sealed unsafe class GameGui : IInternalDisposableService, IGameGui
{
private static readonly ModuleLog Log = new("GameGui");

[ServiceManager.ServiceDependency]
private readonly Framework framework = Service<Framework>.Get();

private readonly GameGuiAddressResolver address;

private readonly Hook<SetGlobalBgmDelegate> setGlobalBgmHook;
private readonly Hook<AgentItemDetail.Delegates.Update> handleItemHoverHook;
private readonly Hook<AgentItemDetail.Delegates.ReceiveEvent> handleItemOutHook;
private readonly Hook<AgentActionDetail.Delegates.HandleActionHover> handleActionHoverHook;
private readonly Hook<AgentActionDetail.Delegates.ReceiveEvent> handleActionOutHook;
private readonly Hook<HandleImmDelegate> handleImmHook;
Expand All @@ -57,6 +56,9 @@ private GameGui(TargetSigScanner sigScanner)

this.setGlobalBgmHook = Hook<SetGlobalBgmDelegate>.FromAddress(this.address.SetGlobalBgm, this.HandleSetGlobalBgmDetour);

this.handleItemHoverHook = Hook<AgentItemDetail.Delegates.Update>.FromAddress((nint)AgentItemDetail.StaticVirtualTablePointer->Update, this.HandleItemHoverDetour);
this.handleItemOutHook = Hook<AgentItemDetail.Delegates.ReceiveEvent>.FromAddress((nint)AgentItemDetail.StaticVirtualTablePointer->ReceiveEvent, this.HandleItemOutDetour);

this.handleActionHoverHook = Hook<AgentActionDetail.Delegates.HandleActionHover>.FromAddress(AgentActionDetail.Addresses.HandleActionHover.Value, this.HandleActionHoverDetour);
this.handleActionOutHook = Hook<AgentActionDetail.Delegates.ReceiveEvent>.FromAddress((nint)AgentActionDetail.StaticVirtualTablePointer->ReceiveEvent, this.HandleActionOutDetour);

Expand All @@ -67,13 +69,13 @@ private GameGui(TargetSigScanner sigScanner)
this.utf8StringFromSequenceHook = Hook<Utf8String.Delegates.Ctor_FromSequence>.FromAddress(Utf8String.Addresses.Ctor_FromSequence.Value, this.Utf8StringFromSequenceDetour);

this.setGlobalBgmHook.Enable();
this.handleItemHoverHook.Enable();
this.handleItemOutHook.Enable();
this.handleImmHook.Enable();
this.setUiVisibilityHook.Enable();
this.handleActionHoverHook.Enable();
this.handleActionOutHook.Enable();
this.utf8StringFromSequenceHook.Enable();

this.framework.Update += this.FrameworkUpdate;
}

// Hooked delegates
Expand Down Expand Up @@ -252,9 +254,9 @@ public IntPtr FindAgentInterface(IntPtr addonPtr)
/// </summary>
void IInternalDisposableService.DisposeService()
{
this.framework.Update -= this.FrameworkUpdate;

this.setGlobalBgmHook.Dispose();
this.handleItemHoverHook.Dispose();
this.handleItemOutHook.Dispose();
this.handleImmHook.Dispose();
this.setUiVisibilityHook.Dispose();
this.handleActionHoverHook.Dispose();
Expand Down Expand Up @@ -300,6 +302,46 @@ private IntPtr HandleSetGlobalBgmDetour(ushort bgmKey, byte a2, uint a3, uint a4
return retVal;
}

private void HandleItemHoverDetour(AgentItemDetail* thisPtr, uint frameCount)
{
this.handleItemHoverHook.Original(thisPtr, frameCount);

if (!thisPtr->IsAgentActive())
return;

var itemId = (ulong)thisPtr->ItemId;
if (this.HoveredItem == itemId)
return;

this.HoveredItem = itemId;
this.HoveredItemChanged?.InvokeSafely(this, itemId);

Log.Verbose($"HoveredItem changed: {itemId}");
}

private AtkValue* HandleItemOutDetour(AgentItemDetail* thisPtr, AtkValue* returnValue, AtkValue* values, uint valueCount, ulong eventKind)
{
var ret = this.handleItemOutHook.Original(thisPtr, returnValue, values, valueCount, eventKind);

if (values != null && valueCount == 1 && values->Int == -1)
{
this.HoveredItem = 0;

try
{
this.HoveredItemChanged?.Invoke(this, 0);
}
catch (Exception e)
{
Log.Error(e, "Could not dispatch HoveredItemChanged event.");
}

Log.Verbose("HoveredItem changed: 0");
}

return ret;
}

private void HandleActionHoverDetour(AgentActionDetail* hoverState, ActionKind actionKind, uint actionId, int a4, byte a5)
{
this.handleActionHoverHook.Original(hoverState, actionKind, actionId, a4, a5);
Expand Down Expand Up @@ -371,24 +413,6 @@ private char HandleImmDetour(IntPtr framework, char a2, byte a3)

return thisPtr; // this function shouldn't need to return but the original asm moves this into rax before returning so be safe?
}

private unsafe void FrameworkUpdate(IFramework framework)
{
var agentItemDetail = AgentItemDetail.Instance();
if (agentItemDetail != null)
{
var itemId = agentItemDetail->ItemId;

if (this.HoveredItem != itemId)
{
Log.Verbose($"HoveredItem changed: {itemId}");

this.HoveredItem = itemId;

this.HoveredItemChanged?.InvokeSafely(this, itemId);
}
}
}
}

/// <summary>
Expand Down
50 changes: 50 additions & 0 deletions Dalamud/Game/Text/SeIconChar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -766,4 +766,54 @@ public enum SeIconChar
/// The Japanese Eorzea time icon unicode character.
/// </summary>
EorzeaTimeJa = 0xE0DB,

/// <summary>
/// The boxed, outlined number 0 icon unicode character.
/// </summary>
BoxedOutlinedNumber0 = 0xE0E0,

/// <summary>
/// The boxed, outlined number 1 icon unicode character.
/// </summary>
BoxedOutlinedNumber1 = 0xE0E1,

/// <summary>
/// The boxed, outlined number 2 icon unicode character.
/// </summary>
BoxedOutlinedNumber2 = 0xE0E2,

/// <summary>
/// The boxed, outlined number 3 icon unicode character.
/// </summary>
BoxedOutlinedNumber3 = 0xE0E3,

/// <summary>
/// The boxed, outlined number 4 icon unicode character.
/// </summary>
BoxedOutlinedNumber4 = 0xE0E4,

/// <summary>
/// The boxed, outlined number 5 icon unicode character.
/// </summary>
BoxedOutlinedNumber5 = 0xE0E5,

/// <summary>
/// The boxed, outlined number 6 icon unicode character.
/// </summary>
BoxedOutlinedNumber6 = 0xE0E6,

/// <summary>
/// The boxed, outlined number 7 icon unicode character.
/// </summary>
BoxedOutlinedNumber7 = 0xE0E7,

/// <summary>
/// The boxed, outlined number 8 icon unicode character.
/// </summary>
BoxedOutlinedNumber8 = 0xE0E8,

/// <summary>
/// The boxed, outlined number 9 icon unicode character.
/// </summary>
BoxedOutlinedNumber9 = 0xE0E9,
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using Dalamud.Game.Text;
using ImGuiNET;

using System.Linq;

namespace Dalamud.Interface.Internal.Windows.Data.Widgets;

/// <summary>
Expand Down Expand Up @@ -28,8 +30,11 @@ public void Draw()
{
var specialChars = string.Empty;

for (var i = 0xE020; i <= 0xE0DB; i++)
specialChars += $"0x{i:X} - {(SeIconChar)i} - {(char)i}\n";
var min = (char)Enum.GetValues<SeIconChar>().Min();
var max = (char)Enum.GetValues<SeIconChar>().Max();

for (var i = min; i <= max; i++)
specialChars += $"0x{(int)i:X} - {(SeIconChar)i} - {i}\n";

ImGui.TextUnformatted(specialChars);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/FFXIVClientStructs
Submodule FFXIVClientStructs updated 31 files
+10 −10 CExporter/Program.cs
+5 −5 FFXIVClientStructs/FFXIV/Client/Game/Control/Control.cs
+10 −10 FFXIVClientStructs/FFXIV/Client/Game/InstanceContent/InstanceContentDeepDungeon.cs
+2 −2 FFXIVClientStructs/FFXIV/Client/Game/InstanceContent/InstanceContentDirector.cs
+21 −21 FFXIVClientStructs/FFXIV/Client/Game/InstanceContent/InstanceContentOceanFishing.cs
+12 −12 FFXIVClientStructs/FFXIV/Client/Game/InventoryManager.cs
+7 −8 FFXIVClientStructs/FFXIV/Client/Game/QuestManager.cs
+10 −10 FFXIVClientStructs/FFXIV/Client/Game/SatisfactionSupplyManager.cs
+10 −10 FFXIVClientStructs/FFXIV/Client/Game/UI/Map.cs
+2 −2 FFXIVClientStructs/FFXIV/Client/UI/AddonAdventureNoteBook.cs
+3 −3 FFXIVClientStructs/FFXIV/Client/UI/AddonCharacterRepute.cs
+1 −1 FFXIVClientStructs/FFXIV/Client/UI/AddonJobHudDRK.cs
+46 −45 FFXIVClientStructs/FFXIV/Client/UI/AddonPartyList.cs
+1 −0 FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentItemDetail.cs
+3 −3 FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentLobby.cs
+15 −13 FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentLookingForGroup.cs
+1 −1 FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentMap.cs
+2 −2 FFXIVClientStructs/FFXIV/Client/UI/Info/InfoProxyCommonList.cs
+1 −1 FFXIVClientStructs/FFXIV/Client/UI/Info/InfoProxyInterface.cs
+815 −806 FFXIVClientStructs/FFXIV/Client/UI/Misc/ConfigOption.cs
+18 −14 FFXIVClientStructs/FFXIV/Client/UI/Misc/UserFileManager.cs
+1 −1 FFXIVClientStructs/FFXIV/Client/UI/RaptureAtkModule.cs
+1 −1 FFXIVClientStructs/FFXIV/Client/UI/UI3DModule.cs
+2 −2 FFXIVClientStructs/FFXIV/Client/UI/UIModule.cs
+1 −1 FFXIVClientStructs/FFXIV/Component/GUI/AtkComponentJournalCanvas.cs
+10 −10 FFXIVClientStructs/FFXIV/Component/GUI/AtkComponentList.cs
+3 −3 FFXIVClientStructs/FFXIV/Component/GUI/AtkComponentTreeList.cs
+1 −1 FFXIVClientStructs/FFXIV/Component/GUI/AtkEvent.cs
+1 −1 FFXIVClientStructs/FFXIV/Component/GUI/AtkUnitBase.cs
+4 −4 ida/data.yml
+12 −0 ida/ffxiv_structimporter.py

0 comments on commit e039273

Please sign in to comment.