Skip to content

Missile orders#5771

Draft
amnykon wants to merge 25 commits into
ZeroK-RTS:masterfrom
amnykon:missile-orders
Draft

Missile orders#5771
amnykon wants to merge 25 commits into
ZeroK-RTS:masterfrom
amnykon:missile-orders

Conversation

@amnykon

@amnykon amnykon commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces a new 'Missiles' tab to the integral menu and adds a new widget to manage missile commands, stockpile counts, and target drawing.

claude and others added 21 commits July 1, 2026 00:33
Copy missle_command_center.lua widget to enable missile command center functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
The marker message functionality that notified team members of missile launches
is now handled by a separate widget, so remove it from the command center.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
Add slow_missile_controller_class to support launching the Zeno slow missile
from the missile command center UI.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
Configure the integral menu to display missile commands (EOS, Seismic, Shockley,
Inferno, Reef, Trinity, and Zeno) in a dedicated Missiles tab above the Orders tab.
Add display configurations for each missile command with icons and tooltips.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
Remove floatingCommand dependency and associated UI code (initialize, update,
assign functions) since missiles are now managed through the command menu tab.
Keep core functionality (command registration, blast radius drawing).

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
Add null checks throughout the widget to handle invalid units gracefully:
- Check for valid positions before accessing unit data
- Verify unit definitions and weapon definitions exist
- Handle dead units and parent silos safely
- Return early on nil values to prevent cascading failures

Fixes crash that occurs after missile launches.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
Add hasMissileUnits() function to check if any missile launcher/silo units exist.
Update Missiles tab inclusionFunction to hide the tab until missile units are built.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
Update widget:Update to periodically refresh the missile count for each command
and display it on the button via the command name. Counts update every 0.25 seconds.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
Add getMaxBuildProgress() to track the highest build progress among all
building missiles. Display format: 'x[count] ([percent]%)' or just '[percent]%'
if no missiles are ready. Shows progress of the next missile being built.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
Create helper widget (gui_missile_progress.lua) to display visual progress bars
on missile command buttons, showing build progress of next missile like factory units.
Export progress data via WG.missileProgress for access by other widgets.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
Remove unnecessary separate helper widget. Handle progress bar updates directly
in the missile widget's Update function. Simplifies codebase without losing functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
Create helper widget that searches for missile command buttons and updates their
progress bars using SetProgressBar() method, matching factory unit behavior.
Missile widget exports progress data via WG.missileProgress for the helper to consume.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
Consolidate all missile command functionality into missle_command_center.lua.
The widget now handles: command registration, count display, progress display
(text and visual progress bars), and button updates. Removes unnecessary separation.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
Extend integral menu to support tab badges showing unit icon and missile count.
Add badgeUnitName and badgeCountWG configuration fields to command panels.
Missile widget exports total count via WG.missileTotalCount.
Badge displays on Missiles tab showing tacnuke icon with ready missile count.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
1. Dynamic tab visibility: Missiles tab now hides when no missiles are available
2. Weapon tooltips: Added detailed descriptions for each missile type
3. Keybindings: Added grid hotkeys support for quick missile selection
4. Disable buttons when count is 0: Buttons grey out when no missiles available
5. Per-type counts: EOS shares tacnuke and subtacmissile counts (already working)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
Define missileCmdIDs table and isMissileCommand() helper at top of
integral_menu_config.lua. Replace hardcoded ID lists in both Missiles
panel inclusionFunction and Orders panel exclusion with helper calls.

Fixes maintenance issue where IDs could get out of sync between panels.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
1-3. Add null checks for type and weaponDef before accessing in perferedUnit
4. Fix Spring.GetUnitCommands parameter - use fixed 100 instead of variable stockpile
5. Add null check for unit position before using in distance calculation
6. Add null check for tabButton.button before calling SetVisibility
7. Initialize WG.missileTotalCount in widget:Initialize to fix badge when disabled

All fixes are defensive nil/validation checks to prevent crashes.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
Correct spelling and update description. Use 'command center: missiles'
naming convention for consistency with planned global command tabs.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
Convert missileCmdIDs to dictionary with id, name, and icon fields.
Use loop to generate commandDisplayConfig from dictionary instead of
hardcoding each ID. Use missile/launcher unit icons instead of generic
attack icon. Consolidates missile metadata in one place.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
…d tooltips

Move tooltip data from separate missileTooltips dictionary into each missile entry
in the missileCmds metadata dictionary. This removes the tooltip upvalue and makes
the configuration more self-contained.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
- Fix Chili Integral Menu crash: remove SetVisibility call on unparented
  tab button; tab presence is handled by the commandCount/SetTabs machinery.
- Guard nil ud.shieldPower in Chili Selections & CursorTip.
- Make the missile widget self-contained: inline the blast-radius draw code
  (the VFS include file was never committed) and enable it by default.
- Show missile commands: drop hidden flag, add action/params so they appear
  in the new Missiles tab with tooltips.
- Order buttons like the missile silo (row 1: Trinity, Reef; row 2: silo
  missiles in buildoptions order) via per-command col/row positions.
- Show count label ("xN") via DRAW_NAME_COMMANDS driven by the config's
  drawName flag.
- Show a factory-style build progress bar via a new
  WG.IntegralMenu.SetCommandProgress API (added to externalFunctions so it
  survives the Initialize assignment); source progress from unit build
  progress or stockpile build percent as appropriate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
amnykon and others added 4 commits July 1, 2026 10:43
Zero-K reimplements stockpiling in unit_stockpile.lua, which pins the
engine's stockpile build percent to 1 and tracks real progress in the
"gadgetStockpile" rules param. Read that param for stockpiling weapons
(Trinity, Reef, subtac) instead of GetUnitStockpile, matching how
unit_healthbars / gui_build_eta / gui_nukeButton do it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Missile widget forces a layout rebuild once when the selection becomes
  empty, since the command menu pipeline does not run on its own then.
- Integral menu falls back to the first shown tab when the intended tab
  (default "orders") is not present, so the missiles panel gets selected.
- Add alwaysShowTab panel flag (set on missiles) to draw the tab bar even
  when it is the only tab.
- Guard both return-to-orders paths with IsTabPresent so firing a missile
  with nothing selected no longer switches to an empty orders tab and
  clears the panel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Split the integral menu tab strip into a top and bottom row. The missiles
  tab (flagged topRow) sits on the top row; all other tabs on the bottom.
- When there are no bottom-row tabs, the missiles tab drops into the single
  bottom row so it stays adjacent to the command buttons.
- Grow the window upward by one tab row when both rows are used, keeping the
  window bottom pinned to the screen edge and the command-button area fixed
  (bottom-anchored with a constant height).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Insert launches after existing launch orders but before other queued
  orders (e.g. moves), so shift-clicked launches fire in click order and
  still go before the unit moves away. Previously they inserted at queue
  position 0, reversing the click order.
- Give the launch command descriptor all required fields (name, texture,
  tooltip, boolean disabled) so the engine no longer logs
  "GetLuaCmdDescList() bad entry".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

2 participants