38 lines
1.2 KiB
Plaintext
38 lines
1.2 KiB
Plaintext
params ["_target", "_player", "_params", "_flagOptionCfg"];
|
|
_params params ["_rootActionID", "_flagCategoryActionID", "_flagSubclassesCfgs"];
|
|
|
|
private _flagOptionID = getText(_flagOptionCfg >> "actionID");
|
|
private _flagOptionTitle = getText(_flagOptionCfg >> "actionTitle");
|
|
private _flagOptionTexture = getText(_flagOptionCfg >> "texture");
|
|
|
|
// if the texture doesn't exist at the config path, skip this flag option
|
|
if (not (fileExists _flagOptionTexture)) then {
|
|
diag_log format ["WARN: Flag option texture not found: %1", _flagOptionTexture];
|
|
continue
|
|
};
|
|
|
|
// diag_log format ["NewFlagOption: %1 %2", _flagOptionID, _flagOptionData];
|
|
|
|
private _newFlagOption = [
|
|
|
|
_rootActionID + "_" + _flagCategoryActionID + "_" + _flagOptionID, // id
|
|
_flagOptionTitle, // displayed title
|
|
_flagOptionTexture, // flag icon
|
|
{
|
|
params ["_target", "_player", "_params"];
|
|
_params params ["_flagOptionTexture"];
|
|
_target forceFlagTexture _flagOptionTexture;
|
|
}, // statement
|
|
{
|
|
params ["_target", "_player", "_params"];
|
|
alive _target;
|
|
// true;
|
|
}, // condition
|
|
nil, // child code
|
|
[_flagOptionTexture], // params
|
|
nil, // position
|
|
4, // distance
|
|
[false, false, false, false, false] // other params
|
|
] call ace_interact_menu_fnc_createAction;
|
|
|
|
_newFlagOption; |