DEADSOFTWARE

Cosmetic: Replace "goal" with "score" everywhere in game code
[d2df-sdl.git] / src / game / g_menu.pas
index 6f351683332b19aa23e217808de3688ff572db48..8d385ad8448441b69806254c84f8e222d3e720bc 100644 (file)
@@ -407,8 +407,7 @@ begin
         if gPlayer1.Team <> gPlayer1Settings.Team then
           gPlayer1.SwitchTeam;
       gPlayer1.WeapSwitchMode := gPlayer1Settings.WeaponSwitch;
-      if (gPlayer1.WeapSwitchMode = 2) then
-        gPlayer1.setWeaponPrefs(gPlayer1Settings.WeaponPreferences);
+      gPlayer1.setWeaponPrefs(gPlayer1Settings.WeaponPreferences);
       gPlayer1.SwitchToEmpty := gPlayer1Settings.SwitchToEmpty;
       gPlayer1.SkipFist := gPlayer1Settings.SkipFist;
       if g_Game_IsNet then MH_SEND_PlayerSettings(gPlayer1.UID);
@@ -424,14 +423,17 @@ begin
         if gPlayer2.Team <> gPlayer2Settings.Team then
           gPlayer2.SwitchTeam;
       gPlayer2.WeapSwitchMode := gPlayer2Settings.WeaponSwitch;
-      if (gPlayer2.WeapSwitchMode = 2) then
-        gPlayer2.setWeaponPrefs(gPlayer2Settings.WeaponPreferences);
+      gPlayer2.setWeaponPrefs(gPlayer2Settings.WeaponPreferences);
       gPlayer2.SwitchToEmpty := gPlayer2Settings.SwitchToEmpty;
       gPlayer2.SkipFist := gPlayer2Settings.SkipFist;
     end;
   end;
 
-  if g_Game_IsClient then MC_SEND_PlayerSettings;
+  if g_Game_IsClient then
+  begin
+    MC_SEND_PlayerSettings;
+    gPlayer1.setWeaponPrefs(gPlayer1Settings.WeaponPreferences);
+  end;
 
   g_Console_WriteGameConfig;
 end;
@@ -439,7 +441,7 @@ end;
 procedure ReadOptions();
 var
   menu: TGUIMenu;
-  i, a: Integer;
+  i: Integer;
 begin
   menu := TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu'));
 
@@ -746,7 +748,7 @@ begin
     Result := TGUISwitch(GetControl('swGameMode')).ItemIndex+1;
     gsGameMode := TGUISwitch(GetControl('swGameMode')).GetText;
     gsTimeLimit := StrToIntDef(TGUIEdit(GetControl('edTimeLimit')).Text, 0);
-    gsGoalLimit := StrToIntDef(TGUIEdit(GetControl('edGoalLimit')).Text, 0);
+    gsScoreLimit := StrToIntDef(TGUIEdit(GetControl('edScoreLimit')).Text, 0);
     gsMaxLives := StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
     gsItemRespawnTime := StrToIntDef(TGUIEdit(GetControl('edItemRespawnTime')).Text, 0);
     gsPlayers := TGUISwitch(GetControl('swPlayers')).ItemIndex;
@@ -797,7 +799,7 @@ begin
   if GameMode = GM_NONE then Exit;
 
   g_Console_WriteGameConfig;
-  g_Game_StartCustom(gsMap, GameMode, gsTimeLimit, gsGoalLimit,
+  g_Game_StartCustom(gsMap, GameMode, gsTimeLimit, gsScoreLimit,
                      gsMaxLives, gsGameFlags, gsPlayers);
 end;
 
@@ -820,7 +822,7 @@ begin
   end;
 
   g_Console_WriteGameConfig;
-  g_Game_StartServer(gsMap, GameMode, gsTimeLimit, gsGoalLimit, gsMaxLives,
+  g_Game_StartServer(gsMap, GameMode, gsTimeLimit, gsScoreLimit, gsMaxLives,
                      gsGameFlags, gsPlayers, 0, NetPort);
 end;
 
@@ -1781,7 +1783,7 @@ begin
         ItemIndex := 2;
 
     TGUIEdit(menu.GetControl('edTimeLimit')).Text := IntToStr(TimeLimit);
-    TGUIEdit(menu.GetControl('edGoalLimit')).Text := IntToStr(GoalLimit);
+    TGUIEdit(menu.GetControl('edScoreLimit')).Text := IntToStr(ScoreLimit);
     TGUIEdit(menu.GetControl('edMaxLives')).Text := IntToStr(MaxLives);
 
     with TGUISwitch(menu.GetControl('swBotsVS')) do
@@ -1810,8 +1812,8 @@ begin
         end;
         TGUIEdit(menu.GetControl('edTimeLimit')).Enabled := True;
         TGUILabel(menu.GetControlsText('edTimeLimit')).Color := MENU_ITEMSTEXT_COLOR;
-        TGUIEdit(menu.GetControl('edGoalLimit')).Enabled := True;
-        TGUILabel(menu.GetControlsText('edGoalLimit')).Color := MENU_ITEMSTEXT_COLOR;
+        TGUIEdit(menu.GetControl('edScoreLimit')).Enabled := True;
+        TGUILabel(menu.GetControlsText('edScoreLimit')).Color := MENU_ITEMSTEXT_COLOR;
         TGUIEdit(menu.GetControl('edMaxLives')).Enabled := True;
         TGUILabel(menu.GetControlsText('edMaxLives')).Color := MENU_ITEMSTEXT_COLOR;
         TGUISwitch(menu.GetControl('swBotsVS')).Enabled := True;
@@ -1829,12 +1831,12 @@ begin
           Text := '';
         end;
         TGUILabel(menu.GetControlsText('edTimeLimit')).Color := MENU_UNACTIVEITEMS_COLOR;
-        with TGUIEdit(menu.GetControl('edGoalLimit')) do
+        with TGUIEdit(menu.GetControl('edScoreLimit')) do
         begin
           Enabled := False;
           Text := '';
         end;
-        TGUILabel(menu.GetControlsText('edGoalLimit')).Color := MENU_UNACTIVEITEMS_COLOR;
+        TGUILabel(menu.GetControlsText('edScoreLimit')).Color := MENU_UNACTIVEITEMS_COLOR;
         with TGUIEdit(menu.GetControl('edMaxLives')) do
         begin
           Enabled := False;
@@ -1899,12 +1901,12 @@ begin
         end;
     end;
 
-    if TGUIEdit(menu.GetControl('edGoalLimit')).Enabled then
+    if TGUIEdit(menu.GetControl('edScoreLimit')).Enabled then
     begin
-      n := StrToIntDef(TGUIEdit(menu.GetControl('edGoalLimit')).Text, GoalLimit);
+      n := StrToIntDef(TGUIEdit(menu.GetControl('edScoreLimit')).Text, ScoreLimit);
 
       if n = 0 then
-        GoalLimit := 0
+        ScoreLimit := 0
       else
         begin
           b := 0;
@@ -1917,15 +1919,15 @@ begin
                     b := stat[a].Frags;
             end
           else // CTF
-            b := Max(gTeamStat[TEAM_RED].Goals, gTeamStat[TEAM_BLUE].Goals);
+            b := Max(gTeamStat[TEAM_RED].Score, gTeamStat[TEAM_BLUE].Score);
 
-          GoalLimit := Max(n, b);
+          ScoreLimit := Max(n, b);
         end;
     end;
 
     if TGUIEdit(menu.GetControl('edMaxLives')).Enabled then
     begin
-      n := StrToIntDef(TGUIEdit(menu.GetControl('edMaxLives')).Text, GoalLimit);
+      n := StrToIntDef(TGUIEdit(menu.GetControl('edMaxLives')).Text, MaxLives);
       if n < 0 then n := 0;
       if n > 255 then n := 255;
       if n = 0 then
@@ -1976,7 +1978,7 @@ begin
     // don't forget to latch this shit
     gsGameFlags := Options;
     gsMaxLives := MaxLives;
-    gsGoalLimit := GoalLimit;
+    gsScoreLimit := ScoreLimit;
     gsTimeLimit := TimeLimit;
   end;
 
@@ -2185,7 +2187,7 @@ procedure CreateAllMenus();
 var
   Menu: TGUIWindow;
   //SR: TSearchRec;
-  a, cx, _y, i, x: Integer;
+  a, cx, _y, i: Integer;
   //list: SSArray;
 begin
   Menu := TGUIWindow.Create('MainMenu');
@@ -2215,8 +2217,8 @@ begin
     Name := 'mmNewGameMenu';
     AddButton(@ProcSingle1Player, _lc[I_MENU_1_PLAYER]);
     AddButton(@ProcSingle2Players, _lc[I_MENU_2_PLAYERS]);
-    AddButton(nil, _lc[I_MENU_CUSTOM_GAME], 'CustomGameMenu');
     AddButton(@ProcSelectCampaignMenu, _lc[I_MENU_CAMPAIGN], 'CampaignMenu');
+    AddButton(nil, _lc[I_MENU_CUSTOM_GAME], 'CustomGameMenu');
   end;
   Menu.DefControl := 'mmNewGameMenu';
   g_GUI_AddWindow(Menu);
@@ -2311,14 +2313,14 @@ begin
       if gsTimeLimit > 0 then
         Text := IntToStr(gsTimeLimit);
     end;
-    with AddEdit(_lc[I_MENU_GOAL_LIMIT]) do
+    with AddEdit(_lc[I_MENU_SCORE_LIMIT]) do
     begin
-      Name := 'edGoalLimit';
+      Name := 'edScoreLimit';
       OnlyDigits := True;
       Width := 4;
       MaxLength := 5;
-      if gsGoalLimit > 0 then
-        Text := IntToStr(gsGoalLimit);
+      if gsScoreLimit > 0 then
+        Text := IntToStr(gsScoreLimit);
     end;
     with AddEdit(_lc[I_MENU_MAX_LIVES]) do
     begin
@@ -2559,14 +2561,14 @@ begin
       if gsTimeLimit > 0 then
         Text := IntToStr(gsTimeLimit);
     end;
-    with AddEdit(_lc[I_MENU_GOAL_LIMIT]) do
+    with AddEdit(_lc[I_MENU_SCORE_LIMIT]) do
     begin
-      Name := 'edGoalLimit';
+      Name := 'edScoreLimit';
       OnlyDigits := True;
       Width := 4;
       MaxLength := 5;
-      if gsGoalLimit > 0 then
-        Text := IntToStr(gsGoalLimit);
+      if gsScoreLimit > 0 then
+        Text := IntToStr(gsScoreLimit);
     end;
     with AddEdit(_lc[I_MENU_MAX_LIVES]) do
     begin
@@ -3658,9 +3660,9 @@ begin
       Width := 4;
       MaxLength := 5;
     end;
-    with AddEdit(_lc[I_MENU_GOAL_LIMIT]) do
+    with AddEdit(_lc[I_MENU_SCORE_LIMIT]) do
     begin
-      Name := 'edGoalLimit';
+      Name := 'edScoreLimit';
       OnlyDigits := True;
       Width := 4;
       MaxLength := 5;