CitiesSkylinesMods / TMPE

Cities: Skylines Traffic Manager: President Edition
https://steamcommunity.com/sharedfiles/filedetails/?id=1637663252
MIT License
571 stars 85 forks source link

Show DLC icon if the effect of the option depends on DLC availability #1657

Closed krzychu124 closed 2 years ago

krzychu124 commented 2 years ago

Resolves #1632

Instead of hiding options if user doesn't have DLC show as read-only. Affects only 4 checkboxes.

image

Build zip

kianzarrin commented 2 years ago

how do you make sure the options are not applied in game when DLC is absent? code path is not even reached?

krzychu124 commented 2 years ago

how do you make sure the options are not applied in game when DLC is absent? code path is not even reached?

What do you mean by that? I think you have missed very important line of code (line 17) which means that missing DLC will make the option disabled.

https://github.com/CitiesSkylinesMods/TMPE/blob/b93c30add87e2aeac27563a2f06fcc1a4392c62d/TLM/TLM/UI/Helpers/DLCRestrictedCheckboxOption.cs#L13-L18

If you ask what about if user have DLC and disabled it? Does it really a problem? Most of the time, especially with those two DLC savegame won't be loadable without those DLCs and.. user already had to have the DLC to enable the option in the first place, not to mention those settings are ignored when there is no DLC since the code is triggered by DLC content (e.g. evacuation buses may ignore arrows - you needs to have access to Evacuation bus and running disaster which requires DLC).

kianzarrin commented 2 years ago

Just because UI is disabled doesn't mean the option won't return a value.