DEADSOFTWARE

Disable accelerometer and add g_dbg_scale as option
[d2df-sdl.git] / src / game / g_menu.pas
index fca66beba93f4e99812a0570f864adb2b66ff58a..3056950af666495842af15a008ba3f4cc2ac211c 100644 (file)
@@ -164,6 +164,7 @@ begin
   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('swScaleFactor')).Value + 1;
 
   menu := TGUIMenu(g_GUI_GetWindow('OptionsControlsMenu').GetControl('mOptionsControlsMenu'));
 
@@ -495,6 +496,8 @@ begin
   with TGUISwitch(menu.GetControl('swChatBubble')) do
     ItemIndex := gChatBubble;
 
+  TGUIScroll(menu.GetControl('swScaleFactor')).Value := Round(g_dbg_scale - 1);
+
   menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1Menu').GetControl('mOptionsPlayersP1Menu'));
 
   TGUIListBox(menu.GetControl('lsP1Model')).SelectItem(gPlayer1Settings.Model);
@@ -1259,6 +1262,14 @@ begin
   );
 end;
 
+procedure ProcChangeGameSettings(Sender: TGUIControl);
+var
+  menu: TGUIMenu;
+begin
+  menu := TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu'));
+  g_dbg_scale := TGUIScroll(menu.GetControl('swScaleFactor')).Value + 1;
+end;
+
 procedure ProcOptionsPlayersMIMenu();
 var
   s, a: string;
@@ -2673,6 +2684,12 @@ begin
       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 := 'swScaleFactor';
+      Max := 10;
+      OnChange := ProcChangeGameSettings;
+    end;
     ReAlign();
   end;
   Menu.DefControl := 'mOptionsGameMenu';