Compare commits
2 Commits
2d9e5aabef
...
fedc6f1432
| Author | SHA1 | Date | |
|---|---|---|---|
| fedc6f1432 | |||
| b34928c0c3 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -2,3 +2,5 @@
|
||||
# Notepad++ backups #
|
||||
*.bak
|
||||
|
||||
|
||||
.vscode/
|
||||
|
||||
@@ -84,30 +84,159 @@ class VehicleFlags {
|
||||
actionID = "flag_simpleshape";
|
||||
actionTitle = "Simple Shapes";
|
||||
|
||||
class GreenOctagon {
|
||||
actionID = "flag_simpleshape_greenoctagon";
|
||||
actionTitle = "Green Octagon";
|
||||
texture = "textures\simple_shape\flag_simpleshape_greenoctagon_co.paa";
|
||||
class Blue {
|
||||
actionID = "flags_simpleshape_blue";
|
||||
actionTitle = "Blue";
|
||||
|
||||
class BlueCircle {
|
||||
actionID = "flag_simpleshape_bluecircle";
|
||||
actionTitle = "Blue Circle";
|
||||
texture = "textures\simple_shape\flag_simpleshape_bluecircle_co.paa";
|
||||
};
|
||||
class BlueOctagon {
|
||||
actionID = "flag_simpleshape_blueoctagon";
|
||||
actionTitle = "Blue Octagon";
|
||||
texture = "textures\simple_shape\flag_simpleshape_blueoctagon_co.paa";
|
||||
};
|
||||
class BluePentagon {
|
||||
actionID = "flag_simpleshape_bluepentagon";
|
||||
actionTitle = "Blue Pentagon";
|
||||
texture = "textures\simple_shape\flag_simpleshape_bluepentagon_co.paa";
|
||||
};
|
||||
class BlueSquare {
|
||||
actionID = "flag_simpleshape_bluesquare";
|
||||
actionTitle = "Blue Square";
|
||||
texture = "textures\simple_shape\flag_simpleshape_bluesquare_co.paa";
|
||||
};
|
||||
class BlueTriangle {
|
||||
actionID = "flag_simpleshape_bluetriangle";
|
||||
actionTitle = "Blue Triangle";
|
||||
texture = "textures\simple_shape\flag_simpleshape_bluetriangle_co.paa";
|
||||
};
|
||||
};
|
||||
class BlueCircle {
|
||||
actionID = "flag_simpleshape_bluecircle";
|
||||
actionTitle = "Blue Circle";
|
||||
texture = "textures\simple_shape\flag_simpleshape_bluecircle_co.paa";
|
||||
|
||||
class Green {
|
||||
actionID = "flags_simpleshape_green";
|
||||
actionTitle = "Green";
|
||||
|
||||
class GreenCircle {
|
||||
actionID = "flag_simpleshape_greencircle";
|
||||
actionTitle = "Green Circle";
|
||||
texture = "textures\simple_shape\flag_simpleshape_greencircle_co.paa";
|
||||
};
|
||||
class GreenOctagon {
|
||||
actionID = "flag_simpleshape_greenoctagon";
|
||||
actionTitle = "Green Octagon";
|
||||
texture = "textures\simple_shape\flag_simpleshape_greenoctagon_co.paa";
|
||||
};
|
||||
class GreenPentagon {
|
||||
actionID = "flag_simpleshape_greenpentagon";
|
||||
actionTitle = "Green Pentagon";
|
||||
texture = "textures\simple_shape\flag_simpleshape_greenpentagon_co.paa";
|
||||
};
|
||||
class GreenSquare {
|
||||
actionID = "flag_simpleshape_greensquare";
|
||||
actionTitle = "Green Square";
|
||||
texture = "textures\simple_shape\flag_simpleshape_greensquare_co.paa";
|
||||
};
|
||||
class GreenTriangle {
|
||||
actionID = "flag_simpleshape_greentriangle";
|
||||
actionTitle = "Green Triangle";
|
||||
texture = "textures\simple_shape\flag_simpleshape_greentriangle_co.paa";
|
||||
};
|
||||
};
|
||||
class OrangeSquare {
|
||||
actionID = "flag_simpleshape_orangesquare";
|
||||
actionTitle = "Orange Square";
|
||||
texture = "textures\simple_shape\flag_simpleshape_orangesquare_co.paa";
|
||||
|
||||
class Orange {
|
||||
actionID = "flags_simpleshape_orange";
|
||||
actionTitle = "Orange";
|
||||
|
||||
class OrangeCircle {
|
||||
actionID = "flag_simpleshape_orangecircle";
|
||||
actionTitle = "Orange Circle";
|
||||
texture = "textures\simple_shape\flag_simpleshape_orangecircle_co.paa";
|
||||
};
|
||||
class OrangeOctagon {
|
||||
actionID = "flag_simpleshape_orangeoctagon";
|
||||
actionTitle = "Orange Octagon";
|
||||
texture = "textures\simple_shape\flag_simpleshape_orangeoctagon_co.paa";
|
||||
};
|
||||
class OrangePentagon {
|
||||
actionID = "flag_simpleshape_orangepentagon";
|
||||
actionTitle = "Orange Pentagon";
|
||||
texture = "textures\simple_shape\flag_simpleshape_orangepentagon_co.paa";
|
||||
};
|
||||
class OrangeSquare {
|
||||
actionID = "flag_simpleshape_orangesquare";
|
||||
actionTitle = "Orange Square";
|
||||
texture = "textures\simple_shape\flag_simpleshape_orangesquare_co.paa";
|
||||
};
|
||||
class OrangeTriangle {
|
||||
actionID = "flag_simpleshape_orangetriangle";
|
||||
actionTitle = "Orange Triangle";
|
||||
texture = "textures\simple_shape\flag_simpleshape_orangetriangle_co.paa";
|
||||
};
|
||||
};
|
||||
class PinkTriangle {
|
||||
actionID = "flag_simpleshape_pinktriangle";
|
||||
actionTitle = "Pink Triangle";
|
||||
texture = "textures\simple_shape\flag_simpleshape_pinktriangle_co.paa";
|
||||
|
||||
class Pink {
|
||||
actionID = "flags_simpleshape_pink";
|
||||
actionTitle = "Pink";
|
||||
|
||||
class PinkCircle {
|
||||
actionID = "flag_simpleshape_pinkcircle";
|
||||
actionTitle = "Pink Circle";
|
||||
texture = "textures\simple_shape\flag_simpleshape_pinkcircle_co.paa";
|
||||
};
|
||||
class PinkOctagon {
|
||||
actionID = "flag_simpleshape_pinkoctagon";
|
||||
actionTitle = "Pink Octagon";
|
||||
texture = "textures\simple_shape\flag_simpleshape_pinkoctagon_co.paa";
|
||||
};
|
||||
class PinkPentagon {
|
||||
actionID = "flag_simpleshape_pinkpentagon";
|
||||
actionTitle = "Pink Pentagon";
|
||||
texture = "textures\simple_shape\flag_simpleshape_pinkpentagon_co.paa";
|
||||
};
|
||||
class PinkSquare {
|
||||
actionID = "flag_simpleshape_pinksquare";
|
||||
actionTitle = "Pink Square";
|
||||
texture = "textures\simple_shape\flag_simpleshape_pinksquare_co.paa";
|
||||
};
|
||||
class PinkTriangle {
|
||||
actionID = "flag_simpleshape_pinktriangle";
|
||||
actionTitle = "Pink Triangle";
|
||||
texture = "textures\simple_shape\flag_simpleshape_pinktriangle_co.paa";
|
||||
};
|
||||
};
|
||||
class RedPentagon {
|
||||
actionID = "flag_simpleshape_redpentagon";
|
||||
actionTitle = "Red Pentagon";
|
||||
texture = "textures\simple_shape\flag_simpleshape_redpentagon_co.paa";
|
||||
|
||||
class Red {
|
||||
actionID = "flags_simpleshape_red";
|
||||
actionTitle = "Red";
|
||||
|
||||
class RedCircle {
|
||||
actionID = "flag_simpleshape_redcircle";
|
||||
actionTitle = "Red Circle";
|
||||
texture = "textures\simple_shape\flag_simpleshape_redcircle_co.paa";
|
||||
};
|
||||
class RedOctagon {
|
||||
actionID = "flag_simpleshape_redoctagon";
|
||||
actionTitle = "Red Octagon";
|
||||
texture = "textures\simple_shape\flag_simpleshape_redoctagon_co.paa";
|
||||
};
|
||||
class RedPentagon {
|
||||
actionID = "flag_simpleshape_redpentagon";
|
||||
actionTitle = "Red Pentagon";
|
||||
texture = "textures\simple_shape\flag_simpleshape_redpentagon_co.paa";
|
||||
};
|
||||
class RedSquare {
|
||||
actionID = "flag_simpleshape_redsquare";
|
||||
actionTitle = "Red Square";
|
||||
texture = "textures\simple_shape\flag_simpleshape_redsquare_co.paa";
|
||||
};
|
||||
class RedTriangle {
|
||||
actionID = "flag_simpleshape_redtriangle";
|
||||
actionTitle = "Red Triangle";
|
||||
texture = "textures\simple_shape\flag_simpleshape_redtriangle_co.paa";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -175,6 +175,8 @@ class DOUBLES(PREFIX,vehicleFlags) {
|
||||
class addFlagActions {};
|
||||
class draw3D {};
|
||||
class getActionsFlagCategories {};
|
||||
class compileFlagAction {};
|
||||
class compileFlagCategoryAction {};
|
||||
class getVehicleFlagsCfg {};
|
||||
class isClassExcluded {};
|
||||
};
|
||||
|
||||
38
framework/vehicleFlags/functions/fn_compileFlagAction.sqf
Normal file
38
framework/vehicleFlags/functions/fn_compileFlagAction.sqf
Normal file
@@ -0,0 +1,38 @@
|
||||
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;
|
||||
@@ -0,0 +1,52 @@
|
||||
// diag_log format ["NewFlagCategory: %1 %2", _flagCategory, _flagOptions];
|
||||
|
||||
params ["_rootActionID", "_flagCategoryCfg"];
|
||||
private _flagCategoryActionID = getText(_flagCategoryCfg >> "actionID");
|
||||
private _flagCategoryTitle = getText(_flagCategoryCfg >> "actionTitle");
|
||||
|
||||
private _flagSubclassesCfgs = _flagCategoryCfg call BIS_fnc_returnChildren;
|
||||
|
||||
private _flagCategoryAction = [
|
||||
_rootActionID + "_" + _flagCategoryActionID, // id
|
||||
_flagCategoryTitle, // displayed title
|
||||
getText((_flagSubclassesCfgs#0) >> "texture"), // flag icon for category - use first flag option
|
||||
{true}, // statement
|
||||
{
|
||||
params ["_target", "_player", "_params"];
|
||||
alive _target;
|
||||
// true;
|
||||
}, // condition
|
||||
{
|
||||
// generate child code under category
|
||||
// this is the level where actual flag options will be displayed
|
||||
params ["_target", "_player", "_params"];
|
||||
// these params are passed from the parent action
|
||||
_params params ["_rootActionID", "_flagCategoryActionID", "_flagSubclassesCfgs"];
|
||||
|
||||
private _individualFlagActions = [];
|
||||
{ // forEach _flagSubclassesCfgs; // we'll generate flag options for each category
|
||||
private _flagOptionCfg = _x;
|
||||
|
||||
// generate flag option for this flag option
|
||||
private _newFlagOption = [
|
||||
_target,
|
||||
_player,
|
||||
_params,
|
||||
_flagOptionCfg
|
||||
] call FUNC(compileFlagAction);
|
||||
|
||||
// add flag option to category subactions
|
||||
_individualFlagActions pushBack [_newFlagOption, [], _target];
|
||||
} forEach _flagSubclassesCfgs;
|
||||
|
||||
// return the generated flag options to the category as child actions
|
||||
_individualFlagActions;
|
||||
}, // child code
|
||||
[_rootActionID, _flagCategoryActionID, _flagSubclassesCfgs], // params
|
||||
nil, // position
|
||||
4, // distance
|
||||
[false, false, false, false, false], // other params
|
||||
nil // modifier function code
|
||||
] call ace_interact_menu_fnc_createAction;
|
||||
|
||||
_flagCategoryAction;
|
||||
@@ -11,80 +11,18 @@ params ["_rootActionID", "_flagCategoryCfgs"];
|
||||
private _allCategoryActions = [];
|
||||
|
||||
{
|
||||
// diag_log format ["NewFlagCategory: %1 %2", _flagCategory, _flagOptions];
|
||||
|
||||
private _flagCategoryCfg = _x;
|
||||
private _flagCategoryActionID = getText(_flagCategoryCfg >> "actionID");
|
||||
private _flagCategoryTitle = getText(_flagCategoryCfg >> "actionTitle");
|
||||
|
||||
private _flagSubclassesCfgs = _flagCategoryCfg call BIS_fnc_returnChildren;
|
||||
|
||||
private _flagCategoryAction = [
|
||||
_rootActionID + "_" + _flagCategoryActionID, // id
|
||||
_flagCategoryTitle, // displayed title
|
||||
getText((_flagSubclassesCfgs#0) >> "texture"), // flag icon for category - use first flag option
|
||||
{true}, // statement
|
||||
_flagCategoryActions = [];
|
||||
if (configName _x == "SimpleShapes") then {
|
||||
{
|
||||
params ["_target", "_player", "_params"];
|
||||
alive _target;
|
||||
// true;
|
||||
}, // condition
|
||||
{
|
||||
// generate child code under category
|
||||
// this is the level where actual flag options will be displayed
|
||||
params ["_target", "_player", "_params"];
|
||||
_params params ["_rootActionID", "_flagCategoryActionID", "_flagSubclassesCfgs"];
|
||||
|
||||
private _individualFlagActions = [];
|
||||
{ // forEach _flagSubclassesCfgs;
|
||||
private _flagOptionCfg = _x;
|
||||
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 {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;
|
||||
|
||||
// add flag option to category subactions
|
||||
_individualFlagActions pushBack [_newFlagOption, [], _target];
|
||||
} forEach _flagSubclassesCfgs;
|
||||
|
||||
// return the generated flag options to the category as child actions
|
||||
_individualFlagActions;
|
||||
}, // child code
|
||||
[_rootActionID, _flagCategoryActionID, _flagSubclassesCfgs], // params
|
||||
nil, // position
|
||||
4, // distance
|
||||
[false, false, false, false, false], // other params
|
||||
nil // modifier function code
|
||||
] call ace_interact_menu_fnc_createAction;
|
||||
|
||||
_flagCategoryActions pushBack ([_rootActionID, _x] call FUNC(compileFlagCategoryAction));
|
||||
} forEach (_x call BIS_fnc_returnChildren);
|
||||
} else {
|
||||
_flagCategoryActions pushBack (_x call FUNC(compileFlagCategoryAction));
|
||||
};
|
||||
// add category to all category actions array
|
||||
_allCategoryActions pushBack [_flagCategoryAction, [], _target];
|
||||
{
|
||||
_allCategoryActions pushBack [_x, [], _target];
|
||||
} forEach _flagCategoryActions;
|
||||
} forEach _flagCategoryCfgs;
|
||||
|
||||
_allCategoryActions;
|
||||
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_blueoctagon_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_blueoctagon_co.paa
Normal file
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_bluepentagon_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_bluepentagon_co.paa
Normal file
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_bluesquare_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_bluesquare_co.paa
Normal file
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_bluetriangle_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_bluetriangle_co.paa
Normal file
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_greencircle_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_greencircle_co.paa
Normal file
Binary file not shown.
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_greenpentagon_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_greenpentagon_co.paa
Normal file
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_greensquare_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_greensquare_co.paa
Normal file
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_greentriangle_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_greentriangle_co.paa
Normal file
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_orangecircle_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_orangecircle_co.paa
Normal file
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_orangeoctagon_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_orangeoctagon_co.paa
Normal file
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_orangepentagon_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_orangepentagon_co.paa
Normal file
Binary file not shown.
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_orangetriangle_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_orangetriangle_co.paa
Normal file
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_pinkcircle_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_pinkcircle_co.paa
Normal file
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_pinkoctagon_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_pinkoctagon_co.paa
Normal file
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_pinkpentagon_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_pinkpentagon_co.paa
Normal file
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_pinksquare_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_pinksquare_co.paa
Normal file
Binary file not shown.
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_redcircle_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_redcircle_co.paa
Normal file
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_redoctagon_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_redoctagon_co.paa
Normal file
Binary file not shown.
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_redsquare_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_redsquare_co.paa
Normal file
Binary file not shown.
BIN
textures/simple_shape/flag_simpleshape_redtriangle_co.paa
Normal file
BIN
textures/simple_shape/flag_simpleshape_redtriangle_co.paa
Normal file
Binary file not shown.
Reference in New Issue
Block a user