Eden Editor: Entity Context Menu: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(wording)
m (Removed: Description of simple expressions. That one belongs to the Simple Expressions page, not here.)
Line 1: Line 1:
WIP
WIP
[[Category:Eden Editor|Entity Context Menu]]
[[Category:Eden Editor: Editing|Entity Context Menu]]


== Conditions ==
== Conditions ==
Line 11: Line 8:
<code>class YourEntry
<code>class YourEntry
{
{
action = "call BIS_fnc_someFunction";//Can be any kind of expression defined as string
action = "call BIS_fnc_someFunction"; // Can be any kind of expression defined as string
Text = "Delete Crew";//Name shown in the context menu
text = "Delete Crew"; // Name shown in the context menu
conditionShow = "hoverObjectVehicle";//Condition
conditionShow = "hoverObjectVehicle"; // Condition
};</code>
};</code>


The condition can be one of the strings from the table below, or a combination of multiple conditions.<br><br>
The condition is a [[Simple Expression]] and can use one of the variables below:
 
'''Example 1''': <code>conditionShow = "hoverObjectCanFly";</code>
Entry will only show if the object you are hovering over can fly.<br><br>
 
'''Example 2:'''  <code>conditionShow = "hoverObjectCanFly * (1 - hoverObjectFlying)";</code>
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? ===
Let's take a closer look at example two.<br><br>
'''hoverObjectCanFly''' and '''hoverObjectFlying''' are two boolean values, which can either be [[true]] (0) or [[false]] (1).<br><br>
If '''hoverObjectCanFly'''  is [[true]] (1) and '''hoverObjectFlying''' is [[false]] (0) the resulting equation looks like this:<br>
<code>1 * (1-0) = x
1 * 1 = x
x = 1</code>
The result will be [[true]] (1), therefore the entry will be shown.
=== Supported Conditions ===
{| class="wikitable sortable"
{| class="wikitable sortable"
! Condition
! Condition
Line 48: Line 27:
| <!-- Condition --> hoverObjectVehicle
| <!-- Condition --> hoverObjectVehicle
| <!-- Description -->True when hovering over a vehicle
| <!-- Description -->True when hovering over a vehicle
|-
| <!-- Condition --> IsInternal
| <!-- Description -->Unknown
|-
|-
| <!-- Condition --> hoverObject
| <!-- Condition --> hoverObject
Line 69: Line 45:
| <!-- Condition --> hoverMarker
| <!-- Condition --> hoverMarker
| <!-- Description -->True when hovering over any marker
| <!-- Description -->True when hovering over any marker
|-
| <!-- Condition --> hoverObjectAttached
| <!-- Description -->Unknown
|-
|-
| <!-- Condition --> isMultiplayer
| <!-- Condition --> isMultiplayer
Line 80: Line 53:
|-
|-
| <!-- Condition --> isEditList
| <!-- Condition --> isEditList
| <!-- Description -->Unknown
| <!-- Description -->True when the menu is opened from entity menu
|-
|-
| <!-- Condition --> hoverLayer
| <!-- Condition --> hoverLayer
Line 103: Line 76:
| <!-- Description -->True when a Marker is selected
| <!-- Description -->True when a Marker is selected
|}
|}
[[Category:Eden Editor|Entity Context Menu]]
[[Category:Eden Editor: Modding|Entity Context Menu]]

Revision as of 11:38, 5 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 is a Simple Expression and can use one of the variables below:

Condition Description
selected True when an Eden entity is selected
hoverObjectBrain True when hovering over an object with simulation "soldier" or "UAVpilot"
hoverObjectVehicle True when hovering over a vehicle
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
isMultiplayer True when editing in multiplayer environment
hoverObjectUav True when hovering over an UAV
isEditList True when the menu is opened from entity menu
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