Add Lua callback: onPreciseLocal
authorWuzzy <Wuzzy2@mail.ru>
Tue, 07 May 2019 15:50:15 +0200
changeset 14918 6a928999fefd
parent 14917 63357ed39886
child 14919 4596357d002d
Add Lua callback: onPreciseLocal
ChangeLog.txt
hedgewars/uInputHandler.pas
--- a/ChangeLog.txt	Tue May 07 14:17:09 2019 +0200
+++ b/ChangeLog.txt	Tue May 07 15:50:15 2019 +0200
@@ -120,6 +120,7 @@
  + Utils library: New calls: getReadableChallengeRecord, updateChallengeRecord, integerSqrt, integerHypotenuse
  + New callback: onGameResult(winningClan): Called when the game ends normally. winningClan = index of winning clan or -1 on draw
  + New callback: onCaseDrop(gear): Called at the point where a crate MIGHT be dropped between turns. Gear is the crate gear or nil
+ + New callback: onPreciseLocal(): Called when precise key is pressed client-side
  + SendStat extension: Option to use predefined modes with siPointType, like "!POINTS" or "!TIME"
  + SimpleMission: Add isMissionTeam attribute for teams
  + SpeedShoppa/TargetPractice libraries: Remove custom hog and team info settings
--- a/hedgewars/uInputHandler.pas	Tue May 07 14:17:09 2019 +0200
+++ b/hedgewars/uInputHandler.pas	Tue May 07 15:50:15 2019 +0200
@@ -60,7 +60,7 @@
 procedure ControllerButtonEvent(joy, button: Byte; pressed: Boolean);
 
 implementation
-uses uKeyNames, uConsole, uCommands, uVariables, uConsts, uUtils, uDebug, uPhysFSLayer, uCursor;
+uses uKeyNames, uConsole, uCommands, uVariables, uConsts, uUtils, uDebug, uPhysFSLayer, uCursor, uScript;
 
 const
     LSHIFT = $0200;
@@ -251,6 +251,7 @@
             updateVolumeDelta(true);
             updateCursorMovementDelta(true, CursorMovementX, CursorMovementX);
             updateCursorMovementDelta(true, CursorMovementY, CursorMovementY);
+            ScriptCall('onPreciseLocal');
             end;
 
         ParseCommand(CurrentBinds.binds[CurrentBinds.indices[code]], Trusted);