Skip to content

Commit

Permalink
Attributes - Add support for dynamic value info (#578)
Browse files Browse the repository at this point in the history
  • Loading branch information
ffredyk authored Mar 30, 2021
1 parent ee70745 commit 7b27ef2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions addons/attributes/functions/fnc_open.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ private _contentPosY = 0;
_ctrlLabel ctrlSetText _displayName;
_ctrlLabel ctrlSetTooltip _tooltip;

// Get dynamic value info for the control if needed
if (_valueInfo isEqualType {}) then {
_valueInfo = _entity call _valueInfo;
};

// Execute attribute control specific init function
private _function = getText (configFile >> _control >> "function");
[_controlsGroup, _entity call _defaultValue, _valueInfo, _entity] call (missionNamespace getVariable _function);
Expand Down
2 changes: 1 addition & 1 deletion addons/attributes/initAttributes.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
"Object",
LSTRING(PlateNumber),
QGVAR(edit),
{_this select [0, MAX_PLATE_CHARACTERS]},
[{_this select [0, MAX_PLATE_CHARACTERS]}],
{
[QEGVAR(common,setPlateNumber), [_entity, _value], _entity] call CBA_fnc_targetEvent;
},
Expand Down

0 comments on commit 7b27ef2

Please sign in to comment.