Attitude Icons

Porges

Chieftain
Joined
Mar 28, 2006
Messages
50
Ok, so I took the idea from SimCutie's main interface mod, simplified it a bit and here it is:

Find CvMainInterface.py (in CustomAssets/python/screens), or if you have 12Monkey's PLE installed, to PLEMainInterface.py (CustomAssets/python/screens also). If you don't have either, just copy the file from your main CivIV directory.

Directly after the line:
Code:
szTempBuffer = u"%d: %s" %(gc.getGame().getPlayerScore(ePlayer), gc.getPlayer(ePlayer).getName())
Put the following code:
Code:
#attitude icons - start					

								if not gc.getPlayer(ePlayer).isHuman():

									iAtt = gc.getPlayer(ePlayer).AI_getAttitude(gc.getGame().getActivePlayer())

									att =  unichr(ord(unichr(CyGame().getSymbolID(FontSymbols.POWER_CHAR) + 4)) + iAtt)

									szTempBuffer = szTempBuffer + ( u" : %s" % att )
#attitude icons - end

If you want to hide dead players from the list, also scroll up a little and change:
Code:
if (gc.getPlayer(ePlayer).isEverAlive() and not gc.getPlayer(ePlayer).isMinorCiv()):
to
Code:
if (gc.getPlayer(ePlayer).isEverAlive() and not gc.getPlayer(ePlayer).isMinorCiv() and gc.getPlayer(ePlayer).isAlive()):#hide the dead ones

Download the attached font files and stick them in CustomAssets/res/fonts/

Looks like this (friendly icon not shown):
 

Attachments

  • fonts.zip
    134.9 KB · Views: 5,975
Porges said:
If you want to hide dead players from the list, also scroll up a little and change:
Code:
if (gc.getPlayer(ePlayer).isEverAlive() and not gc.getPlayer(ePlayer).isMinorCiv()):
to
Code:
if (gc.getPlayer(ePlayer).isEverAlive() and not gc.getPlayer(ePlayer).isMinorCiv() and gc.getPlayer(ePlayer).isAlive()):#hide the dead ones

Or you can use my Dead Civ Scoreboard mod which can do this or some other little things like grey out dead players, etc.
 
This mod is great - love the icons! However, my gamefont.tga file contains modded images that I need to retain - and I don't have the tools I need to copy the five smilies over to my current gamefont.tga. My gamefont files have the icons associated with Alulim's Alt Religion mod.

Those of you in the know recognize I'm fighting against Alpha Channels. I don't have a graphics background, so it is beyond my abilities to knowingly wade through the zillions of options available to us in these graphic programs. I'm using PaintShop Pro 5.

Now, it would be nice to upload these two tga files and ask for one of you wizards to make a quick edit, but CF won't let me upload tga files.

How can I best get help on copying the smilies from Porges' gamefont files to my own?
 
Whereabouts are the additional religion icons? You could try selecting the region around them to the edge of the TGA, then copy and paste it over the top of mine, lining up the edges of the pasted area and the image.

Failing that, find somewhere to upload them and I'll do it :)
 
Porges said:
Whereabouts are the additional religion icons? You could try selecting the region around them to the edge of the TGA, then copy and paste it over the top of mine, lining up the edges of the pasted area and the image.

Failing that, find somewhere to upload them and I'll do it :)

Thanks for the offer Porges. I've tried cutting and pasting, and it was easy for me to line up the image - the problem has been having them (the attitude smilies) display via CvMainScreen. There was one time when CvMainScreen displayed all kinds of junk on the game screen, but mostly CvMainScreen displays all icons correctly except the smilies I pasted in the gamefont and gamefont75 files.

I played around with PSP5 and got the Alpha Channel to show up (lots of gray boxes behind very crisp icon graphics), but when I tried to paste onto the layer with the gray boxes, it would paste the magenta outlines as well, along with all the black dithering outside adjacent icon images.

Anyway, I don't know how to work with this - and I think I'll see if I can learn how to do it through GIMP (because I eventually want to build new flags, new leaders, new civs that are not from Earth's history).

So, I've zipped the two gamefont files together - hopefully CF will let me upload ZIP files :) My gamefonts contain Alulim's Alt Religion mod icons instead of the vanilla religion icons (they're located at the same place in the gamefonts as the vanilla religion icons).

While I fumble around with learning GIMP, maybe you could quickly copy your smilies into my gamefont files?

A hearty Thank You!
Spocko
 

Attachments

  • GameFont_75.zip
    127.3 KB · Views: 337
Actually, I'm pretty sure that only the _75 version is used by my mod, so I just edited that one. If it turns out I'm wrong I'll upload the other as well :)
 

Attachments

  • GameFont_75.tga.zip
    50.9 KB · Views: 322
Porges said:
Actually, I'm pretty sure that only the _75 version is used by my mod, so I just edited that one. If it turns out I'm wrong I'll upload the other as well :)

Works great!!

Thank you!
Spocko
 
Good :)

I've updated the ones attached to my post, turns out the smilies were one pixel off :)
 
I really like this idea, however, it isn't working for me.

Do I have to put the CvMainInterface.py file into the custom assets or can I just put it in it's respective place for my mod?

I'd like to add this component into my mod but the problem I am having is that the smilies don't appear. I get a blank space where they should be.

Is this because of the file location or is because I loaded a previously saved game?


EDIT: I just thought maybe it was the way I entered the coding... and well now I lost the interface altogether... not sure why. :(
EDIT2: Well I fix the lost interface problem but still don't have the icons showing up... Is it because of the location of the icons in the TGA file perhaps?
 
OMG... you won't believe what the problem was...

I made my own icons and didn't use your game font file. Well that was it... for some odd reason it was just not seeing my icons... I put them in exactly the same place as you had yours and it didn't work.

Now I am going to just fix it up to have the icons I wanted in there and I'll be happy. :D
 
Ah, this was just what I was looking for. :)

However, I can't get it to work. :(

What happens is that I get neither the score/name/emotes shown, I only get displayed the trade route icon and the religion icon.

Ideas?
 
jgbaxter said:
Ah, this was just what I was looking for. :)

However, I can't get it to work. :(

What happens is that I get neither the score/name/emotes shown, I only get displayed the trade route icon and the religion icon.

Ideas?


It is probably the was you put the code into the file. Python is very unpredictable and must be perfect... one thing out of place and you get strange effects like that.

Last night I was having trouble getting this to work also... and because the emotes weren't showing up I thought it was the code... so I tried to fix it, not actually changing any of the code itself but rearranged it to look neater. Well, I lost the entire interface as a direct result, and because I had gone into world builder to place an AI unit near my first city to see if the emotes were working... I couldn't get out of the WB and so I had to alt-tab out and do the 3 finger salute. :p

Suffice it to say I suggest opening up the file again and paste the code exactly as it is without changing the way it is arranged and place it exactly after the line mentioned above. It works perfectly over here. So I don't think you'll have any problems if you try redoing it. ;)
 
no..it doesnt work with warlords yet..we're all trying to get it worked out..

right now it works unitl u build a wonder in that city..then it starts messing up
 
Well for the rest of the Warlords players (as discussed in other threads)

What it does is..when u first play..it works fine...but build a wonder in a city then go into the city screen. Notice a small delay? Now look in the bottom right side, it still shows the icons over the workers/people.

The cities with non-wonders work fine..but as you build wonders in towns, it starts slowing the fps in the city screens etc..
 
Are u sure u modified the right CvMainInterface.py and not just copied the 'non-warlods' one over ?
I just finished a game and opened several city screen with wonders or not, never noticed a delay and I dont see the icons on top of it.
 
Top Bottom