X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_menu.pas;h=b84467fcc9c5052b997dce6079aab4098c585898;hb=67c6f2778c699f242412be03e2b874d14a7d10c9;hp=629c38c69adc30a0a8feccfefddf376c6f462480;hpb=b3e0744eff5ea17aaa2be71bde9bddba7f8d4f60;p=d2df-sdl.git diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas index 629c38c..b84467f 100644 --- a/src/game/g_menu.pas +++ b/src/game/g_menu.pas @@ -258,9 +258,10 @@ begin end; end; - if SDL_GetNumTouchDevices() > 0 then + if g_touch_enabled then begin menu := TGUIMenu(g_GUI_GetWindow('OptionsControlsTouchMenu').GetControl('mOptionsControlsTouchMenu')); + g_touch_alt := TGUISwitch(menu.GetControl('swTouchAlt')).ItemIndex = 1; g_touch_size := TGUIScroll(menu.GetControl('scTouchSize')).Value / 10 + 0.5; g_touch_fire := TGUISwitch(menu.GetControl('swTouchFire')).ItemIndex = 1; g_touch_offset := TGUIScroll(menu.GetControl('scTouchOffset')).Value * 5; @@ -454,9 +455,11 @@ begin end; end; - if SDL_GetNumTouchDevices() > 0 then + if g_touch_enabled then begin menu := TGUIMenu(g_GUI_GetWindow('OptionsControlsTouchMenu').GetControl('mOptionsControlsTouchMenu')); + with TGUISwitch(menu.GetControl('swTouchAlt')) do + if g_touch_alt then ItemIndex := 1 else ItemIndex := 0; TGUIScroll(menu.GetControl('scTouchSize')).Value := Round((g_touch_size - 0.5) * 10); with TGUISwitch(menu.GetControl('swTouchFire')) do if g_touch_fire then ItemIndex := 1 else ItemIndex := 0; @@ -1292,6 +1295,7 @@ var menu: TGUIMenu; begin menu := TGUIMenu(g_GUI_GetWindow('OptionsControlsTouchMenu').GetControl('mOptionsControlsTouchMenu')); + g_touch_alt := TGUISwitch(menu.GetControl('swTouchAlt')).ItemIndex = 1; g_touch_size := TGUIScroll(menu.GetControl('scTouchSize')).Value / 10 + 0.5; g_touch_offset := TGUIScroll(menu.GetControl('scTouchOffset')).Value * 5; end; @@ -2742,7 +2746,7 @@ begin AddSpace(); AddButton(nil, _lc[I_MENU_CONTROL_JOYSTICKS], 'OptionsControlsJoystickMenu'); end; - if SDL_GetNumTouchDevices() > 0 then + if g_touch_enabled then begin AddSpace(); AddButton(nil, _lc[I_MENU_CONTROL_TOUCH], 'OptionsControlsTouchMenu'); @@ -2827,6 +2831,13 @@ begin with TGUIMenu(Menu.AddChild(TGUIMenu.Create(gMenuFont, gMenuSmallFont, _lc[I_MENU_CONTROL_TOUCH]))) do begin Name := 'mOptionsControlsTouchMenu'; + with AddSwitch(_lc[I_MENU_CONTROL_TOUCH_ALT]) do + begin + Name := 'swTouchAlt'; + AddItem(_lc[I_MENU_NO]); + AddItem(_lc[I_MENU_YES]); + OnChange := ProcChangeTouchSettings; + end; with AddScroll(_lc[I_MENU_CONTROL_TOUCH_SIZE]) do begin Name := 'scTouchSize';