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

Lock Interaction Component & Dual Interaction Rework #292

Merged
merged 11 commits into from
Oct 9, 2024

Conversation

niefia
Copy link
Collaborator

@niefia niefia commented Sep 26, 2024

Reworked the door locking to match the proposed ideas in #269

Introduced Lock Interaction Component to support this

Reworked the door locking to match the proposed ideas in Phazorknight#269
@Phazorknight
Copy link
Owner

Oooh, making locks their own interaction component is not a bad idea, opens some cool possibilities actually.

Could you include a component scene for the lock interaction as well?

Personally, I'm not the biggest fan of needing two different interaction buttons to unlock then open a door, but using the DualInteraction component, this can be remedied (press for open/close, hold for lock/unlock).
Will play around a bit with this a bit to see how this integrates.

@Phazorknight Phazorknight added the enhancement New feature or request label Sep 27, 2024
Added Dual Interaction to the Lock interaction

Added support for multiple interaction texts being passed to the interaction text in Dual Interaction

Still need to implement buffer time, and figure out why interaction text won't update until player looks at object again
Added buffer time to prevent Hold UI from showing on press

Changed hold and press interaction text to onready to avoid them being defined both multiple places
@niefia
Copy link
Collaborator Author

niefia commented Sep 30, 2024

Still need to solve a couple of problems before merging this one:

First is when to run the key check, as running it on the end of hold down feels wrong, like it feels like you should have been using the key during the hold down time. May have to redo key check and run it at the start of an interaction to see if its valid.
Also means adding the functionality of preventing the hold interaction if the key is not found.

Second is that the interaction text label doesn't seem to update until the player looks at the object again. Can't seem to figure out what's causing that one.

Needs refactoring into the lock component really but added a key check on hold start to avoid holding when key not found
LockComponent Scene added

Added hold_key_check as a temporary way of determining if key check should be run before hold interaction begins, off by default.
Refactored to Removed Key logic from Dual Interaction component and into the Lock component

This now requires a direct reference to the lock node in order to receive info back from it without having to setup lots of signals back and forth
Was having an issue with the interaction prompt not updating until the object was interacted with a second time or relooked at by the player.

This fixes it by using a signal that instructs when the interaction prompt should be updated, the signal is used only after the correct interaction text is generated.
@niefia niefia changed the title Better door locking - Lock Interaction Component Lock Interaction Component & Dual Interaction Rework Oct 2, 2024
@niefia
Copy link
Collaborator Author

niefia commented Oct 2, 2024

Managed to solve both issues, also updated the title since the PR has also become a Dual interaction component rework at this point.

Give it a try and let me know what you think

Removed the key check from the door,
Added Lockpick as an alternate key to the door,  currently behaves exactly like a key
Refactored Check for Key into generic Check for Item
@Phazorknight
Copy link
Owner

Great work! The way this is set up makes sense and fits.
Also reminds me that I wanted to update the Hold UI to ideally be like the background of the interaction prompt or something similar....

Copy link
Owner

@Phazorknight Phazorknight left a comment

Choose a reason for hiding this comment

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

Should be good to merge in! Thanks so much for this!

@Phazorknight Phazorknight merged commit a571eb9 into Phazorknight:main Oct 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants