Skip to content

Commit

Permalink
Improved code with some better syntax (#1107)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasBrostrom authored Jan 12, 2024
1 parent 07ab31d commit 4d83669
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cScripts/functions/systems/fn_addHeal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private _healStatement = {
[[],["You have been healed"], [""], [""]] call CBA_fnc_notify;
};

private _actionType = if (isPlayer _object) then {1} else {0};
private _actionType = parseNumber (isPlayer _object);

private _healAction = [QEGVAR(Actions,HealAction), "Heal", "\z\ACE\addons\medical_gui\ui\cross.paa", _healStatement, {!GVAR(OneLife)}] call ace_interact_menu_fnc_createAction;
[_object, _actionType, _category, _healAction] call ace_interact_menu_fnc_addActionToObject;
Expand Down
2 changes: 1 addition & 1 deletion cScripts/functions/systems/fn_addInsigniaSelection.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ private _insigniaSelection = [format ["cScriptInsigniaSelection_%1", _className]
[player, _className] call EFUNC(unit,setInsignia);
}, {true}, {}, [_className]] call ace_interact_menu_fnc_createAction;

private _actionType = if (isPlayer _object) then {1} else {0};
private _actionType = parseNumber (isPlayer _object);
[_object, _actionType, _category, _insigniaSelection] call ace_interact_menu_fnc_addActionToObject;
2 changes: 1 addition & 1 deletion cScripts/functions/systems/fn_addLoadoutSelection.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private _action = [format ["cScripts_Loadout_%1", _className], _lable, _icon, {
[player, _className] call EFUNC(gear,applyLoadout);
}, _condition, {}, [_className, _company, _allowAllLoadouts]] call ace_interact_menu_fnc_createAction;

private _actionType = if (isPlayer _object) then {1} else {0};
private _actionType = parseNumber (isPlayer _object);
[_object, _actionType, _category, _action] call ace_interact_menu_fnc_addActionToObject;

INFO_4("LoadoutSelector", "%1; selector '%2' with type %3 added for '%4' crate.", _object, _lable, _actionType, _company);
2 changes: 1 addition & 1 deletion cScripts/functions/systems/fn_addReGear.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private _regearStatement = {
[QEGVAR(gear,applyLoadout)] call CBA_fnc_localEvent;
[[],["You have been rearmed"], [""], [""]] call CBA_fnc_notify;
};
private _actionType = if (isPlayer _object) then {1} else {0};
private _actionType = parseNumber (isPlayer _object);

private _regearAction = ["cScriptsReGearAce", "ReGear", _Icon, _regearStatement, {true}] call ace_interact_menu_fnc_createAction;
[_object, _actionType, _category, _regearAction] call ace_interact_menu_fnc_addActionToObject;
Expand Down
2 changes: 1 addition & 1 deletion cScripts/functions/systems/fn_createActionCategory.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ params [

// Make ACE Category
private _aceInteractionAction = [_name, _lable, _Icon, {}, _condition] call ace_interact_menu_fnc_createAction;
private _actionType = if (isPlayer _object) then {1} else {0};
private _actionType = parseNumber (isPlayer _object);
[_object, _actionType, _category, _aceInteractionAction] call ace_interact_menu_fnc_addActionToObject;

0 comments on commit 4d83669

Please sign in to comment.