Leaderhead buttons

vincentz

Programmer
Joined
Feb 4, 2009
Messages
3,614
Location
Denmark
Well, here I am again...

I was really tired of the mess in the info panel when there was a big stack.
In the top it was going off screen and the bottom was unreadable, so I decided to change things a bit :
vHGC5yb.jpg


Problem is that it isnt Elisabeth's units but Willem's.
I sat until 3 am last night and couldnt get it to work, but I suspect it's a really easy fix, so if anyone could take a look at it, I'd appreciate it :D

I guess this is where the issue is :
PHP:
// Vincentz					szString.append(CvWString::format(SETCOLR L"%s" ENDCOLR, GET_PLAYER((PlayerTypes)iJ).getPlayerTextColorR(), GET_PLAYER((PlayerTypes)iJ).getPlayerTextColorG(), GET_PLAYER((PlayerTypes)iJ).getPlayerTextColorB(), GET_PLAYER((PlayerTypes)iJ).getPlayerTextColorA(), GET_PLAYER((PlayerTypes)iJ).getName()));
							szString.append(CvWString::format(L"<img=%S size=24></img>", GC.getLeaderHeadInfo((LeaderHeadTypes)iJ).getButton()));
 
strange part is, i can get the flag to show correctly, but not the leaderhead ???

szString.append(CvWString::format(L"<img=%S size=25></img>", GC.getCivilizationInfo(GET_PLAYER((PlayerTypes)iJ).getCivilizationType()).getButton()));

d5MWNfY.png
 
I would guess that Leaderheadtypes and Playertypes arent a perfectly matched list. You're using the same variable (iJ) to reference both but getting different results.
 
Followup: I did a quick parse through CvGameTextManager and saw leaderheadtypes referenced this way instead

Code:
GC.getLeaderHeadInfo(GET_PLAYER(ePlayer).getPersonalityType())
 
Yup, tried that one too iirc. Said something about ePlayer not int'ed. Also tried GET_PLAYER(activeowner) or something like that. Came up with an icon of a civ that wasnt even on map :crazyeye:

I think I have come to terms with it as is with the Flag instead of leadericon, even though the top shows name. Its easier to identify the small flag than a small leaderheadicon.
 
Code:
GC.getLeaderHeadInfo((LeaderHeadTypes)iJ).getButton()
Isn't iJ the Player ID and not the leadertype

Code:
GC.getLeaderHeadInfo(GET_PLAYER((PlayerTypes)iJ).getLeaderType()).getButton()
 
Back
Top Bottom