It's working! Almost...
I added the following to Highlights.xml:
Then I changed the relevant part in CityView.lua to:
That worked out as intended. Now, whenever I was in city view mode, the city tile was green, locked tiles were green and AI worked tiles were red.
But when I was not in city view mode, but instead on the world map, mousing over the city banner, the colors were the same as before the edits. I guess this has to do with the city banners module, so I edited the CityBannerManager.lua. At line 1322, I made the exact same changes I made to CityView.lua:
Now, when I mouse over the city banner, locked tiles are green and AI worked tiles are red, which is good. BUT the city tile is red instead of green, although I copy pasted the exact code from CityView.lua...
Why does the city tile have different colors in city view and mouse over mode? Where did I make a mistake? I thought "if cityPlotIndex == 0" is used to refer to the city tile. Is that wrong?
I added the following to Highlights.xml:
Code:
<style name="WorkedFillRed" type="FilledHex" width ="1" color="255,0,0,50" />
<style name="WorkedOutlineRed" type="SplineBorder" width ="7" texture="hex_contour1.dds" color="255,0,0,164" />
Then I changed the relevant part in CityView.lua to:
Code:
if notInStrategicView then
if cityPlotIndex == 0 then
Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedFill")
Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedOutline")
elseif city:IsForcedWorkingPlot( plot ) then
Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedFill")
Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedOutline")
else
Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedFillRed")
Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedOutlineRed")
end
end
That worked out as intended. Now, whenever I was in city view mode, the city tile was green, locked tiles were green and AI worked tiles were red.
But when I was not in city view mode, but instead on the world map, mousing over the city banner, the colors were the same as before the edits. I guess this has to do with the city banners module, so I edited the CityBannerManager.lua. At line 1322, I made the exact same changes I made to CityView.lua:
Code:
if cityPlotIndex == 0 then
Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedFill")
Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedOutline")
elseif city:IsForcedWorkingPlot( plot ) then
Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedFill")
Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedOutline")
else
Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedFillRed")
Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedOutlineRed")
end
Now, when I mouse over the city banner, locked tiles are green and AI worked tiles are red, which is good. BUT the city tile is red instead of green, although I copy pasted the exact code from CityView.lua...
Why does the city tile have different colors in city view and mouse over mode? Where did I make a mistake? I thought "if cityPlotIndex == 0" is used to refer to the city tile. Is that wrong?