Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add library for creating GUI menus #370

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open

Add library for creating GUI menus #370

wants to merge 35 commits into from

Conversation

Ghoulboy78
Copy link
Collaborator

@Ghoulboy78 Ghoulboy78 commented Apr 6, 2023

Much like classes.scl, this will in theory allow players to create their own GUI libraries by declaring a list of functions in a map.
Unlike classes.scl, this might actually be useful, since it abstracts a lot more of the grittier process behind nice-to use functions and syntax. Also, this has more flexibility.

Fixes #315

Todo items:

  • Add basic (static) buttons which can do stuff when clicked
  • Add dynamic buttons (clicking the button changes the icon, edits inventory itself, etc)
  • Add storage (so items u put in can be saved)
  • Add dynamic storage slots (Whenever this slot is modified, a function is called)
  • Add ability for programmers to insert their own code into screen callback (with access to (screen, player, action, data) variables, as well as gui_screen variable)
  • Add pages made of buttons
  • Give different titles to new pages (Requires closing and opening new screens)
  • Allow for different sized pages (Same here)
  • Add button labels
  • Allow to use any gui type, not just generic rectangle ones (Need to make sure they don't break existing stuff, and we're good)
  • Add more triggers to change page (basically extract page-changing into a separate function that can be called from anywhere)
  • Add special abilities for all the different types of inventories (Not all types need special treatment, but I'll add them all here, just so I can tick them through, and incase someone else thinks of what to do with this)
  • Anvil (Maybe detecting when the player writes? If the player is renaming, each character change updates the item in the output slot, causing a slot_update action to be sent out)
  • Beacon (Effects ig, gotta read the docs Nothing, as it happens)
  • Brewing stand (Nothing that I know of)
  • Blast furnace (I'll redirect this to whatever the furnace does)
  • Cartography table (Nothing that I know of)
  • Crafting table (Selecting a crafting recipe)
  • Enchanting table (All the enchantments, this is gonna be painful, I think)
  • Furnace (Selecting a smelting recipe)
  • Grindstone (Nothing that I know of)
  • Hopper (Nothing that I know of)
  • Lectern (Possibly the ability to detect when you change page? Though would have to tell the programmer that they must insert a book for this functionality to work)
  • Loom (Editing the displayed banner pattern, but only available if player or programmer puts a banner and some dye in first, also returning the selected banner pattern)
  • Merchant (I'd like to be able to edit trades, but it's probably not possible)
  • Shulker box (Nothing that I know of)
  • Smithing (Maybe something with the new smithing templates? Nothing, it seems)
  • Smoker (I'll redirect this to whatever the furnace does)
  • Stonecutter (Selected recipe in the stonecutter, but only available if player or programmer puts some stone in first)
  • Documentation (Dis gonna be chonky too)
  • Add idiotproof checks to make sure programmer defines all the functions they need to etc.
  • Add on_init function or smth like that for pages, so more complex initial setup can be done (useful for enchanting tables and beacons etc.)

@opsaaaaa
Copy link
Contributor

opsaaaaa commented Apr 8, 2023

I just read the code. This looks pretty cool.
I've been wanting to rework the waystone app, when I do, Ill try this out.
Unfortunately I may not have time to try it out for awhile.
But I think it should tick the boxes.
Thanks.

@Ghoulboy78
Copy link
Collaborator Author

55810ce
Recording this commit as last commit before removal of placeholder names, JIC something goes wrong with that and I need to revert.

@Ghoulboy78 Ghoulboy78 marked this pull request as ready for review June 26, 2023 20:18
@Ghoulboy78
Copy link
Collaborator Author

@altrisi I think this is ready

@rv3r
Copy link
Collaborator

rv3r commented Jul 28, 2023

Seems handy and the test script demonstrates some cool functions. Thanks for adding the example else reviewing this would take an eternity. I'll being going through this for a while but I don't expect any major errors.

@Ghoulboy78
Copy link
Collaborator Author

Thanks for adding the example else reviewing this would take an eternity.

I actually created it so I could test the script as I added more and more to it. Imaging what a nightmare it would have been otherwise...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scarpet library for creating GUI menus.
3 participants