Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Fortify - Display cost of item at start of interaction text #207

Merged
merged 2 commits into from
Feb 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions addons/fortify/functions/fnc_addActions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,24 @@ params ["_player"];
private _side = side group _player;
private _objects = missionNamespace getVariable [format [QGVAR(Objects_%1), _side], []];
private _actions = [];
private _infiniteBudget = ([side group _player] call FUNC(getBudget)) == -1;

{
_x params ["_classname"];
_x params ["_classname", "_cost"];

private _displayName = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");

private _action = [
_classname,
getText (configFile >> "CfgVehicles" >> _classname >> "displayName"),
if (_infiniteBudget) then { _displayName } else { format ["$%1 - %2", _cost, _displayName] },
"",
{_this call FUNC(deployObject)},
LINKFUNC(deployObject),
{
params ["", "_player", "_params"];
private _cost = _params call FUNC(getCost);
params ["", "_player", "_args"];

private _cost = _args call FUNC(getCost);
private _budget = [side group _player] call FUNC(getBudget);
(_budget == -1 || _budget >= _cost)
_budget == -1 || {_budget >= _cost}
},
{},
[_side, _classname]
Expand Down