mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Tagging - Add more tags (#8908)
* Added more tags and reorganised interaction * Removed empty lines from stringtable * Fix macros, use item picture as interaction icon Co-authored-by: PabstMirror <pabstmirror@gmail.com> * Use texture as icon, remove colour from names * Tagging - Compile actions when added Co-authored-by: PabstMirror <pabstmirror@gmail.com>
This commit is contained in:
parent
bf8aa1ab7f
commit
699e286db7
@ -1,26 +1,78 @@
|
||||
#define GLUE(g1,g2) g1##g2
|
||||
#define TAG(name,col) class TRIPLES(ACE,name,col) { \
|
||||
displayName = CSTRING(name); \
|
||||
requiredItem = QUOTE(GLUE(ACE_Spraypaint,col)); \
|
||||
textures[] = {QPATHTOF(UI\tags\col\name.paa)}; \
|
||||
icon = QPATHTOF(UI\tags\col\name.paa); \
|
||||
} \
|
||||
|
||||
class ACE_Tags {
|
||||
class ACE_XBlack {
|
||||
displayName = CSTRING(XBlack);
|
||||
requiredItem = "ACE_SpraypaintBlack";
|
||||
textures[] = {QPATHTOF(UI\tags\black\0.paa), QPATHTOF(UI\tags\black\1.paa), QPATHTOF(UI\tags\black\2.paa)};
|
||||
icon = QPATHTOF(UI\icons\iconTaggingBlack.paa);
|
||||
icon = QPATHTOF(UI\tags\black\0.paa);
|
||||
};
|
||||
class ACE_XRed {
|
||||
displayName = CSTRING(XRed);
|
||||
requiredItem = "ACE_SpraypaintRed";
|
||||
textures[] = {QPATHTOF(UI\tags\red\0.paa), QPATHTOF(UI\tags\red\1.paa), QPATHTOF(UI\tags\red\2.paa)};
|
||||
icon = QPATHTOF(UI\icons\iconTaggingRed.paa);
|
||||
icon = QPATHTOF(UI\tags\red\0.paa);
|
||||
};
|
||||
class ACE_XGreen {
|
||||
displayName = CSTRING(XGreen);
|
||||
requiredItem = "ACE_SpraypaintGreen";
|
||||
textures[] = {QPATHTOF(UI\tags\green\0.paa), QPATHTOF(UI\tags\green\1.paa), QPATHTOF(UI\tags\green\2.paa)};
|
||||
icon = QPATHTOF(UI\icons\iconTaggingGreen.paa);
|
||||
icon = QPATHTOF(UI\tags\green\0.paa);
|
||||
};
|
||||
class ACE_XBlue {
|
||||
displayName = CSTRING(XBlue);
|
||||
requiredItem = "ACE_SpraypaintBlue";
|
||||
textures[] = {QPATHTOF(UI\tags\blue\0.paa), QPATHTOF(UI\tags\blue\1.paa), QPATHTOF(UI\tags\blue\2.paa)};
|
||||
icon = QPATHTOF(UI\icons\iconTaggingBlue.paa);
|
||||
icon = QPATHTOF(UI\tags\blue\0.paa);
|
||||
};
|
||||
|
||||
TAG(arrow_up,Black);
|
||||
TAG(arrow_down,Black);
|
||||
TAG(arrow_left,Black);
|
||||
TAG(arrow_right,Black);
|
||||
TAG(circle,Black);
|
||||
TAG(cross,Black);
|
||||
TAG(diamond,Black);
|
||||
TAG(square,Black);
|
||||
TAG(triangle,Black);
|
||||
TAG(triangle_inverted,Black);
|
||||
|
||||
TAG(arrow_up,Blue);
|
||||
TAG(arrow_down,Blue);
|
||||
TAG(arrow_left,Blue);
|
||||
TAG(arrow_right,Blue);
|
||||
TAG(circle,Blue);
|
||||
TAG(cross,Blue);
|
||||
TAG(diamond,Blue);
|
||||
TAG(square,Blue);
|
||||
TAG(triangle,Blue);
|
||||
TAG(triangle_inverted,Blue);
|
||||
|
||||
TAG(arrow_up,Green);
|
||||
TAG(arrow_down,Green);
|
||||
TAG(arrow_left,Green);
|
||||
TAG(arrow_right,Green);
|
||||
TAG(circle,Green);
|
||||
TAG(cross,Green);
|
||||
TAG(diamond,Green);
|
||||
TAG(square,Green);
|
||||
TAG(triangle,Green);
|
||||
TAG(triangle_inverted,Green);
|
||||
|
||||
TAG(arrow_up,Red);
|
||||
TAG(arrow_down,Red);
|
||||
TAG(arrow_left,Red);
|
||||
TAG(arrow_right,Red);
|
||||
TAG(circle,Red);
|
||||
TAG(cross,Red);
|
||||
TAG(diamond,Red);
|
||||
TAG(square,Red);
|
||||
TAG(triangle,Red);
|
||||
TAG(triangle_inverted,Red);
|
||||
};
|
||||
|
BIN
addons/tagging/UI/tags/black/arrow_down.paa
Normal file
BIN
addons/tagging/UI/tags/black/arrow_down.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/black/arrow_left.paa
Normal file
BIN
addons/tagging/UI/tags/black/arrow_left.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/black/arrow_right.paa
Normal file
BIN
addons/tagging/UI/tags/black/arrow_right.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/black/arrow_up.paa
Normal file
BIN
addons/tagging/UI/tags/black/arrow_up.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/black/circle.paa
Normal file
BIN
addons/tagging/UI/tags/black/circle.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/black/cross.paa
Normal file
BIN
addons/tagging/UI/tags/black/cross.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/black/diamond.paa
Normal file
BIN
addons/tagging/UI/tags/black/diamond.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/black/square.paa
Normal file
BIN
addons/tagging/UI/tags/black/square.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/black/triangle.paa
Normal file
BIN
addons/tagging/UI/tags/black/triangle.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/black/triangle_inverted.paa
Normal file
BIN
addons/tagging/UI/tags/black/triangle_inverted.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/blue/arrow_down.paa
Normal file
BIN
addons/tagging/UI/tags/blue/arrow_down.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/blue/arrow_left.paa
Normal file
BIN
addons/tagging/UI/tags/blue/arrow_left.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/blue/arrow_right.paa
Normal file
BIN
addons/tagging/UI/tags/blue/arrow_right.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/blue/arrow_up.paa
Normal file
BIN
addons/tagging/UI/tags/blue/arrow_up.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/blue/circle.paa
Normal file
BIN
addons/tagging/UI/tags/blue/circle.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/blue/cross.paa
Normal file
BIN
addons/tagging/UI/tags/blue/cross.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/blue/diamond.paa
Normal file
BIN
addons/tagging/UI/tags/blue/diamond.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/blue/square.paa
Normal file
BIN
addons/tagging/UI/tags/blue/square.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/blue/triangle.paa
Normal file
BIN
addons/tagging/UI/tags/blue/triangle.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/blue/triangle_inverted.paa
Normal file
BIN
addons/tagging/UI/tags/blue/triangle_inverted.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/green/arrow_down.paa
Normal file
BIN
addons/tagging/UI/tags/green/arrow_down.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/green/arrow_left.paa
Normal file
BIN
addons/tagging/UI/tags/green/arrow_left.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/green/arrow_right.paa
Normal file
BIN
addons/tagging/UI/tags/green/arrow_right.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/green/arrow_up.paa
Normal file
BIN
addons/tagging/UI/tags/green/arrow_up.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/green/circle.paa
Normal file
BIN
addons/tagging/UI/tags/green/circle.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/green/cross.paa
Normal file
BIN
addons/tagging/UI/tags/green/cross.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/green/diamond.paa
Normal file
BIN
addons/tagging/UI/tags/green/diamond.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/green/square.paa
Normal file
BIN
addons/tagging/UI/tags/green/square.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/green/triangle.paa
Normal file
BIN
addons/tagging/UI/tags/green/triangle.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/green/triangle_inverted.paa
Normal file
BIN
addons/tagging/UI/tags/green/triangle_inverted.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/red/arrow_down.paa
Normal file
BIN
addons/tagging/UI/tags/red/arrow_down.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/red/arrow_left.paa
Normal file
BIN
addons/tagging/UI/tags/red/arrow_left.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/red/arrow_right.paa
Normal file
BIN
addons/tagging/UI/tags/red/arrow_right.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/red/arrow_up.paa
Normal file
BIN
addons/tagging/UI/tags/red/arrow_up.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/red/circle.paa
Normal file
BIN
addons/tagging/UI/tags/red/circle.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/red/cross.paa
Normal file
BIN
addons/tagging/UI/tags/red/cross.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/red/diamond.paa
Normal file
BIN
addons/tagging/UI/tags/red/diamond.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/red/square.paa
Normal file
BIN
addons/tagging/UI/tags/red/square.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/red/triangle.paa
Normal file
BIN
addons/tagging/UI/tags/red/triangle.paa
Normal file
Binary file not shown.
BIN
addons/tagging/UI/tags/red/triangle_inverted.paa
Normal file
BIN
addons/tagging/UI/tags/red/triangle_inverted.paa
Normal file
Binary file not shown.
@ -3,6 +3,7 @@ PREP(addTagActions);
|
||||
PREP(applyCustomTag);
|
||||
PREP(checkTaggable);
|
||||
PREP(compileConfigTags);
|
||||
PREP(compileTagAction);
|
||||
PREP(createTag);
|
||||
PREP(moduleInit);
|
||||
PREP(parseConfigTag);
|
||||
|
@ -7,7 +7,7 @@ PREP_RECOMPILE_START;
|
||||
PREP_RECOMPILE_END;
|
||||
|
||||
GVAR(cachedTags) = [];
|
||||
GVAR(cachedRequiredItems) = [];
|
||||
GVAR(itemActions) = createHashMap;
|
||||
|
||||
#include "initSettings.sqf"
|
||||
|
||||
|
@ -19,38 +19,18 @@ params ["_unit"];
|
||||
|
||||
private _actions = [];
|
||||
{
|
||||
_x params ["_class", "_displayName", "_requiredItem", "_textures", "_icon", "_materials"];
|
||||
|
||||
_actions pushBack [
|
||||
[
|
||||
format ["ACE_ConfigTag_%1", _class],
|
||||
_displayName,
|
||||
_icon,
|
||||
{
|
||||
(_this select 2) params ["_unit", "_class", "_textures", "", "_materials"];
|
||||
|
||||
(
|
||||
if (count _textures == count _materials) then {
|
||||
private _textureIndex = floor random count _textures;
|
||||
[_textures select _textureIndex, _materials select _textureIndex]
|
||||
} else {
|
||||
[selectRandom _textures, selectRandom _materials]
|
||||
}
|
||||
) params ["_randomTexture", "_randomMaterial"];
|
||||
|
||||
[_unit, _randomTexture, _randomMaterial] call FUNC(tag);
|
||||
_unit setVariable [QGVAR(lastUsedTag), _class];
|
||||
},
|
||||
{
|
||||
(_this select 2) params ["_unit", "", "", "_requiredItem"];
|
||||
_requiredItem in (_unit call EFUNC(common,uniqueItems))
|
||||
},
|
||||
format ["ACE_TagItem_%1", _x],
|
||||
getText (configFile >> "CfgWeapons" >> _x >> "displayName"),
|
||||
getText (configFile >> "CfgWeapons" >> _x >> "picture"),
|
||||
{},
|
||||
[_unit, _class, _textures, _requiredItem, _materials]
|
||||
{(_this select 2) in (_player call EFUNC(common,uniqueItems))},
|
||||
{},
|
||||
_x
|
||||
] call EFUNC(interact_menu,createAction),
|
||||
[],
|
||||
_y apply { [_x, [], _unit] }, //sub-actions for each individual tag
|
||||
_unit
|
||||
];
|
||||
} forEach GVAR(cachedTags);
|
||||
|
||||
]
|
||||
} forEach GVAR(itemActions);
|
||||
_actions
|
||||
|
@ -36,5 +36,5 @@ _requiredItem = configName (configFile >> "CfgWeapons" >> _requiredItem); // Con
|
||||
_this set [2, _requiredItem];
|
||||
|
||||
GVAR(cachedTags) pushBack _this;
|
||||
GVAR(cachedRequiredItems) pushBackUnique _requiredItem;
|
||||
_this call FUNC(compileTagAction);
|
||||
TRACE_1("Added custom script tag",_this);
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
// Exit if no required item in inventory
|
||||
if ([_unit, {
|
||||
GVAR(cachedRequiredItems) arrayIntersect (_unit call EFUNC(common,uniqueItems)) isEqualTo []
|
||||
(keys GVAR(itemActions)) arrayIntersect (_unit call EFUNC(common,uniqueItems)) isEqualTo []
|
||||
}, _unit, QGVAR(checkRequiredItemsCache), 9999, "cba_events_loadoutEvent"] call EFUNC(common,cachedCall)) exitWith {false};
|
||||
|
||||
private _startPosASL = eyePos _unit;
|
||||
|
@ -23,7 +23,7 @@
|
||||
_result params ["_tagInfo", "_requiredItem"];
|
||||
|
||||
GVAR(cachedTags) pushBack _tagInfo;
|
||||
GVAR(cachedRequiredItems) pushBackUnique _requiredItem;
|
||||
_tagInfo call FUNC(compileTagAction);
|
||||
};
|
||||
} forEach ("true" configClasses (configFile >> "ACE_Tags"));
|
||||
|
||||
@ -35,6 +35,6 @@
|
||||
_result params ["_tagInfo", "_requiredItem"];
|
||||
|
||||
GVAR(cachedTags) pushBack _tagInfo;
|
||||
GVAR(cachedRequiredItems) pushBackUnique _requiredItem;
|
||||
_tagInfo call FUNC(compileTagAction);
|
||||
};
|
||||
} forEach ("true" configClasses (missionConfigFile >> "ACE_Tags"));
|
||||
|
46
addons/tagging/functions/fnc_compileTagAction.sqf
Normal file
46
addons/tagging/functions/fnc_compileTagAction.sqf
Normal file
@ -0,0 +1,46 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
* Compiles tags from ACE_Tags and returns children actions.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit] call ace_tagging_fnc_compileTagAction
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_class", "_displayName", "_requiredItem", "_textures", "_icon", "_materials"];
|
||||
|
||||
private _actions = GVAR(itemActions) getOrDefault [_requiredItem, []];
|
||||
|
||||
_actions pushBack ([
|
||||
_class,
|
||||
_displayName,
|
||||
_icon,
|
||||
{
|
||||
(_this select 2) params ["_class", "_textures", "_materials"];
|
||||
|
||||
(
|
||||
if (count _textures == count _materials) then {
|
||||
private _textureIndex = floor random count _textures;
|
||||
[_textures select _textureIndex, _materials select _textureIndex]
|
||||
} else {
|
||||
[selectRandom _textures, selectRandom _materials]
|
||||
}
|
||||
) params ["_randomTexture", "_randomMaterial"];
|
||||
|
||||
[_player, _randomTexture, _randomMaterial] call FUNC(tag);
|
||||
_player setVariable [QGVAR(lastUsedTag), _class];
|
||||
},
|
||||
{true}, // required item is checked at an upper level
|
||||
{},
|
||||
[_class, _textures, _materials]
|
||||
] call EFUNC(interact_menu,createAction));
|
||||
|
||||
GVAR(itemActions) set [_requiredItem, _actions];
|
@ -191,6 +191,36 @@
|
||||
<Chinese>藍色X標記</Chinese>
|
||||
<Turkish>X Mavi</Turkish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Tagging_arrow_up">
|
||||
<English>Up Arrow</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Tagging_arrow_down">
|
||||
<English>Down Arrow</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Tagging_arrow_left">
|
||||
<English>Left Arrow</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Tagging_arrow_right">
|
||||
<English>Right Arrow</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Tagging_circle">
|
||||
<English>Circle</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Tagging_cross">
|
||||
<English>Cross</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Tagging_diamond">
|
||||
<English>Diamond</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Tagging_square">
|
||||
<English>Square</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Tagging_triangle">
|
||||
<English>Triangle</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Tagging_triangle_inverted">
|
||||
<English>Triangle Inverted</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Tagging_SpraypaintBlack">
|
||||
<English>Spray Paint (Black)</English>
|
||||
<German>Sprühfarbe (Schwarz)</German>
|
||||
|
Loading…
Reference in New Issue
Block a user