Skip to content

Commit

Permalink
fix(debug): no more fullscreening when typing "F" in the flixel debug…
Browse files Browse the repository at this point in the history
…ger console
  • Loading branch information
ninjamuffin99 committed Oct 4, 2024
1 parent 410cfe9 commit 29b6763
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions source/funkin/util/WindowUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ class WindowUtil
openfl.Lib.current.stage.addEventListener(openfl.events.KeyboardEvent.KEY_DOWN, (e:openfl.events.KeyboardEvent) -> {
for (key in PlayerSettings.player1.controls.getKeysForAction(WINDOW_FULLSCREEN))
{
// FlxG.stage.focus is set to null by the debug console stuff,
// so when that's in focus, we don't want to toggle fullscreen using F
// (annoying when tying "FlxG" in console... lol)
@:privateAccess
if (FlxG.game.debugger.visible)
{
return;
}

if (e.keyCode == key)
{
openfl.Lib.application.window.fullscreen = !openfl.Lib.application.window.fullscreen;
Expand Down

0 comments on commit 29b6763

Please sign in to comment.