fix compile errors + some other shit
This commit is contained in:
@ -21,16 +21,17 @@ using StringTools;
|
||||
|
||||
class FreeplayState extends MusicBeatState
|
||||
{
|
||||
var songs:Array<SongMetadata> = [];
|
||||
public static var songs:Array<SongMetadata> = [];
|
||||
|
||||
var selector:FlxText;
|
||||
var curSelected:Int = 0;
|
||||
var curDifficulty:Int = 1;
|
||||
public static var curSelected:Int = 0;
|
||||
public static var curDifficulty:Int = 1;
|
||||
|
||||
var scoreText:FlxText;
|
||||
var comboText:FlxText;
|
||||
var diffText:FlxText;
|
||||
var diffCalcText:FlxText;
|
||||
var previewtext:FlxText;
|
||||
var lerpScore:Int = 0;
|
||||
var intendedScore:Int = 0;
|
||||
var combo:String = '';
|
||||
@ -40,6 +41,8 @@ class FreeplayState extends MusicBeatState
|
||||
|
||||
private var iconArray:Array<HealthIcon> = [];
|
||||
|
||||
public static var openedPreview = false;
|
||||
|
||||
public static var songData:Map<String,Array<SwagSong>> = [];
|
||||
|
||||
public static function loadDiff(diff:Int, format:String, name:String, array:Array<SwagSong>)
|
||||
@ -101,6 +104,8 @@ class FreeplayState extends MusicBeatState
|
||||
isDebug = true;
|
||||
#end
|
||||
|
||||
persistentUpdate = true;
|
||||
|
||||
// LOAD MUSIC
|
||||
|
||||
// LOAD CHARACTERS
|
||||
@ -147,6 +152,10 @@ class FreeplayState extends MusicBeatState
|
||||
diffCalcText.font = scoreText.font;
|
||||
add(diffCalcText);
|
||||
|
||||
previewtext = new FlxText(scoreText.x, scoreText.y + 94, 0, "" + (KeyBinds.gamepad ? "X" : "SPACE") + " to preview", 24);
|
||||
previewtext.font = scoreText.font;
|
||||
//add(previewtext);
|
||||
|
||||
comboText = new FlxText(diffText.x + 100, diffText.y, 0, "", 24);
|
||||
comboText.font = diffText.font;
|
||||
add(comboText);
|
||||
@ -205,7 +214,7 @@ class FreeplayState extends MusicBeatState
|
||||
num++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
super.update(elapsed);
|
||||
@ -223,14 +232,20 @@ class FreeplayState extends MusicBeatState
|
||||
scoreText.text = "PERSONAL BEST:" + lerpScore;
|
||||
comboText.text = combo + '\n';
|
||||
|
||||
if (FlxG.sound.music.volume > 0.8)
|
||||
{
|
||||
FlxG.sound.music.volume -= 0.5 * FlxG.elapsed;
|
||||
}
|
||||
|
||||
var upP = FlxG.keys.justPressed.UP;
|
||||
var downP = FlxG.keys.justPressed.DOWN;
|
||||
var accepted = controls.ACCEPT;
|
||||
var accepted = FlxG.keys.justPressed.ENTER;
|
||||
|
||||
var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
|
||||
|
||||
if (gamepad != null)
|
||||
{
|
||||
|
||||
if (gamepad.justPressed.DPAD_UP)
|
||||
{
|
||||
changeSelection(-1);
|
||||
@ -247,6 +262,9 @@ class FreeplayState extends MusicBeatState
|
||||
{
|
||||
changeDiff(1);
|
||||
}
|
||||
|
||||
//if (gamepad.justPressed.X && !openedPreview)
|
||||
//openSubState(new DiffOverview());
|
||||
}
|
||||
|
||||
if (upP)
|
||||
@ -258,6 +276,9 @@ class FreeplayState extends MusicBeatState
|
||||
changeSelection(1);
|
||||
}
|
||||
|
||||
//if (FlxG.keys.justPressed.SPACE && !openedPreview)
|
||||
//openSubState(new DiffOverview());
|
||||
|
||||
if (FlxG.keys.justPressed.LEFT)
|
||||
changeDiff(-1);
|
||||
if (FlxG.keys.justPressed.RIGHT)
|
||||
@ -331,6 +352,7 @@ class FreeplayState extends MusicBeatState
|
||||
// NGio.logEvent('Fresh');
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
|
||||
|
||||
|
||||
curSelected += change;
|
||||
|
||||
if (curSelected < 0)
|
||||
@ -370,6 +392,12 @@ class FreeplayState extends MusicBeatState
|
||||
catch(ex)
|
||||
{}
|
||||
|
||||
if (openedPreview)
|
||||
{
|
||||
closeSubState();
|
||||
openSubState(new DiffOverview());
|
||||
}
|
||||
|
||||
var bullShit:Int = 0;
|
||||
|
||||
for (i in 0...iconArray.length)
|
||||
|
Reference in New Issue
Block a user