Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Prevents the Arma 3 addAction icon and windoText from fading out during a long hold aciton.
// addAction Anti-fader by Caleb Serafin, 2022, MIT License. Feel free to use. Tested in Arma 3 v2.06.
// WARNING: This depends on undocumented functionality and will need an update if breaking changes are made to BIS_fnc_holdActionAdd.
MyTag_BIS_holdAction_wasRunning = false;
private _condShow = str { [] call {
private _actualCondition = true; // YOU CAN CHANGE VALUE TO BY YOUR NORMAL SHOW CONDITION.
if (!bis_fnc_holdAction_running) exitWith {
MyTag_BIS_holdAction_wasRunning = false;
_actualCondition;
};
if (MyTag_BIS_holdAction_wasRunning) exitWith {
_actualCondition;
};
MyTag_BIS_holdAction_wasRunning = true;
false; // Hide it for one frame to stop action menu timeout.
};} trim ["{}",0]; // Make sure to have another character like a semi-colon so that trim doesn't remove the closing brace.
// Example of use:
[player, "Hold Me", nil, nil, _condShow, nil, nil, nil, nil, nil, nil, 30] call BIS_fnc_holdActionAdd;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment