INFO:A small library, if you can call it that even, with the goal of coalescing all the various custom ui elements added by all different mods. it all started with me needing to add a ui button and coming to a realization that several someones have already claimed that specific spot on the screen.
This mod adds a small foldable sidebar on the left part of the screen, which contains small buttons, not unlike paint/photoshop toolbar, the size and arrangement of buttons can be configured in settings.json.
Each button can have up to three different actions, depending on which button (CTRL/ALT/SHIFT) is held when pressing it (can also be changed in settings.json).
USAGE:Every button is added via
data/config/sidebarLib_buttons.csv:
"id" - String - must be unique, needs for loading the csv.
"name" - String - human-readable name, displayed to the player.
"order" - int - buttons are sorted and placed in ascending order, bigger the number lower it will be in the list. Buttons with the same order are placed in the order they were read from csv.
"plugin" - String - reference to the plugin defining the button, must be extension of
sidebarLib.buttons.sidebarButton. Said plugin provides all the necessary methods to actually
do things. the method names _should_ be self-explanatory enough, but i will explain things if the need arise
the button itself is self-updating, refreshes when it is pressed, or whenever
rebuild() is called.
also included a silly little mod to serve as an example:
https://www.mediafire.com/file/v9hr9hxduw5q302/sblex-20250415.zip/fileCOMPATIBILITY:This mod has no external dependencies or incompatibilities, beyond possibly occupying the same space as someone else's ui widget (i know at least two), but since it is literally the problem it is made to address, i consider that a feature.
it is made with java 17, contains no reflection, kotlin, or any other questionable code.
all source is included in the archive. you can decompile to verify (you really should).
there is no github repository, and never will be, unless someone else takes it off my hands.
if any issues or misunderstandings arise, please don't hesitate to contact me diretly on discord, or here via dm.
changelogSpoiler
20250417
- internal fix for infinitely added tooltip that can freeze the game forever
- THREAT DETECTED
- added sidebarButton.canBeDisplayed
20250416
- fixed transient script/listener being saved in save
20250415
- preliminary update for 0.98
- internal restructuring
- added extra panel functionality, see "sblex" mod as an example
credits and acknowledgements:myself (banano_of_doom_7070) - most of the code and the idea
audaxludos - his name should be immortalized in stone, for inventing that plain-java-ui-renderer
kaysaar - for helping me wrap my head around most of the UI nonsense, and convincing me to actually publish this