From 4abe4ff595d6fad76a03e8d35f9b4867ed986767 Mon Sep 17 00:00:00 2001 From: icorkovic Date: Tue, 7 Jul 2026 10:17:34 +0200 Subject: [PATCH] Migrate project documentation templates --- CHANGELOG.md | 350 ++++++++++++++++++++--------------- FEATURES.md | 158 ++++++++++------ README.md | 132 +++++++++++-- docs/project/architecture.md | 218 ++++++++++++++++++---- 4 files changed, 607 insertions(+), 251 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9f1cda..35ca42e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,220 +1,276 @@ # Changelog -Release notes for changes to the trainer ---- +All meaningful user-facing and developer-facing changes to the trainer are +documented in this file. -**5.2.6** -25.05.2026. for Beta 1 -- Added Max Market Share button: instantly sets all company products to 100% market share -- Added Auto Max Market Share toggle: keeps all company products at 100% market share continuously +Newest entries first. Dates use `YYYY-MM-DD`. Versions use the semantic version +from `Helpers.Version`. All releases target *Software Inc.* Beta 1. ---- +## Unreleased -**5.2.5** -16.01.2026. for Beta 1 -- Updated libraries +### Changed ---- +- Documentation restructured to the managed templates (README, CHANGELOG, and + the architecture overview). -**5.2.5** -08.10.2025. for Beta 1 -- Removed Reduce Box Price due to incompatibility -- Updated libraries +## [5.2.6] - 2026-05-25 ---- - -**5.2.3** -24.08.2025. for Beta 1 -- Updated libraries +### Added ---- +- Max Market Share button: instantly sets all company products to 100% market share. +- Auto Max Market Share toggle: keeps all company products at 100% market share continuously. -**5.2.2** -23.12.2024. for Beta 1 -- Fix creativity modification in DetailWindowTrainer (muddxyii) +## [5.2.5] - 2026-01-16 ---- +### Changed -**5.2.1** -27.11.2024. for Beta 1 -- Updated libraries -- Fixed broken features +- Updated libraries. ---- +## [5.2.5] - 2025-10-08 -**5.2.0** -08.11.2024. for Beta 1 -- Updated libraries -- Fixed broken features (muddxyii) +### Changed ---- +- Updated libraries. -**5.1.9** -13.10.2024. for Beta 1 -- Updated libraries -- Disable Stress toggle fixed (savisitor15) +### Removed ---- +- Reduce Box Price, due to incompatibility. -**5.1.8** -25.05.2024. for Beta 1 -- Updated libraries -- UI logic refactor -- Added confirmation for Max Reputation feature -- Added experimental toggle +## [5.2.3] - 2025-08-24 ---- +### Changed + +- Updated libraries. + +## [5.2.2] - 2024-12-23 + +### Fixed + +- Creativity modification in DetailWindowTrainer (muddxyii). + +## [5.2.1] - 2024-11-27 + +### Changed + +- Updated libraries. + +### Fixed + +- Broken features. + +## [5.2.0] - 2024-11-08 + +### Changed + +- Updated libraries. + +### Fixed + +- Broken features (muddxyii). + +## [5.1.9] - 2024-10-13 + +### Changed + +- Updated libraries. + +### Fixed + +- Disable Stress toggle (savisitor15). + +## [5.1.8] - 2024-05-25 + +### Added + +- Confirmation for the Max Reputation feature. +- Experimental toggle. + +### Changed + +- Updated libraries. +- UI logic refactor. + +## [5.1.7] - 2023-10-23 + +### Added + +- Experimental features column. +- New loans. + +### Changed -**5.1.7** -23.10.2023. for Beta 1 -- Added experimental features column. -- Removed deprecated features (non-fixable). -- Added new loans. -- Possible fix for NoSickness. - Disable Employee smell (NoNeeds upgraded). -- Possible fix for FreeEmployees where employee try to negotitate salary even if it's zero. ---- +### Fixed + +- Possible fix for NoSickness. +- Possible fix for FreeEmployees where an employee tried to negotiate salary even when it was zero. + +### Removed + +- Deprecated features (non-fixable). + +## [5.1.6] - 2023-10-22 + +### Added + +- Auto Accept Hosting Deals feature. + +### Changed + +- Display game version in the Trainer Settings window. +- Remove the distribution platform if the simulated company is bankrupt. + +### Fixed + +- Trainer Settings save on version increase. +- Duplicated Hosting Deals when More Hosting Deals is activated. +- Missing Hosting category when using the Max Reputation feature. + +## [5.1.5] - 2023-10-21 + +### Fixed + +- Not saving new toggles. + +## [5.1.4] - 2023-10-16 + +### Added + +- 8000% efficiency option. +- Backward compatibility for Beta 1.6. + +### Changed + +- Trainer window: toggles rearranged. +- Updated Discord invite link. + +### Fixed + +- Disable Fire Inspection feature. + +## [5.1.3] - 2023-10-15 + +### Added + +- Disable Fire Inspection feature. +- Disable Force Pause feature. +- Disable Force Freeze feature. +- Auto Research Start feature. +- Digital Distribution Monopol feature. + +### Changed + +- Dynamic loading of software types for More Hosting Deals. + +## [5.1.2] - 2023-10-14 + +### Added + +- Unlock and Claim all Rewards feature. + +### Changed -**5.1.6** +- Updated libraries. -22.10.2023. for Beta 1 -- Fixed Trainer Settings save on version increase -- Display game version in Trainer Settings Window -- Fixed duplicated Hosting Deals when More Hosting Deals is activated -- Added Auto Accept Hosting Deals feature -- Added missing Hosting category when using Max Reputation feature -- Remove the distribution platform if the simulated company is bankrupt +## [5.1.1] - 2023-09-11 ---- +### Added -**5.1.5** +- Added/updated localizations. -21.10.2023. for Beta 1 -- Fixed not saving new toggles +### Fixed ---- +- Max Skill of employees feature. -**5.1.4** +## [5.1.0] - 2023-09-10 -16.10.2023. for Beta 1 -- Fixed Disable Fire Inspection feature -- Trainer Window: Toggles rearrange -- Updated Discord invite link -- Backward compatibility for Beta 1.6 -- Added 8000% efficiency option +### Changed ---- +- Updated libraries. -**5.1.3** +## [5.0.9] - 2023-05-20 -15.10.2023. for Beta 1 -- Added Disable Fire Inspection feature -- Added Disable Force Pause feature -- Added Disable Force Freeze feature -- Added Auto Research Start feature -- Dynamic loading of software types for More Hosting Deals -- Added Digital Distribution Monopol feature +### Changed ---- +- Updated libraries. -**5.1.2** +### Fixed -14.10.2023. for Beta 1 -- Updated libraries -- Added Unlock and Claim all Rewards feature +- Compiler issues. ---- +## [5.0.8] - 2023-05-18 -**5.1.1** +### Changed -11.9.2023. for Beta 1 -- Fixed Max Skill of employees feature -- Added/Updated localizations +- Updated libraries. ---- +## [5.0.7] - 2023-04-15 -**5.1.0** +### Changed -10.9.2023. for Beta 1 -- Updated libraries +- Updated libraries. ---- +## [5.0.6] - 2022-12-14 -**5.0.9** +### Added -20.5.2023. for Beta 1 -- Updated libraries -- Fixed compiler issues +- Employee Demand change, Employee Lead Spec change, Employee Trait change, Console (credits: jiandy666). +- Inspiration Use (credits: progesor). ---- +### Changed -**5.0.8** +- Updated libraries. -18.5.2023. for Beta 1 -- Updated libraries +## [5.0.5] - 2022-10-15 ---- +### Changed -**5.0.7** +- Updated libraries. -15.4.2023. for Beta 1 -- Updated libraries +## [5.0.4] - 2022-09-17 ---- +### Changed -**5.0.6** +- Updated libraries. -14.12.2022. for Beta 1 -- Updated libraries -- Employee Demand change, Employee Lead Spec change Employee Trait change, Console - credits: jiandy666 -- Inspiration Use - credits: progesor +### Fixed ---- +- Typo fix. -**5.0.5** +## [5.0.3] - 2022-07-28 -15.10.2022. for Beta 1 -- Updated libraries +### Changed ---- +- Updated libraries. -**5.0.4** +### Removed -17.09.2022. for Beta 1 -- Updated libraries -- Typo fix +- Auto Distribution Deals option, due to incompatibility. ---- +## [5.0.2] - 2022-06-11 -**5.0.3** +### Changed -28.07.2022. for Beta 1 -- Updated libraries -- Removed Auto Distribution Deals option due to incompatibility +- Updated libraries. ---- +### Fixed -**5.0.2** +- Various fixes. -11.06.2022. for Beta 1 -- Updated libraries -- Various fixes +## [5.0.1] - 2022-04-02 ---- +### Added -**5.0.1** +- "Default" option for the efficiency dropdown(s). +- New localizations: Croatian (Trawis), German (chaikobar), Korean (dragontalk), Spanish (jesustb). -02.04.2022. for Beta 1 -- Added "Default" for efficiency dropdown(s) -- Fixed Lock Age option -- New localizations: Croatian (Trawis), German (chaikobar), Korean (dragontalk), Spanish (jesustb) +### Fixed ---- +- Lock Age option. -**5.0** +## [5.0] - 2022-03-14 -14.03.2022. for Beta 1 -- Initial version +### Added ---- +- Initial version. diff --git a/FEATURES.md b/FEATURES.md index 19c6e18..cd48dba 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -1,65 +1,113 @@ # Features List of features in the trainer +Open the trainer with the **Trainer** button (or F1; F2 closes it). Product +actions read the product name from the *Product Name Here* input box at the top +of the first column. + --- **Buttons** -All button features are initiated once - -| Feature | Parameters | Description | -|:--------------------:|:--------------------:|:-----------------------------------------------------:| -| Add Money | Amount | Adds money to company | -| Add Rep | Amount | Adds reputation to company | -| Max Followers | None | Adds maximum followers possible to company | -| Max Code | Product Name | Maxes code for specified product in development | -| Max Art | Product Name | Maxes art for specified product in development | -| Fix Bugs | Product Name | Fixes all possible bugs for specified product in beta | -| Set Product Price | Product Name, Amount | Sets product's price to specified amount | -| Set Product Stock | Product Name, Amount | Sets product's stock to specified amount | -| Set Product Users | Product Name, Amount | Sets product's active users to specified amount | -| Takeover Company | Company Name | Takes over specified company | -| Subsidiary Company | Company Name | Specified company becomes your company's subsidiary | -| Bankrupt Company | Company Name | Forces specified company to go bankrupt | -| Bankrupt All | None | Forces all companies but yours to go bankrupt | -| Days Per Month | Amount | Changes days per month to specified amount | -| Clear all loans | None | Clears all loans | -| HR Leaders | None | Gives all leaders HR training | -| Max Employees Skills | None | All employee skills and education are maxed | -| Remove Products | None | Products your company didn't invent are removed | -| Sell Products Stock | None | Products with no active users are sold for half price | -| Reset Employees Age | None | All employees ages are set to 21 | -| Unlock All Furniture | None | All furniture is unlocked | -| Unlock All Space | None | All space is unlocked | -| Max Market Share | None | Sets market share to 100% for all company products | +Button features are applied once when clicked. + +| Feature | Parameters | Description | +|:----------------------:|:----------------------:|:-----------------------------------------------------------:| +| Add Money | Amount | Adds money to your company (Deals category) | +| Max Followers | Product Name | Maxes followers for the specified product in development | +| Takeover Company | Company Name | Buys out the specified company | +| Subsidiary Company | Company Name | Specified company becomes your company's subsidiary | +| Bankrupt | Company Name | Toggles bankruptcy for the specified company | +| AI Bankrupt All | None | Forces every simulated company to go bankrupt | +| Fix Bugs | Product Name | Fixes all bugs for the specified product in beta | +| Set Product Price | Product Name, Amount | Sets the product's price | +| Set Product Stock | Product Name, Amount | Sets the product's physical stock | +| Set Active Users | Product Name, Amount | Sets the product's active users | +| Sell products stock | None | Stock of products with no active users is sold at half price| +| Max Market Share | None | Sets market share to 100% for all your products | +| Max Reputation | None (confirmation) | Maxes business reputation across all categories | +| Max market recognition | None | Maxes market recognition for all software types/categories | +| Max Skill of employees | None | Maxes skills, specializations, and lead specializations | +| Reset age of employees | None | Resets every employee to the youngest age | +| Days per month | Amount | Changes days per month (requires restart) | +| Clear all loans | None | Clears all loans | +| Extend Deadline | None | Extends every contract deadline by one year | +| Unlock all furniture | None | Unlocks all furniture | +| Unlock all space | None | Unlocks all plots of land | +| Unlock and Claim Rewards | None | Completes and claims all task rewards | +| Discord | None | Opens the Discord invite message | + +--- + +**Dropdowns** + +- **Efficiency**: Default, 100%-8000%; sets effectiveness for non-lead + employees. +- **Lead Efficiency**: Default, 100%-8000%; sets effectiveness for lead + employees. + +--- **Toggles** -All toggle features last as long as they are toggled - -| Feature | Description | -|:--------------------:|:-----------------------------------------------------:| -| Disable Needs | Disable employees needs | -| Disable Stress | Disable employees stress | -| Free Employees | You do not pay your employees | -| Free Staff | You do not pay your staff | -| Full Efficiency | Your employees operate at full efficiency | -| Full Satisfaction | Your employees are satisfied to the fullest extent | -| Lock Employees Age | Your employees do not age | -| No Vacation | Your employees do not go on vacation | -| No Sickness | Your employees do not fall ill | -| Ultra Efficiency | Your employees are even more efficient | -| Full Sunlight | All rooms are lighted with sunlight | -| Lock Temperature | All rooms temperatures are 21C | -| No Maintenance | Nothing requires maintenance | -| Noise Reduction | All rooms are less noisy | -| Rooms Never Dirty | All rooms are always clean | -| Auto Distr. Deals | You receive more distribution deals automatically | -| Free Print | Print without expenses | -| Free Water & Elec. | Water and electricity are free | -| Inc. Bookshelf Skill | Bookshelves provide more skill | -| Inc. Courier Cap. | Couriers can carry more boxes | -| Inc. Print Speed | Printers print faster | -| More Hosting Deals | You receive more hosting deals automatically | -| Reduce Internet Cost | Internet costs less | -| Auto Max Market Share| All company products are kept at 100% market share | +Toggle features stay active for as long as they are enabled. + +| Feature | Description | +|:---------------------------:|:------------------------------------------------------------:| +| Disable Needs | Employees have no needs | +| Disable Stress | Employees have no stress | +| Free Employees | You do not pay your employees | +| Free Staff | You do not pay your staff | +| Full Satisfaction | Employees are fully satisfied and negative thoughts clear | +| Lock Age of Employees | Employees do not age | +| No Vacation | Employees do not go on vacation | +| No Sickness | Employees do not fall ill | +| Auto Research Start | Automatically starts research for available tech levels | +| Digital Distribution Monopol| Shuts down rival digital distribution platforms | +| Disable Fire Inspection | Removes fire inspectors and passes inspections | +| Auto Max Market Share | Keeps all your products at 100% market share | +| Full Environment | Rooms have maximum furniture environment | +| Full Sun Light | Rooms are fully lit | +| Lock Temperature To 21 | Room temperatures are locked to 21 C | +| No Maintenance | Furniture never needs maintenance | +| Noise Reduction | Furniture and employees produce no noise | +| Rooms Never Dirty | Rooms are always clean and odorless | +| No Education Cost | Education is free | +| Disable Fires | Prevents and extinguishes fires | +| Auto Design End | Automatically promotes finished design documents | +| Auto Research End | Automatically finishes research and files patents | +| Auto Patent End | Automatically completes finished patents | +| Increase Walk Speed | Employees walk faster | +| Disable Furniture Stealing | Furniture cannot be stolen | +| Free Print | Printing has no cost | +| Free Water & Electricity | Water, electricity, and gas are free | +| Increase Bookshelf Skill | Bookshelves provide more skill | +| Increase Courier Capacity | Couriers can carry more boxes | +| Increase Print Speed | Printers print faster | +| More Hosting Deals | Generates extra hosting deals and rewards | +| Reduce Internet Cost | Halves ISP cost | +| No Server Cost | Servers are free | +| Reduce Expansion Cost | Halves expansion cost | +| Disable Force Pause | Prevents the game from force-pausing | +| Disable Force Freeze | Prevents the game from force-freezing | +| Auto Accept Hosting Deals | Automatically accepts available server deals | +| More Inspiration | Inspiration can be used without cooldown | +| More Creativity | Reveals full creativity for employees | +| Experimental | Reveals experimental test controls (re-open window to apply) | + +--- + +**Employee editing** + +The **Skill Change** button (on the actor window) and the extra buttons added to +the game's employee detail window let you edit selected employees. + +| Feature | Description | +|:--------------:|:-----------------------------------------------------------------:| +| Set Skills | Sets specialization stars (-3 to 3) for selected roles/specs | +| Set Base Skills| Sets base role skill (0 to 1.0) | +| Trait | Toggles an employee's traits | +| Demand | Toggles a lead's design demands | +| LeadSpec | Sets lead specialization values per software type | +| Creativity | Sets an employee's creativity (0 to 1.0) | +| Inspiration | Sets an employee's inspiration (0 to 2.0) | diff --git a/README.md b/README.md index 53ece7f..5f29150 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,122 @@ -## Software Inc Trainer +# Software Inc. Trainer -*NOTE: I can't guarantee that some features integrated into this trainer will work with old saves. If you want to test it, please back up your data first. +A trainer (cheat) mod for the game *Software Inc.* (Beta 1 branch). It adds an +in-game window and employee editors that let you apply one-shot actions (add +money, max skills, take over companies) and continuous toggles (no needs, free +employees, auto-finish work). -Report bugs and suggestions through GitHub Issues. +> **Note:** Some features may not work with old saves. Back up your data before +> testing. -[Features](FEATURES.md) -[Changelog](CHANGELOG.md) +## Why -## Development +*Software Inc.* is a business-simulation game. This mod gives players +sandbox-style control over the simulation for experimentation, testing, and +casual play, exposed through the game's own UI so it feels native. + +## Status + +`active` - maintained for the current *Software Inc.* Beta 1 branch. + +## Requirements + +- *Software Inc.* (Beta 1) installed. +- Windows (the game platform). +- To build from source: a .NET SDK able to build the `net46` target project + (CI uses the .NET 8 SDK). The build references the game's assemblies in + `Trainer_v5/Trainer.Libraries/` and Unity modules, which are supplied by the + game at runtime. + +## Setup + +```bash +git clone https://github.com/Trawis/T5B1.git +cd T5B1 +``` + +To install a built mod, copy `Trainer_v5.dll` and the `Trainer.Localization` +folder into the game's mod directory. + +## Build + +```bash +dotnet build "Trainer v5 - Beta 1.sln" +``` + +The solution defines `Debug`, `Release`, `SWINCBETA`, `SWINCBETA1_7`, and +`SWINCRELEASE` configurations for game-version conditional compilation. + +## Test + +```bash +# No automated test project exists. +# Validate changes by loading the mod in the game. +``` + +## Run + +Install the built `Trainer_v5.dll` and `Trainer.Localization` into the game's +mod directory, launch *Software Inc.*, load a game, and press the **Trainer** +button (or F1). + +## Configuration + +- **Version source of truth:** `Helpers.Version` in + `Trainer_v5/Trainer.Source/Helpers.cs`. +- **Build configurations:** select a configuration to target a specific game + version via preprocessor symbols (see [Build](#build)). +- **Persistence:** trainer toggle and efficiency settings are saved into the + game save file. No secrets or external configuration are required. + +## Usage + +Open the trainer with the **Trainer** button or **F1** (**F2** closes it). The +**Skill Change** button on the actor window and extra buttons on the employee +detail window edit selected employees. See [`FEATURES.md`](FEATURES.md) for the +full feature list. + +## Documentation + +- [`docs/project/architecture.md`](docs/project/architecture.md) - architecture and technical overview +- [`FEATURES.md`](FEATURES.md) - feature list +- [`CHANGELOG.md`](CHANGELOG.md) - version history + +## Known Limitations + +- May not work with old saves; back up first. +- Tightly coupled to specific game versions; game updates can break the build + and require preprocessor/version updates. +- No automated tests; behavior is validated by loading the mod in the game. + +## Help and Contributing + +- Report bugs and suggestions through GitHub Issues. +- Community chat and support: [Discord](https://discord.com/invite/J584aG). + +### Branching (Git Flow) This repository follows Git Flow. -### Long-lived branches +**Long-lived branches** | Branch | Purpose | |--------|---------| -| `main` | Production — stable releases only | -| `develop` | Integration — all feature work targets here | +| `main` | Production - stable releases only | +| `develop` | Integration - all feature work targets here | -### Branch families +**Branch families** | Branch | Base | PR target | Use for | |--------|------|-----------|---------| -| `feature/` | `develop` | `develop` | All normal work: features, fixes, docs, tests, refactors, tooling | +| `feature/` | `develop` | `develop` | Normal implementation and maintenance | | `release/..` | `develop` | `main` | Release preparation and version bumps | | `hotfix/` | `main` | `main` | Urgent fixes for released code | -`release/*` and `hotfix/*` changes must also be brought back to `develop` after merge. - -See [`AGENTS.md`](AGENTS.md) for full branching rules and coding conventions. +`release/*` and `hotfix/*` changes must also be brought back to `develop` after +merge. See [`AGENTS.md`](AGENTS.md) for full branching rules and coding +conventions. -## CI / CD +### CI / CD | Trigger | Workflow | Result | |---------|----------|--------| @@ -38,6 +124,18 @@ See [`AGENTS.md`](AGENTS.md) for full branching rules and coding conventions. | Daily schedule or manual dispatch | Nightly | Build + versioned RC artifact + prerelease | | Push to `main` | Release | Build + versioned zip artifact + versioned GitHub Release | -The release workflow reads the semantic version from `Helpers.Version`. A release creates the matching `v..` tag and uses the version in the downloadable archive name. Increase `Helpers.Version` before merging another release to `main`. +The release workflow reads the semantic version from `Helpers.Version`. A release +creates the matching `v..` tag and uses the version in the +downloadable archive name. Increase `Helpers.Version` before merging another +release to `main`. The nightly workflow appends the workflow run number as an RC +suffix, producing versions such as `5.2.6-rc123`; nightly prereleases do not +replace the latest stable release. + +## Maintainers + +Trawis, with community contributors (see +[`Trainer_v5/Trainer.Localization/credits.txt`](Trainer_v5/Trainer.Localization/credits.txt)). + +## License -The nightly workflow appends the workflow run number as an RC suffix, producing versions such as `5.2.6-rc123`. Nightly prereleases do not replace the latest stable release. +No license file is currently present in the repository. diff --git a/docs/project/architecture.md b/docs/project/architecture.md index 50162c4..2126a2e 100644 --- a/docs/project/architecture.md +++ b/docs/project/architecture.md @@ -1,69 +1,223 @@ # Architecture and Technical Overview - - +**Project**: T5B1 - Software Inc. Trainer (v5, Beta 1) +**Status**: Active +**Last Updated**: 2026-07-07 -**Project**: -**Status**: Draft -**Last Updated**: YYYY-MM-DD +This document describes the verified current technical system. Proposed changes +belong under `docs/project/designs/` until accepted or implemented. -Describe the verified current technical system. Keep proposed changes in -`docs/project/designs/` and link them here after they are accepted or implemented. +## Purpose, Scope, and Quality Goals -When this document grows, keep it as the stable overview and move detailed -subjects under `docs/project/architecture/`. Do not create detail files until -they add value. +T5B1 is a client-side trainer (cheat) mod for the Unity game *Software Inc.* +(Beta 1 branch). It compiles to a single managed assembly, `Trainer_v5.dll`, +that the game's DLL mod loader discovers at runtime. The mod adds an in-game +settings window and several employee-editing windows that let the player apply +one-shot actions (add money, max skills, take over companies) and toggle +continuously-enforced cheats (no needs, free employees, auto-finish work). -## Purpose, Scope, and Quality Goals +Quality goals that most influence the design: -Summarize the system's technical purpose, boundaries, constraints, and the -three to five quality goals that most influence its design. +- **Game compatibility**: the mod links against the game's own assemblies and + must keep working across *Software Inc.* Beta versions, which is handled with + compile-time conditional code paths. +- **Non-destructive persistence**: trainer settings serialize into the save + file and must round-trip without corrupting saves. +- **Fail-soft behavior**: a cheat that throws must not crash the game; risky + operations are guarded and logged. +- **Discoverability**: features are exposed through in-game UI built from the + game's own `WindowManager` widgets so they match the game's look and feel. + +Out of scope: the mod does not modify the game on disk, ship its own engine, or +provide any networked/server component. ## System Context -Define the system boundary, users, and external systems. +- **User**: a *Software Inc.* player who installs the mod DLL into the game's + mod folder. +- **Host system**: the *Software Inc.* game process (Unity engine). The mod runs + entirely inside this process and depends on the game's public runtime types + (`GameSettings`, `HUD`, `WindowManager`, `Actor`, `Employee`, `SoftwareProduct`, + `MarketSimulation`, and related classes). +- **External systems**: none at runtime. The only external reference is a Discord + invite URL surfaced to the user as text. + +The mod is a plugin: it has no entry point of its own and is driven entirely by +callbacks from the game (mod lifecycle, Unity scene events, and time events). ## Components and Responsibilities -| Component | Responsibility | Dependencies | -|---|---|---| -| | | | +Source lives under `Trainer_v5/Trainer.Source/`. All types share the +`Trainer_v5` namespace (with nested `SDK`/`Window` namespaces). + +- `Main` (`ModMeta`): mod entry metadata, toolbar button creation, and settings + serialization through `WriteDictionary`. +- `TrainerBehaviour` (`ModBehaviour`): runtime driver for scene/time events, + per-frame toggle enforcement, and one-shot trainer actions. +- `Helpers`: central static state for versioning, settings dictionaries, role + and specialization lists, efficiency options, property helpers, and game + version detection. +- `Constants`: named numeric constants for UI layout and gameplay tuning. +- `SettingsWindow`: six-column trainer window built from `Helpers.Settings`. + Buttons and toggles are wired to `TrainerBehaviour`. +- `EmployeeSkillChangeWindow`: standalone selected-employee role and + specialization editor. +- `DetailWindowTrainer`: injects Trait, Demand, Creativity, Inspiration, and + LeadSpec buttons into the game's employee detail window. +- `Window.EmployeeTraitChangeWindow`, `Window.EmployeeDemandChangeWindow`, and + `Trainer.Source.Window.EmployeeLeadSpecChangeWindow`: lazy-singleton editor + windows for traits, lead-design demands, and lead specializations. +- `UIHelper`, `UIFactory`, and `Utilities`: factories for game UI widgets and + window/column layout. +- `InputHelper`: validated numeric input dialogs with parse and range checks. +- `Notification`: thin wrapper over the game's popup and dialog spawners. +- `Logger`: extension methods that write prefixed messages to the game console. +- `Extensions`: dictionary get, set, toggle, and combobox index helpers. +- `SDK.EmployeeHelper`: employee trait and lead-design demand helpers. +- `SDK.WindowHelper`, `LayoutHelper`, and `VerticalLayout`: vertical layout + helpers for newer editor windows. +- `SDK.ComponentStyleHelper` (`DefaultStyles`) and `Window.WindowStyles`: shared + component height and text styles. ## Important Runtime Flows -Describe the important interactions, including startup, normal operation, -background processing, failure handling, and shutdown where relevant. +**Startup / scene changes.** `TrainerBehaviour.Start` seeds a `System.Random` +and subscribes to `SceneManager.sceneLoaded`. `OnLevelFinishedLoading` reacts to +scene names: entering `MainScene` calls `Main.CreateUIButtons`, installs the +detail-window buttons, and subscribes to time events; returning to `MainMenu` +tears those down. The `Customization` scene widens the available start-year and +start-loan options. + +**Toolbar buttons.** `Main.CreateUIButtons` adds a *Trainer* button (opens the +settings window) to the main fan panel and a *Skill Change* button to the actor +window. `SettingsWindow.Init` lazily builds the six-column window from the +`Helpers.Settings` toggle dictionary; each toggle is bound back to the dictionary +and each button to a `TrainerBehaviour` static method. + +**Per-frame enforcement.** `TrainerBehaviour.Update` runs every frame while the +game is loaded. It hotkeys F1/F2 to open/close the window, lazily loads employee +specializations once a company exists, then iterates furniture, rooms, and actors +applying whichever toggles are active (e.g. `NoStress`, `NoNeeds`, +`FreeEmployees`, `CleanRooms`, `FullEnvironment`), plus company-wide effects +(auto-finish design/research/patent, free print, no server cost, reduced ISP +cost, expansion cost). Toggles read their state through +`Helpers.GetProperty(TrainerSettings, "")`. + +**Time events.** `OnMonthPassed` advances employee birth dates when `LockAge` is +on (keeping ages fixed). `OnHourPassed`/`OnDayPassed` are currently no-ops. + +**One-shot actions.** Buttons that need input open a game input dialog whose +callback performs the change (e.g. `IncreaseMoney`, `SetProductPrice`, +`FixBugs`, `TakeoverCompany`). Actions post a confirmation popup or dialog via +`Notification`/`HUD.AddPopupMessage`. + +**Employee editing.** `DetailWindowTrainer` adds buttons to the game's employee +detail window. Creativity editing clones the `Employee` (creativity is otherwise +read-only), transfers state, and swaps the actor's employee reference. Trait and +demand windows toggle flag enums directly; lead-spec and skill windows write +skill/specialization values on the selected actors. + +**Failure handling.** `Helpers.TryExecute` wraps risky actions in try/catch and +routes exceptions to `Logger.LogException` and `Debug.LogException`. Several +partially-working or version-specific features are guarded (see Cross-Cutting). ## Data, Interfaces, and Integrations -Describe persistence, APIs, commands, events, contracts, external integrations, -and important compatibility boundaries. +- **Persistence.** `Main.Serialize`/`Deserialize` write every key in + `Helpers.Settings` and `Helpers.StoresSettings` into the game's + `WriteDictionary`, so toggle and efficiency choices persist with the save. + Deserialization falls back to the current in-memory value when a key is absent, + which keeps older saves loadable after new toggles are added. +- **Game API surface.** The mod is tightly coupled to the game's internal types. + It links against the game assemblies shipped in `Trainer.Libraries/` + (`Assembly-CSharp.dll`, `Assembly-CSharp-firstpass.dll`) and Unity modules. +- **UI.** All widgets are spawned through the game's `WindowManager` + (`SpawnWindow`, `SpawnButton`, `SpawnCheckbox`, `SpawnComboBox`, + `SpawnInputDialog`, etc.), so the trainer UI is native game UI. +- **Localization.** UI text uses `"Key".LocDef("English default")`; translations + live under `Trainer_v5/Trainer.Localization//Trainer.tyd` + (Croatian, English, German, Korean, Spanish, Chinese, Chinese (Simplified)). ## Configuration and Deployment -Summarize runtimes, configuration sources, environments, storage, hosting, -deployment topology, and operational dependencies. +- **Runtime/target.** `Trainer_v5.csproj` targets `net46` with C# `LangVersion 6.0` + to match the game's Unity runtime. Game/Unity references are marked + `Private=False` (not copied) because the game supplies them at runtime. +- **Build configurations / conditional compilation.** The solution defines + `Debug`, `Release`, `SWINCBETA`, `SWINCBETA1_7`, and `SWINCRELEASE` + configurations. Code adapts to game versions via preprocessor symbols + (`SWINCBETA1_7`/`1_8`/`1_9`/`1_10`, `DEBUG`), for example choosing + `Employee.LeadSpecializationFix` vs `LeadSpecialization` and gating features + such as `MaxMarketShare`, `AutoAcceptHostingDeals`, and + `DigitalDistributionMonopol`. `Helpers.GetGameVersion` maps these symbols to a + displayed version string. +- **Version source of truth.** `Helpers.Version` (currently `5.2.6`) is the + single semantic version; the release and nightly workflows parse it from + `Helpers.cs`. +- **Packaging / deployment.** The Release build produces `Trainer_v5.dll`, which + is packaged with the `Trainer.Localization` folder into + `Trainer_v5_.zip`. The player installs the DLL and localization into + the game's mod directory. ## Cross-Cutting Concerns -Document security, privacy, reliability, observability, performance, -accessibility, capacity, and compatibility approaches that affect the system. +- **Compatibility.** Version-specific behavior is handled at compile time with + preprocessor guards rather than runtime detection; the shipped build targets a + specific game version. Backward-compatible save loading is handled by the + serialize/deserialize fallback described above. +- **Reliability.** `Helpers.TryExecute` and defensive null/collection checks + (e.g. `IsGameReady`, `IsGameLoaded`) keep cheats from throwing into the game + loop. Some methods short-circuit when the game or a required manager is not yet + available. +- **Observability.** `Logger` writes prefixed (`Trainer: ...`) messages to the + in-game dev console; there is no external logging. +- **Performance.** The `Update` loop iterates all furniture, rooms, and actors + every frame when toggles are active. This is acceptable for the game's scale + but is the mod's main hot path; guards ensure work only runs while a game is + loaded. +- **Security/privacy.** No network calls, telemetry, or persisted secrets. The + only outward reference is a static Discord invite URL shown to the user. ## Development and Validation -Summarize build boundaries, test levels, local validation, deployment checks, -and any important environment limitations. +- **Build.** `dotnet build "Trainer v5 - Beta 1.sln"` (CI builds the `Debug` + configuration on `windows-latest` with .NET 8 SDK; the toolchain still targets + `net46`). +- **Local checks.** `dotnet format --verify-no-changes` for formatting; + `dotnet build` for compilation. There is no automated test project, so + `dotnet test` provides no coverage; behavior is validated by loading the mod + in the game. +- **CI/CD.** + - *CI* (`.github/workflows/ci.yml`): builds on push/PR to `develop`. + - *Nightly* (`.github/workflows/nightly.yml`): daily/manual; if `develop` had + commits in the last 24h, builds a Release artifact and publishes a + `v-rc` prerelease. + - *Release* (`.github/workflows/release.yml`): on push to `main`, reads + `Helpers.Version`, builds Release, packages the zip, and creates the + `v` GitHub Release (fails if the tag already points at another + commit; increase `Helpers.Version` before releasing). +- **Environment limitation.** Building/running requires the game and Unity + assemblies referenced from `Trainer.Libraries/`; full runtime validation + requires the actual game. ## Decisions and Design Records -Link significant technical designs under `docs/project/designs/`. Record only -the resulting current state here; do not copy proposal history into this file. +No formal technical designs are recorded under `docs/project/designs/` yet. +Record significant future changes there and summarize the resulting state here. ## Risks, Technical Debt, and Open Questions -- +- The per-frame `Update` method is large and enforces many toggles inline; + it concentrates most runtime logic in one place. +- Several features are version-gated or noted in code as partially working or + broken (e.g. `RemoveSoft` is disabled, `ReduceBoxPrice` is commented out, + `//TODO` notes on maintenance and print pricing). `HREmployees` exists but is + not currently wired to any UI button. +- Heavy coupling to internal game types means game updates can break the build; + compatibility is maintained manually through preprocessor symbols. +- No automated tests exist; regressions are caught only by in-game testing. ## Detailed Documentation -Link any extracted technical documents. This section may remain empty while the -overview is sufficient. +None extracted yet. See `README.md` for setup/branching, `FEATURES.md` for the +user-facing capability list, and `CHANGELOG.md` for release history.