Eden Editor: Entity Context Menu: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
(Further formatting)
Line 6: Line 6:
== Conditions ==
== Conditions ==


*Context menu entires can have different conditions which need to be true in order for the entry to appear
*Context menu entries can have different conditions which need to be true in order for the entry to appear.
*The condition is defined by the '''conditionShow''' config entry:
*The condition is defined by the '''conditionShow''' config entry.


<code>class YourEntry
<code>class YourEntry
Line 18: Line 18:
The condition can be one of the strings from the table below, or a combination of multiple conditions.<br><br>
The condition can be one of the strings from the table below, or a combination of multiple conditions.<br><br>


'''Example 1''': <code>conditionShow = "objectCanFly";</code>
'''Example 1''': <code>conditionShow = "hoverObjectCanFly";</code>
Entry will only show if the selected object can fly.<br><br>
Entry will only show if the object you are hovering over can fly.<br><br>


'''Example 2:'''  <code>conditionShow = "hoverObjectCanFly * (1 - hoverObjectFlying)";</code>
'''Example 2:'''  <code>conditionShow = "hoverObjectCanFly * (1 - hoverObjectFlying)";</code>
Entry will only show if the object can fly and the object isn't flying.<br><br>
Entry will only show if the object you are hovering over can fly and the object isn't flying.<br><br>


'''How does it work?''' <br><br>
=== How does it work? ===
hoverObjectCanFly is nothing less than a bool, which can either be 0 or 1. Same for  hoverObjectFlying.
'''hoverObjectFlying''' and '''hoverObjectCanFly''' are nothing less than two boolean values, which can either be [[true]] (0) or [[false]] (1).<br><br>
If hoverObjectFlying is false (0) and hoverObjectCanFly is true(1) the resulting formular looks like this:
1 * (1-0) = 1//true, the entry will be displayed.


'''Supported conditions:'''
If '''hoverObjectFlying''' is [[false]] (0) and '''hoverObjectCanFly''' is [[true]] (1) the resulting formular looks like this:<br>
 
<code>1 * (1-0) = 1</code>
The result will be [[true]] (1), therefore the entry will be shown.
=== Supported Conditions ===
{| class="wikitable sortable"
{| class="wikitable sortable"
! Condition
! Condition
! class="unsortable" | For Type
! class="unsortable" | Description
! class="unsortable" | Description
|-
|-
| <!-- Condition --> objectBrain
| <!-- Condition --> selected
| <!-- Type --> Object
| <!-- Description -->True when an Eden entity is selected
| <!-- Description -->Object with simulation "soldier" or "UAVpilot"
|-
| <!-- Condition --> hoverObjectBrain
| <!-- Description -->True when hovering over an objectBrain, e.g, AI
|-
| <!-- Condition --> hoverObjectVehicle
| <!-- Description -->True when hovering over a vehicle
|-
| <!-- Condition --> IsInternal
| <!-- Description -->Unknown
|-
| <!-- Condition --> hoverObject
| <!-- Description -->True when hovering over any object
|-
| <!-- Condition --> hoverGroup
| <!-- Description -->True when hovering over any group
|-
|-
| <!-- Condition --> objectControllable
| <!-- Condition --> hoverTrigger
| <!-- Type --> Object
| <!-- Description -->True when hovering over any trigger
| <!-- Description -->Object with simulation "soldier"
|-
|-
| <!-- Condition --> objectAgent
| <!-- Condition --> hoverWaypoint
| <!-- Type --> Object
| <!-- Description -->True when hovering over any waypoint
| <!-- Description --> Object with non-empty ''agentTasks[]'', i.e., animals
|-
|-
| <!-- Condition --> objectVehicle
| <!-- Condition --> hoverLogic
| <!-- Type --> Object
| <!-- Description -->True when hovering over any logic
| <!-- Description -->Vehicle which can be boarded
|-
|-
| <!-- Condition --> objectSimulated
| <!-- Condition --> hoverMarker
| <!-- Type --> Object
| <!-- Description -->True when hovering over any marker
| <!-- Description --> Object which is simulated (e.g., falls down when in the air)
|-
|-
| <!-- Condition --> objectDestructable
| <!-- Condition --> hoverObjectAttached
| <!-- Type --> Object
| <!-- Description -->Unknown
| <!-- Description -->Indestructible object, i.e., when ''destrType'' config property set not ''DestructNo''
|-
|-
| <!-- Condition --> logicModule
| <!-- Condition --> isMultiplayer
| <!-- Type --> Logic
| <!-- Description -->True when editing in multiplayer environment
| <!-- Description -->Logic which is a module (''vehicleClass'' config property is ''"Modules"'')
|-
|-
| <!-- Condition --> objectHasInventoryCargo
| <!-- Condition --> hoverObjectUav
| <!-- Type --> Object
| <!-- Description -->True when hovering over an UAV
| <!-- Description -->All objects which have an openable inventory
|-
| <!-- Condition --> isEditList
| <!-- Description -->Unknown
|-
| <!-- Condition --> hoverLayer
| <!-- Description -->True when hovering over a Layer
|-
| <!-- Condition --> hoverObjectCanFly
| <!-- Description -->True when hovering an object which can fly
|-
| <!-- Condition --> hoverObjectCanFly
| <!-- Description -->True when hovering an object which is flying
|-
| <!-- Condition --> selectedObject
| <!-- Description -->True when an object is selected
|-
| <!-- Condition --> selectedWaypoint
| <!-- Description -->True when a waypoint is selected
|-
| <!-- Condition --> selectedLogic
| <!-- Description -->True when a logic is selected
|-
| <!-- Condition --> selectedMarker
| <!-- Description -->True when a Marker is selected
|}
|}
hoverObject<br>
selected<br>
selected<br>
hoverObjectBrain<br>
hoverObjectVehicle<br>
hoverObjectVehicle<br>
IsInternal<br>
hoverObject<br>
hoverGroup<br>
hoverTrigger<br>
hoverWaypoint<br>
hoverLogic<br>
hoverMarker<br>
hoverObjectAttached<br>
hoverObjectBrain<br>
isMultiplayer<br>
hoverObjectUav<br>
isEditList<br>
hoverLayer<br>
hoverObjectCanFly<br>
hoverObjectFlying<br>
selectedObject<br>
selectedWaypoint<br>
selectedLogic<br>
selectedMarker<br>
'''Exported with:'''
<code>private _classes = "true" configClasses (configFile >> "Display3DEN" >> "ContextMenu" >> "Items");
private _conditions = [];
private _export = "";
private _lb = toString [0x0D, 0x0A];
{
private _name = configName _x;
private _text = getText (configFile >> "Display3DEN" >> "ContextMenu" >> "Items" >> _name >> "ConditionShow");
_conditions pushBackUnique _text;
} forEach _classes;
{
_export = _export + _x + _lb;
systemChat _export;
} forEach _conditions;
copyToClipboard _export;</code>

Revision as of 18:15, 3 December 2016

WIP


Conditions

  • Context menu entries can have different conditions which need to be true in order for the entry to appear.
  • The condition is defined by the conditionShow config entry.

class YourEntry { action = "call BIS_fnc_someFunction";//Can be any kind of expression defined as string Text = "Delete Crew";//Name shown in the context menu conditionShow = "hoverObjectVehicle";//Condition };

The condition can be one of the strings from the table below, or a combination of multiple conditions.

Example 1: conditionShow = "hoverObjectCanFly"; Entry will only show if the object you are hovering over can fly.

Example 2: conditionShow = "hoverObjectCanFly * (1 - hoverObjectFlying)"; Entry will only show if the object you are hovering over can fly and the object isn't flying.

How does it work?

hoverObjectFlying and hoverObjectCanFly are nothing less than two boolean values, which can either be true (0) or false (1).

If hoverObjectFlying is false (0) and hoverObjectCanFly is true (1) the resulting formular looks like this:

1 * (1-0) = 1 The result will be true (1), therefore the entry will be shown.

Supported Conditions

Condition Description
selected True when an Eden entity is selected
hoverObjectBrain True when hovering over an objectBrain, e.g, AI
hoverObjectVehicle True when hovering over a vehicle
IsInternal Unknown
hoverObject True when hovering over any object
hoverGroup True when hovering over any group
hoverTrigger True when hovering over any trigger
hoverWaypoint True when hovering over any waypoint
hoverLogic True when hovering over any logic
hoverMarker True when hovering over any marker
hoverObjectAttached Unknown
isMultiplayer True when editing in multiplayer environment
hoverObjectUav True when hovering over an UAV
isEditList Unknown
hoverLayer True when hovering over a Layer
hoverObjectCanFly True when hovering an object which can fly
hoverObjectCanFly True when hovering an object which is flying
selectedObject True when an object is selected
selectedWaypoint True when a waypoint is selected
selectedLogic True when a logic is selected
selectedMarker True when a Marker is selected