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 1 commit
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
15 changes: 9 additions & 6 deletions addons/fortify/functions/fnc_addActions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,21 @@ private _objects = missionNamespace getVariable [format [QGVAR(Objects_%1), _sid
private _actions = [];

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

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

private _action = [
_classname,
getText (configFile >> "CfgVehicles" >> _classname >> "displayName"),
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