-
-
Notifications
You must be signed in to change notification settings - Fork 446
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
Food Cart UI rework #22866
base: master
Are you sure you want to change the base?
Food Cart UI rework #22866
Conversation
Co-authored-by: Henry <omgredstone@gmail.com>
Does this fix #19482 at all? |
I haven't tested it yet, though i would assume that it doesn't. I'll try to test it today. |
I tested it and made the necessary changes to fix the bug. The fix should also work for any other food item that works similarly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
preliminary review
switch(action) | ||
//Dispense food item | ||
if("dispense") | ||
var/itemPath = text2path(params["itemPath"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to verify that this input is correct, like that it is available in the cart and there's enough. You can pass arbitrary data to tgui and summon literally anything in the game since it's not verified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the dispense_item
proc that this calls DOES do verification (it checks that the item is in the contents - see the find_amount
proc) as I did notice this on my pass. textrefs might be a better option as it'd avoid the whole "creating an item just to check if it exists" dance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing this is resolved then?
//Get content and capacity data | ||
var/list/storageDetails = list() | ||
//Have to subtract contents.len by 1 due to reagents container being in contents | ||
storageDetails["contents_length"] = contents.len - 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not the length of the contents 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would I get it? Am I using the wrong proc?
Co-authored-by: Byemoh <baiomurang@gmail.com>
Co-authored-by: Byemoh <baiomurang@gmail.com>
Co-authored-by: Byemoh <baiomurang@gmail.com>
Document the changes in your pull request
I've changed the food cart's UI from byond HTML into TGUI as it looks nicer. The new UI is broken up into two parts: food and drinks.
Food Tab
Drink Tab
The UI also has info tooltips to explain certain UI elements. Simply hover your mouse over the blue circles with a white i to see the tooltip.
Also, when destroyed, food carts will now spill their reagents. A chat warning will also be sent if either the main or mixer storages have reagents, alerting you of the spill.
Fixes #9310
Fixes #19427
Fixes #19482
P.S.
With the replacement of find_amount with datums, food items like parmesan which add and remove things from contents themselves do not work well with keeping count for UI items. Because of this, stuff like unmatured parmesan cheese will show however much you put into it even when some have matured and will only remove itself from the UI when no unmatured cheese is in the contents. For matured, it will only count the first one added and any you add with attackby, items created within the contents are not counted because I do not know how to do that without essentially just bringing back find_amount which would make the switch pointless.
Why is this good for the game?
Old UI looked bad, reagent part of carts haven't worked in awhile, and spills are funny :]
Testing
Video of cart UI:
https://www.youtube.com/watch?v=FjUYch4DA8A
Also: I changed the spill message to specify that reagents are spilling out after this video.
Wiki Documentation
Food capacity: 80
Glass capacity: 30
Drink capacity
Reagents will spill if cart is destroyed.
Changelog
🆑
rscadd: Food carts now spill their reagents upon destruction
bugfix: Food carts can now handle reagents again
tweak: Reworked food cart's UI
/:cl: