X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fscreens.c;h=16a3fc1b77b8e2e57758487aa5bd2258935eaba5;hb=02a095de0eb40735cb15b3f043c1639dbd883ce1;hp=4d5c8b18cbf992b9fa4f516fffccb433c8628c83;hpb=512f7bbfa113ed92bebc8a3a7d436b38c0227d59;p=rocksndiamonds.git diff --git a/src/screens.c b/src/screens.c index 4d5c8b18..16a3fc1b 100644 --- a/src/screens.c +++ b/src/screens.c @@ -252,6 +252,7 @@ static void DrawChooseLevelSet(void); static void DrawChooseLevelNr(void); static void DrawInfoScreen(void); static void DrawSetupScreen(void); +static void DrawTypeName(void); static void DrawInfoScreen_NotAvailable(char *, char *); static void DrawInfoScreen_HelpAnim(int, int, boolean); @@ -2080,7 +2081,7 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) { SetGameStatus(GAME_MODE_PSEUDO_TYPENAME); - HandleTypeName(strlen(setup.player_name), 0); + DrawTypeName(); } } else if (pos == MAIN_CONTROL_LEVELS) @@ -3960,7 +3961,7 @@ void HandleInfoScreen(int mx, int my, int dx, int dy, int button) // type name functions // ============================================================================ -void HandleTypeName(int newxpos, Key key) +static void HandleTypeNameExt(boolean initialize, Key key) { static char last_player_name[MAX_PLAYER_NAME_LEN + 1]; struct MainControlInfo *mci = getMainControlInfo(MAIN_CONTROL_NAME); @@ -3977,11 +3978,11 @@ void HandleTypeName(int newxpos, Key key) DrawBackgroundForFont(startx,starty, pos->width, pos->height, font_active_nr); - if (newxpos) + if (initialize) { strcpy(last_player_name, setup.player_name); - xpos = newxpos; + xpos = strlen(setup.player_name); StartTextInput(startx, starty, pos->width, pos->height); } @@ -4034,6 +4035,16 @@ void HandleTypeName(int newxpos, Key key) } } +static void DrawTypeName(void) +{ + HandleTypeNameExt(TRUE, 0); +} + +void HandleTypeName(Key key) +{ + HandleTypeNameExt(FALSE, key); +} + // ============================================================================ // tree menu functions