DEADSOFTWARE

game: set randomized rulez respawn to false
[d2df-sdl.git] / src / game / g_menu.pas
index 05abeb44224d3b14fdfbd342068344e0067e0473..b4a4dfd4095fa077ebe7f4ef9b6e80d183abaa48 100644 (file)
@@ -736,12 +736,15 @@ begin
     gsScoreLimit := StrToIntDef(TGUIEdit(GetControl('edScoreLimit')).Text, 0);
     gsMaxLives := StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
     gsItemRespawnTime := StrToIntDef(TGUIEdit(GetControl('edItemRespawnTime')).Text, 0);
+    gsRulezTimeMultiplier := StrToIntDef(TGUIEdit(GetControl('edRulezTimeMultiplier')).Text, 0);
     gsPlayers := TGUISwitch(GetControl('swPlayers')).ItemIndex;
     gsMap := Map;
 
     gsGameFlags := 0;
     if TGUISwitch(GetControl('swTeamDamage')).ItemIndex = 0 then
       gsGameFlags := gsGameFlags or GAME_OPTION_TEAMDAMAGE;
+    if TGUISwitch(GetControl('swTeamAbsorbDamage')).ItemIndex = 0 then
+      gsGameFlags := gsGameFlags or GAME_OPTION_TEAMABSORBDAMAGE;
     if TGUISwitch(GetControl('swDeathmatchKeys')).ItemIndex = 0 then
       gsGameFlags := gsGameFlags or GAME_OPTION_DMKEYS;
     if TGUISwitch(GetControl('swEnableExits')).ItemIndex = 0 then
@@ -750,6 +753,8 @@ begin
       gsGameFlags := gsGameFlags or GAME_OPTION_WEAPONSTAY;
     if TGUISwitch(GetControl('swMonsters')).ItemIndex = 0 then
       gsGameFlags := gsGameFlags or GAME_OPTION_MONSTERS;
+    if TGUISwitch(GetControl('swRulezRandom')).ItemIndex = 0 then
+      gsGameFlags := gsGameFlags or GAME_OPTION_RULEZRANDOM;
 
     case TGUISwitch(GetControl('swTeamHit')).ItemIndex of
       1: gsGameFlags := gsGameFlags or GAME_OPTION_TEAMHITTRACE;
@@ -771,6 +776,7 @@ begin
 
     // TODO: get this crap out of here
     gGameSettings.ItemRespawnTime := gsItemRespawnTime;
+    gGameSettings.RulezTimeMultiplier := gsRulezTimeMultiplier;
     gGameSettings.WarmupTime := gsWarmupTime;
     gGameSettings.SpawnInvul := gsSpawnInvul;
   end;
@@ -1988,7 +1994,7 @@ begin
     if list <> nil then
     begin
       Items := list;
-      ItemIndex := Length(list)
+      ItemIndex := -1; (* nothing selected *)
     end
     else
     begin
@@ -2004,7 +2010,7 @@ begin
 
   TempResScale := Round(r_pixel_scale - 1);
   with TGUISwitch(menu.GetControl('swResFactor')) do
-    ItemIndex := Min(TempResScale, gRC_Width div 640 - 1);
+    ItemIndex := Max(Min(TempResScale, gRC_Width div 640 - 1), 0);
 end;
 
 procedure ProcApplyVideoOptions();
@@ -2325,6 +2331,15 @@ begin
       if gsItemRespawnTime > 0 then
         Text := IntToStr(gsItemRespawnTime);
     end;
+    with AddEdit(_lc[I_MENU_RULEZ_RESPAWN_MULTIPLIER]) do
+    begin
+      Name := 'edRulezTimeMultiplier';
+      OnlyDigits := True;
+      Width := 4;
+      MaxLength := 5;
+      if gsRulezTimeMultiplier > 0 then
+        Text := IntToStr(gsRulezTimeMultiplier);
+    end;
     with AddSwitch(_lc[I_MENU_PLAYERS]) do
     begin
       Name := 'swPlayers';
@@ -2359,6 +2374,16 @@ begin
       else
         ItemIndex := 3;
     end;
+    with AddSwitch(_lc[I_MENU_ENABLE_TEAM_DAMAGE_ABSOBR]) do
+    begin
+      Name := 'swTeamAbsorbDamage';
+      AddItem(_lc[I_MENU_YES]);
+      AddItem(_lc[I_MENU_NO]);
+      if LongBool(gsGameFlags and GAME_OPTION_TEAMABSORBDAMAGE) then
+        ItemIndex := 0
+      else
+        ItemIndex := 1;
+    end;
     with AddSwitch(_lc[I_MENU_DEATHMATCH_KEYS]) do
     begin
       Name := 'swDeathmatchKeys';
@@ -2399,6 +2424,16 @@ begin
       else
         ItemIndex := 1;
     end;
+    with AddSwitch(_lc[I_MENU_ENABLE_RULEZ_RANDOM]) do
+    begin
+      Name := 'swRulezRandom';
+      AddItem(_lc[I_MENU_YES]);
+      AddItem(_lc[I_MENU_NO]);
+      if LongBool(gsGameFlags and GAME_OPTION_RULEZRANDOM) then
+        ItemIndex := 0
+      else
+        ItemIndex := 1;
+    end;
     with AddSwitch(_lc[I_MENU_BOTS_VS]) do
     begin
       Name := 'swBotsVS';
@@ -2573,6 +2608,15 @@ begin
       if gsItemRespawnTime > 0 then
         Text := IntToStr(gsItemRespawnTime);
     end;
+    with AddEdit(_lc[I_MENU_RULEZ_RESPAWN_MULTIPLIER]) do
+    begin
+      Name := 'edRulezTimeMultiplier';
+      OnlyDigits := True;
+      Width := 4;
+      MaxLength := 5;
+      if gsRulezTimeMultiplier > 0 then
+        Text := IntToStr(gsRulezTimeMultiplier);
+    end;
     with AddSwitch(_lc[I_MENU_PLAYERS]) do
     begin
       Name := 'swPlayers';
@@ -2607,6 +2651,16 @@ begin
       else
         ItemIndex := 3;
     end;
+    with AddSwitch(_lc[I_MENU_ENABLE_TEAM_DAMAGE_ABSOBR]) do
+    begin
+      Name := 'swTeamAbsorbDamage';
+      AddItem(_lc[I_MENU_YES]);
+      AddItem(_lc[I_MENU_NO]);
+      if LongBool(gsGameFlags and GAME_OPTION_TEAMABSORBDAMAGE) then
+        ItemIndex := 0
+      else
+        ItemIndex := 1;
+    end;
     with AddSwitch(_lc[I_MENU_DEATHMATCH_KEYS]) do
     begin
       Name := 'swDeathmatchKeys';
@@ -2647,6 +2701,16 @@ begin
       else
         ItemIndex := 1;
     end;
+    with AddSwitch(_lc[I_MENU_ENABLE_RULEZ_RANDOM]) do
+    begin
+      Name := 'swRulezRandom';
+      AddItem(_lc[I_MENU_YES]);
+      AddItem(_lc[I_MENU_NO]);
+      if LongBool(gsGameFlags and GAME_OPTION_RULEZRANDOM) then
+        ItemIndex := 0
+      else
+        ItemIndex := 1;
+    end;
     with AddSwitch(_lc[I_MENU_BOTS_VS]) do
     begin
       Name := 'swBotsVS';
@@ -2782,7 +2846,7 @@ begin
       FixedLength := 10;
       Enabled := False;
     end;
-    with AddMemo(_lc[I_MENU_MAP_DESCRIPTION], 12, 4) do
+    with AddMemo(_lc[I_MENU_MAP_DESCRIPTION], 20, 4) do
     begin
       Name := 'meMapDescription';
     end;