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.
  • OnUpgradeLabButtonPressed()currentRegion.Value.UpgradeLab()
  • OnRemoveLabButtonPressed()currentRegion.Value.RemoveLaboratory(true)
  • OnPauseLabButtonPressed() → sets ProductionPaused = true and swaps button visibility.
  • OnResumeLabButtonPressed() → sets ProductionPaused = false and swaps button visibility.

Notes

  • Requires currentRegion from the base class to be set to the focused region.