DEADSOFTWARE

Added option for alt vkbd layout
[d2df-sdl.git] / src / game / g_options.pas
index 3d2fed9b9cf7b2c04d3cb5b6e02aed017616a05d..15719e6f894fc0f5fce3886235b0e8df523cb339 100644 (file)
@@ -169,6 +169,8 @@ begin
   g_dbg_scale := 1.0;
   g_touch_size := 1.0;
   g_touch_fire := True;
+  g_touch_offset := 50;
+  g_touch_alt := False;
 
   for i := 0 to e_MaxJoys-1 do
     e_JoystickDeadzones[i] := 8192;
@@ -424,6 +426,8 @@ begin
 
   g_touch_size := Max(config.ReadInt('Touch', 'Size', 10) / 10, 0.1);
   g_touch_fire := config.ReadBool('Touch', 'Fire', True);
+  g_touch_offset := Max(Min(config.ReadInt('Touch', 'Offset', 50), 100), 0);
+  g_touch_alt := config.ReadBool('Touch', 'Alt', False);
 
   g_GFX_SetMax(Min(config.ReadInt('Game', 'MaxParticles', 1000), 50000));
   g_Shells_SetMax(Min(config.ReadInt('Game', 'MaxShells', 300), 600));
@@ -455,7 +459,7 @@ begin
   e_FastScreenshots := config.ReadBool('Game', 'FastScreenshots', True);
   gDefaultMegawadStart := config.ReadStr('Game', 'DefaultMegawadStart', DF_Default_Megawad_Start);
   gBerserkAutoswitch := config.ReadBool('Game', 'BerserkAutoswitching', True);
-  g_dbg_scale := Max(config.ReadInt('Game', 'Scale', 1), 1);
+  g_dbg_scale := Max(config.ReadInt('Game', 'Scale', 100) / 100, 1.0);
 
 // Ãåéìïëåé â ñâîåé èãðå
   gcMap := config.ReadStr('GameplayCustom', 'Map', '');
@@ -667,6 +671,8 @@ begin
 
   config.WriteInt('Touch', 'Size', Round(g_touch_size * 10));
   config.WriteBool('Touch', 'Fire', g_touch_fire);
+  config.WriteInt('Touch', 'Offset', Round(g_touch_offset));
+  config.WriteBool('Touch', 'Alt', g_touch_alt);
 
   with config do
     case gGibsCount of
@@ -696,7 +702,7 @@ begin
   config.WriteBool('Game', 'FastScreenshots', e_FastScreenshots);
   config.WriteStr('Game', 'DefaultMegawadStart', gDefaultMegawadStart);
   config.WriteBool('Game', 'BerserkAutoswitching', gBerserkAutoswitch);
-  config.WriteInt('Game', 'Scale', Round(g_dbg_scale));
+  config.WriteInt('Game', 'Scale', Round(g_dbg_scale * 100));
 
   config.WriteStr ('GameplayCustom', 'Map', gcMap);
   config.WriteStr ('GameplayCustom', 'GameMode', gcGameMode);