Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Character name and level/class isn't aligned properly after logging in #17

Open
marcusmoller opened this issue Jul 30, 2013 · 3 comments
Labels

Comments

@marcusmoller
Copy link
Owner

This only happens in the start. Switching to another character and returning to the first character fixes the alignment.

I can't seem to figure out what the problem is. I've tried forcing a resize (.chsize) when initially loading the character selection screen - but no success so far.

@Irtorius
Copy link
Contributor

In menuchar.py
self.lblPlayerName = gui.Label('#PLAYER_NAME', antialias=0, color=(255, 0, 0), font=g.charSelFont)

It's something with #PLAYER_NAME, I can't figure out how #PLAYER_NAME is assigned though
Hopefully this helps

@Irtorius
Copy link
Contributor

This bug really goes on my nerves, it's not logical in anyway. I will feel really satisfied, and possibly annoyed(because it took so long to find the bug), when I find out what's causing trouble.

@marcusmoller
Copy link
Owner Author

'#PLAYER_NAME' is nothing but a string. I used it as an easy-to-identify-and-search-for placeholder for the players name.

'#PLAYER_NAME' (or rather, self.lblPlayerName) is changed when the player changes the character in the character selection: https://github.com/marcusmoller/pyorpg-client/blob/master/src/menu/menuchar.py#L147-L148

Back to the issue itself: It's as if pgu (the GUI toolkit we use) is unable to align the first character's name properly. This is, however, done properly on the next characters, due to pgu telling itself that the label has changed and therefore needs to align it properly, depending on the width of the character name.

So the problem seems to be that pgu is unable itself this on the first lblPlayerName assign.

We might be able to hack around this, by forcing in a self.lblPlayerName.chsize(), which should force pgu to recognize a label change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants