/tg/ Station 13 - Modules - TypesVar Details - Proc Details

Integrated Circuit Component

A component that performs a function when given an input

Can be attached to an integrated circuitboard, where it can then be connected between other components to provide an output or to receive an input. This is the base type of all components

Vars

circuit_flagsThe flags of the circuit to control basic generalised behaviour.
current_optionThe current selected option
display_descThe description of the component shown on the UI
display_nameThe name of the component shown on the UI
input_portsA list that contains the components the input ports on this component Used to connect between the ports
optionsThe options that this component can take on. Limited to strings
output_portsA list that contains the outpurt ports on this component Used to connect between the ports
parentThe integrated_circuit that this component is attached to.
power_usage_per_inputThe power usage whenever this component receives an input
rel_xUsed to determine the x position of the component within the UI
rel_yUsed to determine the y position of the component within the UI
trigger_inputGeneric trigger input for triggering this component

Procs

add_input_portAdds an input port and returns it
add_output_portAdds an output port and returns it
disconnectDisconnects a component from other components
get_ui_noticesGets the UI notices to be displayed on the CircuitInfo panel.
input_receivedCalled whenever an input is received from one of the ports.
match_port_datatypeMatches the output port's datatype with the input port's current connected port.
populate_optionsCalled when the options variable should be set.
register_shellCalled when a shell is registered from the component/the component is added to a circuit.
set_optionSets the option on this component
unregister_shellCalled when a shell is unregistered from the component/the component is removed from a circuit.

Var Details

circuit_flags

The flags of the circuit to control basic generalised behaviour.

current_option

The current selected option

display_desc

The description of the component shown on the UI

display_name

The name of the component shown on the UI

input_ports

A list that contains the components the input ports on this component Used to connect between the ports

options

The options that this component can take on. Limited to strings

output_ports

A list that contains the outpurt ports on this component Used to connect between the ports

parent

The integrated_circuit that this component is attached to.

power_usage_per_input

The power usage whenever this component receives an input

rel_x

Used to determine the x position of the component within the UI

rel_y

Used to determine the y position of the component within the UI

trigger_input

Generic trigger input for triggering this component

Proc Details

add_input_port

Adds an input port and returns it

Arguments:

add_output_port

Adds an output port and returns it

Arguments:

disconnect

Disconnects a component from other components

Disconnects both the input and output ports of the component

get_ui_notices

Gets the UI notices to be displayed on the CircuitInfo panel.

Returns a list of buttons in the following format list( "icon" = ICON(string) "content" = CONTENT(string) "color" = COLOR(string, not a hex) )

input_received

Called whenever an input is received from one of the ports.

Return value indicates that the circuit should not do anything. Also prevents an output signal. Arguments:

match_port_datatype

Matches the output port's datatype with the input port's current connected port.

Returns true if datatype was changed, otherwise returns false. Arguments:

populate_options

Called when the options variable should be set.

register_shell

Called when a shell is registered from the component/the component is added to a circuit.

Register all signals here on the shell. Arguments:

set_option

Sets the option on this component

Can only be a value from the options variable Arguments:

unregister_shell

Called when a shell is unregistered from the component/the component is removed from a circuit.

Unregister all signals here on the shell. Arguments: