• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.
Resource icon

Enhanced User Interface v1.30l

Hi again.

May I suggest an idea for a future version of EUI?

I think it would be great if the city screen icons for locked tiles and for tiles worked by the governor had different colors. At the moment, both of them are green. If for example the icon for governor-worked tiles was blue or red instead, it would be easier to spot new citizens and to make sure that your cities work the best tiles available.
Here is a screenshot for clarification on what icons I am talking about:
http://imgur.com/sUFRWcJ

So would it be possible to change the color of one of the icons?

Greetings,
Quappas.
 
Hi again.

May I suggest an idea for a future version of EUI?

I think it would be great if the city screen icons for locked tiles and for tiles worked by the governor had different colors. At the moment, both of them are green. If for example the icon for governor-worked tiles was blue or red instead, it would be easier to spot new citizens and to make sure that your cities work the best tiles available.
Here is a screenshot for clarification on what icons I am talking about:

So would it be possible to change the color of one of the icons?

Greetings,
Quappas.
(I finished all editing now :D)

What kind of color do you want? With editing the cityscreen.lua you can just edging the tiles like this:
Screenshot
Spoiler :
3j1rtl7zsgt6.jpg


If you want the same style like the the other tiles, you also have to add it to highlights.xml file.
In this xml are styles set by bc1. the problem is that the color set there is fixed. that's why you would have to make a new entry there, if you want another color. Without editing highlights.xml, you can only edging the tiles with any color.

What to do?:
In both cases you have to edit the CityView.lua, found in the CityView directory from UI_bc1.
Go to line ~ 1359. There is the code we are looking for. It should look like this:
Spoiler :
Code:
				if city:IsWorkingPlot( plot ) then

					-- The city itself
					if cityPlotIndex == 0 then
						iconID = 11
						tipKey = "TXT_KEY_CITYVIEW_CITY_CENTER"

					-- FORCED worked plot
					elseif city:IsForcedWorkingPlot( plot ) then
						iconID = 10
						tipKey = "TXT_KEY_CITYVIEW_FORCED_WORK_TILE"

					-- AI-picked worked plot
					else
						iconID = 0
						tipKey = "TXT_KEY_CITYVIEW_GUVNA_WORK_TILE"
					end
					if notInStrategicView then
						Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedFill" )
						Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedOutline" )
					end

For just colouring the borders from each tile, change it to this:

Spoiler :
Code:
				if city:IsWorkingPlot( plot ) then
                    
					-- The city itself
					if cityPlotIndex == 0 then
						iconID = 11
						tipKey = "TXT_KEY_CITYVIEW_CITY_CENTER"

					-- FORCED worked plot
					elseif city:IsForcedWorkingPlot( plot ) then
						iconID = 10
						tipKey = "TXT_KEY_CITYVIEW_FORCED_WORK_TILE"

					-- AI-picked worked plot
					else
						iconID = 0
						tipKey = "TXT_KEY_CITYVIEW_GUVNA_WORK_TILE"
					end
					if notInStrategicView then
                        if city:IsForcedWorkingPlot( plot ) then
                            Events.SerialEventHexHighlight( hexPos , true, Vector4( 0.7, 0, 0, 1 )) -- red color
                            Events.SerialEventHexHighlight( hexPos , true, Vector4( 0.7, 0, 0, 1 ))
                        else
                            Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedFill" )
                            Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedOutline" )
                        end
					end
to be able to use the command "Vector4", you also have to add
Code:
include("FLuaVector")
in the beginning of the script, were the other things are included, around line 34.
In this code I used Vector4(0.7,0,0,1) which is the color red. You can also try some other combinations for different colors. Some working combinations can be found here:
http://modiki.civfanatics.com/index.php/Events.SerialEventHexHighlight_(Civ5_API)
I think you also have to add your new color change to the clearing system at line 1319. I think it should be something like:
Code:
Events.SerialEventHexHighlight( hexPos , false, Vector4( 0.7, 0, 0, 1 ))
(But you should write it somewhre, after the variable "hexPos" is defined. So maybe in line 1358 ... not tested)
______________________________________________________________________

If you want the same style and edit the highlights.xml, then open the highlights.xml file, that can be found in UI_bc1/Core.
Now simply copy paste the exisiting two "Worked" entries and add something like this:
Code:
    <style name="WorkedFillLocked" type="FilledHex" width ="1" color="255,0,0,50" />
	<style name="WorkedOutlineLocked" type="SplineBorder" width ="7" texture="hex_contour1.dds" color="255,0,0,164" />
The numbers in color="R,G,B,I" are Red, Green, Blue, Intensity. With the combination above it would be red. Just choose the color you prefer.

Now that we have new highlight styles named WorkedFillLocked and WorkedOutlineLocked, you can add them in the CityView.lua.
For that we don't need the Vector4, so we also don't need the including FluaVector thing.
Screenshot:
Spoiler :
7ghnk6k6lzz.jpg

The code would be:

Spoiler :
Code:
				if city:IsWorkingPlot( plot ) then
                    
					-- The city itself
					if cityPlotIndex == 0 then
						iconID = 11
						tipKey = "TXT_KEY_CITYVIEW_CITY_CENTER"

					-- FORCED worked plot
					elseif city:IsForcedWorkingPlot( plot ) then
						iconID = 10
						tipKey = "TXT_KEY_CITYVIEW_FORCED_WORK_TILE"

					-- AI-picked worked plot
					else
						iconID = 0
						tipKey = "TXT_KEY_CITYVIEW_GUVNA_WORK_TILE"
					end
					if notInStrategicView then
                        if city:IsForcedWorkingPlot( plot ) then
                            Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedFillLocked") 
                            Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedOutlineLocked")
                        else
                            Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedFill" )
                            Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedOutline" )
                        end
					end

Ah I forgot:
Of course you have to add your new style also to the clearing system in line 1319 in CityView.lua!
Code:
Events.ClearHexHighlightStyle( "WorkedFillLocked" )
Events.ClearHexHighlightStyle( "WorkedOutlineLocked" )
 
So is the stuck tooltip fixed now or what?
I think no.
Someone needs to find out what is causing it...
@Mustakrakish and all who have this bug:
Is there an error in your lua.log when this happens?
Or do you know a way to reproduce the bug? Because on my laptop I've never seen this bug.
 
^ That looks like a bit more work than unchecking stuff in the options menu, but I will try it out later. :D
Edit: Can I change the color of the AI worked hexes as well? I would like the AI worked hexes to be red and the force worked hexes to be green if thats possible. And is it possible to change the color of the icons? Is there an image file somewhere that I can edit with paint for example, to get red citizen head icons and whatever color lock icons for example?

While I am working on the edging, is there now a way to rearrange the PlotHelp tool tip box that appears when i hover over a hex, so that it is not tied to the courser anymore? I would prefer the box in the corner of the screen instead, somewhere next to the minimap, where the terrain info is displayed in the vanilla game iirc. (http://imgur.com/uhnkyaT.jpg) I asked this a while ago, but apparently no one knew how to do it...
 
That looks like a bit more work than unchecking stuff in the options menu, but I will try it out later. :D
Edit: Can I change the color of the AI worked hexes as well? I would like the AI worked hexes to be red and the force worked hexes to be green if thats possible.
The code I posted is easy to read ;) You see the comments that starts with "--".
There you see, that we can identify the city itself, the locked plots, and the AI worked plots. So if you want to change the color from the AI worked plots instead, just change
Spoiler :
Code:
                        [B]if city:IsForcedWorkingPlot( plot ) then[/B]
                            Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedFillLocked") 
                            Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedOutlineLocked")
                        else
                            Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedFill" )
                            Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedOutline" )
                        end
to
Spoiler :
Code:
                        [B]if not cityPlotIndex == 0 and not city:IsForcedWorkingPlot( plot ) then[/B]
                            Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedFillLocked") 
                            Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedOutlineLocked")
                        else
                            Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedFill" )
                            Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedOutline" )
                        end
And is it possible to change the color of the icons? Is there an image file somewhere that I can edit with paint for example, to get red citizen head icons and whatever color lock icons for example?
Most icon files, like the one that has this locked symbol, are packed. So you need to unpack them first. You can find them in Ressource/DX9 from your game folder.
The icon we are looking for is in the file citizenicons180.dds. This dds file can be found in UITextures.fpk in that DX9 folder. You can unpack the fpk file with the "Dragon unpacker" you can find here: http://modiki.civfanatics.com/index.php/Civ5_Useful_Programs. After unpacking the one dds file, you can edit it with Paint net.
I did this for you already. You can download the dds file with the red "locked icon" here:
http://www.file-upload.net/download-10760749/citizenicons180.dds.html
Simply copy it somewhere into the UI_bc1 folder, and it will be used instead of the original file.

While I am working on the edging,
My advise would be, to do it with the highligts.xml file... it looks better and I tested the clearing thing ^^
is there now a way to rearrange the PlotHelp tool tip box that appears when i hover over a hex, so that it is not tied to the courser anymore? I would prefer the box in the corner of the screen instead, somewhere next to the minimap, where the terrain info is displayed in the vanilla game iirc. (http://imgur.com/uhnkyaT.jpg) I asked this a while ago, but apparently no one knew how to do it...

I see in your screenshot, that the commands for your units are in top of the unit panel. Are you not using the newest version or did you already changed something in the Unitpanel?
Anyway, I don't know how much work it would be to change the Tooltip box... I will see if I find the code that does it and if I'm able to change this...
 
I see in your screenshot, that the commands for your units are in top of the unit panel. Are you not using the newest version or did you already changed something in the Unitpanel?
Anyway, I don't know how much work it would be to change the Tooltip box... I will see if I find the code that does it and if I'm able to change this...
I am using the newest version, this was just an old screenshot.

Thanks for all the help, I'll report back after I got everything to work. :)
 
I am using the newest version, this was just an old screenshot.

Thanks for all the help, I'll report back after I got everything to work. :)

okay ;)

I took a quick look at the Tooltip thing... the problem is I have absolut no experience with those textboxes. I don't know how to change anything with those and do not have the time to learn everything about it =/

So no, I'm not able to change position of the text boxes.
But if someone has a lua.log with an error in it, can try to solve the "stucked tooltip" bug.
 
It's working! Almost...

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?
 
It's working! Almost...
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.
So you want in CityView the icon for locked tiles to be red, but the tiles itself are green now? And the AI worked tiles are red? Isn't this confusing? :D

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?

Ah good you found the correct lua for the city banner :) I assume you also did the changes in the clearing system. This is important, because without it, the tile would be red for ever ^^ In CityBannerManager.lua it can be found in line 558 in the function ClearHexHighlights()

The reason why the city plot is red, is because "cityPlotIndex" is just a variable name, that was used in CityView.lua. Obviously it is not used in CityBannerManager.lua (you can set different kinds of variables. some are only used in one specific functions, some are used in the whole file and some are used over all files...cityPlotIndex is the first kind).
That's why the value of it is "nil" in the CityBannerManager.lua, which means basically "nothing". Nil is not the same like 0, so the script won't do the first from your code. It is also not a Working plot. So the cityplot is "else", therefore it gets red.

Better use the IsCity() function. And I think it is better to not use "else" here, since everything "else" would be red then. So to prevent other issues like the one with the city tile, we specify exactly which tile should be red. Also we can combinate the city and forced plots with an "or".
Spoiler :
Code:
if plot:IsCity() or city:IsForcedWorkingPlot( plot ) then
	Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedFill")
	Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedOutline")
elseif city:IsWorkingPlot( plot ) then
	Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedFillRed")
	Events.SerialEventHexHighlight( hexPos , true, nil, "WorkedOutlineRed")
end
 
I think EUI and Super Power mods are among the best mods for Civ V.
However I was trying to use both at the same time, deleting CityView.lua, CityView.xml, CityView_small.xml and UnitPanel.lua from Super Power Mod but all the yield resource icons are replaced by food icons when I open the city view.

Anyone can help me solving this? thanks ;)
 

Attachments

  • CivilizationV_DX11 2015-07-13 12-17-13-21.jpg
    CivilizationV_DX11 2015-07-13 12-17-13-21.jpg
    238.8 KB · Views: 172
I think EUI and Super Power mods are among the best mods for Civ V.
However I was trying to use both at the same time, deleting CityView.lua, CityView.xml, CityView_small.xml and UnitPanel.lua from Super Power Mod but all the yield resource icons are replaced by food icons when I open the city view.

Anyone can help me solving this? thanks ;)
delete the yieldiconmanager files from superpower mod
 
Has anyone noticed that in the latest version, you cannot delete units or annex puppeted cities?
 
Has anyone noticed that in the latest version, you cannot delete units or annex puppeted cities?

there were 2 users that also reported this, but no solution yet.
You could try to play with EUI only, so delete every other mods and try it again.
Also see the lua.log if there are some errors.
 
there were 2 users that also reported this, but no solution yet.
You could try to play with EUI only, so delete every other mods and try it again.
Also see the lua.log if there are some errors.

No mods running whatsoever. Playing same save game on my home computer with an older version of the EUI, and I can perform those functions there.
 
(I'm sure this has been mentioned before, but) Moving part of the top info icon buttons to the right places them right over the IGE icon's location. Kind of annoying, as it makes both pretty much unreadable. Otherwise, great job on this. ;)
 
Back
Top Bottom