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

Make BaseButton Shortcut feedback togglable #63335

Merged
merged 1 commit into from
Nov 2, 2022

Conversation

Spartan322
Copy link
Contributor

@Spartan322 Spartan322 commented Jul 22, 2022

Fixes #365

Makes BaseButton::get_draw_mode return DRAW_NORMAL when a shortcut activates the button if toggle_mode is false and shortcut_feedback is false.

Exposed Additions

BaseButton:

@export
var shortcut_feedback : bool = true

func set_shortcut_feedback(value : bool)
func is_shortcut_feedback() -> bool

Test Project:
ButtonShortcutFeedbackDisableTest.zip

@Spartan322 Spartan322 requested a review from a team as a code owner July 22, 2022 23:29
@KoBeWi KoBeWi added this to the 4.0 milestone Jul 22, 2022
@YuriSizov
Copy link
Contributor

Existing behavior is desirable (godotengine/godot-proposals#4936), so this should not be done as a breaking compatibility change and instead should be an option.

@Spartan322 Spartan322 requested a review from a team as a code owner July 23, 2022 04:32
@Spartan322
Copy link
Contributor Author

I guess it be preferable to keep the current behavior as default, let me correct that commit.

@Spartan322 Spartan322 changed the title Disabled BaseButton ShortCut feedback Make BaseButton Shortcut feedback togglable Jul 23, 2022
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

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

Implementation looks ok.

The feature is probably ok too. Shortcut feedback makes sense in apps, but not really in games I think. Maybe.

I'd rename the property though, because it's a bit awkward. It could be simply shortcut_feedback.

@Spartan322 Spartan322 force-pushed the button-shortcut-feedback branch 3 times, most recently from f8a290b to dfaf6f3 Compare September 23, 2022 01:28
@akien-mga akien-mga merged commit 06c8e40 into godotengine:master Nov 2, 2022
@akien-mga
Copy link
Member

Thanks!

@Spartan322 Spartan322 deleted the button-shortcut-feedback branch November 2, 2022 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow disabling Shortcut's visual pressing of buttons
4 participants