-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Makes it EVEN EASIER to work with atom item interactions ft. "Leaf and Branch" & "Death to Chains" #82625
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SyncIt21
reviewed
Apr 12, 2024
MrMelbert
requested review from
Fikou and
ExcessiveUseOfCobblestone
as code owners
April 12, 2024 20:09
Merged
san7890
pushed a commit
that referenced
this pull request
Apr 16, 2024
## About The Pull Request Rewrites how alt click works. Based heavily on #82625. What a cool concept, it flows nicely with #82533. Fixes #81242 (tm bugs fixed) Fixes #82668 <details><summary>More info for devs</summary> Handy regex used for alt click s&r: `AltClick\((.*).*\)(\n\t.*\.\.\(\))?` `click_alt($1)` (yes I am aware this only copies the first arg. there are no other args!) ### Obj reskins No reason for obj reskin to check on every single alt click for every object. It applies to only a few items. - Moved to obj/item - Made into signal - Added screentips ### Ventcrawling Every single atmospherics machine checked for ventcrawling capability on alt click despite only 3 objects needing that functionality. This has been moved down to those individual items. </details> ## Why It's Good For The Game For players: - Alt clicking should work more logically, not causing double actions like eject disk and open item window - Added context menus for reskinnable items - Removed adjacency restriction on loot panel For devs: - Makes alt click interactions easier to work with, no more click chain nonsense and redundant guard clauses. - OOP hell reduced - Pascal Case reduced - Glorious snake case ## Changelog :cl: add: The lootpanel now works at range. add: Screentips for reskinnable items. fix: Alt click interactions have been refactored, which may lead to unintentional changes to gameplay. Report any issues, please. /:cl:
jlsnow301
reviewed
Apr 17, 2024
Item interaction now runs before all the tool_acts which means this interaction, which attempts to add ANY item to the machine, always blocks.
comfyorange
added a commit
that referenced
this pull request
Apr 18, 2024
Just as an FYI this broke the tray interactions with ranges introduced in #82566 |
#82787 Fixed |
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About The Pull Request
When I made the new item interaction chain, I did this pattern for items interacting with atoms:
tgstation/code/game/atom/atom_tool_acts.dm
Lines 85 to 86 in d2956ae
This is VERY clean and makes it ridiculously easy to add item-to-atom interactions without worry about needing to fuss around with calling parent and checking parent return value, IE, dealing with the dreaded chain.
Of course for some reason when I did this I didn't do the same for atom-from-item interactions themselves, relying on people call parent and check for blockers. Which worked in my head but is not easy to pick up as a new contributor.
So here we are, hopefully the final version of the atom-item-non-combat-interact chain.
Base
item_interaction
that handles all the signals and calling relevant procs is nowbase_item_interaction
item_interaction
is now a stub proc that atoms can override at whim without worrying about parent calls (unless subtypes implement it).This results in MUCH cleaner and easier to work with code.
And as an added bonus, it's (technically) completely backwards compatible with existing code. I changed it just for posterity but for downstreams and such, they don't even need to change anything, and it'll work as it did before.
Changelog
🆑 Melbert
refactor: Atom-Item interactions have been refactored once more. Report any oddities.
/:cl: