saving scores and usernames all work fine except when the cancel button is pressed on the input keyboard. the game just crashes for some reason.
I'm using these two codes straight from the example xna game with a little adjustments. what can i do to fix the cancel problem?
if (Guide.IsVisible == false)
{
object stateObj;
Guide.BeginShowKeyboardInput(PlayerIndex.One, "Game Over", "Please enter a name for the scoreboard (No longer than 10 characters)", "", GetText, stateObj = (object)"GetText for Input PlayerOne");
}
private void GetText(IAsyncResult result)
{
string resultString = Guide.EndShowKeyboardInput(result);
if (resultString.Length > 30)
{
resultString = resultString.Remove(30);
}
sblist.Clear();
int score = 0;
foreach (Obj o in ObjectList.objList)
{
if (o.GetType() == typeof(Player))
score = ((Player)o).score;
}
var userscore = new Score { Data = wave.ToString(), Points = score, UserName = resultString };
Mogade.SaveScore(MogadeHelper.LeaderboardId(Leaderboards.Main), userscore, ScoreResponseHandler);
}