Sid Meier's Civilization VI

Sid Meier's Civilization VI

CQUI - Community Quick User Interface
This topic has been locked
the_m4a  [developer] 22 Apr, 2021 @ 11:04am
Show Unit Path on Hover, even when another unit is selected
This was mentioned in the main discussion thread:

Originally posted by Curt:
it would be really nice if you could see the path (of another unit). I.e. when giving a path, you could give it a quick check by mousing over (non-selected) unit, even if a different unit is selected.

CQUI will not show paths for other units when hovering on them if another unit is selected. I do not recall offhand why this is the case, and at least testing this functionality can be done with a fairly easy code change, if you are willing to crack open a lua file. :)

Remember: this change will be over-written whenever I push updates to the Steam Workshop, so if you make this change and want to keep it (assuming I haven't added it to the mod proper), just follow these steps again

  1. Navigate to where Steam saves your Workshop files, to the CQUI folder. On Windows, it'll be something like C:\Program Files (x86)\Steam\steamapps\workshop\content\289070\2115302648
  2. Go into the Assets folder, then go into the UI folder
  3. Open up unitflagmanager_CQUI.lua
  4. Find the function CQUI_OnUnitFlagPointerEntered (currently line 121 in the current version of the file)
  5. You will comment out two lines of code in this function (currently at line 129 and 131), an if statement that controls whether or not to show the unit path on hovering if another unit. To comment code in Lua, you add two dashes to the beginning of the line. When commenting an if statement, you must also comment the corresponding end to that if statement.
    When you are done commenting these two lines, the *entire* function will look like this:
    function CQUI_OnUnitFlagPointerEntered(playerID:number, unitID:number) if m_IsReligionLensOn and not CQUI_IsReligiousUnit(playerID, unitID) then -- If the lens was enabled from the Lenses Menu, it is possible to show the queued path on mouseover -- If we are here, then the religion lens is on, but player is hovering on a non-religious unit return; end if CQUI_ShowPaths and not CQUI_IsFlagHover then -- if not CQUI_SelectionMade then LuaEvents.CQUI_showUnitPath(true, unitID); -- end CQUI_IsFlagHover = true; end end
  6. Now, go to function CQUI_OnUnitFlagPointerExited (line 138 in current release, this function immediately follows the one you just edited)
  7. Comment two lines (another if statement, just like you did above), at lines 144 and 146,
    When you are done, the *entire* function will look like this:
    function CQUI_OnUnitFlagPointerExited(playerID:number, unitID:number) if m_IsReligionLensOn and not CQUI_IsReligiousUnit(playerID, unitID) then return; end if CQUI_ShowPaths and CQUI_IsFlagHover and not m_IsReligionLensOn then --if not CQUI_SelectionMade then LuaEvents.CQUI_clearUnitPath(); --end CQUI_IsFlagHover = false; end end
  8. Save the file. If you have the game running with CQUI loaded, it should automatically re-load that file when you saved it, and if you did it right you will be able to see the queued path of another unit when a different unit is selected. See demonstration here:
    https://i.imgur.com/V2FArs9.gif


If we see that this appears to work without issue then I'll make the change permanent (or at least add a setting that allows it to be configured).
Last edited by the_m4a; 22 Apr, 2021 @ 11:08am
< >
Showing 1-1 of 1 comments
Kornstalx 25 Apr, 2021 @ 9:42pm 
This is great stuff, simple changes like this really shine. Things you didn't know you missed until you see them!
< >
Showing 1-1 of 1 comments
Per page: 1530 50