unify(translator): Merge message translators from Zero Hour#2794
Conversation
|
| Filename | Overview |
|---|---|
| Generals/Code/GameEngine/Include/Common/BuildAssistant.h | Adds LBC_GENERIC_FAILURE enum value and two new LocalLegalToBuildOptions flags (IGNORE_STEALTHED, FAIL_STEALTHED_WITHOUT_FEEDBACK); re-aligns existing flag column spacing. Clean, straightforward additions. |
| Generals/Code/GameEngine/Source/GameClient/MessageStream/GUICommandTranslator.cpp | Renames GUI_COMMAND_SPECIAL_POWER_FROM_COMMAND_CENTER to GUI_COMMAND_SPECIAL_POWER_FROM_SHORTCUT in one case label; minimal one-line rename from Zero Hour unification. |
| Generals/Code/GameEngine/Source/GameClient/MessageStream/HintSpy.cpp | Adds MSG_SABOTAGE_HINT case to the existing hint-message switch; simple one-line addition consistent with the surrounding pattern. |
| Generals/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp | Enables RMB scrolling in alternate mouse mode; adds MSG_CHEAT_DESHROUD handler guarded by _ALLOW_DEBUG_CHEATS_IN_RELEASE; two DEBUG_ASSERTCRASH calls commented out without explanation and with inconsistent indentation. |
| Generals/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cpp | Ports Sneak Attack special power placement path from Zero Hour: detects getSpecialPowerConstructionCommandButton() and fires MSG_DO_SPECIAL_POWER_AT_LOCATION instead of MSG_DOZER_CONSTRUCT; adds IGNORE_STEALTHED and FAIL_STEALTHED_WITHOUT_FEEDBACK build flags. Logic is well-guarded. |
| Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp | Fixes GUI click-through bug when scrolling: allows left button down/up to reach the window manager while mouse is locked in scrolling mode; ports a date-annotated comment from 2003 that violates project comment-date policy. |
Sequence Diagram
sequenceDiagram
participant User
participant WindowXlat
participant PlaceEventTranslator
participant BuildAssistant
participant InGameUI
participant MessageStream
Note over User,MessageStream: GUI click-through fix (new)
User->>WindowXlat: MSG_RAW_MOUSE_LEFT_BUTTON_DOWN (scrolling)
WindowXlat->>WindowXlat: isScrolling()? YES - pass through
WindowXlat->>InGameUI: winProcessMouseEvent(GWM_LEFT_DOWN)
Note over User,MessageStream: Sneak Attack special power placement (new)
User->>PlaceEventTranslator: MSG_MOUSE_LEFT_CLICK
PlaceEventTranslator->>BuildAssistant: "isLocationLegalToBuild(..., IGNORE_STEALTHED | FAIL_STEALTHED_WITHOUT_FEEDBACK)"
BuildAssistant-->>PlaceEventTranslator: LBC_OK
PlaceEventTranslator->>PlaceEventTranslator: getSpecialPowerConstructionCommandButton()?
alt Has special power command button
PlaceEventTranslator->>MessageStream: appendMessage(MSG_DO_SPECIAL_POWER_AT_LOCATION)
PlaceEventTranslator->>InGameUI: placeBuildAvailable(null, null)
else Normal dozer build
PlaceEventTranslator->>MessageStream: appendMessage(MSG_DOZER_CONSTRUCT)
end
Note over User,MessageStream: Cheat deshroud (new, release-cheat build only)
User->>LookAtTranslator: MSG_CHEAT_DESHROUD
LookAtTranslator->>LookAtTranslator: isInMultiplayerGame()? NO
LookAtTranslator->>PartitionManager: revealMapForPlayerPermanently(localPlayerIndex)
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
Generals/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp:177-179
**Newly added comment references a date prior to 2026.** The attribution comment `//Kris: Aug 15, 2003` was ported verbatim from Zero Hour and has been added to this file in the current diff. Per project policy, newly created comments must not reference dates prior to the current year (2026).
### Issue 2 of 2
Generals/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp:638-656
**Commented-out assertions with inconsistent indentation and no explanation.** Both `DEBUG_ASSERTCRASH` guards for `m_isChangingFOV` are now silenced. The first (`MSG_META_DEMO_BEGIN_ADJUST_FOV`) is commented with `//DEBUG_ASSERTCRASH` at column 0, while the second (`MSG_META_DEMO_END_ADJUST_FOV`) uses `// DEBUG_ASSERTCRASH` with a leading tab — inconsistent style that suggests they were disabled without a clear rationale. A short inline note explaining why the assert fires spuriously would help future maintainers decide whether to restore them.
Reviews (1): Last reviewed commit: "unify(message): Merge remaining message ..." | Re-trigger Greptile
This change merges the code of the message translators.
Generals gets