civfanatics / CQUI_Community-Edition

Civilization 6 mod - UI enhancements, reduce clicks and manage your empire faster!
MIT License
149 stars 28 forks source link

Add settings for lenses in city view #358

Closed JamieNyanchi closed 1 year ago

JamieNyanchi commented 1 year ago

I mentioned I would add this back in #352, so here it finally is. Implements the following two features:

  1. Adds in options to choose whether or not the religion, loyalty, and power lenses automatically apply in the city view when selecting on their respective tabs. These new settings are located under the "Lenses" section. If these lenses are set to not apply and they normally have a key displayed, the key is also hidden now since it's pointless. If the lenses are turned off, the lens applied is the standard CityManagement lens. Default setting is on for all.

  2. Adds in an option to allow citizen management even when these lenses are applied. This option is located under the "City View" section. If enabled, citizens can be managed even when the other lenses are applied. Default setting is off.

I initially only planned to do 1, but as I was doing it, I felt 2 was an interesting idea. I'm curious to see how you all feel about it.

I'm also wondering if there are any recommendations on how I could potentially remove the duplicated code. The code for the Loyalty lens is duplicated in both citypaneloverview_expansion1_CQUI.lua and citypaneloverview_expansion2_CQUI.lua. I want to minimize duplicated code, but I wasn't sure how I could do this with how these files are structured.

I'm also open to feedback on the text for these options as well as their placement in the settings. As always, I'm open to making changes if requested!