Eden Editor: Entity Context Menu: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Added available conditions, WIP)
No edit summary
Line 4: Line 4:




== Conditions ==


'''Available Conditions:''' Needs to be cleaned up + explanations
*Context menu entires 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:
 
<code>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
};</code>
 
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>
Entry will only show if the selected object can fly.<br><br>
 
'''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>
 
'''How does it work?''' <br><br>
hoverObjectCanFly is nothing less than a bool, which can either be 0 or 1. Same for  hoverObjectFlying.
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:'''
{| class="wikitable sortable"
! Condition
! class="unsortable" | For Type
! class="unsortable" | Description
|-
| <!-- Condition --> objectBrain
| <!-- Type --> Object
| <!-- Description -->Object with simulation "soldier" or "UAVpilot"
|-
| <!-- Condition --> objectControllable
| <!-- Type --> Object
| <!-- Description -->Object with simulation "soldier"
|-
| <!-- Condition --> objectAgent
| <!-- Type --> Object
| <!-- Description --> Object with non-empty ''agentTasks[]'', i.e., animals
|-
| <!-- Condition --> objectVehicle
| <!-- Type --> Object
| <!-- Description -->Vehicle which can be boarded
|-
| <!-- Condition --> objectSimulated
| <!-- Type --> Object
| <!-- Description --> Object which is simulated (e.g., falls down when in the air)
|-
| <!-- Condition --> objectDestructable
| <!-- Type --> Object
| <!-- Description -->Indestructible object, i.e., when ''destrType'' config property set not ''DestructNo''
|-
| <!-- Condition --> logicModule
| <!-- Type --> Logic
| <!-- Description -->Logic which is a module (''vehicleClass'' config property is ''"Modules"'')
|-
| <!-- Condition --> objectHasInventoryCargo
| <!-- Type --> Object
| <!-- Description -->All objects which have an openable inventory
|}


hoverObject<br>
hoverObject<br>
(1 - (selected))<br>
selected<br>
selected<br>
(hoverObjectBrain * (1 - (hoverObjectVehicle))) + (hoverObjectVehicle * IsInternal)<br>
selected<br>
hoverObject + hoverGroup + hoverTrigger + hoverWaypoint + hoverLogic + hoverMarker<br>
hoverObject * (1 - (hoverObjectAttached))<br>
hoverObject * hoverObjectAttached<br>
(1 - (hoverObjectBrain)) * (1 - (isMultiplayer))<br>
hoverObjectBrain * (1 - (isMultiplayer)) * (1 - (HoverObjectUav))<br>
(1 - (isEditList))<br>
hoverLayer<br>
hoverObject + hoverGroup<br>
hoverObjectBrain<br>
hoverObjectBrain<br>
hoverObjectBrain + hoverGroup<br>
hoverObjectCanFly * (1 - (hoverObjectFlying))<br>
hoverObject + hoverTrigger + hoverWaypoint + hoverLogic<br>
selectedObject + selectedWaypoint + selectedLogic + selectedMarker<br>
hoverObject + hoverGroup + + hoverTrigger + hoverWaypoint + hoverLogic + hoverMarker + hoverLayer<br>
hoverObject + hoverWaypoint + hoverLogic + hoverMarker<br>
hoverObjectBrain * (1 - (hoverObjectVehicle))<br>
hoverObjectVehicle<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>
selectedObject<br>
selectedTrigger<br>
selectedWaypoint<br>
selectedLogic<br>
selectedLogic<br>
selectedVehicle<br>
selectedMarker<br>
<br><br>
 
'''Exported with:'''
'''Exported with:'''



Revision as of 16:58, 3 December 2016

WIP


Conditions

  • Context menu entires 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 = "objectCanFly"; Entry will only show if the selected object can fly.

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

How does it work?

hoverObjectCanFly is nothing less than a bool, which can either be 0 or 1. Same for hoverObjectFlying. 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:

Condition For Type Description
objectBrain Object Object with simulation "soldier" or "UAVpilot"
objectControllable Object Object with simulation "soldier"
objectAgent Object Object with non-empty agentTasks[], i.e., animals
objectVehicle Object Vehicle which can be boarded
objectSimulated Object Object which is simulated (e.g., falls down when in the air)
objectDestructable Object Indestructible object, i.e., when destrType config property set not DestructNo
logicModule Logic Logic which is a module (vehicleClass config property is "Modules")
objectHasInventoryCargo Object All objects which have an openable inventory

hoverObject
selected
selected
hoverObjectBrain
hoverObjectVehicle
hoverObjectVehicle
IsInternal
hoverObject
hoverGroup
hoverTrigger
hoverWaypoint
hoverLogic
hoverMarker
hoverObjectAttached
hoverObjectBrain
isMultiplayer
hoverObjectUav
isEditList
hoverLayer
hoverObjectCanFly
hoverObjectFlying
selectedObject
selectedWaypoint
selectedLogic
selectedMarker

Exported with:

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;