DEADSOFTWARE

gl: force camera at map center when screen larger than map
[d2df-sdl.git] / src / game / g_console.pas
index 514c69e0ee27a53cd303a83c2e534e9ba4c2ae9f..3005340534c6eec96e5553e1d1e7eef3eb3a51e9 100644 (file)
@@ -102,10 +102,25 @@ var
 implementation
 
 uses
-  {$IFNDEF HEADLESS}
-    g_gui, g_menu, g_touch,
+  {$IFDEF ENABLE_MENU}
+    g_gui, g_menu,
   {$ENDIF}
-  g_textures, e_input, g_game, g_gfx, g_player, g_items,
+  {$IFDEF ENABLE_TOUCH}
+    g_system,
+  {$ENDIF}
+  {$IFDEF ENABLE_GFX}
+    g_gfx,
+  {$ENDIF}
+  {$IFDEF ENABLE_GIBS}
+    g_gibs,
+  {$ENDIF}
+  {$IFDEF ENABLE_SHELLS}
+    g_shells,
+  {$ENDIF}
+  {$IFDEF ENABLE_CORPSES}
+    g_corpses,
+  {$ENDIF}
+  e_input, g_game, g_player, g_items,
   SysUtils, g_basic, g_options, Math, e_res,
   g_language, g_net, g_netmsg, e_log, conbuf, g_weapons,
   Keyboard;
@@ -157,6 +172,7 @@ var
     rep: Boolean;
     down, up: SSArray;
   end;
+
   menu_toggled: BOOLEAN; (* hack for menu controls *)
   ConsoleStdIn: Boolean;
 
@@ -165,8 +181,8 @@ begin
   gChatShow := False;
   gConsoleShow := not gConsoleShow;
   InputReady := False;
-  {$IFNDEF HEADLESS}
-    g_Touch_ShowKeyboard(gConsoleShow or gChatShow);
+  {$IFDEF ENABLE_TOUCH}
+    sys_ShowKeyboard(gConsoleShow or gChatShow);
   {$ENDIF}
 end;
 
@@ -179,8 +195,8 @@ begin
   InputReady := False;
   Line := '';
   CPos := 1;
-  {$IFNDEF HEADLESS}
-    g_Touch_ShowKeyboard(gConsoleShow or gChatShow);
+  {$IFDEF ENABLE_TOUCH}
+    sys_ShowKeyboard(gConsoleShow or gChatShow);
   {$ENDIF}
 end;
 
@@ -875,11 +891,11 @@ begin
   'unbindall':
     for i := 0 to e_MaxInputKeys - 1 do
       g_Console_BindKey(i, '');
-{$IFNDEF HEADLESS}
+{$IFDEF ENABLE_TOUCH}
   'showkeyboard':
-    g_Touch_ShowKeyboard(True);
+    sys_ShowKeyboard(True);
   'hidekeyboard':
-    g_Touch_ShowKeyboard(False);
+    sys_ShowKeyboard(False);
 {$ENDIF}
   'togglemenu':
     begin
@@ -888,7 +904,9 @@ begin
       else if gChatShow then
         g_Console_Chat_Switch
       else
+      begin
         KeyPress(VK_ESCAPE);
+      end;
       menu_toggled := True
     end;
   'toggleconsole':
@@ -1607,12 +1625,6 @@ begin
 
   //SetLength(ConsoleHistory, Length(ConsoleHistory)+1);
   //ConsoleHistory[High(ConsoleHistory)] := L;
-
-  (*
-{$IFDEF HEADLESS}
-  e_WriteLog('CON: ' + L, MSG_NOTIFY);
-{$ENDIF}
-  *)
 end;
 
 
@@ -1854,7 +1866,7 @@ function BindsAllowed (key: Integer): Boolean;
   var grab, active: Boolean;
 begin
   Result := False;
-  {$IFDEF HEADLESS}
+  {$IFDEF DISABLE_MENU}
     grab := False;
     active := False;
   {$ELSE}
@@ -1897,7 +1909,7 @@ end;
 procedure g_Console_ProcessBindRepeat (key: Integer);
   var i: Integer; active: Boolean;
 begin
-  {$IFDEF HEADLESS}
+  {$IFDEF DISABLE_MENU}
     active := False;
   {$ELSE}
     active := g_ActiveWindow <> nil;
@@ -2078,10 +2090,18 @@ begin
   WriteLn(f, 'sv_public ', IfThen(NetUseMaster, 1, 0));
 
   // game settings
-  WriteLn(f, 'g_max_particles ', g_GFX_GetMax());
-  WriteLn(f, 'g_max_shells ', g_Shells_GetMax());
-  WriteLn(f, 'g_max_gibs ', g_Gibs_GetMax());
-  WriteLn(f, 'g_max_corpses ', g_Corpses_GetMax());
+  {$IFDEF ENABLE_GFX}
+    WriteLn(f, 'g_max_particles ', g_GFX_GetMax());
+  {$ENDIF}
+  {$IFDEF ENABLE_SHELLS}
+    WriteLn(f, 'g_max_shells ', g_Shells_GetMax());
+  {$ENDIF}
+  {$IFDEF ENABLE_GIBS}
+    WriteLn(f, 'g_max_gibs ', g_Gibs_GetMax());
+  {$ENDIF}
+  {$IFDEF ENABLE_CORPSES}
+    WriteLn(f, 'g_max_corpses ', g_Corpses_GetMax());
+  {$ENDIF}
   WriteLn(f, 'g_force_model ', g_Force_Model_Get());
   WriteLn(f, 'g_force_model_name ', g_Forced_Model_GetName());
   WriteLn(f, 'sv_intertime ', gDefInterTime);