Entity Ops Definition

The right-click menu of an item or object.

Beyond the five plain operations an entity can have submenus, and operations that only appear while a varp or varbit sits inside a given range - which is how a door offers Open or Close but never both.


EntityOpsDefinition.SetOp

procedure TEntityOpsDefinition.SetOp(index: Integer; text: String);

Sets the text of the operation at index, replacing it if that slot already has one.

index is the operation’s place in the right-click menu, not its place in Ops, which only holds the slots that are actually filled.


EntityOpsDefinition.DecodeOp

procedure TEntityOpsDefinition.DecodeOp(const data: TByteArray; var offset: Integer; index: Integer);

Reads one menu operation into slot index.

The text hidden is how the cache says a slot inherited from a template should be blanked out rather than shown, so it is read and dropped.


EntityOpsDefinition.DecodeSubOp

procedure TEntityOpsDefinition.DecodeSubOp(const data: TByteArray; var offset: Integer);

Reads one entry of a submenu: which operation it hangs off, its place within that submenu, and its text.


EntityOpsDefinition.DecodeConditionalOp

procedure TEntityOpsDefinition.DecodeConditionalOp(const data: TByteArray; var offset: Integer);

Reads an operation that only appears while a varp or varbit sits inside a given range - a door that offers Close only once it is open, for instance.


EntityOpsDefinition.DecodeConditionalSubOp

procedure TEntityOpsDefinition.DecodeConditionalSubOp(const data: TByteArray; var offset: Integer);

TEntityOpsDefinition.DecodeConditionalOp for a submenu entry, so it carries the submenu position as well as the varp range that gates it.