Show Influence

Moriboe

King
Joined
Nov 30, 2010
Messages
662
Location
Belgium
This is a simple mod that displays the influence of rival civilizations in the city state popup. It's useful alongside Gazebo's City State Diplomacy mod, for which I've witnessed influence go over 800. Good to know before trying to replace the culprit as ally. It looks like this:

attachment.php


This component overrides InfoTooltipInclude.lua. For mods also overriding this file, a merge is in order. I tagged my changes with "Moriboe". I will show this information in my (main) mod only if there is a "consulate" in the city state (founded by a great merchant or a wonder), but this would further reduce compatibility, so I left it out here.
 

Attachments

I guess so. Interface stuff is exposed through lua, and the icon can already change as it goes red if you're at war. Go for it! ;)
 
Out of interest, would it be possible to replace the CS' icon for it's allied major civ instead?



In CityBannerManager.lua (around line 412) add the magenta bits

Code:
        		--if( city:IsPuppet() or city:IsOccupied() ) then
        		--if( pOriginalOwner ~= player ) then
			
[COLOR="Magenta"]local iAlly = player:GetAlly() or -1
if (iAlly ~= -1) then 
  local allyType = Players[iAlly]:GetCivilizationType();
  local allyInfo = GameInfo.Civilizations[allyType];
  IconHookup( allyInfo.PortraitIndex, 32, allyInfo.AlphaIconAtlas, controls.MinorIndicator );

  local textColour, backColour = Players[iAlly]:GetPlayerColors();
  local allyColour = textColour;
  allyColour.w = 1;
  controls.MinorIndicator:SetColor( allyColour );
else[/COLOR]            	local _, originalColor = pOriginalOwner:GetPlayerColors();
            	originalColor.w = 1;
            	
				civType = pOriginalOwner:GetCivilizationType();
				civInfo = GameInfo.Civilizations[civType];
				IconHookup( civInfo.PortraitIndex, 32, civInfo.AlphaIconAtlas, controls.MinorIndicator );
				
				controls.MinorIndicator:SetColor( originalColor );
[COLOR="magenta"]end[/COLOR]
				controls.MinorIndicator:SetHide( false );
 


In CityBannerManager.lua (around line 412) add the magenta bits

Code:
        		--if( city:IsPuppet() or city:IsOccupied() ) then
        		--if( pOriginalOwner ~= player ) then
			
[COLOR="Magenta"]local iAlly = player:GetAlly() or -1
if (iAlly ~= -1) then 
  local allyType = Players[iAlly]:GetCivilizationType();
  local allyInfo = GameInfo.Civilizations[allyType];
  IconHookup( allyInfo.PortraitIndex, 32, allyInfo.AlphaIconAtlas, controls.MinorIndicator );

  local textColour, backColour = Players[iAlly]:GetPlayerColors();
  local allyColour = textColour;
  allyColour.w = 1;
  controls.MinorIndicator:SetColor( allyColour );
else[/COLOR]            	local _, originalColor = pOriginalOwner:GetPlayerColors();
            	originalColor.w = 1;
            	
				civType = pOriginalOwner:GetCivilizationType();
				civInfo = GameInfo.Civilizations[civType];
				IconHookup( civInfo.PortraitIndex, 32, civInfo.AlphaIconAtlas, controls.MinorIndicator );
				
				controls.MinorIndicator:SetColor( originalColor );
[COLOR="magenta"]end[/COLOR]
				controls.MinorIndicator:SetHide( false );

Very cool
 
I like this little mod. It's one I'm using. Also Whoward's modifications looks nice, I'll implement that.

I'm not using many mods, no InfoAddict for me, that's way too much info for me, but I think it's reasonable that you know what stake some other civ has in a City State you are at friendly terms with. :goodjob:
 
I think it's reasonable that you know what stake some other civ has in a City State you are at friendly terms with. :goodjob:
I changed it now to the way you say; before influence information would always be shown.
See OP for v2. Influence is now also only shown for players you have already met. Before if an unkown civ adopted Aesthetics, you would learn of its existence.
 
Ah, I need to re-download it then! I hadn't been trying to make a suggestion, I know the default game has some strange quirks of letting things happen between unknown parties, and I'm not sure what can be done against that, but I'm very happy with your mod!
Also Whoward's modification to the CS banner I've implemented, and that works very nicely. I think the first time I checked for it it looked like it didn't work, but it turned out to be Russia's black logo against the black CS banner... With dark logo's it doesn't look so great, but overall I like it.
 
It's a trade off, either the dark ones look bad or the light ones look bad, you can always switch the text/back colours by changing the line

Code:
local allyColour = textColour;

to

Code:
local allyColour = backColour;

It is possible to work out the luminance/hue from the RGB values and then pick the brightest of the the two - but that's overkill!
 
I lose upwards scrolling after adding the ally code and city banners also stay on top of everything - any ideas why?
 
Check the lua.log file for errors

I'm working on/off with updating my Government Buildings mod, which involves changes to TopPanel, so chances are it's more likely something I've done to that. Just don't remember any issues with city banners beforehand :)
 
Back
Top Bottom