Eden Editor: Entity Context Menu: Difference between revisions
Category: Eden Editor: Modding
(Added missing conditions) |
(Entire overhaul of the documentation and added 2.22 additions) |
||
| Line 7: | Line 7: | ||
[[File:A3_3DEN_contextMenu.jpg|500px]] | [[File:A3_3DEN_contextMenu.jpg|500px]] | ||
=== | == Config == | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
class ctrlMenu; // | class ctrlMenu; // Load base class | ||
class Display3DEN | class Display3DEN | ||
{ | { | ||
| Line 42: | Line 16: | ||
class Items | class Items | ||
{ | { | ||
items[] += {"TAG_RootFolder"}; // Root items | |||
class TAG_RootFolder // Level 1 item | |||
class | |||
{ | { | ||
picture = "someLogo.paa"; | |||
picture = "someLogo.paa"; | |||
text = "Custom Folder"; | text = "Custom Folder"; | ||
value = 0; | value = 0; | ||
items[] = | items[] = {"TAG_ShowSomeText"}; // Items in "folder" TAG_RootFolder | ||
}; | }; | ||
class TAG_ShowSomeText // | class TAG_ShowSomeText // Level 2 item | ||
{ | { | ||
text = "Show Text"; | text = "Show Text"; | ||
action = "systemChat 'Showing some text.'"; | action = "systemChat 'Showing some text.'"; | ||
conditionShow = "hoverObject"; | conditionShow = "hoverObject"; | ||
}; | }; | ||
}; | }; | ||
| Line 93: | Line 35: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Properties === | |||
= | {| class="wikitable" | ||
! Property !! Description !! Data type | |||
|- | |||
| text|| Text shown in the menu. Can be [[isLocalized|localized]]. || [[String]] | |||
|- | |||
| picture || Item path to a picture shown in front of the text. || [[String]] | |||
|- | |||
{ | | action || An SQF expression [[call]]ed when the item is activated. || [[String]] | ||
|- | |||
| data || Used by the engine. Internal use only. || [[String]] | |||
|- | |||
} | | enable || Used by the engine. Internal use only. || [[Number]] | ||
|- | |||
| shortcuts[] || Each entry can have a single shortcut assigned to it. The shortcut only works when the context menu is open. This did not work prior to {{GVI|arma3|2.22}}. || [[Array]] | |||
|- | |||
| value || An internal bit flag. Set it to 0 to always show the item in the root of the config menu. Otherwise ignore it. || [[Number]] | |||
|- | |||
| {{GVI|arma3|2.22}} conditionScript1 || Scripted condition that needs to return a [[Boolean]]. It is only evaluated if simple expression {{hl|script1}} is used inside {{hl|conditionShow}}. | |||
{{Feature|warning|This condition is evaluated for all menu items and all selected entities {{hl|entityCount * menuItemCount {{=}} evaluationCount}}. Keep these expressions as simple as possible!}} | |||
|| [[String]] | |||
|- | |||
| conditionShow || A condition represented as simple expression. Needs to return 1 ([[true]]) in order for the item to be visible. A list of all available expression is listed below.|| [[String]] | |||
|} | |||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
| Line 114: | Line 65: | ||
! class="unsortable" | Description | ! class="unsortable" | Description | ||
|- | |- | ||
| | | hoverFolder | ||
| True when hovering over a folder (layer) | |||
| True when hovering over a | |||
|- | |- | ||
| hoverGroup | | hoverGroup | ||
| True when hovering over any group | | True when hovering over any group | ||
|- | |- | ||
| | | hoverLayer | ||
| True when hovering over | | True when hovering over a Layer | ||
|- | |- | ||
| hoverLogic | | hoverLogic | ||
| True when hovering over any logic | | True when hovering over any logic | ||
|- | |||
| hoverLogicModule | |||
| True when hovering over a module | |||
|- | |- | ||
| hoverMarker | | hoverMarker | ||
| True when hovering over any marker | | True when hovering over any marker | ||
|- | |- | ||
| | | hoverMarkerArea | ||
| True when | | True when hovering over a marker of type area | ||
|- | |||
| hoverObject | |||
| True when hovering over any object | |||
|- | |||
| hoverObjectAgent | |||
| | |||
|- | |- | ||
| | | hoverObjectAttached | ||
| | | | ||
|- | |- | ||
| | | hoverObjectBrain | ||
| True when hovering over | | True when hovering over an object with simulation "soldier" or "UAVpilot" | ||
|- | |- | ||
| hoverObjectCanFly | | hoverObjectCanFly | ||
| Line 154: | Line 102: | ||
|- | |- | ||
| hoverObjectFlying | | hoverObjectFlying | ||
| True when hovering over a object that can fly | | True when hovering over a object that can fly | ||
|- | |- | ||
| | | hoverObjectUav | ||
| True when hovering over | | True when hovering over an UAV | ||
|- | |- | ||
| | | hoverObjectVehicle | ||
| True when hovering over a | | True when hovering over a vehicle | ||
|- | |- | ||
| | | hoverTrigger | ||
| True when hovering over | | True when hovering over any trigger | ||
|- | |- | ||
| | | hoverWaypoint | ||
| True when hovering over any waypoint | |||
| | |||
|- | |- | ||
| IsInternal | | IsInternal | ||
| Line 191: | Line 121: | ||
| IsMultiplayer | | IsMultiplayer | ||
| True when editing in multiplayer | | True when editing in multiplayer | ||
|- | |||
| isMultiplayer | |||
| True when editing in multiplayer environment | |||
|- | |- | ||
| Map | | Map | ||
| True when the map is open | | True when the map is open | ||
|- | |- | ||
| | | selected | ||
| True when an Eden entity is selected | |||
|- | |||
| selectedGroup | |||
| True when a group is selected | | True when a group is selected | ||
|- | |- | ||
| | | selectedLogic | ||
| True when a logic is selected | |||
|- | |||
| selectedLogicModule | |||
| Try when a module is selected | | Try when a module is selected | ||
|- | |- | ||
| | | selectedMarker | ||
| True when a Marker is selected | |||
|- | |||
| selectedMarkerArea | |||
| True when a marker of type area is selected | | True when a marker of type area is selected | ||
|- | |- | ||
| | | selectedObject | ||
| True when an object is selected | |||
|- | |||
| selectedObjectAgent | |||
| | | | ||
|- | |- | ||
| | | selectedObjectAttached | ||
| | | | ||
|- | |- | ||
| | | selectedObjectBrain | ||
| True when an object with simulation "soldier" or "UAVpilot" is selected | | True when an object with simulation "soldier" or "UAVpilot" is selected | ||
|- | |- | ||
| | | selectedObjectCanFly | ||
| True when the selected object can fly | | True when the selected object can fly | ||
|- | |- | ||
| | | selectedObjectFlying | ||
| True when the selected object is flying | | True when the selected object is flying | ||
|- | |- | ||
| | | selectedObjectVehicle | ||
| True when a vehicle is selected | | True when a vehicle is selected | ||
|- | |- | ||
| | | selectedTrigger | ||
| True when a trigger is selected | | True when a trigger is selected | ||
|- | |||
| selectedWaypoint | |||
| True when a waypoint is selected | |||
|- | |||
| {{GVI|arma3|2.22}} script1 | |||
| Contains SQF condition defined in {{hl|scriptedCondition1}} property. | |||
|} | |} | ||
== Variables == | == Variables == | ||
Once the menu has been opened, the following variables can be accessed: | Once the menu has been opened, the following variables can be accessed: | ||
<sqf>(uiNamespace getVariable "BIS_fnc_3DENEntityMenu_data") params ["_posEntity3D", "_entity"];</sqf> | <sqf>(uiNamespace getVariable "BIS_fnc_3DENEntityMenu_data") params ["_posEntity3D", "_entity"];</sqf> | ||
Revision as of 18:27, 19 April 2026
Create a custom Entity Context Menu entry
- Entries for the Context Menu are defined in the class Display3DEN.
- The menu has multiple levels, the first level for example contains options like "Go Here" or folders like "Log". Those folders on the other hand can have another level, level 2.
Config
class ctrlMenu; // Load base class
class Display3DEN
{
class ContextMenu : ctrlMenu
{
class Items
{
items[] += {"TAG_RootFolder"}; // Root items
class TAG_RootFolder // Level 1 item
{
picture = "someLogo.paa";
text = "Custom Folder";
value = 0;
items[] = {"TAG_ShowSomeText"}; // Items in "folder" TAG_RootFolder
};
class TAG_ShowSomeText // Level 2 item
{
text = "Show Text";
action = "systemChat 'Showing some text.'";
conditionShow = "hoverObject";
};
};
};
};
Properties
| Property | Description | Data type |
|---|---|---|
| text | Text shown in the menu. Can be localized. | String |
| picture | Item path to a picture shown in front of the text. | String |
| action | An SQF expression called when the item is activated. | String |
| data | Used by the engine. Internal use only. | String |
| enable | Used by the engine. Internal use only. | Number |
| shortcuts[] | Each entry can have a single shortcut assigned to it. The shortcut only works when the context menu is open. This did not work prior to |
Array |
| value | An internal bit flag. Set it to 0 to always show the item in the root of the config menu. Otherwise ignore it. | Number |
| Scripted condition that needs to return a Boolean. It is only evaluated if simple expression script1 is used inside conditionShow. | String | |
| conditionShow | A condition represented as simple expression. Needs to return 1 (true) in order for the item to be visible. A list of all available expression is listed below. | String |
| Condition | Description |
|---|---|
| hoverFolder | True when hovering over a folder (layer) |
| hoverGroup | True when hovering over any group |
| hoverLayer | True when hovering over a Layer |
| hoverLogic | True when hovering over any logic |
| hoverLogicModule | True when hovering over a module |
| hoverMarker | True when hovering over any marker |
| hoverMarkerArea | True when hovering over a marker of type area |
| hoverObject | True when hovering over any object |
| hoverObjectAgent | |
| hoverObjectAttached | |
| hoverObjectBrain | True when hovering over an object with simulation "soldier" or "UAVpilot" |
| hoverObjectCanFly | True when hovering an object which can fly |
| hoverObjectFlying | True when hovering over a object that can fly |
| hoverObjectUav | True when hovering over an UAV |
| hoverObjectVehicle | True when hovering over a vehicle |
| hoverTrigger | True when hovering over any trigger |
| hoverWaypoint | True when hovering over any waypoint |
| IsInternal | True when using internal executable. For developers only! |
| IsMultiplayer | True when editing in multiplayer |
| isMultiplayer | True when editing in multiplayer environment |
| Map | True when the map is open |
| selected | True when an Eden entity is selected |
| selectedGroup | True when a group is selected |
| selectedLogic | True when a logic is selected |
| selectedLogicModule | Try when a module is selected |
| selectedMarker | True when a Marker is selected |
| selectedMarkerArea | True when a marker of type area is selected |
| selectedObject | True when an object is selected |
| selectedObjectAgent | |
| selectedObjectAttached | |
| selectedObjectBrain | True when an object with simulation "soldier" or "UAVpilot" is selected |
| selectedObjectCanFly | True when the selected object can fly |
| selectedObjectFlying | True when the selected object is flying |
| selectedObjectVehicle | True when a vehicle is selected |
| selectedTrigger | True when a trigger is selected |
| selectedWaypoint | True when a waypoint is selected |
| Contains SQF condition defined in scriptedCondition1 property. |
Variables
Once the menu has been opened, the following variables can be accessed: