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

Dispensary Interlink Meter Screen #16405

Merged
merged 2 commits into from Oct 12, 2023

Conversation

Flaborized
Copy link
Contributor

@Flaborized Flaborized commented Oct 11, 2023

[CHEMISTRY] [FEAT]

About the PR

This PR makes the dispensary interlink's screen into a meter that shows you how full it is. As a trade off of not wanting to make versions of this for each dir (and also thinking that south facing is the most visually clear anyways so it should always show that) I also cut the directionality of it, so it only has south facing sprites.

There's 10 icon states: it'll show a red bar if it's completely devoid of chemicals and otherwise show a blue wavy animation and fill up, increasing one stage around every 55u of chemicals it has inside its products. It doesn't care if it's medical chemicals, just that there's chemicals. A pill bottle full of epi pills will fill the counter, but an empty patch won't!

interlink_screenshot

also it glows in the dark :)

chem_dispenser_animation

Also I added a new file just for the dispenser and its animations, since there's lots of them and I'm aware that very large dmi files have a negative impact on performance. easily fixed if that's not preferred though

Why's this needed?

I like the sorta retro light up wave visual! Also I was playing chemist and found myself not wanting to use this thing because I didn't think doctors would even realize I put chemicals inside the thing to use (since people rarely do). This is a feedback loop!! Nobody checks it because it's empty... nobody fills it because nobody checks it... now you can just see that it's full of useful stuff. This might not entirely fix the reasons people don't use this so much but I think this is a pretty obvious first-step-ish approach to making it more usable.

Changelog

(u)Flaborized
(+)The dispensary interlink dispenser in medical will now visually show how many units of chems it has in it, the more blue the screen the more meds it has to vend.

@boring-cyborg boring-cyborg bot added the C-Sprites Automatically applied on any .dmi or icons folder change label Oct 11, 2023
@keywordlabeler keywordlabeler bot added A-Chemistry Deals with the chemistry system in some way C-Feature A new feature or enhancements to existing features labels Oct 11, 2023
@github-actions github-actions bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 11, 2023
Copy link
Contributor

@TobleroneSwordfish TobleroneSwordfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Should check that tipped over sprites look right with the lack of directionality if you haven't already.

Comment on lines 3395 to 3400
if(istype(product, /obj/item/item_box/medical_patches) || istype(product, /obj/item/chem_pill_bottle))
for(var/obj/item/reagent_containers/container in product)
total_reagents += container.reagents.total_volume
if(istype(product, /obj/item/reagent_containers))
var/obj/item/reagent_containers/container = product
total_reagents += container.reagents.total_volume
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could probably cut the istypes here since it can be assumed that we want to read the reagents and contents of anything we put in here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup did this and it's much cleaner and easier to read and works!

else
fluid_state = round(clamp((total_reagents / 500 * 9 + 1), 1, 9)) //it'll jump up a state every ~55 reagents added or so
src.fill_image.icon_state = "medchem-[fluid_state]"
src.UpdateOverlays(src.fill_image, "fill_image")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're never swapping out the overlay you should just be able to call UpdateOverlays once and then change the icon with your image reference?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unless I'm misunderstanding the suggestion trying this has made the icon not actually swap in-game? I think most overlays use UpdateOverlays to update icon changes like this, at least, though again it's entirely possible I just don't Get What You Mean :sheltersweat:

@Flaborized
Copy link
Contributor Author

This is great! Should check that tipped over sprites look right with the lack of directionality if you haven't already.

Yea funnily enough I don't think any of the tipped over sprites use directionality, so I kept this one the same. Icondiff is showing Very Wrong sprites though, possibly because of the new file or something ??

@TobleroneSwordfish TobleroneSwordfish merged commit e02f1bf into goonstation:master Oct 12, 2023
23 checks passed
github-actions bot pushed a commit that referenced this pull request Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Chemistry Deals with the chemistry system in some way C-Feature A new feature or enhancements to existing features C-Sprites Automatically applied on any .dmi or icons folder change size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants