Interface IMyTerminalBlock
Describes terminal block (PB scripting interface)
Inherited Members
Namespace: Sandbox.ModAPI.Ingame
Assembly: Sandbox.Common.dll
Syntax
public interface IMyTerminalBlock : IMyCubeBlock, IMyEntity
Properties
CustomData
Gets or sets the Custom Data string. NOTE: Only use this for user input. For storing large mod configs, create your own MyModStorageComponent
Declaration
string CustomData { get; set; }
Property Value
Type | Description |
---|---|
System.String |
CustomInfo
Gets information about block status (available from mods) AppendingCustomInfo RefreshCustomInfo().
Declaration
string CustomInfo { get; }
Property Value
Type | Description |
---|---|
System.String |
CustomName
Gets or sets how block is named in Terminal menu
Declaration
string CustomName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
CustomNameWithFaction
Gets or sets how block is named in Terminal menu. Work only for Cockpit, LaserAntenna RadioAntenna, SpaceBall, Beacon
Declaration
string CustomNameWithFaction { get; }
Property Value
Type | Description |
---|---|
System.String |
DetailedInfo
Gets information about block status. In Control panel bottom right text
Declaration
string DetailedInfo { get; }
Property Value
Type | Description |
---|---|
System.String |
ShowInInventory
Represent terminal gui toggle Show block in Inventory Screen
. Gets or sets its value
Declaration
bool ShowInInventory { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ShowInTerminal
Represent terminal gui toggle Show block in terminal
. Gets or sets its value
Declaration
bool ShowInTerminal { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ShowInToolbarConfig
Represent terminal gui toggle Show in toolbar config
. Gets or sets its value
Declaration
bool ShowInToolbarConfig { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ShowOnHUD
Represent terminal gui toggle Show On HUD
. Gets or sets its value
Declaration
bool ShowOnHUD { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
GetActions(List<ITerminalAction>, Func<ITerminalAction, Boolean>)
Get all terminal actions available for block
Declaration
void GetActions(List<ITerminalAction> resultList, Func<ITerminalAction, bool> collect = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<ITerminalAction> | resultList | Buffer list, results would be added here. Can be null if always returns false |
System.Func<ITerminalAction, System.Boolean> | collect | Filter function, if function is null or returns true, terminal action would be added to |
See Also
GetActionWithName(String)
Get first found terminal action with name
Declaration
ITerminalAction GetActionWithName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Searches for terminal action with this name |
Returns
Type | Description |
---|---|
ITerminalAction | Found terminal action or null |
See Also
GetProperties(List<ITerminalProperty>, Func<ITerminalProperty, Boolean>)
Get all terminal actions available for block.
Declaration
void GetProperties(List<ITerminalProperty> resultList, Func<ITerminalProperty, bool> collect = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<ITerminalProperty> | resultList | Buffer list, results would be added here. Can be null if always returns false |
System.Func<ITerminalProperty, System.Boolean> | collect | Filter function, if function is null or returns true, terminal property would be added to |
See Also
GetProperty(String)
Finds terminal property with provided id
Declaration
ITerminalProperty GetProperty(string id)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | Terminal id |
Returns
Type | Description |
---|---|
ITerminalProperty | Found terminal property or null |
See Also
HasLocalPlayerAccess()
Returns if local player can use block. Executes HasPlayerAccess(Int64, MyRelationsBetweenPlayerAndBlock) with local player identityId. On Dedicated Server as identityId it is using 0 as playerId
Declaration
bool HasLocalPlayerAccess()
Returns
Type | Description |
---|---|
System.Boolean | Can player access this block or not. (Result of HasPlayerAccess(Int64, MyRelationsBetweenPlayerAndBlock) function call) |
HasNobodyPlayerAccessToBlock()
Returns if Nobody has access to block.
Declaration
bool HasNobodyPlayerAccessToBlock()
Returns
Type | Description |
---|---|
System.Boolean | True when block is has ShareAll or BigOwners of grid is Nobody |
See Also
HasPlayerAccess(Int64, MyRelationsBetweenPlayerAndBlock)
Returns if local player can use block. It is also checking for admin access.
Declaration
bool HasPlayerAccess(long playerId, MyRelationsBetweenPlayerAndBlock defaultNoUser)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | playerId | PlayerId which you want check |
MyRelationsBetweenPlayerAndBlock | defaultNoUser |
Returns
Type | Description |
---|---|
System.Boolean | Can player access block or not |
See Also
HasPlayerAccessWithNobodyCheck(Int64, Boolean)
Returns if player can use block. If playerId is 0 (Nobody), calls HasNobodyPlayerAccessToBlock instead It is also checking for admin access.
Declaration
bool HasPlayerAccessWithNobodyCheck(long playerId, bool isForPB = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | playerId | PlayerId which you want check |
System.Boolean | isForPB | Is used for PB block or not (PB block has more restrictions) |
Returns
Type | Description |
---|---|
System.Boolean | Can player access block or not |
See Also
IsSameConstructAs(IMyTerminalBlock)
Determines whether this block is Mechanical connected to the other. This is any block connected with rotors or pistons or other mechanical devices, but not things like connectors. This will in most cases constitute your complete construct.
Be aware that using merge blocks combines grids into one, so this function will not filter out grids connected that way. Also be aware that detaching the heads of pistons and rotors will cause this connection to change.
Declaration
bool IsSameConstructAs(IMyTerminalBlock other)
Parameters
Type | Name | Description |
---|---|---|
IMyTerminalBlock | other | Other block |
Returns
Type | Description |
---|---|
System.Boolean | True if blocks are on same grid, or has Mechanical linking |
SearchActionsOfName(String, List<ITerminalAction>, Func<ITerminalAction, Boolean>)
Get all terminal actions available for block.
NOTE: First called <param ref="collect" />
and then <param ref="name" />
check
Declaration
void SearchActionsOfName(string name, List<ITerminalAction> resultList, Func<ITerminalAction, bool> collect = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Searches for terminal action with this name |
System.Collections.Generic.List<ITerminalAction> | resultList | Buffer list, results would be added here. Can be null if always returns false |
System.Func<ITerminalAction, System.Boolean> | collect | Filter function, if function is null or returns true, terminal action would be added to |
See Also
SetCustomName(String)
Obsolete
Declaration
void SetCustomName(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text |
SetCustomName(StringBuilder)
Obsolete
Declaration
void SetCustomName(StringBuilder text)
Parameters
Type | Name | Description |
---|---|---|
System.Text.StringBuilder | text |