feat: make disabled radial menu options visible with color-coded states#160
Merged
feat: make disabled radial menu options visible with color-coded states#160
Conversation
- Tweaked research tree UI text and tooltip content (short vs detailed) - Updated tech tooltips with clearer unlock summaries and numbers - Refactored tech effects unlock logic and cleaned definitions
Adds a complete structure stacking system that allows players to build multiple instances of structures in a single tile. Stacking provides: - Increased HP (bonus per stacked instance) - Multiplied functionality (e.g., ×2 city = 2× population cap) STACKING MECHANICS: - Stack count is user-controlled (1-99) via +/- buttons in build menu - Each game starts fresh with stack count reset to 1 - Uses localStorage for in-game UI communication only (cleared on game start) - Stack count shown as ×N prefix in build menu display STACKABLE STRUCTURES (9 total): - City: ×N population cap increase - Port: ×N trade ship supply - Airfield: spawns N bombers - Hospital: ×N healing effect - Academy: ×N combat bonus - Research Lab: ×N research boost - Factory: ×N gold production bonus - Missile Silo: can launch N nukes before cooldown - SAM Launcher: fires N missiles per interception DEFENSE POST: Stacking intentionally disabled (single instance only) IMPLEMENTATION DETAILS: Core data model: - Added _stackCount field to UnitImpl for tracking stacked instances - Added _launchesRemaining field for missile silo multi-launch tracking - Added stackCount() and launchesRemaining() to Unit interface - Added fields to GameUpdates and GameView for client sync Stackable structure definitions (Upgradeables.ts): - Added STACKABLE_STRUCTURES set (9 structure types) - Added TECH_UPGRADEABLE_STRUCTURES set (SAM, Airfield only) - Added helper functions: isStackableStructure(), maxStackCount(), isTechUpgradeableStructure(), maxStructureTechLevel() Construction execution: - ConstructionExecution now separates stackCount from techLevel - Added computeStackCount() and computeTechLevel() methods - Added applyStackingIfNeeded() to set stack count and HP bonuses Structure-specific execution updates: - AirfieldExecution: spawns stackCount bombers, tracks upgrades - SAMLauncherExecution: fires stackCount missiles per interception - MissileSiloExecution: accepts stackCount param, allows N launches before cooldown via launchesRemaining tracking - DefensePostExecution: removed stacking support Client UI: - BuildMenu: shows ×N prefix for stacked structures - ControlPanel2: Stack ×N UI with +/- adjustment buttons - Transport: reads stack count and sends with build intent - LocalPersistantStats: clears stack count settings on game start
…ited SAM/Silo stacking - Fix structure stacking system to properly increment stackCount via setStackCount() - Update playerMaxStructureLevel() to return 99 for all stackable structures (SAM, Silo, Airfield) - Remove legacy cap of 3 from maxStructureLevel() for SAM and Silo - Implement launchesRemaining system for SAM (fire stackCount times before cooldown) - Fix SAM/Silo cooldown calculation to use effectiveMaxHealth() instead of base health - SAM range now uses playerMaxStructureTechLevel() (tech tier 1-3), not stack count - Display stack count instead of level for structure badges - Add SAM tech level as secondary indicator (similar to Airfield bomber level) - PlayerInfoOverlay and BuildMenu now show correct counts including stacked structures - Update unitsOwned() to use stackCount() for all stackable structures - Rename 'Upgrade Structures' button to 'Stack Structures'
…STACK_COUNT=25 and clamp in helpers (maxStackCount, maxStructureLevel, playerMaxStructureLevel)\n- Clamp ConstructionExecution desired stack, UnitImpl.setStackCount\n- Limit client intent payload and schema to 25 (Transport, Schemas)\n- Keeps UI controls honoring cap via shared helpers
- Support multiple simultaneous research priorities (Set-based) - Add category 'Prioritize' button to set all techs in category - Cross-category prioritization: selecting individual tech clears same-level techs from other categories - Category prioritization clears other categories but preserves existing priorities in selected category - Locked prioritized techs show gold background with lock icon - Research allocation: 60% split among available priorities, 40% to others - Priority prerequisites get 60% when priorities locked - Update PlayerView to expose full priorities Set
- Remove ScorchedEarth upgrade and all related code - Delete ScorchedEarthExecution and integration tests - Remove SCORCHED_EARTH from UpgradeType enum - Remove scorchedEarthActivationCost from Config - Remove Insurance system - Remove INSURANCE_REFUND message type - Remove insurance refund logic from UnitImpl - Remove structureInsuranceRefundNum/Den from Config - Remove ECONOMY_INSURANCE tech ID - Remove policy directive system (referenced non-existent Economy-3 tech) - Delete PolicyDirectiveSelectExecution, MarkPolicyDirectivesSeenExecution - Delete PolicyDirectives.ts definition file - Remove policy schemas, intents, handlers from Transport/ExecutionManager - Remove policy methods from Player interface and PlayerImpl - Remove policy logic from all TechEffects modifier functions - Remove policy notification from ResearchToggleButton - Move InternationalTrade upgrade to Land-1 tech (Road Network) - Remove unused tech IDs: ECONOMY_INTERNATIONAL_TRADE, ECONOMY_TBD_LEVEL4, TRADE_POLICY_FRAMEWORK - Remove unused upgrade types: WaterUpgrade1/2/3, AirUpgrade3, EconomyUpgrade1/2/3 All tests passing (46 suites, 276 tests)
The paratrooper option was not appearing in the radial menu even when Air-1 tech was researched and airfield was in range. Root cause: Both RadialMenu.shouldShowAirAttack() and ParatrooperAttackExecution.init() were checking for obsolete UpgradeType.AirUpgrade1 instead of UpgradeType.JetEngines. The Air-1 Early Air Power tech grants UpgradeType.JetEngines, not AirUpgrade1, so the check was always failing. Changed both files to check for JetEngines upgrade, which is the correct requirement for paratroopers. All tests pass (46 suites, 276 tests).
…mbing by default
BREAKING CHANGE: Auto-bombing is now enabled by default for all players
Changes:
- PlayerImpl: Changed _autoBombingEnabled default from false to true
* All players now have auto-bombing active by default
* Can still be overridden via radial menu manual targeting
- RadialMenu: Added bomber targeting action (Slot.Bomber)
* Shows airfield icon when right-clicking enemy land tiles
* Gating: requires airfield, land tile, enemy ownership, war status
* Range validation: checks bomber level and config range from all airfields
* Targets all structure types (City, DefensePost, SAMLauncher, etc.)
* Uses preferClosest=true for optimal targeting priority
* Icon: airfield icon (matches build menu consistency)
- BomberExecution: Fixed manual to auto fallback logic
* When manual targets exhausted, now clears bomberIntent via setBomberIntent(null)
* Ensures seamless switch back to auto-bombing mode
* Previously would get stuck when findTargetFromQueue returned null
- ControlPanel2: Completely removed Bombers tab
* Deleted tab UI rendering (button and content panel ~200 lines)
* Removed all bomber-specific state variables
* Removed bomber methods: _startAutoBombing, _stopAutoBombing,
_handleBomberTargetChange, populateBomberForm, _refreshBomberPlayerLists,
_getPlayersInAirfieldRange
* Removed bomber-related updated() hook logic
* Removed Bombers from activeTab type union and _changeTab signature
* Cleaned up residual references (comments, dead code)
* Kept sendBomberIntent() for radial integration
- UI/UX Improvements:
* Unified bomber control via radial menu (right-click context)
* Removed toggle complexity from control panel
* Airfield icon provides visual consistency with build menu
* Auto-bombing ensures bombers always active when at war
All tests pass (46 suites, 276 tests). TypeScript and ESLint clean.
Previously, disabled radial menu options were completely greyed out with a generic disabled icon, making it impossible to understand what options were available or why they were unavailable. Now there are three distinct visual states: 1. Active (unlocked and in range): Full color, full opacity, clickable 2. Out of range (unlocked but too far): Darkened version of the feature's color (preserves hue), 0.7 opacity 3. Not unlocked (feature not researched): Black and white (no color set), 0.7 opacity Changes: - Replaced swap-to-grey-icon with darkenColor() helper that preserves original hue when a color is set - When no color is set (not unlocked), uses dark grey fallback for black-and-white appearance - Increased disabled opacity from 0.5 to 0.7 for better icon visibility - Icons always remain visible (boat, airAttack, bomber, info, ally, peace icons set as defaults) - Removed unused disabledIcon import Result: Players can now see all radial menu options and understand their status at a glance - full color means ready to use, colored but dark means out of range, black and white means not yet unlocked.
This was referenced Dec 14, 2025
El-Magico777
added a commit
that referenced
this pull request
Dec 18, 2025
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.
Build on top of #158 and #159
Description:
Previously, disabled radial menu options were completely greyed out with a generic disabled icon, making it impossible to understand what options were available or why they were unavailable.
Now there are three distinct visual states:
Changes:
Result: Players can now see all radial menu options and understand their status at a glance - full color means ready to use, colored but dark means out of range, black and white means not yet unlocked.
Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
el_magico777