├── .gitignore ├── .gitattributes ├── Settings └── UnlockAllTilesSettings.cs ├── Patches ├── MapTilePurchaseSystem_Cost.cs └── MapTilePurchaseSystem_TileNumber.cs ├── UnlockAllTilesMod.sln ├── Plugin.cs ├── README.md └── UnlockAllTilesMod.csproj /.gitignore: -------------------------------------------------------------------------------- 1 | unstripped_libs 2 | bin 3 | obj 4 | .vs 5 | 0Harmony.dll 6 | Releases -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /Settings/UnlockAllTilesSettings.cs: -------------------------------------------------------------------------------- 1 | namespace Wayz.CS2.UnlockAllTilesMod; 2 | internal class UnlockAllTilesSettings 3 | { 4 | public bool FreeTiles { get; set; } = true; 5 | } 6 | -------------------------------------------------------------------------------- /Patches/MapTilePurchaseSystem_Cost.cs: -------------------------------------------------------------------------------- 1 | using Game.Simulation; 2 | using HarmonyLib; 3 | 4 | namespace Wayz.CS2.UnlockAllTilesMod.Patches; 5 | 6 | [HarmonyPatch(typeof(MapTilePurchaseSystem), "get_cost")] 7 | public static class MapTilePurchaseSystemPatch_Cost 8 | { 9 | [HarmonyPrefix] 10 | public static bool Prefix(object __instance, ref int __result) 11 | { 12 | __result = 0; 13 | return !UnlockAllTilesMod.ModSettings.FreeTiles; 14 | } 15 | } -------------------------------------------------------------------------------- /Patches/MapTilePurchaseSystem_TileNumber.cs: -------------------------------------------------------------------------------- 1 | using Game.Simulation; 2 | using HarmonyLib; 3 | using System.Reflection; 4 | 5 | namespace Wayz.CS2.UnlockAllTilesMod.Patches; 6 | 7 | [HarmonyPatch(typeof(MapTilePurchaseSystem), "GetAvailableTiles")] 8 | public static class MapTilePurchaseSystemPatch_TileNumber 9 | { 10 | [HarmonyPrefix] 11 | public static bool Prefix(MapTilePurchaseSystem __instance, out int __result) 12 | { 13 | var ownedTiles = typeof(MapTilePurchaseSystem).GetMethod("CalculateOwnedTiles", BindingFlags.Instance | BindingFlags.NonPublic)?.Invoke(__instance, []); 14 | if (ownedTiles == null) 15 | { 16 | __result = 0; 17 | return true; 18 | } 19 | __result = 529 - (int)ownedTiles; 20 | return false; 21 | } 22 | } -------------------------------------------------------------------------------- /UnlockAllTilesMod.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.8.34309.116 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnlockAllTilesMod", "UnlockAllTilesMod.csproj", "{E27FB639-EABF-4A41-B39C-85726BA8DC2E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E27FB639-EABF-4A41-B39C-85726BA8DC2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {E27FB639-EABF-4A41-B39C-85726BA8DC2E}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {E27FB639-EABF-4A41-B39C-85726BA8DC2E}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {E27FB639-EABF-4A41-B39C-85726BA8DC2E}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {9147C802-57BB-4D7E-8CF4-47C18294C528} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Plugin.cs: -------------------------------------------------------------------------------- 1 | #if BEPINEX6 2 | using BepInEx.Unity.Mono; 3 | #endif 4 | using BepInEx; 5 | using HarmonyLib; 6 | using System.Reflection; 7 | using BepInEx.Logging; 8 | 9 | namespace Wayz.CS2.UnlockAllTilesMod; 10 | 11 | [BepInPlugin("Wayz.CS2.UnlockAllTilesMod", "Unlock All Tiles Mod", "1.1.1")] 12 | #pragma warning disable BepInEx002 13 | public class UnlockAllTilesMod : BaseUnityPlugin 14 | #pragma warning restore BepInEx002 15 | { 16 | public static ManualLogSource GameLogger { get; private set; } 17 | internal static UnlockAllTilesSettings ModSettings { get; private set; } 18 | 19 | private void Awake() 20 | { 21 | GameLogger = Logger; 22 | ModSettings = WayzSettingsManager.GetOrInitializeSettings("UnlockAllTiles_Wayz", "settings"); 23 | 24 | var harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), MyPluginInfo.PLUGIN_GUID + "_Cities2Harmony"); 25 | 26 | var patchedMethods = harmony.GetPatchedMethods(); 27 | 28 | // Plugin startup logic 29 | Logger.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} {MyPluginInfo.PLUGIN_VERSION} is loaded! Patched methods: " + patchedMethods.Count()); 30 | 31 | foreach (var patchedMethod in patchedMethods) 32 | { 33 | Logger.LogInfo($"Patched method: {patchedMethod.Module.Name}:{patchedMethod.Name}"); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UnlockAllTilesMod 2 | 3 | Unlocks all 529 tiles for Cities Skylines II maps and reduces their cost to $0. 4 | 5 | The tiles will be available for "purchase" after hitting the first XP milestone. 6 | 7 | ## Installation - Thunderstore 8 | If you wish to use a mod manager, you can go to the [Unlock All Tiles mod Thunderstore page](https://thunderstore.io/c/cities-skylines-ii/p/Wayzware/UnlockAllTiles/), to automatically install the mod with their mod manager. 9 | 10 | ## Installation - Manual 11 | 1. Install [BepInEx 6 Bleeding Edge build](https://builds.bepinex.dev/projects/bepinex_be) or BepInEx 5. 12 | 13 | The pre-release version of BepInEx 6 available on their GitHub release page is quite outdated (dated August 2022) and may not support loading this mod. Please download the Bleeding Edge version from [their website](https://builds.bepinex.dev/projects/bepinex_be) 14 | 15 | * Download `BepInEx-Unity.Mono-win-x64-6.0.0-be.674+82077ec.zip` (or a newer version), and unzip all of its contents into the game's installation directory, typically `C:/Program Files (x86)/Steam/steamapps/common/Cities Skylines II` 16 | 17 | * The installation directory should now have the `BepInEx` folder, the `doorstop_config.ini` file, and the `winhttp.dll` file 18 | 19 | 2. Run the game once, then close it. You can close it when the main menu appears 20 | 21 | 3. Download the mod from the [release page](https://github.com/Wayzware/UnlockAllTilesMod/releases). Make sure you select the download that is compatible with your version of BepInEx. Unzip it into the `Cities Skylines II/BepInEx/plugins` folder. 22 | 23 | 4. Launch the game, and your mods should be loaded automatically 24 | 25 | ## Configuration 26 | By default, this mod makes the purchasing of tiles cost no money. If you would like them to cost money again, you will need to edit the config file located at `C:\Users\YOUR_USERNAME_HERE\AppData\LocalLow\Colossal Order\Cities Skylines II\ModSettings\UnlockAllTiles_Wayz`. **You must run the game with the mod installed at least once for this file to be generated**. Simply change the value next to "FreeTiles" from `true` to `false`, and restart your game for the change to take effect. 27 | 28 | ## Compiling the Mod Yourself 29 | The project should be able to build without extra work after cloning if you are using BepInEx 6. 30 | 31 | You will need to add references to Unity yourself if using BepInEx 5 and wish to compile the project. 32 | 33 | In the .csproj, you can set the location of your game install and enable the PostBuild install step, to automatically install the mod after build. 34 | 35 | ## Thank You 36 | * optimus-code for their [template mod repo](https://github.com/optimus-code/Cities2Modding/tree/main), especially the .csproj 37 | * [slyh](https://github.com/slyh) for their installation instructions 38 | * The creators of Harmony and BepInEx 39 | * The Cities Skylines II modding discord in general 40 | 41 | (This mod is largely untested and I take absolutely no responsibility if it somehow ends up breaking your saves) 42 | -------------------------------------------------------------------------------- /UnlockAllTilesMod.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.1 4 | Wayz.CS2.UnlockAllTilesMod 5 | 1.1.1 6 | enable 7 | 12.0 8 | 9 | https://api.nuget.org/v3/index.json; 10 | https://nuget.bepinex.dev/v3/index.json; 11 | 12 | enable 13 | 14 | 15 | 16 | false 17 | true 18 | C:\Program Files (x86)\Steam\steamapps\common\Cities Skylines II 19 | $(Cities2_Location) 20 | 21 | 22 | 23 | $(DefineConstants);BEPINEX6 24 | 25 | 26 | 27 | 28 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.AssetPipeline.dll 29 | False 30 | 31 | 32 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.AssetPipeline.Native.dll 33 | False 34 | 35 | 36 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.ATL.dll 37 | False 38 | 39 | 40 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.CharacterSystem.dll 41 | False 42 | 43 | 44 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.Collections.dll 45 | False 46 | 47 | 48 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.Core.dll 49 | False 50 | 51 | 52 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.IO.dll 53 | False 54 | 55 | 56 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.IO.AssetDatabase.dll 57 | False 58 | 59 | 60 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.Localization.dll 61 | False 62 | 63 | 64 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.Logging.dll 65 | False 66 | 67 | 68 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.Mathematics.dll 69 | False 70 | 71 | 72 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.Mono.Cecil.dll 73 | False 74 | 75 | 76 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.OdinSerializer.dll 77 | False 78 | 79 | 80 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.Plugins.dll 81 | False 82 | 83 | 84 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.PSI.Common.dll 85 | False 86 | 87 | 88 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.PSI.Discord.dll 89 | False 90 | 91 | 92 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.PSI.PdxSdk.dll 93 | False 94 | 95 | 96 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.PSI.Steamworks.dll 97 | False 98 | 99 | 100 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.UI.dll 101 | False 102 | 103 | 104 | $(Cities2Libs_Location)\Cities2_Data\Managed\Colossal.UI.Binding.dll 105 | False 106 | 107 | 108 | $(Cities2Libs_Location)\Cities2_Data\Managed\cohtml.Net.dll 109 | False 110 | 111 | 112 | $(Cities2Libs_Location)\Cities2_Data\Managed\Game.dll 113 | False 114 | 115 | 116 | $(Cities2Libs_Location)\Cities2_Data\Managed\Unity.Entities.dll 117 | False 118 | 119 | 120 | $(Cities2Libs_Location)\Cities2_Data\Managed\Unity.InputSystem.dll 121 | False 122 | 123 | 124 | $(Cities2Libs_Location)\Cities2_Data\Managed\Unity.Mathematics.dll 125 | False 126 | 127 | 128 | $(Cities2Libs_Location)\Cities2_Data\Managed\Unity.Collections.dll 129 | False 130 | 131 | 132 | $(Cities2Libs_Location)\Cities2_Data\Managed\Unity.Burst.dll 133 | False 134 | 135 | 136 | $(Cities2Libs_Location)\Cities2_Data\Managed\Unity.Transforms.dll 137 | False 138 | 139 | 140 | $(Cities2Libs_Location)\Cities2_Data\Managed\Unity.Transforms.Hybrid.dll 141 | False 142 | 143 | 144 | $(Cities2Libs_Location)\Cities2_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll 145 | False 146 | 147 | 148 | $(Cities2Libs_Location)\Cities2_Data\Managed\Cohtml.RenderingBackend.dll 149 | False 150 | 151 | 152 | $(Cities2Libs_Location)\Cities2_Data\Managed\Cinemachine.dll 153 | False 154 | 155 | 156 | unstripped_libs\UnityEngine.dll 157 | False 158 | 159 | 160 | unstripped_libs\UnityEngine.AccessibilityModule.dll 161 | False 162 | 163 | 164 | unstripped_libs\UnityEngine.AIModule.dll 165 | False 166 | 167 | 168 | unstripped_libs\UnityEngine.AndroidJNIModule.dll 169 | False 170 | 171 | 172 | unstripped_libs\UnityEngine.AnimationModule.dll 173 | False 174 | 175 | 176 | unstripped_libs\UnityEngine.AssetBundleModule.dll 177 | False 178 | 179 | 180 | unstripped_libs\UnityEngine.AudioModule.dll 181 | False 182 | 183 | 184 | unstripped_libs\UnityEngine.ClothModule.dll 185 | False 186 | 187 | 188 | unstripped_libs\UnityEngine.ClusterInputModule.dll 189 | False 190 | 191 | 192 | unstripped_libs\UnityEngine.ClusterRendererModule.dll 193 | False 194 | 195 | 196 | unstripped_libs\UnityEngine.ContentLoadModule.dll 197 | False 198 | 199 | 200 | unstripped_libs\UnityEngine.CoreModule.dll 201 | False 202 | 203 | 204 | unstripped_libs\UnityEngine.CrashReportingModule.dll 205 | False 206 | 207 | 208 | unstripped_libs\UnityEngine.DirectorModule.dll 209 | False 210 | 211 | 212 | unstripped_libs\UnityEngine.DSPGraphModule.dll 213 | False 214 | 215 | 216 | unstripped_libs\UnityEngine.GameCenterModule.dll 217 | False 218 | 219 | 220 | unstripped_libs\UnityEngine.GIModule.dll 221 | False 222 | 223 | 224 | unstripped_libs\UnityEngine.GridModule.dll 225 | False 226 | 227 | 228 | unstripped_libs\UnityEngine.HotReloadModule.dll 229 | False 230 | 231 | 232 | unstripped_libs\UnityEngine.ImageConversionModule.dll 233 | False 234 | 235 | 236 | unstripped_libs\UnityEngine.IMGUIModule.dll 237 | False 238 | 239 | 240 | unstripped_libs\UnityEngine.InputLegacyModule.dll 241 | False 242 | 243 | 244 | unstripped_libs\UnityEngine.InputModule.dll 245 | False 246 | 247 | 248 | unstripped_libs\UnityEngine.JSONSerializeModule.dll 249 | False 250 | 251 | 252 | unstripped_libs\UnityEngine.LocalizationModule.dll 253 | False 254 | 255 | 256 | unstripped_libs\UnityEngine.ParticleSystemModule.dll 257 | False 258 | 259 | 260 | unstripped_libs\UnityEngine.PerformanceReportingModule.dll 261 | False 262 | 263 | 264 | unstripped_libs\UnityEngine.Physics2DModule.dll 265 | False 266 | 267 | 268 | unstripped_libs\UnityEngine.PhysicsModule.dll 269 | False 270 | 271 | 272 | unstripped_libs\UnityEngine.ProfilerModule.dll 273 | False 274 | 275 | 276 | unstripped_libs\UnityEngine.PropertiesModule.dll 277 | False 278 | 279 | 280 | unstripped_libs\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll 281 | False 282 | 283 | 284 | unstripped_libs\UnityEngine.ScreenCaptureModule.dll 285 | False 286 | 287 | 288 | unstripped_libs\UnityEngine.SharedInternalsModule.dll 289 | False 290 | 291 | 292 | unstripped_libs\UnityEngine.SpriteMaskModule.dll 293 | False 294 | 295 | 296 | unstripped_libs\UnityEngine.SpriteShapeModule.dll 297 | False 298 | 299 | 300 | unstripped_libs\UnityEngine.StreamingModule.dll 301 | False 302 | 303 | 304 | unstripped_libs\UnityEngine.SubstanceModule.dll 305 | False 306 | 307 | 308 | unstripped_libs\UnityEngine.SubsystemsModule.dll 309 | False 310 | 311 | 312 | unstripped_libs\UnityEngine.TerrainModule.dll 313 | False 314 | 315 | 316 | unstripped_libs\UnityEngine.TerrainPhysicsModule.dll 317 | False 318 | 319 | 320 | unstripped_libs\UnityEngine.TextCoreFontEngineModule.dll 321 | False 322 | 323 | 324 | unstripped_libs\UnityEngine.TextCoreTextEngineModule.dll 325 | False 326 | 327 | 328 | unstripped_libs\UnityEngine.TextRenderingModule.dll 329 | False 330 | 331 | 332 | unstripped_libs\UnityEngine.TilemapModule.dll 333 | False 334 | 335 | 336 | unstripped_libs\UnityEngine.TLSModule.dll 337 | False 338 | 339 | 340 | unstripped_libs\UnityEngine.UIElementsModule.dll 341 | False 342 | 343 | 344 | unstripped_libs\UnityEngine.UIModule.dll 345 | False 346 | 347 | 348 | unstripped_libs\UnityEngine.UmbraModule.dll 349 | False 350 | 351 | 352 | unstripped_libs\UnityEngine.UnityAnalyticsCommonModule.dll 353 | False 354 | 355 | 356 | unstripped_libs\UnityEngine.UnityAnalyticsModule.dll 357 | False 358 | 359 | 360 | unstripped_libs\UnityEngine.UnityConnectModule.dll 361 | False 362 | 363 | 364 | unstripped_libs\UnityEngine.UnityCurlModule.dll 365 | False 366 | 367 | 368 | unstripped_libs\UnityEngine.UnityTestProtocolModule.dll 369 | False 370 | 371 | 372 | unstripped_libs\UnityEngine.UnityWebRequestAssetBundleModule.dll 373 | False 374 | 375 | 376 | unstripped_libs\UnityEngine.UnityWebRequestAudioModule.dll 377 | False 378 | 379 | 380 | unstripped_libs\UnityEngine.UnityWebRequestModule.dll 381 | False 382 | 383 | 384 | unstripped_libs\UnityEngine.UnityWebRequestTextureModule.dll 385 | False 386 | 387 | 388 | unstripped_libs\UnityEngine.UnityWebRequestWWWModule.dll 389 | False 390 | 391 | 392 | unstripped_libs\UnityEngine.VehiclesModule.dll 393 | False 394 | 395 | 396 | unstripped_libs\UnityEngine.VFXModule.dll 397 | False 398 | 399 | 400 | unstripped_libs\UnityEngine.VideoModule.dll 401 | False 402 | 403 | 404 | unstripped_libs\UnityEngine.VirtualTexturingModule.dll 405 | False 406 | 407 | 408 | unstripped_libs\UnityEngine.VRModule.dll 409 | False 410 | 411 | 412 | unstripped_libs\UnityEngine.WindModule.dll 413 | False 414 | 415 | 416 | unstripped_libs\UnityEngine.XRModule.dll 417 | False 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | --------------------------------------------------------------------------------