diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas
index fca66beba93f4e99812a0570f864adb2b66ff58a..b84467fcc9c5052b997dce6079aab4098c585898 100644 (file)
--- a/src/game/g_menu.pas
+++ b/src/game/g_menu.pas
e_log, SysUtils, CONFIG, g_playermodel, DateUtils, sdl2,
MAPDEF, Math, g_saveload,
e_texture, g_language,
- g_net, g_netmsg, g_netmaster, g_items, e_input,
+ g_net, g_netmsg, g_netmaster, g_items, e_input, g_touch,
utils, wadreader;
gShowMessages := TGUISwitch(menu.GetControl('swMessages')).ItemIndex = 0;
gRevertPlayers := TGUISwitch(menu.GetControl('swRevertPlayers')).ItemIndex = 0;
gChatBubble := TGUISwitch(menu.GetControl('swChatBubble')).ItemIndex;
+ g_dbg_scale := TGUIScroll(menu.GetControl('scScaleFactor')).Value + 1;
menu := TGUIMenu(g_GUI_GetWindow('OptionsControlsMenu').GetControl('mOptionsControlsMenu'));
end;
end;
+ 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;
+ end;
+
menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mOptionsPlayersP1Menu'));
gPlayer1Settings.Name := b_Text_Unformat(TGUIEdit(menu.GetControl('edP1Name')).Text);
end;
end;
+ 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;
+ TGUIScroll(menu.GetControl('scTouchOffset')).Value := Round(g_touch_offset / 5);
+ end;
+
menu := TGUIMenu(g_GUI_GetWindow('OptionsControlsMenu').GetControl('mOptionsControlsMenu'));
with menu, gGameControls.GameControls do
begin
with TGUISwitch(menu.GetControl('swChatBubble')) do
ItemIndex := gChatBubble;
+ TGUIScroll(menu.GetControl('scScaleFactor')).Value := Round(g_dbg_scale - 1);
+
menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mOptionsPlayersP1Menu'));
TGUIListBox(menu.GetControl('lsP1Model')).SelectItem(gPlayer1Settings.Model);
);
end;
+procedure ProcChangeGameSettings(Sender: TGUIControl);
+var
+ menu: TGUIMenu;
+begin
+ menu := TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
+ g_dbg_scale := TGUIScroll(menu.GetControl('scScaleFactor')).Value + 1;
+end;
+
+procedure ProcChangeTouchSettings(Sender: TGUIControl);
+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;
+
procedure ProcOptionsPlayersMIMenu();
var
s, a: string;
AddItem(_lc[I_MENU_GAME_CHAT_TYPE_COLOR]);
AddItem(_lc[I_MENU_GAME_CHAT_TYPE_TEXTURE]);
end;
+ with AddScroll(_lc[I_MENU_GAME_SCALE_FACTOR]) do
+ begin
+ Name := 'scScaleFactor';
+ Max := 10;
+ OnChange := ProcChangeGameSettings;
+ end;
ReAlign();
end;
Menu.DefControl := 'mOptionsGameMenu';
AddButton(nil, _lc[I_MENU_PLAYER_2_KBD], 'OptionsControlsP2Menu');
{AddButton(nil, _lc[I_MENU_PLAYER_2_ALT], 'OptionsControlsP2MenuAlt');}
AddButton(nil, _lc[I_MENU_PLAYER_2_WEAPONS], 'OptionsControlsP2MenuWeapons');
- AddSpace();
if e_JoysticksAvailable <> 0 then
+ begin
+ AddSpace();
AddButton(nil, _lc[I_MENU_CONTROL_JOYSTICKS], 'OptionsControlsJoystickMenu');
+ end;
+ if g_touch_enabled then
+ begin
+ AddSpace();
+ AddButton(nil, _lc[I_MENU_CONTROL_TOUCH], 'OptionsControlsTouchMenu');
+ end;
end;
Menu.DefControl := 'mOptionsControlsMenu';
g_GUI_AddWindow(Menu);
Menu.DefControl := 'mOptionsControlsJoystickMenu';
g_GUI_AddWindow(Menu);
+ Menu := TGUIWindow.Create('OptionsControlsTouchMenu');
+ 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';
+ Max := 20;
+ OnChange := ProcChangeTouchSettings;
+ end;
+ with AddSwitch(_lc[I_MENU_CONTROL_TOUCH_FIRE]) do
+ begin
+ Name := 'swTouchFire';
+ AddItem(_lc[I_MENU_NO]);
+ AddItem(_lc[I_MENU_YES]);
+ end;
+ with AddScroll(_lc[I_MENU_CONTROL_TOUCH_OFFSET]) do
+ begin
+ Name := 'scTouchOffset';
+ Max := 20;
+ OnChange := ProcChangeTouchSettings;
+ end;
+ end;
+ Menu.DefControl := 'mOptionsControlsTouchMenu';
+ g_GUI_AddWindow(Menu);
+
Menu := TGUIWindow.Create('OptionsPlayersMenu');
with TGUIMenu(Menu.AddChild(TGUIMenu.Create(gMenuFont, gMenuSmallFont, _lc[I_MENU_PLAYER_OPTIONS]))) do
begin