Skip to content

Commit

Permalink
fnc_directCall and type
Browse files Browse the repository at this point in the history
  • Loading branch information
OverlordZorn committed Sep 7, 2024
1 parent 709a41a commit 920e85a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion addons/common/fnc_removePerFrameHandler.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ params [["_handle", -1, [0]]];

GVAR(perFrameHandlersToRemove) pushBackUnique _index;
true
}, _handle] call CBA_fnc_directCall;
}, _handle] call CBA_fnc_directCall;
26 changes: 18 additions & 8 deletions addons/common/fnc_updatePerFrameHandlerDelay.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Description:
Parameters:
_handle - The existing perFrameHandler's handle. <NUMBER>
_delay - The amount of time in seconds between executions, 0 for every frame. (optional, default: 0) <NUMBER>
_updateExecutionTime - <BOOL> When true, adjusts the nextExecution time.
Returns:
true if successful, false otherwise <BOOLEAN>
Expand All @@ -21,14 +22,23 @@ Author:
Mokka, OverlordZorn
---------------------------------------------------------------------------- */

params [["_handle", -1, [0]], ["_newDelay", 0, [0]], ["_updateExectionTime", false, [false]]];
params [["_handle", -1, [0]], ["_newDelay", 0, [0]], ["_updateExecutionTime", false, [false]]];

private _idx = GVAR(PFHhandles) param [_handle];
if (isNil "_idx") exitWith {false};
(GVAR(perFrameHandlerArray) select _idx) set [1, _newDelay];
[{
params ["_handle", "_newDelay", "_updateExecutionTime"];

if (_updateExectionTime) then {
// Add code here
};
private _idx = GVAR(PFHhandles) param [_handle];
if (isNil "_idx") exitWith {false};
(GVAR(perFrameHandlerArray) select _idx) set [1, _newDelay];

true
if (_updateExecutionTime) then {
// Add code here




};

true

}, [_handle, _newDelay, _updateExecutionTime]] call CBA_fnc_directCall;

0 comments on commit 920e85a

Please sign in to comment.