Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.98a is out! (03/27/25)

Author Topic: [0.98a] sidebarLib v.20250417  (Read 7968 times)

banano of doom

  • Captain
  • ****
  • Posts: 365
    • View Profile
[0.98a] sidebarLib v.20250417
« on: February 03, 2025, 04:40:42 PM »

INFO:
Spoiler
[close]
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/file

COMPATIBILITY:
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.

changelog
Spoiler


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

[close]

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
« Last Edit: April 16, 2025, 05:55:58 PM by banano of doom »
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

banano of doom

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: [0.97] sidebarLib v20250204
« Reply #1 on: February 03, 2025, 04:41:10 PM »

reserved
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

banano of doom

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: [0.97] sidebarLib v20250204
« Reply #2 on: February 03, 2025, 04:41:18 PM »

reserved
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

Kaysaar

  • Admiral
  • *****
  • Posts: 583
    • View Profile
Re: [0.97] sidebarLib v20250204
« Reply #3 on: February 05, 2025, 01:48:29 AM »

Already working on implementation of sidebar for my own mods.
Spoiler
[close]
Thanks banano for such useful mod
Logged

banano of doom

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: [0.97] sidebarLib v20250209
« Reply #4 on: February 09, 2025, 12:22:02 AM »

small update
20250209
- changed mod id from "sidebar" to "sidebarLib", as it was supposed to be, but forgot.
- fixed button not refreshing when triggered via keyboard shortcut
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

banano of doom

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: [0.97] sidebarLib v20250217
« Reply #5 on: February 17, 2025, 02:11:47 AM »

update
20250217
- fix for ui element freezing after entering battle
- fix for keyboard hotkeys working when sidebar is closed
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

banano of doom

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: [0.97] sidebarLib v.20250302
« Reply #6 on: March 02, 2025, 06:20:36 AM »

minor update
20250302
- minor internal changes, update if something breaks idk
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

banano of doom

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: [0.98a] sidebarLib v.20250417
« Reply #7 on: April 16, 2025, 05:37:10 PM »

update
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
« Last Edit: April 16, 2025, 05:42:19 PM by banano of doom »
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned