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 toggle to options menu #316

Open
wants to merge 5 commits into
base: nightly
Choose a base branch
from

Conversation

Orangestar12
Copy link

@Orangestar12 Orangestar12 commented Jun 8, 2020

Since we now have an in-game fullscreen toggle, we no longer need an alternative keybind to enter windowed mode than alt+enter.
Fixes #297

Since we now have an in-game fullscreen toggle, we no longer need an alternative keybind to enter windowed mode than alt+enter.
@rawr51919
Copy link
Contributor

both esc and alt-enter work fine on emulators. I don't see the point of this PR

@Orangestar12
Copy link
Author

Orangestar12 commented Jun 8, 2020 via email

@rawr51919
Copy link
Contributor

emulators allow for Esc as an alternative way to access fullscreen (both into and out of fullscreen). Again, I don't see the point of this.

@Orangestar12
Copy link
Author

Orangestar12 commented Jun 8, 2020 via email

@Mode8fx
Copy link
Contributor

Mode8fx commented Jun 8, 2020

emulators allow for Esc as an alternative way to access fullscreen (both into and out of fullscreen). Again, I don't see the point of this.

Even so, I think it should at least be changed to a fullscreen toggle. Currently, Esc can only be used to exit full screen mode, not go back into it.
Maybe there could be an option in controls to change Esc between Toggle Fullscreen (default), Pause, and Quit Game.

@rawr51919
Copy link
Contributor

Your solution is far better imo GateGuy. I suggest this PR be reworked to fit said solution.

@fgsfdsfgs
Copy link
Collaborator

Just like make a bind for fullscreen toggle and put it in the config options if you're unsure whether you want to have ESC turning it off or not.

@Orangestar12
Copy link
Author

You guys make very good points. I completely understand the sentiment to add more features than remove them. I'll see what I can do, though this might not be my area of expertise.

@Mode8fx
Copy link
Contributor

Mode8fx commented Jun 9, 2020

If you want, I can do it since I'm already familiar with the settings menu.

@CyndaquilDAC
Copy link

THANK YOU! Out of reflex, I would press escape to exit the pause menu, only to leave full-screen mode by accident.

Allows users to bind a keyboard key to toggle fullscreen.
Note: I didn't bother adding a check for gamepad buttons.
@Orangestar12
Copy link
Author

Orangestar12 commented Jun 11, 2020

Alright, added a working fullscreen definition to the menu.

image

It uses the generic binding system that the rest of the buttons use, but it isn't tied to the input system. It also doesn't work with gamepad buttons although you can bind them, but I don't think that's a necessary feature right now.

Default key is escape. Props to whoever wrote the menu/config system, it was very easy to jump into.

EDIT: default key is NOT escape because I typed the wrong keycode so gimme a bit to push a new commit.

EDIT 2: never mind I misunderstood keycodes and scancodes completely i guess. don't pull this yet

EDIT 3: Okay, I'm officially lost. I don't understand how the keycode received in this part of options_menu.c:

if (optmenu_binding) {
    u32 key = controller_get_raw_key();
    if (key != VK_INVALID) {
        #ifndef nosound
        play_sound(SOUND_MENU_CHANGE_SELECT, gDefaultSoundArgs);
        #endif
        currentMenu->opts[currentMenu->select].uval[optmenu_bind_idx] = key;
        optmenu_binding = 0;
        optmenu_option_timer = 12;
    }
    return;
}

differs from the keycode that gets sent down the pipe from gfx_sdl2.c

static void gfx_sdl_onkeydown(int scancode) {
    keyboard_on_key_down(translate_scancode(scancode));
    // ... snip
}

Is it a bad time to mention I don't usually code in C?

@Orangestar12 Orangestar12 changed the title Remove windowed mode on ESC Add fullscreen toggle to options menu Jun 12, 2020
@Orangestar12
Copy link
Author

Alright, actually done this time. Works for definitely.

Surprise changes to nightly branch ruin me again!
theclashingfritz pushed a commit to djoslin0/sm64ex-coop that referenced this pull request Mar 25, 2023
* Override envfx from Lua

set_override_envfx(-1) to reset override

* Fix type mismatch
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.

5 participants