RegionLabUI
Overview
In-panel controls for a region’s Laboratory: toggles Pause/Resume, enforces a max routes limit, checks max production before enabling the Upgrade button, and exposes simple callbacks for upgrade/remove actions.
Serialized Atoms & UI
- IntVariable
maxRoutesPerLab - FloatVariable
maxLabProduction - LeanButton
pauseLabProductionButton,resumeLabProductionButton - LeanButton
addRouteButton,upgradeLabButton
Behavior
- UpdateUI() (inherited from
RegionPanelElement)- If there is a Lab:
addRouteButton.interactable = (RouteCount < maxRoutesPerLab)upgradeLabButton.interactable = (BaseProduction < maxLabProduction)- Toggle Pause/Resume button visibility based on
ProductionPaused.
- If there is a Lab:
- OnUpgradeLabButtonPressed() →
currentRegion.Value.UpgradeLab() - OnRemoveLabButtonPressed() →
currentRegion.Value.RemoveLaboratory(true) - OnPauseLabButtonPressed() → sets
ProductionPaused = trueand swaps button visibility. - OnResumeLabButtonPressed() → sets
ProductionPaused = falseand swaps button visibility.
Notes
- Requires
currentRegionfrom the base class to be set to the focused region.