civfanatics / CQUI_Community-Edition

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

Various Minor Fixes #351

Closed JamieNyanchi closed 1 year ago

JamieNyanchi commented 1 year ago

Instead of creating separate pull requests for each minor change as I was doing previously, I decided to merge them into one here. If desired though, I can split these into separate pull requests. A description of all the changes are listed below.

  1. CityBannerManager_CQUI: Ensure the Religion lens is cleared when switching to other lenses, such as the Power lens. If you are viewing the world with the Religion lens on and switch to another, like Power, the religion lens will stay. This doesn't happen with every lens though. This also seems to not happen if the CityBanner.UpdateReligion() function is not overwritten (Which we want to do due to our added features). I couldn't figure out why this was happening though, so the best fix I could find is to make sure the religion lens is cleared when switching off of it.

  2. WorldViewIconsManager_CQUI: Show or hide the builder improvement recommendations based on the CQUI settings. They were always hidden before.

  3. worldinput_CQUI: Don't reset the lens back to default when hovering over units if currently on a modal lens. Sometimes, while viewing through a lens, the lens would reset to default if you hovered on and off units. This has been fixed.

  4. worldinput_CQUI: Do not clear the attack arrow on range attacks if hovering over other units. If you were performing a range attack and hovered over another unit, it would clear the attack arrow. This prevents that from happening now.

  5. unitflagmanager_CQUI: Show unit path on selected unit when not hovering over other unit. If you were to select a unit and then move the mouse on and off another unit, it would clear the path of the unit you're selected on. This is modified now to always show the path of the selected unit as long as you are not hovering over another unit. If hovering over another unit, it will show the path of that unit instead as long as you're hovering over it.

  6. NotificationPanel_CQUI, citypanel, CivicsTree_CQUI, TechTree_CQUI, unitflagmanager_CQUI, BuilderLens_Config_Default: All of these files were modified to add additional scenario compatibility. When playing scenarios, some values will be nil due to the different game rules. For instance, some code checks for certain techs or civics that may not exist in scenarios. This adds in checks for these and a few others. Also comments out unnecessary code in the citypanel since the ProduceWithFaithCheck and ProduceWithGoldCheck elements do not exist in the xml. I haven't thoroughly tested the scenarios yet, but this seems to fix all the errors that occur when loading the singleplayer ones up at least, with the exception of the Black Death scenario. The Black Death scenario modifies the city banner and I haven't worked on that yet.

  7. actionpanel: When auto selecting a unit, properly look at the unit when selected. This code was bugged before and caused an error every time instead. Though I am unsure if this code is even necessary as it seems the previous line before this code looks at the unit automatically. Either way, this error is resolved now.

I tried to give a good overview of all the changes, but if more description is needed, I'll be happy to provide it!