ACE3/addons/overheating/functions/fnc_getConsumableChildren.sqf
Drofseh eadbc60314
Overheating - Fix errors, improve documentation, change AceX references for integration (#8522)
* Fix jam script error, improve documentation

* formatting

* Update docs/wiki/feature/overheating.md

Co-authored-by: GhostIsSpooky <69561145+Salluci@users.noreply.github.com>

* Update docs/wiki/feature/overheating.md

Co-authored-by: GhostIsSpooky <69561145+Salluci@users.noreply.github.com>

* fix icon filepath for AceX integration

* Apply suggestions from code review

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* Update addons/overheating/XEH_postInit.sqf

Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com>

* move old AceX references to macros

* small whitespace formatting

Co-authored-by: GhostIsSpooky <69561145+Salluci@users.noreply.github.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com>
2021-10-17 17:00:16 -05:00

42 lines
1.3 KiB
Plaintext

#include "script_component.hpp"
/*
* Author: mharis001, Glowbal, PabstMirror
* Returns children actions for consumable items in player's inventory.
*
* Arguments:
* 0: Player <OBJECT>
*
* Return Value:
* Actions <ARRAY>
*
* Example:
* [_unit] call ace_overheating_fnc_getConsumableChildren
*
* Public: No
*/
params ["_unit"];
private _fnc_getActions = {
TRACE_1("Creating overheating consumable item actions",_unit);
private _actions = [];
private _cfgWeapons = configFile >> "CfgWeapons";
{
private _config = _cfgWeapons >> _x;
if (getNumber (_config >> QEXGVAR(field_rations,thirstQuenched)) > 0) then {
private _displayName = getText (_config >> "displayName");
private _picture = getText (_config >> "picture");
// Exec next frame so closing interaction menu doesn't block progressBar
private _action = [_x, _displayName, _picture, {[FUNC(coolWeaponWithItem), _this] call CBA_fnc_execNextFrame}, {true}, {}, _x] call EFUNC(interact_menu,createAction);
_actions pushBack [_action, [], _unit];
};
} forEach (_unit call EFUNC(common,uniqueItems));
_actions
};
[[], _fnc_getActions, _unit, QGVAR(overheatingConsumableActionsCache), 9999, "cba_events_loadoutEvent"] call EFUNC(common,cachedCall);