Code cleanup

This commit is contained in:
r00telement
2022-01-10 05:41:31 +00:00
parent 8fb68789a1
commit 6db44881b1
2 changed files with 5 additions and 2 deletions

View File

@@ -353,7 +353,7 @@ namespace PlayerTags.GameInterface.ContextMenus
{
return false;
}
// The important things to make this work are:
// 1. Allocate a temporary sub context menu title. The value doesn't matter, we'll set it later.
// 2. Context menu item count must equal 1 to tell the game there is enough space for the "< Return" item.
@@ -383,6 +383,9 @@ namespace PlayerTags.GameInterface.ContextMenus
var atkValues = &agentContext->ItemData->AtkValues;
atkValues[0].UInt = 1;
// This isn't needed by the game, it's needed by ContextMenuReaderWriter which uses this to check if it's a context menu
m_AtkValueChangeType(&atkValues[1], FFXIVClientStructs.FFXIV.Component.GUI.ValueType.String);
ContextMenuReaderWriter contextMenuReaderWriter = new ContextMenuReaderWriter(agent, agentContext->ItemData->AtkValuesCount, atkValues);
*(&agentContext->ItemData->AtkValuesCount) = (ushort)contextMenuReaderWriter.FirstContextMenuItemIndex;

View File

@@ -46,7 +46,7 @@ namespace PlayerTags.GameInterface.ContextMenus
|| (int)m_AtkValues[1].Type == 38
|| m_AtkValues[1].Type == FFXIVClientStructs.FFXIV.Component.GUI.ValueType.String;
return isStringType && m_AtkValues[1].Int != 0;
return isStringType;
}
}