Status element

Add an icon to display the machine status in the machine gui.

The status element is used to shown the crafting status of the custom machine in the Machine GUI.

Status element must be defined in json like : "type": "custommachinery:status".

The crafting status of a custom machine can be IDLE, RUNNING or ERRORED.

Properties

The status element has 3 mandatory properties and 7 optional properties :

Mandatory properties

"type": "custommachinery:status" //Mandatory to define a status element.
X

Name : x

Description :

A positive integer value that define the x axis position of the element to be displayed on the Machine GUI.

Example :

The element will be rendered 100px to the right from the top-left corner of the gui.

"x": 100
Y

Name : y

Description :

A positive integer value that define the y axis position of the element to be displayed on the Machine GUI.

Example :

The element will be rendered 100px to the bottom from the top-left corner of the gui.

"y": 100

Optional property

Width

Name : width

Description :

A positive integer value that define the width of the element on the Machine GUI.

Default :

The same width as the texture specified in the texture property.

Example :

The width of the element will be 100px.

"width": 100
Height

Name : height

Description :

A positive integer value that define the height of the element on the Machine GUI.

Default :

The same height as the texture specified in the texture property.

Example :

The height of the element will be 100px.

"height": 100
Priority

Name : priority

Description :

An integer property that define the priority of the Element to be rendered.

Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above.

Default : 0

Example :

The element will be rendered under each element that have a priority lower than 1000.

"priority": 1000
Idle texture

Name : texture_idle

Description :

The location of the texture file the status element will display when the machine status is IDLE.

Default :

"texture_idle": "custommachinery:textures/gui/base_status_idle.png"

Example :

The texture loader will use the file assets/namespace/textures/status_idle_texture.png as the status IDLE texture in the machine GUI.

"texture_idle": "namespace:textures/status_idle_texture.png"
Running texture

Name : texture_running

Description :

The location of the texture file the status element will display when the machine status is RUNNING.

Default :

"texture_running": "custommachinery:textures/gui/base_status_running.png"

Example :

The texture loader will use the file assets/namespace/textures/status_running_texture.png as the status RUNNING texture in the machine GUI.

"texture_running": "namespace:textures/status_running_texture.png"
Errored texture

Name : texture_errored

Description :

The location of the texture file the status element will display when the machine status is ERRORED.

Default :

"texture_errored": "custommachinery:textures/gui/base_status_errored.png"

Example :

The texture loader will use the file assets/namespace/textures/status_errored_texture.png as the status ERRORED texture in the machine GUI.

"texture_errored": "namespace:textures/status_errored_texture.png"
Tooltips

Name : tooltips

Description :

A list of Text components that will be shown as tooltips when the player mouse cursor hover the element.

Each tooltips of the list will be a new line.

Example :

Replace the default tooltips with a single line that say "Click me !" :

"tooltips": "Click me !"

Example :

A basic status element with the default textures :

{
    "type": "custommachinery:status",
    "x": 20,
    "y": 20
}

Result :

(Here the Custom Machine is IDLE if not obvious)

Last updated