[BTS] Quality of Life: Info Screen Portrait of Chosen Leader

Kjotleik

Kjotleik
Joined
Feb 22, 2010
Messages
451
Location
Norway
I've always found it peculiar (just another word for annoying) that after a game - when you go to the Info Screen that comes up after the replay, and choose the Statistics screen - you get to see your portrait, but when you choose another leader you don't see their face.

I don't know if this has been known for a long time here (I did search, but found nothing), so I create this thread to inform you where you need to change one small thing. If you want the QoL of seeing the pleading face of Catherine after you've crushed her under the feet of your mighty Greek armies!

First: The result:
Spoiler Same game, two portraits :

SameGameTwoPortraits.jpg



Spoiler CvInfoScreen.py :

In the file CvInfoScreen.py, around line 2670-2680 somewhere...
BAD CODE:
# Leaderhead graphic
player = gc.getPlayer(gc.getPlayer(gc.getGame().getActivePlayer())

GOOD CODE:
# Leaderhead graphic
player = gc.getPlayer(self.iActivePlayer)



I have no idea WHY this works. But it does. I don't know anything about Python myself. But I can read. I can also CTRL+C and CTRL+V, as well as typing what I've just seen. That is apparantly enough to get by. At least for a little while... :D
 
The top one asks the game for the active player, which is the human player (local in case of multiplayer). The second line asks python for whatever it placed in self.iActivePlayer. Sounds to me like somebody decided active player is the one being displayed by python and got confused because python active player isn't the same as the active player in the dll file.
In other words it's a bug, which is due to confusing names. There are rules for naming variables to avoid bugs and having two "active player" linking to different players should likely be rule #1.
 
The top one asks the game for the active player, which is the human player (local in case of multiplayer). The second line asks python for whatever it placed in self.iActivePlayer.
In other words it's a bug...

Thank you for the explanation. That makes sense. I don't know enough Python to determine if that is a bug, or not. I appreciate your explanation. It helps me understand it a little bit better.
 
Back
Top Bottom