Show / Hide Table of Contents

Interface IMyTerminalControls

This interface allows you to query, add or remove terminal controls for a block. The terminal controls are the controls that appear in the terminal screen when you select a block. You may add new controls, remove existing controls, or modify existing controls.

Namespace: Sandbox.ModAPI
Assembly: Sandbox.Common.dll
Syntax
public interface IMyTerminalControls

Methods

add_CustomActionGetter(CustomActionGetDelegate)

Declaration
void add_CustomActionGetter(CustomActionGetDelegate value)
Parameters
Type Name Description
CustomActionGetDelegate value

add_CustomControlGetter(CustomControlGetDelegate)

Declaration
void add_CustomControlGetter(CustomControlGetDelegate value)
Parameters
Type Name Description
CustomControlGetDelegate value

AddAction<TBlock>(IMyTerminalAction)

This allows you to add an action to an associated block

Declaration
void AddAction<TBlock>(IMyTerminalAction action)
Parameters
Type Name Description
IMyTerminalAction action

An IMyTerminalAction object returned from CreateAction

Type Parameters
Name Description
TBlock

The ModAPI interface of the associated block

AddControl<TBlock>(IMyTerminalControl)

Adds a terminal control to a block.

Declaration
void AddControl<TBlock>(IMyTerminalControl item)
Parameters
Type Name Description
IMyTerminalControl item

This is the control you're adding, created with CreateControl or CreateProperty

Type Parameters
Name Description
TBlock

This is the ModAPI interface of the associated block you want to add a terminal control to

CreateAction<TBlock>(String)

This allows you to create an action to associate with a block

Declaration
IMyTerminalAction CreateAction<TBlock>(string id)
Parameters
Type Name Description
System.String id

A unique identifier for this action

Returns
Type Description
IMyTerminalAction

An IMyTerminalAction object

Type Parameters
Name Description
TBlock

The ModAPI interface of the associated block

CreateControl<TControl, TBlock>(String)

This creates a control that can be added to a block.

Declaration
TControl CreateControl<TControl, TBlock>(string id)
Parameters
Type Name Description
System.String id

A unique identifier for this control

Returns
Type Description
TControl

Returns an interface to the control you've created depending on TControl

Type Parameters
Name Description
TControl

The type of control you're creating

TBlock

The ModAPI interface of the associated block

CreateProperty<TValue, TBlock>(String)

This creates a property that can be added to a block. A property is not visible on the terminal screen but can hold a value that can be used in programmable blocks.

Declaration
IMyTerminalControlProperty<TValue> CreateProperty<TValue, TBlock>(string id)
Parameters
Type Name Description
System.String id

A unique identifier for this property

Returns
Type Description
IMyTerminalControlProperty<TValue>

Returns an IMyTerminalControlProperty that can be added to a block via AddControl

Type Parameters
Name Description
TValue

The type of property you're creating

TBlock

The ModAPI interface of the associated block

GetActions<TBlock>(out List<IMyTerminalAction>)

This allows you to get all actions associated with this block.

Declaration
void GetActions<TBlock>(out List<IMyTerminalAction> items)
Parameters
Type Name Description
System.Collections.Generic.List<IMyTerminalAction> items

The list that contains the actions associated with this block

Type Parameters
Name Description
TBlock

The ModAPI interface of the associated block

GetControls<TBlock>(out List<IMyTerminalControl>)

Gets the controls associated with a block.

Declaration
void GetControls<TBlock>(out List<IMyTerminalControl> items)
Parameters
Type Name Description
System.Collections.Generic.List<IMyTerminalControl> items

The list that contains the terminal controls for this block

Type Parameters
Name Description
TBlock

This is the object builder type of the associated block you want to get terminal controls for

remove_CustomActionGetter(CustomActionGetDelegate)

Declaration
void remove_CustomActionGetter(CustomActionGetDelegate value)
Parameters
Type Name Description
CustomActionGetDelegate value

remove_CustomControlGetter(CustomControlGetDelegate)

Declaration
void remove_CustomControlGetter(CustomControlGetDelegate value)
Parameters
Type Name Description
CustomControlGetDelegate value

RemoveAction<TBlock>(IMyTerminalAction)

This allows you to remove an action from a block

Declaration
void RemoveAction<TBlock>(IMyTerminalAction action)
Parameters
Type Name Description
IMyTerminalAction action

An IMyTerminalAction object

Type Parameters
Name Description
TBlock

The ModAPI interface of the associated block

RemoveControl<TBlock>(IMyTerminalControl)

Removes a terminal control from a block.

Declaration
void RemoveControl<TBlock>(IMyTerminalControl item)
Parameters
Type Name Description
IMyTerminalControl item

This is the control you're removing. Use GetControls to get the item itself.

Type Parameters
Name Description
TBlock

This is the ModAPI interface of the associated block you want to remove a terminal control from

Events

CustomActionGetter

This event allows you to modify the list of actions available when a user wants to select an action for a block in the toolbar. Modifying the list in this event modifies the list displayed to the user so that you can customize it in specific situations (like blocks with different subtypes, or even on specific blocks by entityId)

Declaration
event CustomActionGetDelegate CustomActionGetter
Event Type
Type Description
CustomActionGetDelegate

CustomControlGetter

This event allows you to modify the list of controls that the game displays when a user selects a block. Each time terminal controls are enumerated for a block, this delegate is called, which allows you to modify the control list directly, and remove/add as you see fit before the controls are displayed. This is to allow fine grain control of the controls being displayed, so you can display only controls you want to in specific situations (like blocks with different subtypes, or even on specific blocks by entityId)

Declaration
event CustomControlGetDelegate CustomControlGetter
Event Type
Type Description
CustomControlGetDelegate
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾