DEADSOFTWARE

render: draw touch controls via render
[d2df-sdl.git] / src / game / g_console.pas
index 91131d1d91e75bba067c9927f5d86ea118de5ef7..2c0bf6145fa7109d51ab4ecb68d5f81902c63004 100644 (file)
@@ -100,8 +100,11 @@ var
 implementation
 
 uses
-  {$IFNDEF HEADLESS}
-    g_gui, g_menu, g_touch,
+  {$IFDEF ENABLE_MENU}
+    g_gui, g_menu,
+  {$ENDIF}
+  {$IFDEF ENABLE_TOUCH}
+    g_system,
   {$ENDIF}
   g_textures, e_input, g_game, g_gfx, g_player, g_items,
   SysUtils, g_basic, g_options, Math, e_res,
@@ -154,6 +157,7 @@ var
     rep: Boolean;
     down, up: SSArray;
   end;
+
   menu_toggled: BOOLEAN; (* hack for menu controls *)
 
 procedure g_Console_Switch;
@@ -161,8 +165,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;
 
@@ -175,8 +179,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;
 
@@ -871,11 +875,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
@@ -884,7 +888,9 @@ begin
       else if gChatShow then
         g_Console_Chat_Switch
       else
+      begin
         KeyPress(VK_ESCAPE);
+      end;
       menu_toggled := True
     end;
   'toggleconsole':
@@ -1768,7 +1774,7 @@ function BindsAllowed (key: Integer): Boolean;
   var grab, active: Boolean;
 begin
   Result := False;
-  {$IFDEF HEADLESS}
+  {$IFDEF DISABLE_MENU}
     grab := False;
     active := False;
   {$ELSE}
@@ -1811,7 +1817,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;