diff --git a/appveyor-linux.yml b/appveyor-linux.yml
index 3a18504..dc06bb0 100644
--- a/appveyor-linux.yml
+++ b/appveyor-linux.yml
@@ -9,7 +9,7 @@ install:
- cd /home/appveyor
- sudo add-apt-repository ppa:haxe/releases -y
- sudo apt update
- - sudo apt install neko tar -y
+ - sudo apt install neko tar gcc-multilib g++-multilib -y
- wget https://github.com/HaxeFoundation/haxe/releases/download/4.1.5/haxe-4.1.5-linux64.tar.gz
- mkdir $HAXE_INSTALLDIR
- tar -xf haxe-4.1.5-linux64.tar.gz -C $HAXE_INSTALLDIR
@@ -28,7 +28,10 @@ install:
- haxelib git faxe https://github.com/uhrobots/faxe
- haxelib git polymod https://github.com/larsiusprime/polymod.git
- haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc
+ - haxelib git extension-webm https://github.com/KadeDev/extension-webm
+ - haxelib run lime rebuild extension-webm linux
- haxelib install linc_luajit
+ - haxelib install actuate
- haxelib list
- cd /home/appveyor/projects/kade-engine-linux
diff --git a/appveyor-macos.yml b/appveyor-macos.yml
index 446096c..f8d8148 100644
--- a/appveyor-macos.yml
+++ b/appveyor-macos.yml
@@ -28,7 +28,11 @@ install:
- haxelib git faxe https://github.com/uhrobots/faxe
- haxelib git polymod https://github.com/larsiusprime/polymod.git
- haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc
+ - haxelib git extension-webm https://github.com/KadeDev/extension-webm
+ - haxelib run lime rebuild extension-webm macos
- haxelib install linc_luajit
+ - haxelib install actuate
+ - haxelib git extension-webm https://github.com/KadeDev/extension-webm
- haxelib list
- cd /Users/appveyor/projects/kade-engine-macos
diff --git a/appveyor-windows.yml b/appveyor-windows.yml
index 65acce8..eaf9b74 100644
--- a/appveyor-windows.yml
+++ b/appveyor-windows.yml
@@ -18,6 +18,7 @@ install:
- haxelib setup "%HAXELIB_ROOT%"
# Install project dependencies
- haxelib install lime 7.9.0
+ - RefreshEnv
- haxelib install openfl
- haxelib install flixel
- haxelib run lime setup flixel
@@ -32,7 +33,12 @@ install:
- haxelib git faxe https://github.com/uhrobots/faxe
- haxelib git polymod https://github.com/larsiusprime/polymod.git
- haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc
+ - haxelib git extension-webm https://github.com/KadeDev/extension-webm
+ - haxelib run lime rebuild extension-webm windows
- haxelib install linc_luajit
+ - haxelib install actuate
+ - haxelib git extension-webm https://github.com/KadeDev/extension-webm
+ - lime rebuild extension-webm windows
- haxelib list
# No tests idk lol
diff --git a/assets/shared/images/NOTE_assets.png b/assets/shared/images/NOTE_assets.png
index 7d50636..8e9f3a0 100644
Binary files a/assets/shared/images/NOTE_assets.png and b/assets/shared/images/NOTE_assets.png differ
diff --git a/assets/shared/images/NOTE_assets.xml b/assets/shared/images/NOTE_assets.xml
index 82a997a..6e80b13 100644
--- a/assets/shared/images/NOTE_assets.xml
+++ b/assets/shared/images/NOTE_assets.xml
@@ -1,53 +1,92 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/shared/images/characters/Monster_Assets.png b/assets/shared/images/characters/Monster_Assets.png
index 10b7bbe..7307545 100644
Binary files a/assets/shared/images/characters/Monster_Assets.png and b/assets/shared/images/characters/Monster_Assets.png differ
diff --git a/assets/shared/images/characters/Monster_Assets.xml b/assets/shared/images/characters/Monster_Assets.xml
index 687d294..37341d5 100644
--- a/assets/shared/images/characters/Monster_Assets.xml
+++ b/assets/shared/images/characters/Monster_Assets.xml
@@ -1,109 +1,109 @@
-๏ปฟ
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/building.md b/docs/building.md
index adfa00c..fa8d5a9 100644
--- a/docs/building.md
+++ b/docs/building.md
@@ -34,10 +34,22 @@
### Windows-only dependencies (only for building *to* Windows. Building html5 on Windows does not require this)
If you are planning to build for Windows, you also need to install **Visual Studio 2019**. While installing it, *don't click on any of the options to install workloads*. Instead, go to the **individual components** tab and choose the following:
-- MSVC C++ x64/x86 build tools (versions 142 and up)
-- Windows SDK (versions 10.0.19041.0 and up)
-This will install about 4 GB of crap, but is necessary to build for Windows.
+- MSVC v142 - VS 2019 C++ x64/x86 build tools
+- Windows SDK (10.0.17763.0)
+- C++ Profiling tools
+- C++ CMake tools for windows
+- C++ ATL for v142 build tools (x86 & x64)
+- C++ MFC for v142 build tools (x86 & x64)
+- C++/CLI support for v142 build tools (14.21)
+- C++ Modules for v142 build tools (x64/x86)
+- Clang Compiler for Windows
+- Windows 10 SDK (10.0.17134.0)
+- Windows 10 SDK (10.0.16299.0)
+- MSVC v141 - VS 2017 C++ x64/x86 build tools
+- MSVC v140 - VS 2015 C++ build tools (v14.00)
+
+This will install about 22 GB of crap, but is necessary to build for Windows.
### macOS-only dependencies (these are required for building on macOS at all, including html5.)
If you are running macOS, you'll need to install Xcode. You can download it from the macOS App Store or from the [Xcode website](https://developer.apple.com/xcode/).
diff --git a/docs/changelogs/changelog-1.5.3.md b/docs/changelogs/changelog-1.5.3.md
index 510ff5b..745f5c2 100644
--- a/docs/changelogs/changelog-1.5.3.md
+++ b/docs/changelogs/changelog-1.5.3.md
@@ -1,4 +1,4 @@
-# Latest (master) changelog
+# Changelog for 1.5.3
Changes marked with ๐ will be listed in the short version of the changelog in `version.downloadMe`.
@@ -14,3 +14,6 @@ Changes marked with ๐ will be listed in the short version of the changelog in
### Bugfixes
- NPS not showing if accuracy is disabled
- Fixed song names so they don't crash (๐)
+
+## Links
+[GitHub Release](https://github.com/KadeDev/Kade-Engine/releases/tag/1.5.3) ยท [Last Windows CI build](https://ci.appveyor.com/project/KadeDev/kade-engine-windows/builds/39671466) ยท [Last macOS CI build](https://ci.appveyor.com/project/KadeDev/kade-engine-macos/builds/39671465) ยท [Last Linux CI build](https://ci.appveyor.com/project/KadeDev/kade-engine-linux/builds/39671464)
diff --git a/docs/changelogs/changelog-1.5.4.md b/docs/changelogs/changelog-1.5.4.md
new file mode 100644
index 0000000..0c4e1e9
--- /dev/null
+++ b/docs/changelogs/changelog-1.5.4.md
@@ -0,0 +1,17 @@
+# Latest (master) changelog
+
+Changes marked with ๐ will be listed in the short version of the changelog in `version.downloadMe`.
+
+### Additions
+- Controller Support (๐)
+
+### Changes
+- KeyBinds don't effect menu screen options anymore.
+- Updated some image assets
+- Fixed spookeez audio sync
+
+### Bugfixes
+- Fixed Input Drops/Disappering Notes (๐)
+- Fixed HitGraph/Result Screen bugs
+- Fixed the chart editor
+- Fixed HTML5 Build issues
\ No newline at end of file
diff --git a/source/Caching.hx b/source/Caching.hx
index 2c6fb50..1cbbcd6 100644
--- a/source/Caching.hx
+++ b/source/Caching.hx
@@ -83,6 +83,7 @@ class Caching extends MusicBeatState
var images = [];
var music = [];
+ var charts = [];
trace("caching images...");
@@ -99,6 +100,7 @@ class Caching extends MusicBeatState
{
music.push(i);
}
+
toBeDone = Lambda.count(images) + Lambda.count(music);
@@ -120,6 +122,7 @@ class Caching extends MusicBeatState
done++;
}
+
trace("Finished caching...");
FlxG.switchState(new TitleState());
diff --git a/source/Controls.hx b/source/Controls.hx
index ac44eed..b52b858 100644
--- a/source/Controls.hx
+++ b/source/Controls.hx
@@ -1,5 +1,6 @@
package;
+import flixel.input.gamepad.FlxGamepad;
import flixel.FlxG;
import flixel.input.FlxInput;
import flixel.input.actions.FlxAction;
@@ -571,8 +572,22 @@ class Controls extends FlxActionSet
//trace(FlxKey.fromString(FlxG.save.data.upBind));
removeKeyboard();
+ if (gamepadsAdded.length != 0)
+ removeGamepad();
KeyBinds.keyCheck();
-
+
+ var buttons = new Map>();
+
+ buttons.set(Control.UP,[FlxGamepadInputID.fromString(FlxG.save.data.gpupBind)]);
+ buttons.set(Control.LEFT,[FlxGamepadInputID.fromString(FlxG.save.data.gpleftBind)]);
+ buttons.set(Control.DOWN,[FlxGamepadInputID.fromString(FlxG.save.data.gpdownBind)]);
+ buttons.set(Control.RIGHT,[FlxGamepadInputID.fromString(FlxG.save.data.gprightBind)]);
+ buttons.set(Control.ACCEPT,[FlxGamepadInputID.A]);
+ buttons.set(Control.BACK,[FlxGamepadInputID.B]);
+ buttons.set(Control.PAUSE,[FlxGamepadInputID.START]);
+
+ addGamepad(0,buttons);
+
inline bindKeys(Control.UP, [FlxKey.fromString(FlxG.save.data.upBind), FlxKey.UP]);
inline bindKeys(Control.DOWN, [FlxKey.fromString(FlxG.save.data.downBind), FlxKey.DOWN]);
inline bindKeys(Control.LEFT, [FlxKey.fromString(FlxG.save.data.leftBind), FlxKey.LEFT]);
@@ -599,6 +614,9 @@ class Controls extends FlxActionSet
public function addGamepad(id:Int, ?buttonMap:Map>):Void
{
+ if (gamepadsAdded.contains(id))
+ gamepadsAdded.remove(id);
+
gamepadsAdded.push(id);
#if (haxe >= "4.0.0")
diff --git a/source/DialogueBox.hx b/source/DialogueBox.hx
index 929eb24..d52358c 100644
--- a/source/DialogueBox.hx
+++ b/source/DialogueBox.hx
@@ -177,7 +177,7 @@ class DialogueBox extends FlxSpriteGroup
dialogueStarted = true;
}
- if (FlxG.keys.justPressed.ANY && dialogueStarted == true)
+ if (PlayerSettings.player1.controls.ACCEPT && dialogueStarted == true)
{
remove(dialogue);
diff --git a/source/DiffCalc.hx b/source/DiffCalc.hx
new file mode 100644
index 0000000..cd7bcf8
--- /dev/null
+++ b/source/DiffCalc.hx
@@ -0,0 +1,92 @@
+import Song.SwagSong;
+
+class SmallNote // basically Note.hx but small as fuck
+{
+ public var strumTime:Float;
+ public var noteData:Int;
+
+ public function new(strum,data)
+ {
+ strumTime = strum;
+ noteData = data;
+ }
+}
+
+class DiffCalc
+{
+ public static function CalculateDiff(song:SwagSong)
+ {
+ // cleaned notes
+ var cleanedNotes:Array = [];
+
+ // find all of the notes
+ for(i in song.notes) // sections
+ {
+ for (ii in i.sectionNotes) // notes
+ {
+ if (ii[2] != 0) // skip helds
+ continue;
+ var gottaHitNote:Bool = i.mustHitSection;
+
+ if (ii[1] > 3)
+ gottaHitNote = !i.mustHitSection;
+
+ if (gottaHitNote)
+ cleanedNotes.push(new SmallNote(ii[0],ii[1]));
+ }
+ }
+
+ cleanedNotes.sort((a, b) -> Std.int(a.strumTime - b.strumTime));
+
+ var firstNoteTime = cleanedNotes[0].strumTime;
+
+ // normalize the notes
+ for(i in cleanedNotes)
+ {
+ i.strumTime = (i.strumTime - firstNoteTime) * 2;
+ }
+
+ // length in segments of the song
+ var length = ((cleanedNotes[cleanedNotes.length - 1].strumTime / 1000) / 0.5);
+
+ // hackey way of creating a array with a length
+ var segments:Array = new_Array(1,Std.int(length));
+
+ // algo loop
+ for(i in cleanedNotes)
+ {
+ var index = Std.int(((i.strumTime / 1000)));
+ if (index + 1 > segments.length)
+ continue;
+ segments[index] = segments[index] + 1;
+ }
+
+ // get the average of all of the segments
+ var sum:Float = 0;
+
+ var newLength = segments.length;
+
+ for (i in segments)
+ {
+ if (i == 0) // remove empty/breaks
+ {
+ newLength--;
+ continue;
+ }
+ //trace(i);
+ sum += i / .5; // half it because otherwise instead of nps its just fucking notes per half second which is dumb and stupid
+ }
+ return HelperFunctions.truncateFloat(sum / newLength,2);
+ }
+
+ static public function new_Array( ArrayType:T, Length:Int ):Array {
+ var empty:Null = null;
+ var newArray:Array = new Array();
+
+ for ( i in 0...Length ) {
+ newArray.push( empty );
+ }
+
+ return newArray;
+ }
+}
\ No newline at end of file
diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx
index 7a3be07..7ff0fd4 100644
--- a/source/FreeplayState.hx
+++ b/source/FreeplayState.hx
@@ -1,5 +1,7 @@
package;
+import Song.SwagSong;
+import flixel.input.gamepad.FlxGamepad;
import flash.text.TextField;
import flixel.FlxG;
import flixel.FlxSprite;
@@ -28,6 +30,7 @@ class FreeplayState extends MusicBeatState
var scoreText:FlxText;
var comboText:FlxText;
var diffText:FlxText;
+ var diffCalcText:FlxText;
var lerpScore:Int = 0;
var intendedScore:Int = 0;
var combo:String = '';
@@ -37,6 +40,20 @@ class FreeplayState extends MusicBeatState
private var iconArray:Array = [];
+ public static var songData:Map> = [];
+
+ public static function loadDiff(diff:Int, format:String, name:String, array:Array)
+ {
+ try
+ {
+ array.push(Song.loadFromJson(Highscore.formatSong(format, diff), name));
+ }
+ catch(ex)
+ {
+ // do nada
+ }
+ }
+
override function create()
{
var initSonglist = CoolUtil.coolTextFile(Paths.txt('freeplaySonglist'));
@@ -44,8 +61,23 @@ class FreeplayState extends MusicBeatState
for (i in 0...initSonglist.length)
{
var data:Array = initSonglist[i].split(':');
+ var meta = new SongMetadata(data[0], Std.parseInt(data[2]), data[1]);
if(Std.parseInt(data[2]) <= FlxG.save.data.weekUnlocked - 1)
songs.push(new SongMetadata(data[0], Std.parseInt(data[2]), data[1]));
+ songs.push(meta);
+ var format = StringTools.replace(meta.songName, " ", "-");
+ switch (format) {
+ case 'Dad-Battle': format = 'Dadbattle';
+ case 'Philly-Nice': format = 'Philly';
+ }
+
+ var diffs = [];
+ FreeplayState.loadDiff(0,format,meta.songName,diffs);
+ FreeplayState.loadDiff(1,format,meta.songName,diffs);
+ FreeplayState.loadDiff(2,format,meta.songName,diffs);
+ FreeplayState.songData.set(meta.songName,diffs);
+ trace('loaded diffs for ' + meta.songName);
+
}
/*
@@ -101,7 +133,7 @@ class FreeplayState extends MusicBeatState
scoreText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, RIGHT);
// scoreText.alignment = RIGHT;
- var scoreBG:FlxSprite = new FlxSprite(scoreText.x - 6, 0).makeGraphic(Std.int(FlxG.width * 0.35), 66, 0xFF000000);
+ var scoreBG:FlxSprite = new FlxSprite(scoreText.x - 6, 0).makeGraphic(Std.int(FlxG.width * 0.35), 105, 0xFF000000);
scoreBG.alpha = 0.6;
add(scoreBG);
@@ -109,6 +141,10 @@ class FreeplayState extends MusicBeatState
diffText.font = scoreText.font;
add(diffText);
+ diffCalcText = new FlxText(scoreText.x, scoreText.y + 66, 0, "", 24);
+ diffCalcText.font = scoreText.font;
+ add(diffCalcText);
+
comboText = new FlxText(diffText.x + 100, diffText.y, 0, "", 24);
comboText.font = diffText.font;
add(comboText);
@@ -185,10 +221,32 @@ class FreeplayState extends MusicBeatState
scoreText.text = "PERSONAL BEST:" + lerpScore;
comboText.text = combo + '\n';
- var upP = controls.UP_P;
- var downP = controls.DOWN_P;
+ var upP = FlxG.keys.justPressed.UP;
+ var downP = FlxG.keys.justPressed.DOWN;
var accepted = controls.ACCEPT;
+ var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
+
+ if (gamepad != null)
+ {
+ if (gamepad.justPressed.DPAD_UP)
+ {
+ changeSelection(-1);
+ }
+ if (gamepad.justPressed.DPAD_DOWN)
+ {
+ changeSelection(1);
+ }
+ if (gamepad.justPressed.DPAD_LEFT)
+ {
+ changeDiff(-1);
+ }
+ if (gamepad.justPressed.DPAD_RIGHT)
+ {
+ changeDiff(1);
+ }
+ }
+
if (upP)
{
changeSelection(-1);
@@ -198,9 +256,9 @@ class FreeplayState extends MusicBeatState
changeSelection(1);
}
- if (controls.LEFT_P)
+ if (FlxG.keys.justPressed.LEFT)
changeDiff(-1);
- if (controls.RIGHT_P)
+ if (FlxG.keys.justPressed.RIGHT)
changeDiff(1);
if (controls.BACK)
@@ -216,14 +274,20 @@ class FreeplayState extends MusicBeatState
case 'Dad-Battle': songFormat = 'Dadbattle';
case 'Philly-Nice': songFormat = 'Philly';
}
-
- trace(songs[curSelected].songName);
+ var hmm;
+ try
+ {
+ hmm = songData.get(songs[curSelected].songName)[curDifficulty];
+ if (hmm == null)
+ return;
+ }
+ catch(ex)
+ {
+ return;
+ }
- var poop:String = Highscore.formatSong(songFormat, curDifficulty);
- trace(poop);
-
- PlayState.SONG = Song.loadFromJson(poop, songs[curSelected].songName);
+ PlayState.SONG = hmm;
PlayState.isStoryMode = false;
PlayState.storyDifficulty = curDifficulty;
PlayState.storyWeek = songs[curSelected].week;
@@ -252,7 +316,7 @@ class FreeplayState extends MusicBeatState
intendedScore = Highscore.getScore(songHighscore, curDifficulty);
combo = Highscore.getCombo(songHighscore, curDifficulty);
#end
-
+ diffCalcText.text = 'RATING: ${DiffCalc.CalculateDiff(songData.get(songs[curSelected].songName)[curDifficulty])}';
diffText.text = CoolUtil.difficultyFromInt(curDifficulty).toUpperCase();
}
@@ -288,6 +352,8 @@ class FreeplayState extends MusicBeatState
// lerpScore = 0;
#end
+ diffCalcText.text = 'RATING: ${DiffCalc.CalculateDiff(songData.get(songs[curSelected].songName)[curDifficulty])}';
+
#if PRELOAD_ALL
FlxG.sound.playMusic(Paths.inst(songs[curSelected].songName), 0);
#end
diff --git a/source/KadeEngineData.hx b/source/KadeEngineData.hx
index e386474..2e5b424 100644
--- a/source/KadeEngineData.hx
+++ b/source/KadeEngineData.hx
@@ -1,3 +1,4 @@
+import flixel.input.gamepad.FlxGamepad;
import openfl.Lib;
import flixel.FlxG;
@@ -95,6 +96,10 @@ class KadeEngineData
if (FlxG.save.data.optimize == null)
FlxG.save.data.optimize = false;
+
+ var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
+
+ KeyBinds.gamepad = gamepad != null;
Conductor.recalculateTimings();
PlayerSettings.player1.controls.loadKeyBinds();
diff --git a/source/KeyBindMenu.hx b/source/KeyBindMenu.hx
index 1d3f6e4..d5a3d41 100644
--- a/source/KeyBindMenu.hx
+++ b/source/KeyBindMenu.hx
@@ -3,6 +3,7 @@ package;
/// Code created by Rozebud for FPS Plus (thanks rozebud)
// modified by KadeDev for use in Kade Engine/Tricky
+import flixel.input.gamepad.FlxGamepad;
import flixel.util.FlxAxes;
import flixel.FlxSubState;
import Options.Option;
@@ -36,15 +37,19 @@ class KeyBindMenu extends FlxSubState
var warningTween:FlxTween;
var keyText:Array = ["LEFT", "DOWN", "UP", "RIGHT"];
var defaultKeys:Array = ["A", "S", "W", "D", "R"];
+ var defaultGpKeys:Array = ["DPAD_LEFT", "DPAD_DOWN", "DPAD_UP", "DPAD_RIGHT"];
var curSelected:Int = 0;
var keys:Array = [FlxG.save.data.leftBind,
FlxG.save.data.downBind,
FlxG.save.data.upBind,
FlxG.save.data.rightBind];
-
+ var gpKeys:Array = [FlxG.save.data.gpleftBind,
+ FlxG.save.data.gpdownBind,
+ FlxG.save.data.gpupBind,
+ FlxG.save.data.gprightBind];
var tempKey:String = "";
- var blacklist:Array = ["ESCAPE", "ENTER", "BACKSPACE", "SPACE"];
+ var blacklist:Array = ["ESCAPE", "ENTER", "BACKSPACE", "SPACE", "TAB"];
var blackBox:FlxSprite;
var infoText:FlxText;
@@ -60,10 +65,17 @@ class KeyBindMenu extends FlxSubState
if (k == null)
keys[i] = defaultKeys[i];
}
+
+ for (i in 0...gpKeys.length)
+ {
+ var k = gpKeys[i];
+ if (k == null)
+ gpKeys[i] = defaultGpKeys[i];
+ }
//FlxG.sound.playMusic('assets/music/configurator' + TitleState.soundExt);
- persistentUpdate = persistentDraw = true;
+ persistentUpdate = true;
keyTextDisplay = new FlxText(-10, 0, 1280, "", 72);
keyTextDisplay.scrollFactor.set(0, 0);
@@ -74,7 +86,7 @@ class KeyBindMenu extends FlxSubState
blackBox = new FlxSprite(0,0).makeGraphic(FlxG.width,FlxG.height,FlxColor.BLACK);
add(blackBox);
- infoText = new FlxText(-10, 580, 1280, "(Escape to save, backspace to leave without saving)", 72);
+ infoText = new FlxText(-10, 580, 1280, 'Current Mode: ${KeyBinds.gamepad ? 'GAMEPAD' : 'KEYBOARD'}. Press TAB to switch\n(${KeyBinds.gamepad ? 'RIGHT Trigger' : 'Escape'} to save, ${KeyBinds.gamepad ? 'LEFT Trigger' : 'Backspace'} to leave without saving. ${KeyBinds.gamepad ? 'START To change a keybind' : ''})', 72);
infoText.scrollFactor.set(0, 0);
infoText.setFormat("VCR OSD Mono", 24, FlxColor.WHITE, FlxTextAlign.CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
infoText.borderSize = 2;
@@ -98,23 +110,36 @@ class KeyBindMenu extends FlxSubState
super.create();
}
+ var frames = 0;
+
override function update(elapsed:Float)
{
+ var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
+
+ if (frames <= 10)
+ frames++;
switch(state){
case "select":
if (FlxG.keys.justPressed.UP)
- {
- FlxG.sound.play(Paths.sound('scrollMenu'));
- changeItem(-1);
- }
+ {
+ FlxG.sound.play(Paths.sound('scrollMenu'));
+ changeItem(-1);
+ }
- if (FlxG.keys.justPressed.DOWN)
- {
- FlxG.sound.play(Paths.sound('scrollMenu'));
- changeItem(1);
- }
+ if (FlxG.keys.justPressed.DOWN)
+ {
+ FlxG.sound.play(Paths.sound('scrollMenu'));
+ changeItem(1);
+ }
+
+ if (FlxG.keys.justPressed.TAB)
+ {
+ KeyBinds.gamepad = !KeyBinds.gamepad;
+ infoText.text = 'Current Mode: ${KeyBinds.gamepad ? 'GAMEPAD' : 'KEYBOARD'}. Press TAB to switch\n(${KeyBinds.gamepad ? 'RIGHT Trigger' : 'Escape'} to save, ${KeyBinds.gamepad ? 'LEFT Trigger' : 'Backspace'} to leave without saving. ${KeyBinds.gamepad ? 'START To change a keybind' : ''})';
+ textUpdate();
+ }
if (FlxG.keys.justPressed.ENTER){
FlxG.sound.play(Paths.sound('scrollMenu'));
@@ -123,31 +148,87 @@ class KeyBindMenu extends FlxSubState
else if(FlxG.keys.justPressed.ESCAPE){
quit();
}
- else if (FlxG.keys.justPressed.BACKSPACE){
+ else if (FlxG.keys.justPressed.BACKSPACE){
reset();
}
+ if (gamepad != null) // GP Logic
+ {
+ if (gamepad.justPressed.DPAD_UP)
+ {
+ FlxG.sound.play(Paths.sound('scrollMenu'));
+ changeItem(-1);
+ textUpdate();
+ }
+ if (gamepad.justPressed.DPAD_DOWN)
+ {
+ FlxG.sound.play(Paths.sound('scrollMenu'));
+ changeItem(1);
+ textUpdate();
+ }
+
+ if (gamepad.justPressed.START && frames > 10){
+ FlxG.sound.play(Paths.sound('scrollMenu'));
+ state = "input";
+ }
+ else if(gamepad.justPressed.LEFT_TRIGGER){
+ quit();
+ }
+ else if (gamepad.justPressed.RIGHT_TRIGGER){
+ reset();
+ }
+ }
case "input":
tempKey = keys[curSelected];
keys[curSelected] = "?";
+ if (KeyBinds.gamepad)
+ gpKeys[curSelected] = "?";
textUpdate();
state = "waiting";
case "waiting":
- if(FlxG.keys.justPressed.ESCAPE){
- keys[curSelected] = tempKey;
- state = "select";
- FlxG.sound.play(Paths.sound('confirmMenu'));
+ if (gamepad != null && KeyBinds.gamepad) // GP Logic
+ {
+ if(FlxG.keys.justPressed.ESCAPE){ // just in case you get stuck
+ gpKeys[curSelected] = tempKey;
+ state = "select";
+ FlxG.sound.play(Paths.sound('confirmMenu'));
+ }
+
+ if (gamepad.justPressed.START)
+ {
+ addKeyGamepad(defaultKeys[curSelected]);
+ save();
+ state = "select";
+ }
+
+ if (gamepad.justPressed.ANY)
+ {
+ trace(gamepad.firstJustPressedID());
+ addKeyGamepad(gamepad.firstJustPressedID());
+ save();
+ state = "select";
+ textUpdate();
+ }
+
}
- else if(FlxG.keys.justPressed.ENTER){
- addKey(defaultKeys[curSelected]);
- save();
- state = "select";
- }
- else if(FlxG.keys.justPressed.ANY){
- addKey(FlxG.keys.getIsDown()[0].ID.toString());
- save();
- state = "select";
+ else
+ {
+ if(FlxG.keys.justPressed.ESCAPE){
+ keys[curSelected] = tempKey;
+ state = "select";
+ FlxG.sound.play(Paths.sound('confirmMenu'));
+ }
+ else if(FlxG.keys.justPressed.ENTER){
+ addKey(defaultKeys[curSelected]);
+ save();
+ state = "select";
+ }
+ else if(FlxG.keys.justPressed.ANY){
+ addKey(FlxG.keys.getIsDown()[0].ID.toString());
+ save();
+ state = "select";
+ }
}
@@ -170,11 +251,24 @@ class KeyBindMenu extends FlxSubState
keyTextDisplay.text = "\n\n";
- for(i in 0...4){
+ if (KeyBinds.gamepad)
+ {
+ for(i in 0...4){
- var textStart = (i == curSelected) ? "> " : " ";
- keyTextDisplay.text += textStart + keyText[i] + ": " + ((keys[i] != keyText[i]) ? (keys[i] + " / ") : "" ) + keyText[i] + " ARROW\n";
+ var textStart = (i == curSelected) ? "> " : " ";
+ trace(gpKeys[i]);
+ keyTextDisplay.text += textStart + keyText[i] + ": " + gpKeys[i] + "\n";
+
+ }
+ }
+ else
+ {
+ for(i in 0...4){
+ var textStart = (i == curSelected) ? "> " : " ";
+ keyTextDisplay.text += textStart + keyText[i] + ": " + ((keys[i] != keyText[i]) ? (keys[i] + " / ") : "" ) + keyText[i] + " ARROW\n";
+
+ }
}
keyTextDisplay.screenCenter();
@@ -187,6 +281,11 @@ class KeyBindMenu extends FlxSubState
FlxG.save.data.downBind = keys[1];
FlxG.save.data.leftBind = keys[0];
FlxG.save.data.rightBind = keys[3];
+
+ FlxG.save.data.gpupBind = gpKeys[2];
+ FlxG.save.data.gpdownBind = gpKeys[1];
+ FlxG.save.data.gpleftBind = gpKeys[0];
+ FlxG.save.data.gprightBind = gpKeys[3];
FlxG.save.flush();
@@ -217,6 +316,38 @@ class KeyBindMenu extends FlxSubState
}
+ function addKeyGamepad(r:String){
+
+ var shouldReturn:Bool = true;
+
+ var notAllowed:Array = ["START", "RIGHT_TRIGGER", "LEFT_TRIGGER"];
+
+ for(x in 0...gpKeys.length)
+ {
+ var oK = gpKeys[x];
+ if(oK == r)
+ gpKeys[x] = null;
+ if (notAllowed.contains(oK))
+ {
+ gpKeys[x] = null;
+ return;
+ }
+ }
+
+ if(shouldReturn){
+ gpKeys[curSelected] = r;
+ FlxG.sound.play(Paths.sound('scrollMenu'));
+ }
+ else{
+ gpKeys[curSelected] = tempKey;
+ FlxG.sound.play(Paths.sound('scrollMenu'));
+ keyWarning.alpha = 1;
+ warningTween.cancel();
+ warningTween = FlxTween.tween(keyWarning, {alpha: 0}, 0.5, {ease: FlxEase.circOut, startDelay: 2});
+ }
+
+ }
+
function addKey(r:String){
var shouldReturn:Bool = true;
@@ -233,9 +364,18 @@ class KeyBindMenu extends FlxSubState
if(oK == r)
keys[x] = null;
if (notAllowed.contains(oK))
+ {
+ keys[x] = null;
return;
+ }
}
+ if (r.contains("NUMPAD"))
+ {
+ keys[curSelected] = null;
+ return;
+ }
+
if(shouldReturn){
keys[curSelected] = r;
FlxG.sound.play(Paths.sound('scrollMenu'));
diff --git a/source/KeyBinds.hx b/source/KeyBinds.hx
index facd1ad..b9c704d 100644
--- a/source/KeyBinds.hx
+++ b/source/KeyBinds.hx
@@ -12,6 +12,8 @@ import flixel.input.keyboard.FlxKey;
class KeyBinds
{
+ public static var gamepad:Bool = false;
+
public static function resetBinds():Void{
FlxG.save.data.upBind = "W";
@@ -19,6 +21,10 @@ class KeyBinds
FlxG.save.data.leftBind = "A";
FlxG.save.data.rightBind = "D";
FlxG.save.data.killBind = "R";
+ FlxG.save.data.gpupBind = "DPAD_UP";
+ FlxG.save.data.gpdownBind = "DPAD_DOWN";
+ FlxG.save.data.gpleftBind = "DPAD_LEFT";
+ FlxG.save.data.gprightBind = "DPAD_RIGHT";
PlayerSettings.player1.controls.loadKeyBinds();
}
@@ -29,22 +35,49 @@ class KeyBinds
FlxG.save.data.upBind = "W";
trace("No UP");
}
+ if (StringTools.contains(FlxG.save.data.upBind,"NUMPAD"))
+ FlxG.save.data.upBind = "W";
if(FlxG.save.data.downBind == null){
FlxG.save.data.downBind = "S";
trace("No DOWN");
}
+ if (StringTools.contains(FlxG.save.data.downBind,"NUMPAD"))
+ FlxG.save.data.downBind = "S";
if(FlxG.save.data.leftBind == null){
FlxG.save.data.leftBind = "A";
trace("No LEFT");
}
+ if (StringTools.contains(FlxG.save.data.leftBind,"NUMPAD"))
+ FlxG.save.data.leftBind = "A";
if(FlxG.save.data.rightBind == null){
FlxG.save.data.rightBind = "D";
trace("No RIGHT");
}
- if(FlxG.save.data.killBind == null){
+ if (StringTools.contains(FlxG.save.data.rightBind,"NUMPAD"))
+ FlxG.save.data.rightBind = "D";
+
+ if(FlxG.save.data.gpupBind == null){
+ FlxG.save.data.gpupBind = "DPAD_UP";
+ trace("No GUP");
+ }
+ if(FlxG.save.data.gpdownBind == null){
+ FlxG.save.data.gpdownBind = "DPAD_DOWN";
+ trace("No GDOWN");
+ }
+ if(FlxG.save.data.gpleftBind == null){
+ FlxG.save.data.gpleftBind = "DPAD_LEFT";
+ trace("No GLEFT");
+ }
+ if(FlxG.save.data.gprightBind == null){
+ FlxG.save.data.gprightBind = "DPAD_RIGHT";
+ trace("No GRIGHT");
+ }
+ if(FlxG.save.data.killBind == null){
FlxG.save.data.killBind = "R";
trace("No KILL");
}
+
+ trace('${FlxG.save.data.leftBind}-${FlxG.save.data.downBind}-${FlxG.save.data.upBind}-${FlxG.save.data.rightBind}');
}
-}
\ No newline at end of file
+}
diff --git a/source/Main.hx b/source/Main.hx
index 6efcae3..a065da2 100644
--- a/source/Main.hx
+++ b/source/Main.hx
@@ -1,7 +1,5 @@
package;
-
-import webm.WebmPlayer;
import openfl.display.BlendMode;
import openfl.text.TextFormat;
import openfl.display.Application;
@@ -77,10 +75,12 @@ class Main extends Sprite
gameHeight = Math.ceil(stageHeight / zoom);
}
+ #if cpp
initialState = Caching;
-
game = new FlxGame(gameWidth, gameHeight, initialState, zoom, framerate, framerate, skipSplash, startFullscreen);
-
+ #else
+ game = new FlxGame(gameWidth, gameHeight, initialState, zoom, framerate, framerate, skipSplash, startFullscreen);
+ #end
addChild(game);
#if !mobile
diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx
index f2c5d67..ab5f444 100644
--- a/source/MainMenuState.hx
+++ b/source/MainMenuState.hx
@@ -1,5 +1,6 @@
package;
+import flixel.input.gamepad.FlxGamepad;
import Controls.KeyboardScheme;
import flixel.FlxG;
import flixel.FlxObject;
@@ -39,7 +40,7 @@ class MainMenuState extends MusicBeatState
public static var nightly:String = "";
- public static var kadeEngineVer:String = "1.5.3" + nightly;
+ public static var kadeEngineVer:String = "1.5.4" + nightly;
public static var gameVer:String = "0.2.7.1";
var magenta:FlxSprite;
@@ -144,13 +145,29 @@ class MainMenuState extends MusicBeatState
if (!selectedSomethin)
{
- if (controls.UP_P)
+ var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
+
+ if (gamepad != null)
+ {
+ if (gamepad.justPressed.DPAD_UP)
+ {
+ FlxG.sound.play(Paths.sound('scrollMenu'));
+ changeItem(-1);
+ }
+ if (gamepad.justPressed.DPAD_DOWN)
+ {
+ FlxG.sound.play(Paths.sound('scrollMenu'));
+ changeItem(1);
+ }
+ }
+
+ if (FlxG.keys.justPressed.UP)
{
FlxG.sound.play(Paths.sound('scrollMenu'));
changeItem(-1);
}
- if (controls.DOWN_P)
+ if (FlxG.keys.justPressed.DOWN)
{
FlxG.sound.play(Paths.sound('scrollMenu'));
changeItem(1);
diff --git a/source/Note.hx b/source/Note.hx
index cdb9cb2..ec67490 100644
--- a/source/Note.hx
+++ b/source/Note.hx
@@ -99,20 +99,20 @@ class Note extends FlxSprite
default:
frames = Paths.getSparrowAtlas('NOTE_assets');
- animation.addByPrefix('greenScroll', 'green0');
- animation.addByPrefix('redScroll', 'red0');
- animation.addByPrefix('blueScroll', 'blue0');
- animation.addByPrefix('purpleScroll', 'purple0');
+ animation.addByPrefix('greenScroll', 'green instance 1');
+ animation.addByPrefix('redScroll', 'red instance 1');
+ animation.addByPrefix('blueScroll', 'blue instance 1');
+ animation.addByPrefix('purpleScroll', 'purple instance 1');
- animation.addByPrefix('purpleholdend', 'pruple end hold');
- animation.addByPrefix('greenholdend', 'green hold end');
- animation.addByPrefix('redholdend', 'red hold end');
- animation.addByPrefix('blueholdend', 'blue hold end');
+ animation.addByPrefix('purpleholdend', 'pruple end hold instance 1');
+ animation.addByPrefix('greenholdend', 'green hold end instance 1');
+ animation.addByPrefix('redholdend', 'red hold end instance 1');
+ animation.addByPrefix('blueholdend', 'blue hold end instance 1');
- animation.addByPrefix('purplehold', 'purple hold piece');
- animation.addByPrefix('greenhold', 'green hold piece');
- animation.addByPrefix('redhold', 'red hold piece');
- animation.addByPrefix('bluehold', 'blue hold piece');
+ animation.addByPrefix('purplehold', 'purple hold piece instance 1');
+ animation.addByPrefix('greenhold', 'green hold piece instance 1');
+ animation.addByPrefix('redhold', 'red hold piece instance 1');
+ animation.addByPrefix('bluehold', 'blue hold piece instance 1');
setGraphicSize(Std.int(width * 0.7));
updateHitbox();
@@ -235,4 +235,4 @@ class Note extends FlxSprite
alpha = 0.3;
}
}
-}
\ No newline at end of file
+}
diff --git a/source/Options.hx b/source/Options.hx
index fce3fd1..8be193e 100644
--- a/source/Options.hx
+++ b/source/Options.hx
@@ -317,10 +317,10 @@ class Judgement extends Option
override function getValue():String {
return "Safe Frames: " + Conductor.safeFrames +
- " - SIK: " + HelperFunctions.truncateFloat(22 * Conductor.timeScale, 0) +
- "ms GD: " + HelperFunctions.truncateFloat(45 * Conductor.timeScale, 0) +
+ " - SIK: " + HelperFunctions.truncateFloat(45 * Conductor.timeScale, 0) +
+ "ms GD: " + HelperFunctions.truncateFloat(90 * Conductor.timeScale, 0) +
"ms BD: " + HelperFunctions.truncateFloat(135 * Conductor.timeScale, 0) +
- "ms SHT: " + HelperFunctions.truncateFloat(155 * Conductor.timeScale, 0) +
+ "ms SHT: " + HelperFunctions.truncateFloat(166 * Conductor.timeScale, 0) +
"ms TOTAL: " + HelperFunctions.truncateFloat(Conductor.safeZoneOffset,0) + "ms";
}
diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx
index 6b6bf53..e67cd0f 100644
--- a/source/OptionsMenu.hx
+++ b/source/OptionsMenu.hx
@@ -1,5 +1,6 @@
package;
+import flixel.input.gamepad.FlxGamepad;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import openfl.Lib;
@@ -150,9 +151,26 @@ class OptionsMenu extends MusicBeatState
changeSelection(curSelected);
}
- if (controls.UP_P)
+
+ var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
+
+ if (gamepad != null)
+ {
+ if (gamepad.justPressed.DPAD_UP)
+ {
+ FlxG.sound.play(Paths.sound('scrollMenu'));
+ changeSelection(-1);
+ }
+ if (gamepad.justPressed.DPAD_DOWN)
+ {
+ FlxG.sound.play(Paths.sound('scrollMenu'));
+ changeSelection(1);
+ }
+ }
+
+ if (FlxG.keys.justPressed.UP)
changeSelection(-1);
- if (controls.DOWN_P)
+ if (FlxG.keys.justPressed.DOWN)
changeSelection(1);
if (isCat)
diff --git a/source/PauseSubState.hx b/source/PauseSubState.hx
index 3985d4b..f2e3a0b 100644
--- a/source/PauseSubState.hx
+++ b/source/PauseSubState.hx
@@ -1,5 +1,6 @@
package;
+import flixel.input.gamepad.FlxGamepad;
import openfl.Lib;
#if windows
import llua.Lua;
@@ -108,13 +109,22 @@ class PauseSubState extends MusicBeatSubstate
if (PlayState.instance.useVideo)
menuItems.remove('Resume');
- var upP = controls.UP_P;
- var downP = controls.DOWN_P;
- var leftP = controls.LEFT_P;
- var rightP = controls.RIGHT_P;
- var accepted = controls.ACCEPT;
+ var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
+
+ var upPcontroller:Bool = false;
+ var downPcontroller:Bool = false;
+ var leftPcontroller:Bool = false;
+ var rightPcontroller:Bool = false;
var oldOffset:Float = 0;
+ if (gamepad != null && KeyBinds.gamepad)
+ {
+ upPcontroller = gamepad.justPressed.DPAD_UP;
+ downPcontroller = gamepad.justPressed.DPAD_DOWN;
+ leftPcontroller = gamepad.justPressed.DPAD_LEFT;
+ rightPcontroller = gamepad.justPressed.DPAD_RIGHT;
+ }
+
// pre lowercasing the song name (update)
var songLowercase = StringTools.replace(PlayState.SONG.song, " ", "-").toLowerCase();
switch (songLowercase) {
@@ -123,17 +133,18 @@ class PauseSubState extends MusicBeatSubstate
}
var songPath = 'assets/data/' + songLowercase + '/';
- if (upP)
+ if (controls.UP_P || upPcontroller)
{
changeSelection(-1);
- }else if (downP)
+ }
+ else if (controls.DOWN_P || downPcontroller)
{
changeSelection(1);
}
#if cpp
- else if (leftP)
+ else if (controls.LEFT_P || leftPcontroller)
{
oldOffset = PlayState.songOffset;
PlayState.songOffset -= 1;
@@ -160,7 +171,8 @@ class PauseSubState extends MusicBeatSubstate
cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
offsetChanged = true;
}
- }else if (rightP)
+ }
+ else if (controls.RIGHT_P || rightPcontroller)
{
oldOffset = PlayState.songOffset;
PlayState.songOffset += 1;
@@ -188,7 +200,7 @@ class PauseSubState extends MusicBeatSubstate
}
#end
- if (accepted)
+ if (controls.ACCEPT)
{
var daSelected:String = menuItems[curSelected];
diff --git a/source/PlayState.hx b/source/PlayState.hx
index 021ef92..89d77ff 100644
--- a/source/PlayState.hx
+++ b/source/PlayState.hx
@@ -1,12 +1,15 @@
package;
+import openfl.ui.KeyLocation;
import openfl.events.Event;
import haxe.EnumTools;
import openfl.ui.Keyboard;
import openfl.events.KeyboardEvent;
import Replay.Ana;
import Replay.Analysis;
+#if cpp
import webm.WebmPlayer;
+#end
import flixel.input.keyboard.FlxKey;
import haxe.Exception;
import openfl.geom.Matrix;
@@ -250,6 +253,8 @@ class PlayState extends MusicBeatState
}
misses = 0;
+
+ highestCombo = 0;
repPresses = 0;
repReleases = 0;
@@ -996,7 +1001,7 @@ class PlayState extends MusicBeatState
add(healthBar);
// Add Kade Engine watermark
- kadeEngineWatermark = new FlxText(4,healthBarBG.y + 50,0,SONG.song + " " + CoolUtil.difficultyFromInt(storyDifficulty) + (Main.watermarks ? " - KE " + MainMenuState.kadeEngineVer : ""), 16);
+ kadeEngineWatermark = new FlxText(4,healthBarBG.y + 50,0,SONG.song + " - " + CoolUtil.difficultyFromInt(storyDifficulty) + (Main.watermarks ? " | KE " + MainMenuState.kadeEngineVer : ""), 16);
kadeEngineWatermark.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE,FlxColor.BLACK);
kadeEngineWatermark.scrollFactor.set();
add(kadeEngineWatermark);
@@ -1124,6 +1129,7 @@ class PlayState extends MusicBeatState
rep = new Replay("na");
FlxG.stage.addEventListener(KeyboardEvent.KEY_DOWN,handleInput);
+ FlxG.stage.addEventListener(KeyboardEvent.KEY_UP,releaseInput);
super.create();
}
@@ -1353,24 +1359,94 @@ class PlayState extends MusicBeatState
var songTime:Float = 0;
+ private function getKey(charCode:Int):String
+ {
+ for (key => value in FlxKey.fromStringMap)
+ {
+ if (charCode == value)
+ return key;
+ }
+ return null;
+ }
+
+ var keys = [false,false,false,false];
+
+ private function releaseInput(evt:KeyboardEvent):Void // handles releases
+ {
+ @:privateAccess
+ var key = FlxKey.toStringMap.get(Keyboard.__convertKeyCode(evt.keyCode));
+
+ var binds:Array = [FlxG.save.data.leftBind,FlxG.save.data.downBind, FlxG.save.data.upBind, FlxG.save.data.rightBind];
+
+ var data = -1;
+
+ switch(evt.keyCode) // arrow keys
+ {
+ case 37:
+ data = 0;
+ case 40:
+ data = 1;
+ case 38:
+ data = 2;
+ case 39:
+ data = 3;
+ }
+
+ for (i in 0...binds.length) // binds
+ {
+ if (binds[i].toLowerCase() == key.toLowerCase())
+ data = i;
+ }
+
+ if (data == -1)
+ return;
+
+ keys[data] = false;
+ }
+
private function handleInput(evt:KeyboardEvent):Void { // this actually handles press inputs
if (PlayStateChangeables.botPlay || loadRep || paused)
return;
- var key = String.fromCharCode(evt.charCode);
+ // first convert it from openfl to a flixel key code
+ // then use FlxKey to get the key's name based off of the FlxKey dictionary
+ // this makes it work for special characters
+ @:privateAccess
+ var key = FlxKey.toStringMap.get(Keyboard.__convertKeyCode(evt.keyCode));
+
var binds:Array = [FlxG.save.data.leftBind,FlxG.save.data.downBind, FlxG.save.data.upBind, FlxG.save.data.rightBind];
var data = -1;
+
+ switch(evt.keyCode) // arrow keys
+ {
+ case 37:
+ data = 0;
+ case 40:
+ data = 1;
+ case 38:
+ data = 2;
+ case 39:
+ data = 3;
+ }
- for (i in 0...binds.length)
- if (binds[i].toLowerCase() == key)
+ for (i in 0...binds.length) // binds
+ {
+ if (binds[i].toLowerCase() == key.toLowerCase())
data = i;
-
+ }
if (data == -1)
return;
+ if (keys[data])
+ {
+ return;
+ }
+
+ keys[data] = true;
+
var ana = new Ana(Conductor.songPosition, null, false, "miss", data);
var dataNotes = [];
@@ -1382,7 +1458,7 @@ class PlayState extends MusicBeatState
dataNotes.sort((a, b) -> Std.int(a.strumTime - b.strumTime)); // sort by the earliest note
-
+
if (dataNotes.length != 0)
{
var coolNote = dataNotes[0];
@@ -1555,6 +1631,18 @@ class PlayState extends MusicBeatState
swagNote.sustainLength = songNotes[2];
swagNote.scrollFactor.set(0, 0);
+ var addNote = false;
+
+ for (i in unspawnNotes)
+ if (i.strumTime == daStrumTime && i.noteData == daNoteData)
+ addNote = true;
+
+ if (addNote)
+ {
+ trace('stacked note, thats cringe');
+ continue;
+ }
+
var susLength:Float = swagNote.sustainLength;
susLength = susLength / Conductor.stepCrochet;
@@ -1656,73 +1744,73 @@ class PlayState extends MusicBeatState
babyArrow.animation.add('confirm', [12, 16], 24, false);
}
- case 'normal':
- babyArrow.frames = Paths.getSparrowAtlas('NOTE_assets');
- babyArrow.animation.addByPrefix('green', 'arrowUP');
- babyArrow.animation.addByPrefix('blue', 'arrowDOWN');
- babyArrow.animation.addByPrefix('purple', 'arrowLEFT');
- babyArrow.animation.addByPrefix('red', 'arrowRIGHT');
-
- babyArrow.antialiasing = true;
- babyArrow.setGraphicSize(Std.int(babyArrow.width * 0.7));
-
- switch (Math.abs(i))
- {
- case 0:
- babyArrow.x += Note.swagWidth * 0;
- babyArrow.animation.addByPrefix('static', 'arrowLEFT');
- babyArrow.animation.addByPrefix('pressed', 'left press', 24, false);
- babyArrow.animation.addByPrefix('confirm', 'left confirm', 24, false);
- case 1:
- babyArrow.x += Note.swagWidth * 1;
- babyArrow.animation.addByPrefix('static', 'arrowDOWN');
- babyArrow.animation.addByPrefix('pressed', 'down press', 24, false);
- babyArrow.animation.addByPrefix('confirm', 'down confirm', 24, false);
- case 2:
- babyArrow.x += Note.swagWidth * 2;
- babyArrow.animation.addByPrefix('static', 'arrowUP');
- babyArrow.animation.addByPrefix('pressed', 'up press', 24, false);
- babyArrow.animation.addByPrefix('confirm', 'up confirm', 24, false);
- case 3:
- babyArrow.x += Note.swagWidth * 3;
- babyArrow.animation.addByPrefix('static', 'arrowRIGHT');
- babyArrow.animation.addByPrefix('pressed', 'right press', 24, false);
- babyArrow.animation.addByPrefix('confirm', 'right confirm', 24, false);
- }
+ case 'normal':
+ babyArrow.frames = Paths.getSparrowAtlas('NOTE_assets');
+ babyArrow.animation.addByPrefix('green', 'arrow static instance 1');
+ babyArrow.animation.addByPrefix('blue', 'arrow static instance 2');
+ babyArrow.animation.addByPrefix('purple', 'arrow static instance 3');
+ babyArrow.animation.addByPrefix('red', 'arrow static instance 4');
- default:
- babyArrow.frames = Paths.getSparrowAtlas('NOTE_assets');
- babyArrow.animation.addByPrefix('green', 'arrowUP');
- babyArrow.animation.addByPrefix('blue', 'arrowDOWN');
- babyArrow.animation.addByPrefix('purple', 'arrowLEFT');
- babyArrow.animation.addByPrefix('red', 'arrowRIGHT');
+ babyArrow.antialiasing = true;
+ babyArrow.setGraphicSize(Std.int(babyArrow.width * 0.7));
- babyArrow.antialiasing = true;
- babyArrow.setGraphicSize(Std.int(babyArrow.width * 0.7));
-
- switch (Math.abs(i))
- {
- case 0:
- babyArrow.x += Note.swagWidth * 0;
- babyArrow.animation.addByPrefix('static', 'arrowLEFT');
- babyArrow.animation.addByPrefix('pressed', 'left press', 24, false);
- babyArrow.animation.addByPrefix('confirm', 'left confirm', 24, false);
- case 1:
- babyArrow.x += Note.swagWidth * 1;
- babyArrow.animation.addByPrefix('static', 'arrowDOWN');
- babyArrow.animation.addByPrefix('pressed', 'down press', 24, false);
- babyArrow.animation.addByPrefix('confirm', 'down confirm', 24, false);
- case 2:
- babyArrow.x += Note.swagWidth * 2;
- babyArrow.animation.addByPrefix('static', 'arrowUP');
- babyArrow.animation.addByPrefix('pressed', 'up press', 24, false);
- babyArrow.animation.addByPrefix('confirm', 'up confirm', 24, false);
- case 3:
- babyArrow.x += Note.swagWidth * 3;
- babyArrow.animation.addByPrefix('static', 'arrowRIGHT');
- babyArrow.animation.addByPrefix('pressed', 'right press', 24, false);
- babyArrow.animation.addByPrefix('confirm', 'right confirm', 24, false);
+ switch (Math.abs(i))
+ {
+ case 0:
+ babyArrow.x += Note.swagWidth * 0;
+ babyArrow.animation.addByPrefix('static', 'arrow static instance 1');
+ babyArrow.animation.addByPrefix('pressed', 'left press instance 1', 24, false);
+ babyArrow.animation.addByPrefix('confirm', 'left confirm instance 1', 24, false);
+ case 1:
+ babyArrow.x += Note.swagWidth * 1;
+ babyArrow.animation.addByPrefix('static', 'arrow static instance 2');
+ babyArrow.animation.addByPrefix('pressed', 'down press instance 1', 24, false);
+ babyArrow.animation.addByPrefix('confirm', 'down confirm instance 1', 24, false);
+ case 2:
+ babyArrow.x += Note.swagWidth * 2;
+ babyArrow.animation.addByPrefix('static', 'arrow static instance 4');
+ babyArrow.animation.addByPrefix('pressed', 'up press instance 1', 24, false);
+ babyArrow.animation.addByPrefix('confirm', 'up confirm instance 1', 24, false);
+ case 3:
+ babyArrow.x += Note.swagWidth * 3;
+ babyArrow.animation.addByPrefix('static', 'arrow static instance 3');
+ babyArrow.animation.addByPrefix('pressed', 'right press instance 1', 24, false);
+ babyArrow.animation.addByPrefix('confirm', 'right confirm instance 1', 24, false);
}
+
+ default:
+ babyArrow.frames = Paths.getSparrowAtlas('NOTE_assets');
+ babyArrow.animation.addByPrefix('green', 'arrow static instance 1');
+ babyArrow.animation.addByPrefix('blue', 'arrow static instance 2');
+ babyArrow.animation.addByPrefix('purple', 'arrow static instance 3');
+ babyArrow.animation.addByPrefix('red', 'arrow static instance 4');
+
+ babyArrow.antialiasing = true;
+ babyArrow.setGraphicSize(Std.int(babyArrow.width * 0.7));
+
+ switch (Math.abs(i))
+ {
+ case 0:
+ babyArrow.x += Note.swagWidth * 0;
+ babyArrow.animation.addByPrefix('static', 'arrow static instance 1');
+ babyArrow.animation.addByPrefix('pressed', 'left press instance 1', 24, false);
+ babyArrow.animation.addByPrefix('confirm', 'left confirm instance 1', 24, false);
+ case 1:
+ babyArrow.x += Note.swagWidth * 1;
+ babyArrow.animation.addByPrefix('static', 'arrow static instance 2');
+ babyArrow.animation.addByPrefix('pressed', 'down press instance 1', 24, false);
+ babyArrow.animation.addByPrefix('confirm', 'down confirm instance 1', 24, false);
+ case 2:
+ babyArrow.x += Note.swagWidth * 2;
+ babyArrow.animation.addByPrefix('static', 'arrow static instance 4');
+ babyArrow.animation.addByPrefix('pressed', 'up press instance 1', 24, false);
+ babyArrow.animation.addByPrefix('confirm', 'up confirm instance 1', 24, false);
+ case 3:
+ babyArrow.x += Note.swagWidth * 3;
+ babyArrow.animation.addByPrefix('static', 'arrow static instance 3');
+ babyArrow.animation.addByPrefix('pressed', 'right press instance 1', 24, false);
+ babyArrow.animation.addByPrefix('confirm', 'right confirm instance 1', 24, false);
+ }
}
babyArrow.updateHitbox();
@@ -1970,7 +2058,7 @@ class PlayState extends MusicBeatState
scoreTxt.x = (originalX - (lengthInPx / 2)) + 335;
- if (FlxG.keys.justPressed.ENTER && startedCountdown && canPause)
+ if (controls.PAUSE && startedCountdown && canPause)
{
persistentUpdate = false;
persistentDraw = true;
@@ -1986,6 +2074,7 @@ class PlayState extends MusicBeatState
openSubState(new PauseSubState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
}
+
if (FlxG.keys.justPressed.SEVEN)
{
if (useVideo)
@@ -2001,6 +2090,7 @@ class PlayState extends MusicBeatState
#end
FlxG.switchState(new ChartingState());
FlxG.stage.removeEventListener(KeyboardEvent.KEY_DOWN,handleInput);
+ FlxG.stage.removeEventListener(KeyboardEvent.KEY_UP,releaseInput);
#if windows
if (luaModchart != null)
{
@@ -2053,6 +2143,7 @@ class PlayState extends MusicBeatState
FlxG.switchState(new AnimationDebug(SONG.player2));
FlxG.stage.removeEventListener(KeyboardEvent.KEY_DOWN,handleInput);
+ FlxG.stage.removeEventListener(KeyboardEvent.KEY_UP,releaseInput);
#if windows
if (luaModchart != null)
{
@@ -2066,6 +2157,7 @@ class PlayState extends MusicBeatState
{
FlxG.switchState(new AnimationDebug(SONG.player1));
FlxG.stage.removeEventListener(KeyboardEvent.KEY_DOWN,handleInput);
+ FlxG.stage.removeEventListener(KeyboardEvent.KEY_UP,releaseInput);
#if windows
if (luaModchart != null)
{
@@ -2620,6 +2712,7 @@ class PlayState extends MusicBeatState
function endSong():Void
{
FlxG.stage.removeEventListener(KeyboardEvent.KEY_DOWN,handleInput);
+ FlxG.stage.removeEventListener(KeyboardEvent.KEY_UP,releaseInput);
if (useVideo)
{
GlobalVideo.get().stop();
@@ -2817,7 +2910,7 @@ class PlayState extends MusicBeatState
ss = false;
shits++;
if (FlxG.save.data.accuracyMod == 0)
- totalNotesHit += 0.25;
+ totalNotesHit -= 1;
case 'bad':
daRating = 'bad';
score = 0;
@@ -3078,7 +3171,7 @@ class PlayState extends MusicBeatState
var rightHold:Bool = false;
var leftHold:Bool = false;
- // THIS FUNCTION JUST FUCKS WIT HELD NOTES AND BOTPLAY/REPLAY
+ // THIS FUNCTION JUST FUCKS WIT HELD NOTES AND BOTPLAY/REPLAY (also gamepad shit)
private function keyShit():Void // I've invested in emma stocks
{
@@ -3104,6 +3197,9 @@ class PlayState extends MusicBeatState
if (controls.RIGHT_P){luaModchart.executeState('keyPressed',["right"]);};
};
#end
+
+ var nonCpp = false;
+
// Prevent player input if botplay is on
if(PlayStateChangeables.botPlay)
@@ -3113,11 +3209,15 @@ class PlayState extends MusicBeatState
releaseArray = [false, false, false, false];
}
+ #if !cpp
+ nonCpp = true;
+ #end
+
var anas:Array = [null,null,null,null];
- /*for (i in 0...pressArray.length)
+ for (i in 0...pressArray.length)
if (pressArray[i])
- anas[i] = new Ana(Conductor.songPosition, null, false, "miss", i);*/
+ anas[i] = new Ana(Conductor.songPosition, null, false, "miss", i);
// HOLDS, check for sustain notes
if (holdArray.contains(true) && /*!boyfriend.stunned && */ generatedMusic)
@@ -3129,103 +3229,98 @@ class PlayState extends MusicBeatState
});
}
- // PRESSES, check for note hits
- /*if (pressArray.contains(true) && generatedMusic)
+ if ((KeyBinds.gamepad && !FlxG.keys.justPressed.ANY) || nonCpp)
{
- boyfriend.holdTimer = 0;
-
- var possibleNotes:Array = []; // notes that can be hit
- var directionList:Array = []; // directions that can be hit
- var dumbNotes:Array = []; // notes to kill later
- var directionsAccounted:Array = [false,false,false,false]; // we don't want to do judgments for more than one presses
-
- notes.forEachAlive(function(daNote:Note)
+ // PRESSES, check for note hits
+ if (pressArray.contains(true) && generatedMusic)
{
- if (daNote.canBeHit && daNote.mustPress && !daNote.tooLate && !daNote.wasGoodHit)
- {
- if (!directionsAccounted[daNote.noteData])
+ boyfriend.holdTimer = 0;
+
+ var possibleNotes:Array = []; // notes that can be hit
+ var directionList:Array = []; // directions that can be hit
+ var dumbNotes:Array = []; // notes to kill later
+ var directionsAccounted:Array = [false,false,false,false]; // we don't want to do judgments for more than one presses
+
+ notes.forEachAlive(function(daNote:Note)
{
- if (directionList.contains(daNote.noteData))
- {
- directionsAccounted[daNote.noteData] = true;
- for (coolNote in possibleNotes)
+ if (daNote.canBeHit && daNote.mustPress && !daNote.tooLate && !daNote.wasGoodHit && !directionsAccounted[daNote.noteData])
+ {
+ if (directionList.contains(daNote.noteData))
{
- if (coolNote.noteData == daNote.noteData && Math.abs(daNote.strumTime - coolNote.strumTime) < 10)
- { // if it's the same note twice at < 10ms distance, just delete it
- // EXCEPT u cant delete it in this loop cuz it fucks with the collection lol
- dumbNotes.push(daNote);
- break;
- }
- else if (coolNote.noteData == daNote.noteData && daNote.strumTime < coolNote.strumTime)
- { // if daNote is earlier than existing note (coolNote), replace
- possibleNotes.remove(coolNote);
- possibleNotes.push(daNote);
- break;
+ directionsAccounted[daNote.noteData] = true;
+ for (coolNote in possibleNotes)
+ {
+ if (coolNote.noteData == daNote.noteData && Math.abs(daNote.strumTime - coolNote.strumTime) < 10)
+ { // if it's the same note twice at < 10ms distance, just delete it
+ // EXCEPT u cant delete it in this loop cuz it fucks with the collection lol
+ dumbNotes.push(daNote);
+ break;
+ }
+ else if (coolNote.noteData == daNote.noteData && daNote.strumTime < coolNote.strumTime)
+ { // if daNote is earlier than existing note (coolNote), replace
+ possibleNotes.remove(coolNote);
+ possibleNotes.push(daNote);
+ break;
+ }
}
}
- }
- else
- {
- possibleNotes.push(daNote);
- directionList.push(daNote.noteData);
- }
- }
- }
- });
-
- trace('notes that can be hit: ' + possibleNotes.length);
-
- for (note in dumbNotes)
- {
- FlxG.log.add("killing dumb ass note at " + note.strumTime);
- note.kill();
- notes.remove(note, true);
- note.destroy();
- }
-
- possibleNotes.sort((a, b) -> Std.int(a.strumTime - b.strumTime));
-
- if (perfectMode)
- goodNoteHit(possibleNotes[0]);
- else if (possibleNotes.length > 0)
- {
- if (!FlxG.save.data.ghost)
- {
- for (shit in 0...pressArray.length)
- { // if a direction is hit that shouldn't be
- if (pressArray[shit] && !directionList.contains(shit))
- noteMiss(shit, null);
+ else
+ {
+ possibleNotes.push(daNote);
+ directionList.push(daNote.noteData);
+ }
}
- }
- for (coolNote in possibleNotes)
+ });
+
+ for (note in dumbNotes)
{
- if (pressArray[coolNote.noteData])
+ FlxG.log.add("killing dumb ass note at " + note.strumTime);
+ note.kill();
+ notes.remove(note, true);
+ note.destroy();
+ }
+
+ possibleNotes.sort((a, b) -> Std.int(a.strumTime - b.strumTime));
+ if (perfectMode)
+ goodNoteHit(possibleNotes[0]);
+ else if (possibleNotes.length > 0)
+ {
+ if (!FlxG.save.data.ghost)
{
- if (mashViolations != 0)
- mashViolations--;
- scoreTxt.color = FlxColor.WHITE;
- var noteDiff:Float = -(coolNote.strumTime - Conductor.songPosition);
- anas[coolNote.noteData].hit = true;
- anas[coolNote.noteData].hitJudge = Ratings.CalculateRating(noteDiff, Math.floor((PlayStateChangeables.safeFrames / 60) * 1000));
- anas[coolNote.noteData].nearestNote = [coolNote.strumTime,coolNote.noteData,coolNote.sustainLength];
- goodNoteHit(coolNote);
+ for (shit in 0...pressArray.length)
+ { // if a direction is hit that shouldn't be
+ if (pressArray[shit] && !directionList.contains(shit))
+ noteMiss(shit, null);
+ }
+ }
+ for (coolNote in possibleNotes)
+ {
+ if (pressArray[coolNote.noteData])
+ {
+ if (mashViolations != 0)
+ mashViolations--;
+ scoreTxt.color = FlxColor.WHITE;
+ var noteDiff:Float = -(coolNote.strumTime - Conductor.songPosition);
+ anas[coolNote.noteData].hit = true;
+ anas[coolNote.noteData].hitJudge = Ratings.CalculateRating(noteDiff, Math.floor((PlayStateChangeables.safeFrames / 60) * 1000));
+ anas[coolNote.noteData].nearestNote = [coolNote.strumTime,coolNote.noteData,coolNote.sustainLength];
+ goodNoteHit(coolNote);
+ }
}
}
+ else if (!FlxG.save.data.ghost)
+ {
+ for (shit in 0...pressArray.length)
+ if (pressArray[shit])
+ noteMiss(shit, null);
+ }
}
- else if (!FlxG.save.data.ghost)
- {
- for (shit in 0...pressArray.length)
- if (pressArray[shit])
- noteMiss(shit, null);
- }
- }*/
-
- /*if (!loadRep)
- for (i in anas)
- if (i != null)
- replayAna.anaArray.push(i); // put em all there*/
-
+ if (!loadRep)
+ for (i in anas)
+ if (i != null)
+ replayAna.anaArray.push(i); // put em all there
+ }
notes.forEachAlive(function(daNote:Note)
{
if(PlayStateChangeables.useDownscroll && daNote.y > strumLine.y ||
@@ -3331,6 +3426,7 @@ class PlayState extends MusicBeatState
public function backgroundVideo(source:String) // for background videos
{
+ #if cpp
useVideo = true;
FlxG.stage.window.onFocusOut.add(focusOut);
@@ -3381,6 +3477,7 @@ class PlayState extends MusicBeatState
webmHandler.pause();
else
webmHandler.resume();
+ #end
}
function noteMiss(direction:Int = 1, daNote:Note):Void
diff --git a/source/ResultsScreen.hx b/source/ResultsScreen.hx
index 1343b04..255ab8c 100644
--- a/source/ResultsScreen.hx
+++ b/source/ResultsScreen.hx
@@ -82,7 +82,7 @@ class ResultsScreen extends FlxSubState
comboText.scrollFactor.set();
add(comboText);
- contText = new FlxText(FlxG.width - 475,FlxG.height + 50,0,'Press ENTER to continue.');
+ contText = new FlxText(FlxG.width - 475,FlxG.height + 50,0,'Press ${KeyBinds.gamepad ? 'A' : 'ENTER'} to continue.');
contText.size = 28;
contText.setBorderStyle(FlxTextBorderStyle.OUTLINE,FlxColor.BLACK,4,1);
contText.color = FlxColor.WHITE;
@@ -172,7 +172,7 @@ class ResultsScreen extends FlxSubState
// keybinds
- if (FlxG.keys.justPressed.ENTER)
+ if (PlayerSettings.player1.controls.ACCEPT)
{
music.fadeOut(0.3);
@@ -199,12 +199,6 @@ class ResultsScreen extends FlxSubState
FlxG.switchState(new FreeplayState());
}
- if (FlxG.keys.justPressed.EIGHT)
- {
- graph.showInput = !graph.showInput;
- graph.update();
- }
-
if (FlxG.keys.justPressed.F1)
{
trace(PlayState.rep.path);
diff --git a/source/StoryMenuState.hx b/source/StoryMenuState.hx
index 0b59740..120d4fa 100644
--- a/source/StoryMenuState.hx
+++ b/source/StoryMenuState.hx
@@ -1,5 +1,6 @@
package;
+import flixel.input.gamepad.FlxGamepad;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.addons.transition.FlxTransitionableState;
@@ -239,12 +240,44 @@ class StoryMenuState extends MusicBeatState
{
if (!selectedWeek)
{
- if (controls.UP_P)
+ var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
+
+ if (gamepad != null)
+ {
+ if (gamepad.justPressed.DPAD_UP)
+ {
+ changeWeek(-1);
+ }
+ if (gamepad.justPressed.DPAD_DOWN)
+ {
+ changeWeek(1);
+ }
+
+ if (gamepad.pressed.DPAD_RIGHT)
+ rightArrow.animation.play('press')
+ else
+ rightArrow.animation.play('idle');
+ if (gamepad.pressed.DPAD_LEFT)
+ leftArrow.animation.play('press');
+ else
+ leftArrow.animation.play('idle');
+
+ if (gamepad.justPressed.DPAD_RIGHT)
+ {
+ changeDifficulty(1);
+ }
+ if (gamepad.justPressed.DPAD_LEFT)
+ {
+ changeDifficulty(-1);
+ }
+ }
+
+ if (FlxG.keys.justPressed.UP)
{
changeWeek(-1);
}
- if (controls.DOWN_P)
+ if (FlxG.keys.justPressed.DOWN)
{
changeWeek(1);
}
diff --git a/source/TitleState.hx b/source/TitleState.hx
index 9873de2..cbf4da5 100644
--- a/source/TitleState.hx
+++ b/source/TitleState.hx
@@ -1,5 +1,8 @@
package;
+#if sys
+import smTools.SMFile;
+#end
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxState;
@@ -77,6 +80,8 @@ class TitleState extends MusicBeatState
curWacky = FlxG.random.getObject(getIntroTextShit());
+ trace('hello');
+
// DEBUG BULLSHIT
super.create();
@@ -92,6 +97,9 @@ class TitleState extends MusicBeatState
KadeEngineData.initSave();
+ // var file:SMFile = SMFile.loadFile("file.sm");
+ // this was testing things
+
Highscore.load();
#if FREEPLAY
@@ -257,7 +265,7 @@ class TitleState extends MusicBeatState
FlxG.fullscreen = !FlxG.fullscreen;
}
- var pressedEnter:Bool = FlxG.keys.justPressed.ENTER;
+ var pressedEnter:Bool = controls.ACCEPT;
#if mobile
for (touch in FlxG.touches.list)
@@ -269,19 +277,6 @@ class TitleState extends MusicBeatState
}
#end
- var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
-
- if (gamepad != null)
- {
- if (gamepad.justPressed.START)
- pressedEnter = true;
-
- #if switch
- if (gamepad.justPressed.B)
- pressedEnter = true;
- #end
- }
-
if (pressedEnter && !transitioning && skippedIntro)
{
#if !switch
diff --git a/source/smTools/SMFile.hx b/source/smTools/SMFile.hx
new file mode 100644
index 0000000..f4cde5b
--- /dev/null
+++ b/source/smTools/SMFile.hx
@@ -0,0 +1,61 @@
+#if sys
+package smTools;
+
+import sys.io.File;
+
+class SMFile
+{
+ public static function loadFile(path):SMFile
+ {
+ return new SMFile(File.getContent(path).split('\n'));
+ }
+
+ private var _fileData:Array;
+
+ public var _readTime:Float = 0;
+
+ public var header:SMHeader;
+ public var measures:Array;
+
+ public function new(data:Array)
+ {
+ _fileData = data;
+
+ // Gather header data
+ var headerData = "";
+ var inc = 0;
+ while(!StringTools.contains(data[inc + 1],"//"))
+ {
+ headerData += data[inc] + "\n";
+ inc++;
+ // trace(data[inc]);
+ }
+
+ header = new SMHeader(headerData.split('\n'));
+
+ // check if this is a valid file, it should be a dance double file.
+ inc += 3; // skip three lines down
+ if (!StringTools.contains(data[inc],"dance-double:"))
+ return;
+ trace('this is dance double');
+
+ inc += 4; // skip 5 down to where da notes @
+ trace(data[inc]);
+
+ measures = [];
+
+ while(data[inc + 1] != ";")
+ {
+ var measure = "";
+ while(data[inc + 1] != ",")
+ {
+ inc++;
+ var line = data[inc];
+ measure += line + "\n";
+ }
+ measures.push(new SMMeasure(measure.split('\n')));
+ }
+ trace(measures.length + " Measures");
+ }
+}
+#end
\ No newline at end of file
diff --git a/source/smTools/SMHeader.hx b/source/smTools/SMHeader.hx
new file mode 100644
index 0000000..cfe7770
--- /dev/null
+++ b/source/smTools/SMHeader.hx
@@ -0,0 +1,39 @@
+#if sys
+package smTools;
+
+class SMHeader
+{
+ private var _header:Array;
+
+ public var TITLE = "";
+ public var SUBTITLE = "";
+ public var ARTIST = "";
+ public var GENRE = "";
+ public var CREDIT = "";
+ public var MUSIC = "";
+ public var BANNER = "";
+ public var BACKGROUND = "";
+ public var CDTITLE = "";
+ public var OFFSET = "";
+ public var BPMS = "";
+
+ public function new(headerData:Array)
+ {
+ _header = headerData;
+ for (i in headerData)
+ readHeaderLine(i);
+ }
+
+ function readHeaderLine(line:String)
+ {
+ var propName = line.split('#')[1].split(':')[0];
+ var value = line.split(':')[1].split(';')[0];
+ var prop = Reflect.getProperty(this,propName);
+
+ if (prop != null)
+ {
+ Reflect.setProperty(this,propName,value);
+ }
+ }
+}
+#end
\ No newline at end of file
diff --git a/source/smTools/SMMeasure.hx b/source/smTools/SMMeasure.hx
new file mode 100644
index 0000000..bd21dd9
--- /dev/null
+++ b/source/smTools/SMMeasure.hx
@@ -0,0 +1,16 @@
+#if sys
+package smTools;
+
+class SMMeasure
+{
+ public var notes:Array;
+
+ private var _measure:Array;
+
+ public function new(measureData:Array)
+ {
+ _measure = measureData;
+ notes = [];
+ }
+}
+#end
\ No newline at end of file
diff --git a/source/smTools/SMNote.hx b/source/smTools/SMNote.hx
new file mode 100644
index 0000000..6f2a5bd
--- /dev/null
+++ b/source/smTools/SMNote.hx
@@ -0,0 +1,10 @@
+#if sys
+package smTools;
+
+class SMNote
+{
+ public var time:Float;
+ public var data:Int;
+ public var length:Float;
+}
+#end
\ No newline at end of file
diff --git a/version.downloadMe b/version.downloadMe
index b03f579..869b3f9 100644
--- a/version.downloadMe
+++ b/version.downloadMe
@@ -1,6 +1,3 @@
-1.5.3;
-- Score Screen
-- Rewrote the entire hit ranking system
-- Fixed song names so they don't crash
-- New asset loading system
-- New Logo
\ No newline at end of file
+1.5.4;
+- Controller Support
+- Fixed Input Drops/Disappering Notes
\ No newline at end of file