Skip to content

Add Rebuild X Keyboard Commands#2129

Open
CnCRAZER wants to merge 4 commits intoPhobos-developers:developfrom
CnCRAZER:Rebuild-last-structure
Open

Add Rebuild X Keyboard Commands#2129
CnCRAZER wants to merge 4 commits intoPhobos-developers:developfrom
CnCRAZER:Rebuild-last-structure

Conversation

@CnCRAZER
Copy link
Contributor

@CnCRAZER CnCRAZER commented Mar 5, 2026

This pull request introduces four new keyboard commands that allow players to quickly re-queue the last produced structure, defense, infantry, or vehicle unit from each sidebar tab. The implementation involves new command classes, updates to the player state to track the last-built item per tab, and documentation updates to describe the new features.

New keyboard commands and tracking system:

  • Added four new commands—Rebuild Structure, Rebuild Defense, Rebuild Infantry, and Rebuild Vehicle—that re-queue the last produced item in each respective sidebar tab. These commands are now registered and available in the interface. [1] [2] [3] [4] [5]
  • Implemented per-tab tracking in HouseExt to remember the last built item, its type, and whether it was naval, for each sidebar tab. This state is properly serialized for save/load support. [1] [2] [3]
  • Added a new hook in Hooks.BuildLastTab.cpp to update the last-built tracking whenever a player gains a new unit or building from a factory.

Documentation and credits:

  • Updated user documentation (User-Interface.md and Whats-New.md) to describe the new rebuild commands and their usage. [1] [2]
  • Added credit for the new keyboard commands to the CREDITS.md file under RAZER.

Project configuration:

  • Updated the project file (Phobos.vcxproj) to include the new source files for the build last commands and their hooks. [1] [2]

CnCRAZER added 4 commits March 5, 2026 12:50
Introduce BuildLastOfTab commands to re-queue the last produced item from each sidebar tab (Power/Infrastructure, Defense/Combat, Infantry, Vehicles/Aircraft). Adds BuildLastOfTab.cpp/.h with a templated CommandClass (explicit instantiations for tabs 0..3) and UI strings. Register the new commands in Commands.cpp and add sources to the Visual Studio project file. Add per-tab last-built tracking to HouseExt (LastBuiltPerTab, LastBuiltRTTIPerTab, LastBuiltIsNavalPerTab), initialize defaults, and include them in serialization. Add a hook (Hooks.BuildLastTab.cpp) into HouseClass object delivery to update the per-tab last-built info when the current player's factory delivers an object.
Document four new keyboard commands (Rebuild Structure, Rebuild Defense, Rebuild Infantry, Rebuild Vehicle) in docs/User-Interface.md, add a What's New entry in docs/Whats-New.md, and credit RAZER in CREDITS.md. Adds brief descriptions and localization note for the new commands.
@CnCRAZER CnCRAZER changed the title Rebuild last structure Add Rebuild X Keyboard Commands Mar 5, 2026
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant