- Open solution in Visual Studio
- Make changes...
- Build solution/project (automatically outputs to CS2
Mods/folder)
- ⚠ Ensure game was started with Steam
--uiDeveloperModelaunch parameter- Allows accessing UI debugger at http://localhost:9444
- Open
UIfolder in text editor - Start development server (
npm run dev) - Make changes (automatically updates via HMR)
# Start development server
npm run devThe built-in CS UI package can be updated with npm run update, and will most notably update the types (bindings, etc).
All UI changes should be formatted, linted, and type checked before review!
- Code formatting (
npm run code:format) - Code linting (
npm run code:lint - TS type checking (
npm run code:type)
To access decompiled results, use a tool like ILSpy to open the Game.dll file (found in Steam installation). Then "Save" the project after decompiling to output a C# project for searching/learning.
Game media can be found at steamapps\common\Cities Skylines II\Cities2_Data\StreamingAssets\~UI~\GameUI\Media.
Currently the primary English localization uses the default CO LocaleEN C# class, rather than a separate JSON object. However, all other locale files are stored under Locales/ as JSON. This can make generating localization objects more complex, as there is no easy way to copy the base JSON file. To help with this, the mod automatically dumps the current LocaleEN dictionary into a JSON file within ModsData upon startup.
Forked changes can be tested by adding a new Git remote to the forked repository, then checking out a local branch from the forked remote.
# https://stackoverflow.com/a/69758165/4206438
git remote add forked https://github.com/something/something.git
git fetch forked
git checkout -b otherDevelopersBranch forked/otherDevelopersBranch
# Cleanup fork remote after testing
git remote remove forked