hedgewars/uUtils.pas
changeset 14916 d4a19bf6687e
parent 14913 444ed0622348
child 14917 63357ed39886
--- a/hedgewars/uUtils.pas	Tue May 07 13:15:00 2019 +0200
+++ b/hedgewars/uUtils.pas	Tue May 07 13:56:11 2019 +0200
@@ -83,6 +83,8 @@
 
 function CalcWorldWrap(X, radius: LongInt): LongInt;
 
+procedure updateVolumeDelta(precise: boolean);
+
 function read1stLn(filePath: shortstring): shortstring;
 function readValueFromINI(key, filePath: shortstring): shortstring;
 
@@ -698,6 +700,23 @@
     sanitizeCharForLog:= r
 end;
 
+// helper function for volume change controls
+procedure updateVolumeDelta(precise: boolean);
+begin
+if cVolumeUpKey and (not cVolumeDownKey) then
+    if precise then
+        cVolumeDelta:= 1
+    else
+        cVolumeDelta:= 3
+else if cVolumeDownKey and (not cVolumeUpKey) then
+    if precise then
+        cVolumeDelta:= -1
+    else
+        cVolumeDelta:= -3
+else
+    cVolumeDelta:= 0;
+end;
+
 function read1stLn(filePath: shortstring): shortstring;
 var f: pfsFile;
 begin