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

Add Fullscreen shortcut #79

Merged
merged 3 commits into from
Mar 8, 2025
Merged

Add Fullscreen shortcut #79

merged 3 commits into from
Mar 8, 2025

Conversation

CaptainDolphy
Copy link
Contributor

Well I figured since there is fullscreen button, it could be convenient to have a shortcut for it in the settings. The feature currently works even in the main menu before you start the game. I know this is a minor thing but I want to get used to this codebase and understand how things are done.

I am aware of the fact that I could have used another signal but then the button's state would have to be adjusted, like this its all done as it hooks to the existing code for the button press

Copy link
Owner

@m4ym4y m4ym4y left a comment

Choose a reason for hiding this comment

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

Great idea! Thank you for the contribution! I suggested some changes to make this work more in line with how other settings are implemented

scenes/Main.gd Outdated
if Input.is_action_pressed("toggle_fullscreen"):
# '%' is a unique name property of a node (since 4.0)
var fullscreen = $CanvasLayer/Settings/%GraphicsSettings/%Fullscreen
fullscreen.button_pressed = not GraphicsManager.fullscreen
Copy link
Owner

Choose a reason for hiding this comment

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

This should be emitted via "GlobalMenuEvents" and then handled in GraphicsSettings, so that main does not need to reach into the graphics settings menu internals

@@ -16,6 +16,7 @@ var remappable_actions_str := [
"jump",
"crouch",
"interact",
"toggle_fullscreen",
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think this should be rebindable as it's not really a game control

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think if more miscellaenous controls like zoom/pan, show fps, etc. will be added they should maybe have a special category in the control settings, I dont see why not to allow users to change these binds.

Copy link
Owner

Choose a reason for hiding this comment

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

I think it's a bit strange right now because it also offers the ability to toggle full screen via the joypad which isn't really needed. maybe can be reconsidered once there's more controls, like you say

@m4ym4y
Copy link
Owner

m4ym4y commented Mar 8, 2025

ok this looks great, thank you!

@m4ym4y m4ym4y merged commit dd887ae into m4ym4y:main Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants