X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_console.pas;h=aa06ac00c412c9a13c36afdac7d8dedb5920f8db;hb=23a883f6c44413c380997e61b00a756bda95bc03;hp=91131d1d91e75bba067c9927f5d86ea118de5ef7;hpb=e979719019322a78e7fded8fd96130c18cf31972;p=d2df-sdl.git diff --git a/src/game/g_console.pas b/src/game/g_console.pas index 91131d1..aa06ac0 100644 --- a/src/game/g_console.pas +++ b/src/game/g_console.pas @@ -100,10 +100,16 @@ 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} + g_textures, 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; @@ -154,6 +160,7 @@ var rep: Boolean; down, up: SSArray; end; + menu_toggled: BOOLEAN; (* hack for menu controls *) procedure g_Console_Switch; @@ -161,8 +168,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 +182,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 +878,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 +891,9 @@ begin else if gChatShow then g_Console_Chat_Switch else + begin KeyPress(VK_ESCAPE); + end; menu_toggled := True end; 'toggleconsole': @@ -1768,7 +1777,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 +1820,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; @@ -1991,7 +2000,9 @@ begin WriteLn(f, 'sv_public ', IfThen(NetUseMaster, 1, 0)); // game settings - WriteLn(f, 'g_max_particles ', g_GFX_GetMax()); + {$IFDEF ENABLE_GFX} + WriteLn(f, 'g_max_particles ', g_GFX_GetMax()); + {$ENDIF} WriteLn(f, 'g_max_shells ', g_Shells_GetMax()); WriteLn(f, 'g_max_gibs ', g_Gibs_GetMax()); WriteLn(f, 'g_max_corpses ', g_Corpses_GetMax());