added request to use current setup values for newly created users
authorHolger Schemel <info@artsoft.org>
Sat, 24 Oct 2020 22:10:21 +0000 (00:10 +0200)
committerHolger Schemel <info@artsoft.org>
Sun, 13 Dec 2020 23:58:00 +0000 (00:58 +0100)
src/screens.c

index e5741bc01bd5bf81836133131ad40b71eba995ce..6f1e7f423dcdaa49c8b473559b57ad6522f265c0 100644 (file)
@@ -4102,6 +4102,7 @@ static void setTypeNameValues(char *name, struct TextPosInfo *pos,
 {
   boolean reset_setup = strEqual(name, "");
   boolean remove_user = strEqual(name, EMPTY_PLAYER_NAME);
+  boolean create_user = strEqual(type_name_last, EMPTY_PLAYER_NAME);
 
   if (!changed)
     strcpy(name, type_name_last);
@@ -4128,8 +4129,10 @@ static void setTypeNameValues(char *name, struct TextPosInfo *pos,
     // temporarily change active user to edited user
     user.nr = type_name_nr;
 
-    // load setup of edited user
-    LoadSetup();
+    // load setup of edited user (unless creating user with current setup)
+    if (!create_user ||
+       !Request("Use current setup values for the new player?", REQ_ASK))
+      LoadSetup();
   }
 
   // change name of edited user in setup structure