Repository navigation
Reimplement 33 UI::MenuItems functions: gynt's finished backlog, part 1 (100%) - #381
Merged
gynt merged 47 commits intoNov 10, 2026
Merged
Conversation
MenuItemRenderFunction_BuildMenu_MiniMapInteraction, gynt's work as it stands on his fork's reimpl/UI-MenuItems-100 at 0a7d992 (2026-10-25), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_BuildMenu_CurrentlySelectedTroops, gynt's work as it stands on his fork's reimpl/UI-MenuItems at d91f623 (2026-10-08), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_BuildingAndStatusMenu_StatusMenuButtons, gynt's work as it stands on his fork's archive/UI-MenuViews-development-second-pass at 71eb42a (2026-10-10), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemRenderFunction_BuildingAndStatusMenu_StatusMainMenuButtons, gynt's work as it stands on his fork's reimpl/UI-MenuItems at 9bea797 (2026-10-09), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemRenderFunction_BuildingAndStatusMenu_DisableFoodType, gynt's work as it stands on his fork's archive/UI-MenuViews-development-second-pass at 81e1041 (2026-10-03), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemRenderFunction_BuildingAndStatusMenu_ArmyStatusReturn, gynt's work as it stands on his fork's reimpl/UI-MenuItems at 48d3995 (2026-10-08), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_CustomScenarios_Main, gynt's work as it stands on his fork's archive/UI-MenuViews-development-second-pass at a389f84 (2026-10-04), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_BuildingAndStatusMenu_WorkshopWeaponSelection, gynt's work as it stands on his fork's reimpl/UI-MenuItems-100 at 0a7d992 (2026-10-25), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_BuildingAndStatusMenu_DrawbridgeOpenClose, gynt's work as it stands on his fork's reimpl/UI-MenuItems-100 at 0a7d992 (2026-10-25), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_BuildingAndStatusMenu_GatehouseOpenClose, gynt's work as it stands on his fork's reimpl/UI-MenuItems-100 at 0a7d992 (2026-10-25), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_BuildingAndStatusMenu_TaxSlider, gynt's work as it stands on his fork's archive/UI-MenuViews-development-second-pass at 81e1041 (2026-10-03), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemRenderFunction_BuildingAndStatusMenu_HorizontalSlider, gynt's work as it stands on his fork's reimpl/UI-MenuItems at b43b87b (2026-10-09), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemRenderFunction_BuildingAndStatusMenu_TaxArrowButtons, gynt's work as it stands on his fork's reimpl/UI-MenuItems-100 at 0a7d992 (2026-10-25), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_BuildingAndStatusMenu_ChangeRations, gynt's work as it stands on his fork's reimpl/UI-MenuItems at cea5c3a (2026-10-08), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_BuildingAndStatusMenu_SelectBuySellGoods, gynt's work as it stands on his fork's archive/UI-MenuViews-development-second-pass at 637c6b0 (2026-10-06), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_BuildingAndStatusMenu_OutpostSliderSize, gynt's work as it stands on his fork's archive/UI-MenuViews-development-second-pass at 81e1041 (2026-10-03), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_BuildingAndStatusMenu_OutpostSliderDelay, gynt's work as it stands on his fork's archive/UI-MenuViews-development-second-pass at 81e1041 (2026-10-03), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_ChooseNetworkServiceProvider_ProviderScrollbarUnk, gynt's work as it stands on his fork's reimpl/UI-MenuItems at 01ff313 (2026-10-08), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_General_TextInputDisplay, gynt's work as it stands on his fork's archive/UI-MenuViews-development-second-pass at c52ccd4 (2026-10-06), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_ChooseNetworkServiceProvider_ModemScrollbarUnk, gynt's work as it stands on his fork's archive/UI-MenuViews-development-second-pass at 81e1041 (2026-10-03), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemRenderFunction_ChooseNetworkServiceProvider_ModemTableRows, gynt's work as it stands on his fork's archive/UI-MenuViews-development-second-pass at 637c6b0 (2026-10-06), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemRenderFunction_FindingNetworkSessions_TableRows, gynt's work as it stands on his fork's archive/UI-MenuViews-development-second-pass at 637c6b0 (2026-10-06), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemRenderFunction_Chat_TauntButtons, gynt's work as it stands on his fork's reimpl/UI-MenuItems at acd19e6 (2026-10-10), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_ChooseNetworkServiceProvider_ProviderTableRows, gynt's work as it stands on his fork's reimpl/UI-MenuItems at ea82c21 (2026-10-10), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_GameplayOptions_SpeedSlider, gynt's work as it stands on his fork's reimpl/UI-MenuItems at 456c6b3 (2026-10-08), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_GreatestLord_Main, gynt's work as it stands on his fork's archive/UI-MenuViews-development-second-pass at a389f84 (2026-10-04), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_EditScenario_DateYearBox, gynt's work as it stands on his fork's archive/UI-MenuViews-development-second-pass at a389f84 (2026-10-04), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_EditScenario_Scrollbar, gynt's work as it stands on his fork's reimpl/UI-MenuItems at 1a21a7a (2026-10-10), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_General_MessageScrollbar, gynt's work as it stands on his fork's reimpl/UI-MenuItems at 92974fe (2026-10-10), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemRenderFunction_General_Scrollbar, gynt's work as it stands on his fork's archive/UI-MenuViews-development-second-pass at 81e1041 (2026-10-03), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_DisableWeapon_Main, gynt's work as it stands on his fork's archive/UI-MenuViews-development-second-pass at dd14331 (2026-10-06), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_CrusadeEndscreen_Main, gynt's work as it stands on his fork's archive/UI-MenuViews-development-second-pass at a389f84 (2026-10-04), where its status line reads 100%. Taken over unchanged; main's later renames and the style rules follow in commits of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gynt's drafts were written against an older main. Main's Ghidra syncs have renamed or retyped what these files use, so they would not compile as they stand. Renamed by tools/reimplementation-helper/batch/refactor_struct_fields.py from the compiler errors, by offset: field1030_0x54a5c -> SelectionSlotUnitTypes, field12_0x30 -> pendingGameSpeedLevel, field42_0x9c -> field_0x9c, field47_0x1355c -> eventListScrollOffset. In CustomScenarios_Main the 9 passed to activateLoadOrSaveMapUI is written as MMT_LOAD_MAP, now that it takes a MenuModalType. No logic changes. Co-authored-by: Gynt <gynt@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… truth tests, no using lines The style fixer's pass over the lines the batch adds, then clang-format: hexadecimal constants as decimals, x = x + n as x += n, + -n as - n, == FALSE / != FALSE on BOOL values as truth tests, and the decompiler's using declarations dropped (the names are written qualified). The code is unchanged: quick_diff gives the same output for every file before and after. Co-authored-by: Gynt <gynt@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/reimplementation-helper/batch/strip_noise_comments.py drops the decompiler's block comments above each // FUNCTION: line (the WARNING: Enum and decompilerscript plates). The code is unchanged: quick_diff gives the same output for every file before and after. Co-authored-by: Gynt <gynt@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e, loops The rest of the checker's ERRORs on the batch, file by file: the decompiler's iVar / sVar / psVar / piVar / BVar locals get names that say what they hold and are declared where first assigned; the block comment in ProviderTableRows becomes // lines; text colours are written by their ColorsEnum names (COL_CCFAFF, COL_C2F0EB); ArmyStatusReturn's BOOLEnum stores are TRUE / FALSE; the nine copies of one statement in CustomScenarios_Main and HorizontalSlider's if / do-while pair become for loops, which MSVC unrolls or lays out the same. quick_diff gives the same output for every file before and after, but for the jump table's label number in CustomScenarios_Main's listing, whose loops add labels (its .text and .rdata compare identical). Co-authored-by: Gynt <gynt@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The for loops of the previous commit in CustomScenarios_Main count to countof(the array) instead of 9 and step with ++i, as main's other loops do. The code is unchanged: quick_diff gives the same output (but for the listing's label numbers). Co-authored-by: Gynt <gynt@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…NKNOWN_37 MenuItemActionHandler_BuildingAndStatusMenu_WorkshopWeaponSelection (0x00465200) queues command 33 (push 0x21; call 0x489100, queueCommand) with the selected workshop's building ID, the weapon and the building's uid, and MenuItemActionHandler_BuildingAndStatusMenu_DrawbridgeOpenClose (0x00465360) queues command 37 (push 0x25) with the selected drawbridge's building ID, open or close, and its uid. The enum had 31, 34, 36 and 38 but not 33 or 37; they get the placeholder name form of GCT_UNKNOWN_40. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ID_UNKNOWN_0x8E MenuItemActionHandler_BuildingAndStatusMenu_GatehouseOpenClose (0x00465480) plays sound effect 140 (push 0x8c; call 0x449c40, setUpSFXToPlayUnk) when the gatehouse button passes 10, and 142 (push 0x8e) when it passes 11. The enum had 137, 141 and 143 but not 140 or 142; they get the same placeholder name form as their neighbours. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MenuItemActionHandler_EditScenario_DateYearBox (0x004B8990) compares UserTextHandler::textArrayIndex with 13 (cmp dword ptr [0x1652740], 0xd) for its sixth box and, when it differs, passes 13 to resetToTextIndex (push 0xd; call 0x469790), as it does with 10, 11, 12, 14 and 15 for the other boxes. The enum had 12 and 14 but not 13; it gets the placeholder name form of TAIT_UNKNOWN_12. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…des over the batch These come from the review of the branch, and none of them changes the generated code: - StatusMenuButtons compares and stores menu tabs, not buildings: BT_OXTETHER and BT_KEEPDOOR_LEFT (4 and 71) are BASMTT_GRANARY_OR_MPMENU_TCPIP and BASMTT_STATUS_OVERVIEW, the 71 and 75 it tests are BASMTT_STATUS_OVERVIEW and BASMTT_STATUS_FOOD, and the 4 in INT_00b96120 is the granary tab, the only value main's RenderBuildingMenu_Granary writes there. StatusMainMenuButtons' tabType - 71 is tabType - BASMTT_STATUS_OVERVIEW, and SelectBuySellGoods' tab 57 is BASMTT_MARKETPLACE_TRADE. - DateYearBox's TAIT_EIGHT | TAIT_SEVEN style ORs were Ghidra splitting a plain index into flags: they are TAIT_UNKNOWN_15, 10, 11, 13 and 14, the (TextArrayIndexTypeInt)12 cast is TAIT_UNKNOWN_12, and the same names go into its resetToTextIndex calls, as main's TextBoxLike writes them. - Number casts become enum names: GCT_UNKNOWN_33, GCT_UNKNOWN_37, SEID_UNKNOWN_0x8C and SEID_UNKNOWN_0x8E, and their using lines go. - The last decompiler locals go: ChangeRations tests Tutorial_IsActionAllowed directly and stores timeGetTime() straight into timeTaxesOrRationsChange, and SelectBuySellGoods tests isResourceTypeTradeable directly, so their BOOLEnum includes and using lines go too. - param_N gets main's names: button for the menu buttons, row for the table rows, unused where the parameter is not read, unused and scrollbarEvent for the scrollbar and slider handlers, unused and sliderValue for the scrollbar renders, and rations, openOrClose, resourceType, tabType, action, taunt, box and field where the value says what it is. HorizontalSlider's thumb position is added to DAT_ButtonX, so it is thumbXPos. - ModemTableRows and FindingNetworkSessions_TableRows lose Ghidra's comma operator in the colour test: they return early for rows past the end and set the colour in both arms of an if / else, as main's ProviderTableRows render does. - Casts that restated a field's own type go: DAT_ButtonX/Y/W/H, MapPropertiesState::offset, eventListScrollOffset, the (int) on the short outpost fields and the (uint) on the row == index argument, and the inner (int) of (BuildingType)((int)x). (int)total in MessageScrollbar stays: total is undefined4, so the compare would be unsigned without it. - The colour 0 in StatusMainMenuButtons and TaxArrowButtons is COL_000000, minimapClickEnabled and FindingNetworkSessions' keepXOffset get TRUE / FALSE, and BOOLEnum.hpp is dropped from the 9 files that never name BOOLEnum (TaxArrowButtons' unused BGR24.hpp too). - ProviderTableRows' two-line sparse-switch comment is one line. quick_diff gives the same output for every file before and after, and each function's body in the /FA listing, with the globals' offsets, compares identical. Co-authored-by: Gynt <gynt@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d early returns over the batch These come from the second review of the branch, and none of them changes the generated code: - ProviderTableRows' comment said the original tests the TCPIP arm first. It tests the modem arm first and only lays the TCPIP arm out first, so the comment now says that. The handler returns early for rows past the end, as its two row-render twins do. - resetToTextIndex gets the TAIT names its callers compare with: TAIT_FIVE__NUMERIC_DOT, TAIT_SIX__NUMERIC_ONLY, TAIT_SEVEN__NUMERIC_ONLY and TAIT_ZERO in TextInputDisplay, and the first and third in ProviderTableRows. TextInputDisplay's != TRUE gets the reason its render twin gives. - HorizontalSlider's thumb size is thumbWidth now that the position is thumbXPos, and isDragged is a BOOLEnum, as in main's horizontal sliders. - The modem, provider and event scrollbars say how many rows fit in their list, and the provider and event ones step with --x / ++x, as MessageScrollbar does. - Constants move to the right of their comparisons (x > 0, action >= 0), and the decompiler's parentheses go from ArmyStatusReturn, MiniMapInteraction, SpeedSlider, GreatestLord, StatusMenuButtons and TextInputDisplay. - DisableWeapon toggles with ^= 1. DisableFoodType's render tests isFoodTypeBanned for truth and names its offsets iconOffsetX and iconOffsetY. - StatusMainMenuButtons passes its five constant arguments directly, so its BGR24 and BOOLEnum includes and using lines go. It and TaxArrowButtons name the text position textX and textY. - ModemTableRows and FindingNetworkSessions_TableRows both declare the colour as uint, with main's ProviderTableRows render line on why it is set in both branches. ModemTableRows' BGR24 include and using line go. - TaxSlider writes taxesSliderUI directly instead of through a pointer local, says that case 1 falls through into case 4, and returns from case 6 as from case 5. The outpost sliders keep their pointer and say why: written directly, quick_diff drops from 0.8723 to 0.4719. Both now name buildingID, delay / delayField and size / sizeField alike. - CurrentlySelectedTroops says what its 20 is. - CustomScenarios stores a plain 1 as the map choice's tab, as main's openUnusedHelpTextEditorDialog does: BASMTT_BARRACKS_OR_MPMENU_MODEM names a building menu and multiplayer menu tab, which means nothing there. quick_diff gives the same output for every file before and after, and each function's body in the /FA listing, with the globals' offsets, compares identical. Co-authored-by: Gynt <gynt@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CurrentlySelectedTroops keeps 100.0% (reccmp: 96.3% raw, 100% normalized), as main's 0x004C01B0 and 0x004C0860 lines do, and the remark now names what is left. It ends both arms with a tail jump to recountUnitsInSelection (0x00535240), at 0x004393FE for slots below 20 and at 0x0043942D for the rest. That function is still Pending, so reccmp has no name for it and shows both jumps as displacements; ours both read as the second jump's, so only the first one differs. Co-authored-by: Gynt <gynt@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The three scrollbar handlers whose case 5 stores and returns (ProviderScrollbarUnk, EditScenario_Scrollbar, General_MessageScrollbar) get the line main's BuildingAvailability_Scrollbar has for that shape. CustomScenarios_Main includes MenuModalType.hpp for the MMT_LOAD_MAP it passes, as main's other MenuItems files do. ProviderTableRows loses an empty `default: break;` at the end of its switch, and CurrentlySelectedTroops' comment names its parameter. Comments only, apart from the include and the default: quick_diff output is identical for every changed file. Co-authored-by: Gynt <gynt@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"while its resolver is off", as main's 0x004C01B0 and 0x004C0860 lines say it: recountUnitsInSelection (0x00535240) is pending and its function resolver is false on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 9, 2026
Main's Ghidra sync 6c1e0bd brought this branch's header changes; main's versions are kept. Co-authored-by: Gynt <gynt@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gynt
approved these changes
Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These are 33 of gynt's finished MenuItems functions: the first half of his MenuItems backlog. He OK'd landing them on Discord on 2026-11-09: "Yes you can make a PR for them and check they still build. Cleaning up the backlog, love it". The other 32 are in #382, and #379 (MenuViews) and #380 (MenuModals, DisplayElements and Rendering) carry the rest.
Each of these functions read 100% on his fork but was never in a PR. Each one comes in as a commit authored by him: his file as it stands at the last commit that touched it, where its status line reads 100%. The body names the branch and the commit, and the table at the end lists them. What main needed on top follows in our own commits, which credit him as co-author.
Measured on today's main (9528350) with the bundled MSVC1400-SP1 against the Steam
Stronghold Crusader.exe(3bb0a8c1…5387ac5a). Struct and function resolvers were enabled locally (not committed), and reccmp is sourcehold's, run with--resolve-wrapped-calls --ignore-security-cookie.MenuItemActionHandler_BuildMenu_CurrentlySelectedTroops(0x004393C0) reads 96.3% raw and 100% normalized: of its two tail calls to recountUnitsInSelection (0x00535240), the first one's target differs, because that function's resolver is still off. Its status line says so.openshc-pr-checkgives no errors, andstatus_regression.pyfinds no status line that got worse.Our commits on top of his
refactor_struct_fields.py:MMT_LOAD_MAP, now that activateLoadOrSaveMapUI takes a MenuModalType.param_Ngiven main's names (button, row,unused, scrollbarEventfor the scrollbar handlers);countofloops where the original has a loop;BT_OXTETHERis 4, the granary tab, andBT_KEEPDOOR_LEFTis 71, the status overview.TAIT_UNKNOWN_10to_15where Ghidra had OR-ed two TAIT values together.Header changes (each in a commit of its own)
Main's Ghidra sync (6c1e0bd) brought these header lines, and main (d5d965d) is merged in, with our code following main's spellings (
TAIT_UNKNOWNfor text index 4,INT_00b9840c), so the declaration check passes now.GameCommandTypegetsGCT_UNKNOWN_33andGCT_UNKNOWN_37(b3917f1). The originals dopush 0x21/push 0x25beforecall 0x489100(queueCommand), in WorkshopWeaponSelection (0x00465200) and DrawbridgeOpenClose (0x00465360).SoundEffectIDgetsSEID_UNKNOWN_0x8CandSEID_UNKNOWN_0x8E(191ff07). GatehouseOpenClose (0x00465480) doespush 0x8c/push 0x8ebeforecall 0x449c40. They sit next to GATEHOUSE_CLOSE/OPEN (141/143), so they may be the other gatehouse sounds.TextArrayIndexTypegetsTAIT_UNKNOWN_13(d21f2af). DateYearBox (0x004B8990) doescmp dword ptr [0x1652740], 0xdandpush 0xd; call 0x469790.The sibling MenuItems PR adds other values to the same two headers (GCT 96, SEID 0x104/0x105), and #379/#380 add
TAIT_UNKNOWN_4. All of them merge cleanly in any order.Kept as they are, with the reason
!= TRUE: the original doescmp dword [0x1FE7E28], 1at 0x47CC62.uint color;without a value in ModemTableRows and FindingNetworkSessions_TableRows is the shape of main's ProviderTableRows render: a preset colour overridden in one branch costs two instructions.(int)onMapPropertiesState::total: the field isundefined4, and the original compares it signed.1.BASMTT_BARRACKS_OR_MPMENU_MODEMwould be the wrong name there; main's openUnusedHelpTextEditorDialog also writes 1.Header changes we didn't make (suggestions)
MapPropertiesState::total→int, which would drop the cast above.thumbXPos, sliderValue, thumbWidth, BOOLEnum isDragged, as NewInvasion.hpp has it. SoundOptions.hpp has the same stale names.SetTutorialBuildingActionState's second parameter is declaredBuildingType, but it is passed a rations value and a tab.GameCore::*Producible_logicfields (0x160-0x174) are in DisableWeapon's button order and only hold 0/1, so they could beBOOLEnum, maybe as anint[6].pendingGameSpeedLevel,DAT_GameCommandParam1/2andDAT_MapMissionType→int.Names to offer
outpostRelatedUnk2is the outpost size (0-5), andoutpostRelatedUnk3its delay (0-24000).INT_00b96120looks like the last building menu: the only value main writes to it is 4, the granary tab.renderUpDownButtonUnk's first argument is "is down": -1 passes 0.Modem/ProviderScrollbarUnkare the scrollbars of the modem and provider lists.field_0x9candINT_00b95b64, no better name is known.The 33 functions
Function, address, and gynt's branch and commit it comes from
MenuItemActionHandler_BuildMenu_CurrentlySelectedTroopsreimpl/UI-MenuItemsd91f623MenuItemActionHandler_BuildingAndStatusMenu_ChangeRationsreimpl/UI-MenuItemscea5c3aMenuItemActionHandler_BuildingAndStatusMenu_DrawbridgeOpenClosereimpl/UI-MenuItems-1000a7d992MenuItemActionHandler_BuildingAndStatusMenu_GatehouseOpenClosereimpl/UI-MenuItems-1000a7d992MenuItemActionHandler_BuildingAndStatusMenu_OutpostSliderDelayarchive/UI-MenuViews-development-second-pass81e1041MenuItemActionHandler_BuildingAndStatusMenu_OutpostSliderSizearchive/UI-MenuViews-development-second-pass81e1041MenuItemActionHandler_BuildingAndStatusMenu_SelectBuySellGoodsarchive/UI-MenuViews-development-second-pass637c6b0MenuItemActionHandler_BuildingAndStatusMenu_StatusMenuButtonsarchive/UI-MenuViews-development-second-pass71eb42aMenuItemActionHandler_BuildingAndStatusMenu_TaxSliderarchive/UI-MenuViews-development-second-pass81e1041MenuItemActionHandler_BuildingAndStatusMenu_WorkshopWeaponSelectionreimpl/UI-MenuItems-1000a7d992MenuItemActionHandler_ChooseNetworkServiceProvider_ModemScrollbarUnkarchive/UI-MenuViews-development-second-pass81e1041MenuItemActionHandler_ChooseNetworkServiceProvider_ProviderScrollbarUnkreimpl/UI-MenuItems01ff313MenuItemActionHandler_ChooseNetworkServiceProvider_ProviderTableRowsreimpl/UI-MenuItemsea82c21MenuItemActionHandler_CrusadeEndscreen_Mainarchive/UI-MenuViews-development-second-passa389f84MenuItemActionHandler_CustomScenarios_Mainarchive/UI-MenuViews-development-second-passa389f84MenuItemActionHandler_DisableWeapon_Mainarchive/UI-MenuViews-development-second-passdd14331MenuItemActionHandler_EditScenario_DateYearBoxarchive/UI-MenuViews-development-second-passa389f84MenuItemActionHandler_EditScenario_Scrollbarreimpl/UI-MenuItems1a21a7aMenuItemActionHandler_GameplayOptions_SpeedSliderreimpl/UI-MenuItems456c6b3MenuItemActionHandler_General_MessageScrollbarreimpl/UI-MenuItems92974feMenuItemActionHandler_General_TextInputDisplayarchive/UI-MenuViews-development-second-passc52ccd4MenuItemActionHandler_GreatestLord_Mainarchive/UI-MenuViews-development-second-passa389f84MenuItemRenderFunction_BuildMenu_MiniMapInteractionreimpl/UI-MenuItems-1000a7d992MenuItemRenderFunction_BuildingAndStatusMenu_ArmyStatusReturnreimpl/UI-MenuItems48d3995MenuItemRenderFunction_BuildingAndStatusMenu_DisableFoodTypearchive/UI-MenuViews-development-second-pass81e1041MenuItemRenderFunction_BuildingAndStatusMenu_HorizontalSliderreimpl/UI-MenuItemsb43b87bMenuItemRenderFunction_BuildingAndStatusMenu_StatusMainMenuButtonsreimpl/UI-MenuItems9bea797MenuItemRenderFunction_BuildingAndStatusMenu_TaxArrowButtonsreimpl/UI-MenuItems-1000a7d992MenuItemRenderFunction_Chat_TauntButtonsreimpl/UI-MenuItemsacd19e6MenuItemRenderFunction_ChooseNetworkServiceProvider_ModemTableRowsarchive/UI-MenuViews-development-second-pass637c6b0MenuItemRenderFunction_FindingNetworkSessions_TableRowsarchive/UI-MenuViews-development-second-pass637c6b0MenuItemRenderFunction_General_MessageScrollbarUpDownreimpl/UI-MenuItems-1000a7d992MenuItemRenderFunction_General_Scrollbararchive/UI-MenuViews-development-second-pass81e1041Other PRs:
🤖 Generated with Claude Code