Skip to content

Instantly share code, notes, and snippets.

@CalebSerafin
Created January 7, 2022 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CalebSerafin/f4a16f2f564a438882ca6f32107bec24 to your computer and use it in GitHub Desktop.
Save CalebSerafin/f4a16f2f564a438882ca6f32107bec24 to your computer and use it in GitHub Desktop.
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