Adding Button Positions
How it works and adding your own defaults
When opening the GUI, Chest Tracker places the button based on the following criteria:
Where a user has manually moved it (stored under
chesttracker/user_button_positions.dat
)From a position specified for that particular screen's class via resource pack (see below)
From the default position specified via resource pack (see below)
A hardcoded copy of the default position, if for whatever reason pack loading fails
Don't write it yourself!
Chest Tracker adds an export button which can be turned on in the global mod settings. This allows you to export the button's current position to the chesttracker/export
directory, after dragging and positioning it yourself.
Adding your own default positions
Position references are stored under assets/<pack id>/chesttracker_button_positions
. Files consist of a list of screens to apply to, and a position
object saying where to place the button based on anchor points and offsets.
The file name doesn't matter; feel free to name it whatever you want for organisational purposes.
Adding the class name DEFAULT
will replace the default position for screens that don't have a registered position. This may be useful in the case of pack devs which are also shipping button-supplying mods.
For a practical example, take the shipped position for the enchanting table, which moves the button outside as to not overlap the top enchanting option:
The valid options for x_align
, as well as their x_offset
behavior is as follows:
screen_left
Aligned to the left side of the window.
Pixels from the left of the screen.
screen_right
Aligned to the right side of the window.
Pixels from the right of the screen.
left_with_recipe
Aligned to the left side of the GUI. Moves left when a recipe book is open.
Pixels from the left of the GUI or Open Recipe Book, positive rightwards.
left
Aligned to the left side of the GUI. Does not move left when a recipe book is open.
Pixels from the left of the GUI, positive rightwards.
right
Aligned to the right side of the GUI.
Pixels from the left of the GUI, positive leftwards.
The valid options for y_align
, as well as their y_offset
behavior is as follows:
screen_top
Aligned to the top side of the window.
Pixels from the top of the screen.
screen_bottom
Aligned to the bottom side of the window.
Pixels from the bottom of the screen.
top
Aligned to the top side of the GUI.
Pixels from the top of the GUI, positive downwards.
bottom
Aligned to the bottom side of the GUI.
Pixels from the bottom of the GUI, positive upwards.
Last updated