done!!
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
||||
1081
|
||||
1084
|
||||
@@ -206,11 +206,7 @@ class FreeplayState extends MusicBeatState
|
||||
|
||||
if (controls.ACCEPT)
|
||||
{
|
||||
PlayState.SONG = Song.loadFromJson(songs[curSelected].songName, songs[curSelected].difficulties[curDifficulty]);
|
||||
PlayState.isStoryMode = false;
|
||||
|
||||
// PlayState.storyWeek = songs[curSelected].week;
|
||||
trace('CUR WEEK' + PlayState.storyWeek);
|
||||
CoolUtil.loadSong(songs[curSelected].songName, songs[curSelected].difficulties[curDifficulty]);
|
||||
FlxG.switchState(new PlayState());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ class PauseSubState extends MusicBeatSubstate
|
||||
levelInfo.updateHitbox();
|
||||
add(levelInfo);
|
||||
|
||||
var levelDifficulty:FlxText = new FlxText(20, 15 + 32, 0, PlayState.difficulty, 32);
|
||||
var levelDifficulty:FlxText = new FlxText(20, 15 + 32, 0, PlayState.difficulty.toUpperCase(), 32);
|
||||
levelDifficulty.scrollFactor.set();
|
||||
levelDifficulty.setFormat(Paths.font('vcr.ttf'), 32);
|
||||
levelDifficulty.updateHitbox();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package funkin.menus;
|
||||
|
||||
import flixel.util.FlxTimer;
|
||||
import flixel.math.FlxPoint;
|
||||
import funkin.system.XMLUtil;
|
||||
import flixel.graphics.frames.FlxFramesCollection;
|
||||
@@ -141,8 +142,8 @@ class StoryMenuState extends MusicBeatState {
|
||||
changeDifficulty((controls.LEFT_P ? -1 : 0) + (controls.RIGHT_P ? 1 : 0));
|
||||
changeWeek((controls.UP_P ? -1 : 0) + (controls.DOWN_P ? 1 : 0));
|
||||
|
||||
if (controls.ACCEPT) {
|
||||
}
|
||||
if (controls.ACCEPT)
|
||||
selectWeek();
|
||||
} else {
|
||||
for(e in [leftArrow, rightArrow])
|
||||
e.animation.play('idle');
|
||||
@@ -186,9 +187,9 @@ class StoryMenuState extends MusicBeatState {
|
||||
|
||||
FlxTween.tween(diffSprite, {y: leftArrow.y, alpha: 1}, 0.07);
|
||||
}
|
||||
|
||||
intendedScore = Highscore.getWeekScore(weeks[curWeek].name, weeks[curWeek].difficulties[curDifficulty]).score;
|
||||
}
|
||||
|
||||
intendedScore = Highscore.getWeekScore(weeks[curWeek].name, weeks[curWeek].difficulties[curDifficulty]).score;
|
||||
}
|
||||
|
||||
public function loadXMLs() {
|
||||
@@ -202,6 +203,24 @@ class StoryMenuState extends MusicBeatState {
|
||||
e.offset.put();
|
||||
}
|
||||
|
||||
public function selectWeek() {
|
||||
canSelect = false;
|
||||
CoolUtil.playMenuSFX(1);
|
||||
|
||||
for(char in characterSprites)
|
||||
if (char.animation.exists("confirm"))
|
||||
char.animation.play("confirm");
|
||||
|
||||
CoolUtil.loadWeek(weeks[curWeek], weeks[curWeek].difficulties[curDifficulty]);
|
||||
|
||||
|
||||
new FlxTimer().start(1, function(tmr:FlxTimer)
|
||||
{
|
||||
FlxG.switchState(new PlayState());
|
||||
});
|
||||
weekSprites.members[curWeek].startFlashing();
|
||||
}
|
||||
|
||||
public function loadXML(xmlPath:String) {
|
||||
try {
|
||||
var xml = new Access(Xml.parse(Assets.getText(xmlPath)).firstElement());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package funkin.system;
|
||||
|
||||
import funkin.menus.StoryMenuState.WeekData;
|
||||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
import flixel.system.FlxAssets.FlxGraphicAsset;
|
||||
import flixel.graphics.FlxGraphic;
|
||||
@@ -225,6 +226,22 @@ class CoolUtil
|
||||
}
|
||||
}
|
||||
|
||||
public static function loadWeek(weekData:WeekData, difficulty:String = "normal") {
|
||||
PlayState.storyWeek = weekData;
|
||||
PlayState.storyPlaylist = [for(e in weekData.songs) e.name];
|
||||
PlayState.isStoryMode = true;
|
||||
PlayState.campaignScore = 0;
|
||||
__loadSong(PlayState.storyPlaylist[0], difficulty);
|
||||
}
|
||||
public static function loadSong(name:String, difficulty:String = "normal") {
|
||||
PlayState.campaignScore = 0;
|
||||
PlayState.isStoryMode = false;
|
||||
__loadSong(name, difficulty);
|
||||
}
|
||||
public static function __loadSong(name:String, difficulty:String) {
|
||||
PlayState.difficulty = difficulty;
|
||||
PlayState.SONG = Song.loadFromJson(name, difficulty);
|
||||
}
|
||||
public static function setSpriteSize(sprite:FlxSprite, width:Float, height:Float) {
|
||||
sprite.scale.set(width / sprite.frameWidth, height / sprite.frameHeight);
|
||||
sprite.updateHitbox();
|
||||
|
||||
Reference in New Issue
Block a user