mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-09-12 05:07:06 +00:00
Merge pull request #205 from FunkinCrew/rewrite/bugfix/input-issues
Refactor controls to fix some bugs
This commit is contained in:
commit
60e607890c
|
@ -1,7 +1,7 @@
|
|||
package funkin;
|
||||
|
||||
import funkin.save.Save;
|
||||
import funkin.Controls;
|
||||
import funkin.input.Controls;
|
||||
import flixel.FlxCamera;
|
||||
import funkin.input.PreciseInputManager;
|
||||
import flixel.input.actions.FlxActionInput;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
|
||||
package funkin;
|
||||
package funkin.input;
|
||||
|
||||
import flixel.input.gamepad.FlxGamepad;
|
||||
import flixel.util.FlxDirectionFlags;
|
|
@ -3,7 +3,7 @@ package funkin.save;
|
|||
import flixel.util.FlxSave;
|
||||
import funkin.save.migrator.SaveDataMigrator;
|
||||
import thx.semver.Version;
|
||||
import funkin.Controls.Device;
|
||||
import funkin.input.Controls.Device;
|
||||
import funkin.save.migrator.RawSaveData_v1_0_0;
|
||||
|
||||
@:nullSafety
|
||||
|
|
|
@ -12,6 +12,7 @@ import funkin.modding.PolymodHandler;
|
|||
import funkin.modding.events.ScriptEvent;
|
||||
import funkin.modding.module.ModuleHandler;
|
||||
import funkin.util.SortUtil;
|
||||
import funkin.input.Controls;
|
||||
|
||||
/**
|
||||
* MusicBeatState actually represents the core utility FlxState of the game.
|
||||
|
|
|
@ -11,6 +11,7 @@ import funkin.modding.module.ModuleHandler;
|
|||
import funkin.modding.PolymodHandler;
|
||||
import funkin.util.SortUtil;
|
||||
import flixel.util.FlxSort;
|
||||
import funkin.input.Controls;
|
||||
|
||||
/**
|
||||
* MusicBeatSubState reincorporates the functionality of MusicBeatState into an FlxSubState.
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package funkin.ui.freeplay;
|
||||
|
||||
import funkin.input.Controls;
|
||||
import flash.text.TextField;
|
||||
import flixel.addons.display.FlxGridOverlay;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
|
@ -22,7 +23,7 @@ import flixel.tweens.FlxTween;
|
|||
import flixel.util.FlxColor;
|
||||
import flixel.util.FlxSpriteUtil;
|
||||
import flixel.util.FlxTimer;
|
||||
import funkin.Controls.Control;
|
||||
import funkin.input.Controls.Control;
|
||||
import funkin.data.level.LevelRegistry;
|
||||
import funkin.data.song.SongRegistry;
|
||||
import funkin.graphics.adobeanimate.FlxAtlasSprite;
|
||||
|
@ -35,7 +36,6 @@ import funkin.play.components.HealthIcon;
|
|||
import funkin.play.PlayState;
|
||||
import funkin.play.PlayStatePlaylist;
|
||||
import funkin.play.song.Song;
|
||||
import funkin.play.song.Song;
|
||||
import funkin.save.Save;
|
||||
import funkin.save.Save.SaveScoreData;
|
||||
import funkin.ui.freeplay.BGScrollingText;
|
||||
|
|
|
@ -8,7 +8,7 @@ import flixel.group.FlxGroup;
|
|||
import flixel.input.actions.FlxActionInput;
|
||||
import flixel.input.gamepad.FlxGamepadInputID;
|
||||
import flixel.input.keyboard.FlxKey;
|
||||
import funkin.Controls;
|
||||
import funkin.input.Controls;
|
||||
import funkin.ui.AtlasText;
|
||||
import funkin.ui.MenuList;
|
||||
import funkin.ui.TextMenuList;
|
||||
|
|
|
@ -8,6 +8,7 @@ import flixel.util.FlxSignal;
|
|||
import funkin.ui.mainmenu.MainMenuState;
|
||||
import funkin.ui.MusicBeatState;
|
||||
import funkin.util.WindowUtil;
|
||||
import funkin.input.Controls;
|
||||
|
||||
class OptionsState extends MusicBeatState
|
||||
{
|
||||
|
@ -35,7 +36,7 @@ class OptionsState extends MusicBeatState
|
|||
if (options.hasMultipleOptions())
|
||||
{
|
||||
options.onExit.add(exitToMainMenu);
|
||||
controls.onExit.add(switchPage.bind(Options));
|
||||
controls.onExit.add(exitControls);
|
||||
preferences.onExit.add(switchPage.bind(Options));
|
||||
}
|
||||
else
|
||||
|
@ -85,10 +86,19 @@ class OptionsState extends MusicBeatState
|
|||
|
||||
function switchPage(name:PageName)
|
||||
{
|
||||
// Todo animate?
|
||||
// TODO: Animate this transition?
|
||||
setPage(name);
|
||||
}
|
||||
|
||||
function exitControls():Void
|
||||
{
|
||||
// Apply any changes to the controls.
|
||||
PlayerSettings.reset();
|
||||
PlayerSettings.init();
|
||||
|
||||
switchPage(Options);
|
||||
}
|
||||
|
||||
function exitToMainMenu()
|
||||
{
|
||||
currentPage.enabled = false;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package funkin.util;
|
||||
|
||||
import funkin.Controls;
|
||||
import funkin.input.Controls;
|
||||
import flixel.input.gamepad.FlxGamepad;
|
||||
import flixel.input.gamepad.FlxGamepadInputID;
|
||||
import flixel.input.keyboard.FlxKey;
|
||||
|
|
Loading…
Reference in a new issue