Compare commits

..

No commits in common. "108a7a2c2d359c57369677b18e9150618079b5dd" and "f142fb1058887be55cb3b9cbebd370643f4bc3d5" have entirely different histories.

4 changed files with 40 additions and 55 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 = 112;
internal const int MaxConditionEntries = 104;
[ServiceManager.ServiceDependency]
private readonly Framework framework = Service<Framework>.Get();

View file

@ -520,17 +520,4 @@ 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<AddonContextMenu.Delegates.OnMenuSelected> addonContextMenuOnMenuSelectedHook;
private readonly Hook<AddonContextMenuOnMenuSelectedDelegate> 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<AddonContextMenu.Delegates.OnMenuSelected>.FromAddress((nint)AddonContextMenu.StaticVirtualTablePointer->OnMenuSelected, this.AddonContextMenuOnMenuSelectedDetour);
this.addonContextMenuOnMenuSelectedHook = Hook<AddonContextMenuOnMenuSelectedDelegate>.FromAddress((nint)AddonContextMenu.StaticVirtualTablePointer->OnMenuSelected, this.AddonContextMenuOnMenuSelectedDetour);
this.atkModuleVf22OpenAddonByAgentHook.Enable();
this.addonContextMenuOnMenuSelectedHook.Enable();
@ -48,6 +48,10 @@ 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;
@ -181,7 +185,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.EncodeWithNullTerminator());
values[1].SetManagedString(name.Encode().NullTerminate());
values[2].ChangeType(ValueType.Int);
values[2].Int = x;
values[3].ChangeType(ValueType.Int);
@ -261,7 +265,7 @@ internal sealed unsafe class ContextMenu : IInternalDisposableService, IContextM
submenuMask |= 1u << i;
nameData[i].ChangeType(ValueType.String);
nameData[i].SetManagedString(this.GetPrefixedName(item).EncodeWithNullTerminator());
nameData[i].SetManagedString(this.GetPrefixedName(item).Encode().NullTerminate());
}
for (var i = 0; i < prefixMenuSize; ++i)
@ -291,9 +295,8 @@ internal sealed unsafe class ContextMenu : IInternalDisposableService, IContextM
// 2: UInt = Return Mask (?)
// 3: UInt = Submenu Mask
// 4: UInt = OpenAtCursorPosition ? 2 : 1
// 5: UInt = ?
// 6: UInt = ?
// 7: UInt = ?
// 5: UInt = 0
// 6: UInt = 0
foreach (var item in items)
{
@ -309,7 +312,7 @@ internal sealed unsafe class ContextMenu : IInternalDisposableService, IContextM
}
}
this.SetupGenericMenu(8, 0, 2, 3, items, ref valueCount, ref values);
this.SetupGenericMenu(7, 0, 2, 3, items, ref valueCount, ref values);
}
private void SetupContextSubMenu(IReadOnlyList<IMenuItem> items, ref int valueCount, ref AtkValue* values)

View file

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