Compare commits

...

7 commits

Author SHA1 Message Date
github-actions[bot]
fc804ba0d0 Update ClientStructs
Some checks are pending
Build Dalamud / Build on Windows (push) Waiting to run
Build Dalamud / Check API Compatibility (push) Blocked by required conditions
Build Dalamud / Deploy dalamud-distrib staging (push) Blocked by required conditions
2025-12-17 18:40:02 +00:00
goat
108a7a2c2d
Merge pull request #2510 from Haselnussbomber/conditions
Some checks failed
Build Dalamud / Build on Windows (push) Waiting to run
Build Dalamud / Check API Compatibility (push) Blocked by required conditions
Build Dalamud / Deploy dalamud-distrib staging (push) Blocked by required conditions
Rollup changes to next version / check (api14) (push) Failing after 7s
Tag Build / Tag Build (push) Successful in 4s
Update Condition/ConditionFlag
2025-12-17 18:48:25 +01:00
goat
c5d90aef64
Merge pull request #2511 from Haselnussbomber/context-menu-fix
Fix crashing Context Menu
2025-12-17 18:42:32 +01:00
goat
92d6c70358
Merge pull request #2512 from Haselnussbomber/hover-action-kind
Update HoverActionKind
2025-12-17 18:41:56 +01:00
Haselnussbomber
2fc9884aad
Update HoverActionKind 2025-12-17 18:17:44 +01:00
Haselnussbomber
b3c4363e0f
Fix crashing Context Menu 2025-12-17 17:09:18 +01:00
Haselnussbomber
19660a20d9
Update Condition/ConditionFlag 2025-12-17 16:12:33 +01:00
5 changed files with 56 additions and 41 deletions

View file

@ -18,7 +18,7 @@ internal sealed class Condition : IInternalDisposableService, ICondition
/// <summary>
/// Gets the current max number of conditions. You can get this just by looking at the condition sheet and how many rows it has.
/// </summary>
internal const int MaxConditionEntries = 104;
internal const int MaxConditionEntries = 112;
[ServiceManager.ServiceDependency]
private readonly Framework framework = Service<Framework>.Get();

View file

@ -520,4 +520,17 @@ public enum ConditionFlag
PilotingMech = 102,
// Unknown103 = 103,
/// <summary>
/// Unable to execute command while editing a strategy board.
/// </summary>
EditingStrategyBoard = 104,
// Unknown105 = 105,
// Unknown106 = 106,
// Unknown107 = 107,
// Unknown108 = 108,
// Unknown109 = 109,
// Unknown110 = 110,
// Unknown111 = 111,
}

View file

@ -31,7 +31,7 @@ internal sealed unsafe class ContextMenu : IInternalDisposableService, IContextM
private static readonly ModuleLog Log = new("ContextMenu");
private readonly Hook<AtkModuleVf22OpenAddonByAgentDelegate> atkModuleVf22OpenAddonByAgentHook;
private readonly Hook<AddonContextMenuOnMenuSelectedDelegate> addonContextMenuOnMenuSelectedHook;
private readonly Hook<AddonContextMenu.Delegates.OnMenuSelected> addonContextMenuOnMenuSelectedHook;
private uint? addonContextSubNameId;
@ -40,7 +40,7 @@ internal sealed unsafe class ContextMenu : IInternalDisposableService, IContextM
{
var raptureAtkModuleVtable = (nint*)RaptureAtkModule.StaticVirtualTablePointer;
this.atkModuleVf22OpenAddonByAgentHook = Hook<AtkModuleVf22OpenAddonByAgentDelegate>.FromAddress(raptureAtkModuleVtable[22], this.AtkModuleVf22OpenAddonByAgentDetour);
this.addonContextMenuOnMenuSelectedHook = Hook<AddonContextMenuOnMenuSelectedDelegate>.FromAddress((nint)AddonContextMenu.StaticVirtualTablePointer->OnMenuSelected, this.AddonContextMenuOnMenuSelectedDetour);
this.addonContextMenuOnMenuSelectedHook = Hook<AddonContextMenu.Delegates.OnMenuSelected>.FromAddress((nint)AddonContextMenu.StaticVirtualTablePointer->OnMenuSelected, this.AddonContextMenuOnMenuSelectedDetour);
this.atkModuleVf22OpenAddonByAgentHook.Enable();
this.addonContextMenuOnMenuSelectedHook.Enable();
@ -48,10 +48,6 @@ internal sealed unsafe class ContextMenu : IInternalDisposableService, IContextM
private delegate ushort AtkModuleVf22OpenAddonByAgentDelegate(AtkModule* module, byte* addonName, int valueCount, AtkValue* values, AgentInterface* agent, nint a7, bool a8);
private delegate bool AddonContextMenuOnMenuSelectedDelegate(AddonContextMenu* addon, int selectedIdx, byte a3);
private delegate ushort RaptureAtkModuleOpenAddonDelegate(RaptureAtkModule* a1, uint addonNameId, uint valueCount, AtkValue* values, AgentInterface* parentAgent, ulong unk, ushort parentAddonId, int unk2);
/// <inheritdoc/>
public event IContextMenu.OnMenuOpenedDelegate? OnMenuOpened;
@ -185,7 +181,7 @@ internal sealed unsafe class ContextMenu : IInternalDisposableService, IContextM
values[0].ChangeType(ValueType.UInt);
values[0].UInt = 0;
values[1].ChangeType(ValueType.String);
values[1].SetManagedString(name.Encode().NullTerminate());
values[1].SetManagedString(name.EncodeWithNullTerminator());
values[2].ChangeType(ValueType.Int);
values[2].Int = x;
values[3].ChangeType(ValueType.Int);
@ -265,7 +261,7 @@ internal sealed unsafe class ContextMenu : IInternalDisposableService, IContextM
submenuMask |= 1u << i;
nameData[i].ChangeType(ValueType.String);
nameData[i].SetManagedString(this.GetPrefixedName(item).Encode().NullTerminate());
nameData[i].SetManagedString(this.GetPrefixedName(item).EncodeWithNullTerminator());
}
for (var i = 0; i < prefixMenuSize; ++i)
@ -295,8 +291,9 @@ internal sealed unsafe class ContextMenu : IInternalDisposableService, IContextM
// 2: UInt = Return Mask (?)
// 3: UInt = Submenu Mask
// 4: UInt = OpenAtCursorPosition ? 2 : 1
// 5: UInt = 0
// 6: UInt = 0
// 5: UInt = ?
// 6: UInt = ?
// 7: UInt = ?
foreach (var item in items)
{
@ -312,7 +309,7 @@ internal sealed unsafe class ContextMenu : IInternalDisposableService, IContextM
}
}
this.SetupGenericMenu(7, 0, 2, 3, items, ref valueCount, ref values);
this.SetupGenericMenu(8, 0, 2, 3, items, ref valueCount, ref values);
}
private void SetupContextSubMenu(IReadOnlyList<IMenuItem> items, ref int valueCount, ref AtkValue* values)

View file

@ -14,140 +14,145 @@ public enum HoverActionKind
/// <summary>
/// A regular action is hovered.
/// </summary>
Action = 28,
Action = 29,
/// <summary>
/// A crafting action is hovered.
/// </summary>
CraftingAction = 29,
CraftingAction = 30,
/// <summary>
/// A general action is hovered.
/// </summary>
GeneralAction = 30,
GeneralAction = 31,
/// <summary>
/// A companion order type of action is hovered.
/// </summary>
CompanionOrder = 31, // Game Term: BuddyOrder
CompanionOrder = 32, // Game Term: BuddyOrder
/// <summary>
/// A main command type of action is hovered.
/// </summary>
MainCommand = 32,
MainCommand = 33,
/// <summary>
/// An extras command type of action is hovered.
/// </summary>
ExtraCommand = 33,
ExtraCommand = 34,
/// <summary>
/// A companion action is hovered.
/// </summary>
Companion = 34,
Companion = 35,
/// <summary>
/// A pet order type of action is hovered.
/// </summary>
PetOrder = 35,
PetOrder = 36,
/// <summary>
/// A trait is hovered.
/// </summary>
Trait = 36,
Trait = 37,
/// <summary>
/// A buddy action is hovered.
/// </summary>
BuddyAction = 37,
BuddyAction = 38,
/// <summary>
/// A company action is hovered.
/// </summary>
CompanyAction = 38,
CompanyAction = 39,
/// <summary>
/// A mount is hovered.
/// </summary>
Mount = 39,
Mount = 40,
/// <summary>
/// A chocobo race action is hovered.
/// </summary>
ChocoboRaceAction = 40,
ChocoboRaceAction = 41,
/// <summary>
/// A chocobo race item is hovered.
/// </summary>
ChocoboRaceItem = 41,
ChocoboRaceItem = 42,
/// <summary>
/// A deep dungeon equipment is hovered.
/// </summary>
DeepDungeonEquipment = 42,
DeepDungeonEquipment = 43,
/// <summary>
/// A deep dungeon equipment 2 is hovered.
/// </summary>
DeepDungeonEquipment2 = 43,
DeepDungeonEquipment2 = 44,
/// <summary>
/// A deep dungeon item is hovered.
/// </summary>
DeepDungeonItem = 44,
DeepDungeonItem = 45,
/// <summary>
/// A quick chat is hovered.
/// </summary>
QuickChat = 45,
QuickChat = 46,
/// <summary>
/// An action combo route is hovered.
/// </summary>
ActionComboRoute = 46,
ActionComboRoute = 47,
/// <summary>
/// A pvp trait is hovered.
/// </summary>
PvPSelectTrait = 47,
PvPSelectTrait = 48,
/// <summary>
/// A squadron action is hovered.
/// </summary>
BgcArmyAction = 48,
BgcArmyAction = 49,
/// <summary>
/// A perform action is hovered.
/// </summary>
Perform = 49,
Perform = 50,
/// <summary>
/// A deep dungeon magic stone is hovered.
/// </summary>
DeepDungeonMagicStone = 50,
DeepDungeonMagicStone = 51,
/// <summary>
/// A deep dungeon demiclone is hovered.
/// </summary>
DeepDungeonDemiclone = 51,
DeepDungeonDemiclone = 52,
/// <summary>
/// An eureka magia action is hovered.
/// </summary>
EurekaMagiaAction = 52,
EurekaMagiaAction = 53,
/// <summary>
/// An island sanctuary temporary item is hovered.
/// </summary>
MYCTemporaryItem = 53,
MYCTemporaryItem = 54,
/// <summary>
/// An ornament is hovered.
/// </summary>
Ornament = 54,
Ornament = 55,
/// <summary>
/// Glasses are hovered.
/// </summary>
Glasses = 55,
Glasses = 56,
/// <summary>
/// Phantom Job Trait is hovered.
/// </summary>
MKDTrait = 58,
}

@ -1 +1 @@
Subproject commit e5dedba42a3fea8f050ea54ac583a5874bf51c6f
Subproject commit 305c1629eed0b1cdca5efb102e37de93d592d155