mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-02-16 20:01:49 -05:00
Merge branch 'rewrite/master' into preloader-fnf-spacing
This commit is contained in:
commit
c0ae253c40
4 changed files with 32 additions and 2 deletions
|
@ -74,6 +74,7 @@ class InitState extends FlxState
|
||||||
//
|
//
|
||||||
|
|
||||||
// Setup window events (like callbacks for onWindowClose)
|
// Setup window events (like callbacks for onWindowClose)
|
||||||
|
// and fullscreen keybind setup
|
||||||
WindowUtil.initWindowEvents();
|
WindowUtil.initWindowEvents();
|
||||||
// Disable the thing on Windows where it tries to send a bug report to Microsoft because why do they care?
|
// Disable the thing on Windows where it tries to send a bug report to Microsoft because why do they care?
|
||||||
WindowUtil.disableCrashHandler();
|
WindowUtil.disableCrashHandler();
|
||||||
|
|
|
@ -66,6 +66,7 @@ class Controls extends FlxActionSet
|
||||||
var _volume_up = new FunkinAction(Action.VOLUME_UP);
|
var _volume_up = new FunkinAction(Action.VOLUME_UP);
|
||||||
var _volume_down = new FunkinAction(Action.VOLUME_DOWN);
|
var _volume_down = new FunkinAction(Action.VOLUME_DOWN);
|
||||||
var _volume_mute = new FunkinAction(Action.VOLUME_MUTE);
|
var _volume_mute = new FunkinAction(Action.VOLUME_MUTE);
|
||||||
|
var _fullscreen = new FunkinAction(Action.FULLSCREEN);
|
||||||
|
|
||||||
var byName:Map<String, FunkinAction> = new Map<String, FunkinAction>();
|
var byName:Map<String, FunkinAction> = new Map<String, FunkinAction>();
|
||||||
|
|
||||||
|
@ -272,6 +273,11 @@ class Controls extends FlxActionSet
|
||||||
inline function get_VOLUME_MUTE()
|
inline function get_VOLUME_MUTE()
|
||||||
return _volume_mute.check();
|
return _volume_mute.check();
|
||||||
|
|
||||||
|
public var FULLSCREEN(get, never):Bool;
|
||||||
|
|
||||||
|
inline function get_FULLSCREEN()
|
||||||
|
return _fullscreen.check();
|
||||||
|
|
||||||
public function new(name, scheme:KeyboardScheme = null)
|
public function new(name, scheme:KeyboardScheme = null)
|
||||||
{
|
{
|
||||||
super(name);
|
super(name);
|
||||||
|
@ -296,6 +302,7 @@ class Controls extends FlxActionSet
|
||||||
add(_volume_up);
|
add(_volume_up);
|
||||||
add(_volume_down);
|
add(_volume_down);
|
||||||
add(_volume_mute);
|
add(_volume_mute);
|
||||||
|
add(_fullscreen);
|
||||||
|
|
||||||
for (action in digitalActions) {
|
for (action in digitalActions) {
|
||||||
if (Std.isOfType(action, FunkinAction)) {
|
if (Std.isOfType(action, FunkinAction)) {
|
||||||
|
@ -399,6 +406,7 @@ class Controls extends FlxActionSet
|
||||||
case VOLUME_UP: _volume_up;
|
case VOLUME_UP: _volume_up;
|
||||||
case VOLUME_DOWN: _volume_down;
|
case VOLUME_DOWN: _volume_down;
|
||||||
case VOLUME_MUTE: _volume_mute;
|
case VOLUME_MUTE: _volume_mute;
|
||||||
|
case FULLSCREEN: _fullscreen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -474,6 +482,8 @@ class Controls extends FlxActionSet
|
||||||
func(_volume_down, JUST_PRESSED);
|
func(_volume_down, JUST_PRESSED);
|
||||||
case VOLUME_MUTE:
|
case VOLUME_MUTE:
|
||||||
func(_volume_mute, JUST_PRESSED);
|
func(_volume_mute, JUST_PRESSED);
|
||||||
|
case FULLSCREEN:
|
||||||
|
func(_fullscreen, JUST_PRESSED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -668,6 +678,7 @@ class Controls extends FlxActionSet
|
||||||
bindKeys(Control.VOLUME_UP, getDefaultKeybinds(scheme, Control.VOLUME_UP));
|
bindKeys(Control.VOLUME_UP, getDefaultKeybinds(scheme, Control.VOLUME_UP));
|
||||||
bindKeys(Control.VOLUME_DOWN, getDefaultKeybinds(scheme, Control.VOLUME_DOWN));
|
bindKeys(Control.VOLUME_DOWN, getDefaultKeybinds(scheme, Control.VOLUME_DOWN));
|
||||||
bindKeys(Control.VOLUME_MUTE, getDefaultKeybinds(scheme, Control.VOLUME_MUTE));
|
bindKeys(Control.VOLUME_MUTE, getDefaultKeybinds(scheme, Control.VOLUME_MUTE));
|
||||||
|
bindKeys(Control.FULLSCREEN, getDefaultKeybinds(scheme, Control.FULLSCREEN));
|
||||||
|
|
||||||
bindMobileLol();
|
bindMobileLol();
|
||||||
}
|
}
|
||||||
|
@ -696,6 +707,8 @@ class Controls extends FlxActionSet
|
||||||
case Control.VOLUME_UP: return [PLUS, NUMPADPLUS];
|
case Control.VOLUME_UP: return [PLUS, NUMPADPLUS];
|
||||||
case Control.VOLUME_DOWN: return [MINUS, NUMPADMINUS];
|
case Control.VOLUME_DOWN: return [MINUS, NUMPADMINUS];
|
||||||
case Control.VOLUME_MUTE: return [ZERO, NUMPADZERO];
|
case Control.VOLUME_MUTE: return [ZERO, NUMPADZERO];
|
||||||
|
case Control.FULLSCREEN: return [FlxKey.F];
|
||||||
|
|
||||||
}
|
}
|
||||||
case Duo(true):
|
case Duo(true):
|
||||||
switch (control) {
|
switch (control) {
|
||||||
|
@ -719,6 +732,8 @@ class Controls extends FlxActionSet
|
||||||
case Control.VOLUME_UP: return [PLUS];
|
case Control.VOLUME_UP: return [PLUS];
|
||||||
case Control.VOLUME_DOWN: return [MINUS];
|
case Control.VOLUME_DOWN: return [MINUS];
|
||||||
case Control.VOLUME_MUTE: return [ZERO];
|
case Control.VOLUME_MUTE: return [ZERO];
|
||||||
|
case Control.FULLSCREEN: return [FlxKey.F];
|
||||||
|
|
||||||
}
|
}
|
||||||
case Duo(false):
|
case Duo(false):
|
||||||
switch (control) {
|
switch (control) {
|
||||||
|
@ -742,6 +757,8 @@ class Controls extends FlxActionSet
|
||||||
case Control.VOLUME_UP: return [NUMPADPLUS];
|
case Control.VOLUME_UP: return [NUMPADPLUS];
|
||||||
case Control.VOLUME_DOWN: return [NUMPADMINUS];
|
case Control.VOLUME_DOWN: return [NUMPADMINUS];
|
||||||
case Control.VOLUME_MUTE: return [NUMPADZERO];
|
case Control.VOLUME_MUTE: return [NUMPADZERO];
|
||||||
|
case Control.FULLSCREEN: return [];
|
||||||
|
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
// Fallthrough.
|
// Fallthrough.
|
||||||
|
@ -876,6 +893,7 @@ class Controls extends FlxActionSet
|
||||||
case Control.CUTSCENE_ADVANCE: return [A];
|
case Control.CUTSCENE_ADVANCE: return [A];
|
||||||
case Control.DEBUG_MENU: return [];
|
case Control.DEBUG_MENU: return [];
|
||||||
case Control.DEBUG_CHART: return [];
|
case Control.DEBUG_CHART: return [];
|
||||||
|
case Control.FULLSCREEN: return [];
|
||||||
default:
|
default:
|
||||||
// Fallthrough.
|
// Fallthrough.
|
||||||
}
|
}
|
||||||
|
@ -1398,6 +1416,7 @@ enum Control
|
||||||
ACCEPT;
|
ACCEPT;
|
||||||
BACK;
|
BACK;
|
||||||
PAUSE;
|
PAUSE;
|
||||||
|
FULLSCREEN;
|
||||||
// CUTSCENE
|
// CUTSCENE
|
||||||
CUTSCENE_ADVANCE;
|
CUTSCENE_ADVANCE;
|
||||||
// SCREENSHOT
|
// SCREENSHOT
|
||||||
|
@ -1443,6 +1462,7 @@ enum abstract Action(String) to String from String
|
||||||
var BACK = "back";
|
var BACK = "back";
|
||||||
var PAUSE = "pause";
|
var PAUSE = "pause";
|
||||||
var RESET = "reset";
|
var RESET = "reset";
|
||||||
|
var FULLSCREEN = "fullscreen";
|
||||||
// SCREENSHOT
|
// SCREENSHOT
|
||||||
var SCREENSHOT = "screenshot";
|
var SCREENSHOT = "screenshot";
|
||||||
// CUTSCENE
|
// CUTSCENE
|
||||||
|
|
|
@ -251,7 +251,7 @@ class TitleState extends MusicBeatState
|
||||||
|
|
||||||
var transitioning:Bool = false;
|
var transitioning:Bool = false;
|
||||||
|
|
||||||
override function update(elapsed:Float)
|
override function update(elapsed:Float):Void
|
||||||
{
|
{
|
||||||
FlxG.bitmapLog.add(FlxG.camera.buffer);
|
FlxG.bitmapLog.add(FlxG.camera.buffer);
|
||||||
|
|
||||||
|
@ -286,7 +286,6 @@ class TitleState extends MusicBeatState
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FlxG.sound.music != null) Conductor.instance.update(FlxG.sound.music.time);
|
if (FlxG.sound.music != null) Conductor.instance.update(FlxG.sound.music.time);
|
||||||
if (FlxG.keys.justPressed.F) FlxG.fullscreen = !FlxG.fullscreen;
|
|
||||||
|
|
||||||
// do controls.PAUSE | controls.ACCEPT instead?
|
// do controls.PAUSE | controls.ACCEPT instead?
|
||||||
var pressedEnter:Bool = FlxG.keys.justPressed.ENTER;
|
var pressedEnter:Bool = FlxG.keys.justPressed.ENTER;
|
||||||
|
|
|
@ -90,6 +90,16 @@ class WindowUtil
|
||||||
openfl.Lib.current.stage.application.onExit.add(function(exitCode:Int) {
|
openfl.Lib.current.stage.application.onExit.add(function(exitCode:Int) {
|
||||||
windowExit.dispatch(exitCode);
|
windowExit.dispatch(exitCode);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
openfl.Lib.current.stage.addEventListener(openfl.events.KeyboardEvent.KEY_DOWN, (e:openfl.events.KeyboardEvent) -> {
|
||||||
|
for (key in PlayerSettings.player1.controls.getKeysForAction(FULLSCREEN))
|
||||||
|
{
|
||||||
|
if (e.keyCode == key)
|
||||||
|
{
|
||||||
|
openfl.Lib.application.window.fullscreen = !openfl.Lib.application.window.fullscreen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue