DEADSOFTWARE

net: it is now possible to use more than one master (use "List=host:port,host:port...
[d2df-sdl.git] / src / game / g_menu.pas
index 3a6f0e7d6efb7895642f1cd3f86bf1b5522e1354..2d83a526d2b53d96de91f4bcc2f3fb39169d4ec0 100644 (file)
@@ -45,11 +45,11 @@ uses
   {$INCLUDE ../nogl/noGLuses.inc}
   g_gui, g_textures, e_graphics, g_main, g_window, g_game, g_map,
   g_basic, g_console, g_sound, g_gfx, g_player, g_options, g_weapons,
-  e_log, SysUtils, CONFIG, g_playermodel, DateUtils, sdl2,
+  e_log, SysUtils, CONFIG, g_playermodel, DateUtils,
   MAPDEF, Math, g_saveload,
   e_texture, g_language,
   g_net, g_netmsg, g_netmaster, g_items, e_input, g_touch,
-  utils, wadreader;
+  utils, wadreader, g_system;
 
 
 type TYNCallback = procedure (yes:Boolean);
@@ -118,7 +118,8 @@ begin
 
   ovs := gVSync;
   gVSync := TGUISwitch(menu.GetControl('swVSync')).ItemIndex = 0;
-  if (ovs <> gVSync) then g_SetVSync(gVSync);
+  if (ovs <> gVSync) then
+    sys_EnableVSync(gVSync);
 
   gTextureFilter := TGUISwitch(menu.GetControl('swTextureFilter')).ItemIndex = 0;
   glLegacyNPOT := not (TGUISwitch(menu.GetControl('swLegacyNPOT')).ItemIndex = 0);
@@ -161,6 +162,7 @@ begin
   gRevertPlayers := TGUISwitch(menu.GetControl('swRevertPlayers')).ItemIndex = 0;
   gChatBubble := TGUISwitch(menu.GetControl('swChatBubble')).ItemIndex;
   gPlayerIndicator := TGUISwitch(menu.GetControl('swPlayerIndicator')).ItemIndex;
+  gPlayerIndicatorStyle := TGUISwitch(menu.GetControl('swPlayerIndicatorStyle')).ItemIndex;
   if TGUIScroll(menu.GetControl('scScaleFactor')).Value <> TempScale then
   begin
     TempScale := TGUIScroll(menu.GetControl('scScaleFactor')).Value;
@@ -571,6 +573,9 @@ begin
   with TGUISwitch(menu.GetControl('swPlayerIndicator')) do
     ItemIndex := gPlayerIndicator;
 
+  with TGUISwitch(menu.GetControl('swPlayerIndicatorStyle')) do
+    ItemIndex := gPlayerIndicatorStyle;
+
   TempScale := Round(g_dbg_scale - 1);
   TGUIScroll(menu.GetControl('scScaleFactor')).Value := TempScale;
 
@@ -806,7 +811,7 @@ begin
       NetInitDone := True;
   end;
 
-  g_Net_Slist_Set(NetSlistIP, NetSlistPort);
+  g_Net_Slist_Set(NetSlistIP, NetSlistPort, NetSlistList);
 
   gState := STATE_SLIST;
   g_ActiveWindow := nil;
@@ -814,7 +819,7 @@ begin
   slWaitStr := _lc[I_NET_SLIST_WAIT];
 
   g_Game_Draw;
-  ReDrawWindow;
+  sys_Repaint;
 
   slReturnPressed := True;
   if g_Net_Slist_Fetch(slCurrent) then
@@ -1820,7 +1825,6 @@ procedure ProcVideoOptionsRes();
 var
   menu: TGUIMenu;
   list: SSArray;
-  SR: DWORD;
 begin
   menu := TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu'));
 
@@ -1831,15 +1835,16 @@ begin
 
   with TGUIListBox(menu.GetControl('lsResolution')) do
   begin
-    list := GetDisplayModes(gBPP, SR);
-
+    list := sys_GetDispalyModes(gBPP);
     if list <> nil then
-      begin
-        Items := list;
-        ItemIndex := SR;
-      end
+    begin
+      Items := list;
+      ItemIndex := Length(list)
+    end
     else
-      Clear();
+    begin
+      Clear
+    end
   end;
 
   with TGUISwitch(menu.GetControl('swFullScreen')) do
@@ -2784,6 +2789,12 @@ begin
       AddItem(_lc[I_MENU_GAME_INDICATOR_OWN]);
       AddItem(_lc[I_MENU_GAME_INDICATOR_ALL]);
     end;
+    with AddSwitch(_lc[I_MENU_GAME_INDICATOR_STYLE]) do
+    begin
+      Name := 'swPlayerIndicatorStyle';
+      AddItem(_lc[I_MENU_GAME_INDICATOR_ARROW]);
+      AddItem(_lc[I_MENU_GAME_INDICATOR_NAME]);
+    end;
     with AddScroll(_lc[I_MENU_GAME_SCALE_FACTOR]) do
     begin
       Name := 'scScaleFactor';
@@ -2888,12 +2899,11 @@ begin
   begin
     Name := 'mOptionsControlsJoystickMenu';
     for i := 0 to e_MaxJoys - 1 do
-      if e_JoystickAvailable[i] then
-        with AddScroll(Format(_lc[I_MENU_CONTROL_DEADZONE], [i + 1])) do
-        begin
-          Name := 'scDeadzone' + IntToStr(i);
-          Max := 20
-        end
+      with AddScroll(Format(_lc[I_MENU_CONTROL_DEADZONE], [i + 1])) do
+      begin
+        Name := 'scDeadzone' + IntToStr(i);
+        Max := 20
+      end
   end;
   Menu.DefControl := 'mOptionsControlsJoystickMenu';
   g_GUI_AddWindow(Menu);