Eden Editor: Entity Context Menu

From Bohemia Interactive Community
Revision as of 17:58, 3 December 2016 by R3vo (talk | contribs)
Jump to navigation Jump to search

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;