Skip to content

Comments

Add district unemployment signals and workplace features#140

Open
Toon-Red wants to merge 1 commit intoihsoft:mainfrom
Toon-Red:feature/district-unemployed-signals
Open

Add district unemployment signals and workplace features#140
Toon-Red wants to merge 1 commit intoihsoft:mainfrom
Toon-Red:feature/district-unemployed-signals

Conversation

@Toon-Red
Copy link

Summary

Implements Issue #78 — district-level unemployment signals — plus two related workplace features:

  • District.UnemployedBeavers / District.UnemployedBots signals — reads the same values the game UI shows, via PopulationDataCollector
  • Workplace.AssignedWorkers signal — current number of assigned workers for a building
  • Workplace.SetPriority action — set workplace priority (VeryLow through VeryHigh) via dropdown

All four use existing game APIs and follow the established ScriptableComponentBase patterns (signal definitions, change trackers, localization).

Changes

  • DistrictScriptableComponent.cs — added unemployment signals + district-wide workplace event tracking
  • WorkplaceScriptableComponent.cs — added assigned workers signal + set priority action with dropdown
  • enUS.txt / ruRU.txt — localization strings for all new signals/actions

Test plan

  • Verified unemployment signals reflect game UI values
  • Verified assigned workers signal updates on worker assign/unassign
  • Verified set priority action works with all five priority levels
  • Verified dropdown displays localized priority names
  • Built against game version 0.7.x with no warnings

District signals:
- District.UnemployedBeavers: number of unemployed beaver workers
- District.UnemployedBots: number of unemployed bot workers
  Uses the game's PopulationDataCollector.CollectData() to read the
  same unemployment values displayed in the top-left UI panel.
  Change tracking subscribes to CitizenAssigned/Unassigned events
  and per-workplace WorkerAssigned/Unassigned events so the signal
  updates when workers are hired, fired, or reassigned.

Workplace signal:
- Workplace.AssignedWorkers: current number of workers at a building
  Tracks via WorkerAssigned/WorkerUnassigned events on the Workplace.

Workplace action:
- Workplace.SetPriority: sets the building's worker priority level
  (VeryLow/Low/Normal/High/VeryHigh) via WorkplacePriority component.
  Uses the game's built-in Priorities localization keys for the
  dropdown display names.

Localization:
- Added English (enUS) and Russian (ruRU) strings for all new
  signals and actions.
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