GNOME Bugzilla – Bug 552963
Default to use appropriate player name for high score list
Last modified: 2008-12-15 04:02:31 UTC
Unlike most gnome games, gtali allows multiple human players, and it lets the human players select a name different from the name associated with the login. GTali should use the Player Name of the winning player as the default value should someone make the high score list.
Created attachment 119025 [details] [review] Change name default for high score This patch changes the default name for the high score list to use the player name of the winning human player. I've also added my name to the credits in a fit of shameless self-promotion.
Created attachment 119748 [details] [review] Corrected patch implementing the new score behavior The previous patch always used the user defined name, even when the player overwrites it in the score dialog. This patch allows the update to happen correctly. The problem before was that games_scores_update_score would only change a name when the old name was the g_get_real_name() value for the person logged in. This patch creates a new function, games_scores_update_score_name, which takes in an extra argument, gchar *old_name. When that is not NULL, the code compares the name in the list against the old_name argument. When it is NULL, it sets old_name to g_get_real_name() and acts as before. I've converted games_scores_update to a wrapper which calls games_scores_update_name with a NULL old_name argument (to preserve backwards compatibility). So now when the player changes a name in the scores dialog, it first looks up the old name, then passes that string to games_scores_update_name in addition to the new name. This achieves the desired results: by default, the name in the high score list is the name the player chose in gtali, but if the player enters a different name, that is now stored correctly.
Commited to trunk. Thanks!