Skip to content

Commit 2f8fe9e

Browse files
committed
docs(readme): improve README and use CSM icon for the NuGet package
1 parent 91355f6 commit 2f8fe9e

File tree

5 files changed

+78
-8
lines changed

5 files changed

+78
-8
lines changed

NetDevKit/NetDevKit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
</ItemGroup>
9999

100100
<ItemGroup>
101-
<None Include="$(SolutionDir)\icon.png" Pack="true" PackagePath=""/>
101+
<None Include="$(SolutionDir)\Resources\icon.png" Pack="true" PackagePath=""/>
102102
<None Include="$(SolutionDir)\README.md" Pack="true" PackagePath=""/>
103103
</ItemGroup>
104104

README.md

Lines changed: 77 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,50 @@
55
</p>
66

77
<p align="center">
8-
<a href="https://discord.gg/SsshDVq2Zj">
9-
<img alt="npm version" src="https://img.shields.io/badge/Discord-Cities:_Skylines_Modding-5865f2?logo=discord&logoColor=white&style=flat-square">
8+
<a title="Join us on Discord!" href="https://discord.gg/SsshDVq2Zj">
9+
<img alt="Discord join link" src="https://img.shields.io/badge/Discord-csm--github_›_UrbanDevKit-5865f2?logo=discord&logoColor=white&style=flat-square">
10+
</a>
11+
<a title="Install .NET SDK with NuGet" href="https://www.nuget.org/packages/CitiesSkylinesModding.UrbanDevKit">
12+
<img alt="NuGet package version" src="https://img.shields.io/nuget/v/CitiesSkylinesModding.UrbanDevKit?style=flat-square&logo=nuget">
13+
</a>
14+
<a title="Install UI SDK with npm" href="https://www.npmjs.com/package/@csmodding/urbandevkit">
15+
<img alt="npm package version" src="https://img.shields.io/npm/v/%40csmodding%2Furbandevkit?style=flat-square&logo=npm">
1016
</a>
1117
</p>
1218

1319
> Reference maintainer(s): @toverux<br>
1420
> Contributors: @toverux
1521
22+
## What is UrbanDevKit and why should I use it?
23+
24+
UrbanDevKit (UDK) is a set of two SDKs (UI and .NET) that provide useful utilities and patterns for Cities: Skylines 2 mods.
25+
It is carefully designed to be modular, robust, and as forward and backward compatible as possible.
26+
27+
Let's walk through a few reasons why this approach is better than traditional code sharing or dependency mods.
28+
29+
The often-used approach in C:S 1 was to copy and paste useful code from other mods, but this can become quickly impractical:
30+
- Hard to track changes and bug fixes (*Who has the best version of that feature? Did someone fix this bug?*).
31+
- Gives you more maintenance work as you have to track game updates for potential breakages and fix them yourself
32+
- Clutters your project with third-party code.
33+
- Forces you to adapt the code when something was not designed to be fully reusable/generic.
34+
35+
Another one was to create a dependency mod, however this has a few drawbacks:
36+
- If it is broken for one feature (ex. after a game update) and does not load, all mods depending on it are broken.
37+
- If it is not updated for a new game version, all mods depending on it are stuck.
38+
- It forces you to update your mod when the dependency receives breaking changes, even if you don't need the new
39+
features or don't have time to do it, increasing chances for your mod to be broken before its time.
40+
- Load order/dependencies issues.
41+
42+
An SDK might often be a better solution because:
43+
- It is included in your mod, so you can control when to update it.<br>
44+
The .NET SDK is designed so that different mods can use a different, incompatible version, while the UI SDK is
45+
directly integrated into the final bundle of your mod, and only the features you use thanks to
46+
[tree shaking](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking) making it potentially very light.
47+
- If one feature is broken, only the mods using this feature are broken.
48+
- Being modular, it is easier if you really need so to copy and paste a portion of the SDK's code into your mod and
49+
adapt it to your needs.
50+
- Thought for developers, it has superior documentation, examples and testing.
51+
1652
## Features
1753

1854
Features offered by UrbanDevKit (UDK) are covered in the repo's [Wiki](https://github.com/CitiesSkylinesModding/UrbanDevKit/wiki).
@@ -21,22 +57,56 @@ Here is however a quick overview of features provided by UrbanDevKit:
2157

2258
### .NET-only Features
2359

24-
- **[Shared State](https://github.com/CitiesSkylinesModding/UrbanDevKit/wiki/Shared-State)** Share state between assemblies without linking
25-
- **[Coroutine Runner](https://github.com/CitiesSkylinesModding/UrbanDevKit/wiki/Coroutine-Runner)** Helper to start coroutines from anywhere or wrap them into Tasks.
60+
- **[Shared State](https://github.com/CitiesSkylinesModding/UrbanDevKit/wiki/Shared-State)**
61+
Share state between assemblies without linking
62+
- **[Coroutine Runner](https://github.com/CitiesSkylinesModding/UrbanDevKit/wiki/Coroutine-Runner)**
63+
Helper to start coroutines from anywhere or wrap them into Tasks.
2664

2765
### UI-only Features
2866

29-
None. For now!
67+
- **[`cs2/*` Types as a Dependency](https://github.com/CitiesSkylinesModding/UrbanDevKit/wiki/CS2-UI-Types-as-a-Dependency)**
68+
Get rid of that `types/` folder from your codebase.
3069

3170
### .NET+UI Features
3271

33-
- **[Cooperative Preloading](https://github.com/CitiesSkylinesModding/UrbanDevKit/wiki/Cooperative-Preloading)** Prevent the user to load a game while mods are preloading
72+
- **[Cooperative Preloading](https://github.com/CitiesSkylinesModding/UrbanDevKit/wiki/Cooperative-Preloading)**
73+
Prevent the user to load a game while mods are preloading
74+
75+
## Installation
76+
77+
Depending on the features you want to use, you will need to install the .NET SDK, the UI SDK, or both.<br>
78+
Each documentation page informs you about what SDK you need to install and the eventual additional configuration steps.
3479

35-
## Development
80+
The .NET SDK is available as a NuGet package: [CitiesSkylinesModding.UrbanDevKit](https://www.nuget.org/packages/CitiesSkylinesModding.UrbanDevKit).
81+
<br>
82+
C# IDEs like Rider or Visual Studio also typically have a GUI client for managing NuGet packages.
83+
84+
```sh
85+
dotnet add package CitiesSkylinesModding.UrbanDevKit
86+
```
87+
88+
The UI SDK is available as a npm package: [@csmodding/urbandevkit](https://www.npmjs.com/package/@csmodding/urbandevkit).
89+
<br>
90+
Your IDE might also have a GUI client!
91+
92+
```sh
93+
npm install @csmodding/urbandevkit
94+
```
95+
96+
And a final tip: get notified of new features and bugfixes by watching for Releases!
97+
98+
<p align="center">
99+
<img src="Resources/watch-releases.gif" align="center" width=600>
100+
</p>
101+
102+
## Development & Contributing
36103

37104
**These are instructions for modifying and building the UrbanDevKit modding libraries,
38105
not the usage documentation of the libraries which is described above.**
39106

107+
> You have a cool snippet you think might be useful to other modders?
108+
> Please open a PR or even join the project on our Discord!
109+
40110
Development Guides are maintained on the repo's [Wiki](https://github.com/CitiesSkylinesModding/UrbanDevKit/wiki) as well, but here's a quick access to development pages:
41111

42112
- **[Installing & Building UrbanDevKit](https://github.com/CitiesSkylinesModding/UrbanDevKit/wiki/Installing-&-Building-UrbanDevKit)**

Resources/icon.png

10.4 KB
Loading

Resources/watch-releases.gif

1.45 MB
Loading

icon.png

-19.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)