mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-23 16:17:53 -05:00
Merge pull request #105 from FunkinCrew/feature/modded-story
Mods in story menu
This commit is contained in:
commit
a4a4e705a1
4 changed files with 34 additions and 10 deletions
4
hmm.json
4
hmm.json
|
@ -68,8 +68,8 @@
|
|||
"name": "hxCodec",
|
||||
"type": "git",
|
||||
"dir": null,
|
||||
"ref": "c42ab99",
|
||||
"url": "https://github.com/polybiusproxy/hxCodec"
|
||||
"ref": "a56f4b4",
|
||||
"url": "https://github.com/FunkinCrew/hxCodec"
|
||||
},
|
||||
{
|
||||
"name": "hxcpp",
|
||||
|
|
|
@ -156,7 +156,10 @@ class Level implements IRegistryEntry<LevelData>
|
|||
for (propIndex in 0..._data.props.length)
|
||||
{
|
||||
var propData = _data.props[propIndex];
|
||||
var propSprite:LevelProp = LevelProp.build(propData);
|
||||
|
||||
var propSprite:Null<LevelProp> = LevelProp.build(propData);
|
||||
if (propSprite == null) continue;
|
||||
|
||||
propSprite.x += FlxG.width * 0.25 * propIndex;
|
||||
props.push(propSprite);
|
||||
}
|
||||
|
|
|
@ -16,8 +16,10 @@ class LevelProp extends Bopper
|
|||
playAnimation('confirm', true, true);
|
||||
}
|
||||
|
||||
public static function build(propData:LevelPropData):Null<LevelProp>
|
||||
public static function build(propData:Null<LevelPropData>):Null<LevelProp>
|
||||
{
|
||||
if (propData == null) return null;
|
||||
|
||||
var isAnimated:Bool = propData.animations.length > 0;
|
||||
var prop:LevelProp = new LevelProp(propData.danceEvery);
|
||||
|
||||
|
|
|
@ -52,6 +52,11 @@ class StoryMenuState extends MusicBeatState
|
|||
*/
|
||||
var scoreText:FlxText;
|
||||
|
||||
/**
|
||||
* The mode text at the top-middle.
|
||||
*/
|
||||
var modeText:FlxText;
|
||||
|
||||
/**
|
||||
* The list of songs on the left.
|
||||
*/
|
||||
|
@ -146,16 +151,22 @@ class StoryMenuState extends MusicBeatState
|
|||
|
||||
updateProps();
|
||||
|
||||
scoreText = new FlxText(10, 10, 0, 'HIGH SCORE: 42069420');
|
||||
scoreText.setFormat("VCR OSD Mono", 32);
|
||||
add(scoreText);
|
||||
|
||||
tracklistText = new FlxText(FlxG.width * 0.05, levelBackground.x + levelBackground.height + 100, 0, "Tracks", 32);
|
||||
tracklistText.setFormat("VCR OSD Mono", 32);
|
||||
tracklistText.alignment = CENTER;
|
||||
tracklistText.color = 0xFFe55777;
|
||||
add(tracklistText);
|
||||
|
||||
scoreText = new FlxText(10, 10, 0, 'HIGH SCORE: 42069420');
|
||||
scoreText.setFormat("VCR OSD Mono", 32);
|
||||
add(scoreText);
|
||||
|
||||
modeText = new FlxText(10, 10, 0, 'Base Game Levels [TAB to switch]');
|
||||
modeText.setFormat("VCR OSD Mono", 32);
|
||||
modeText.screenCenter(X);
|
||||
modeText.visible = hasModdedLevels();
|
||||
add(modeText);
|
||||
|
||||
levelTitleText = new FlxText(FlxG.width * 0.7, 10, 0, 'LEVEL 1');
|
||||
levelTitleText.setFormat("VCR OSD Mono", 32, FlxColor.WHITE, RIGHT);
|
||||
levelTitleText.alpha = 0.7;
|
||||
|
@ -256,7 +267,7 @@ class StoryMenuState extends MusicBeatState
|
|||
displayingModdedLevels = moddedLevels;
|
||||
buildLevelTitles();
|
||||
|
||||
changeLevel(0);
|
||||
changeLevel(999999); // Jump past the end of the list to the beginning.
|
||||
changeDifficulty(0);
|
||||
}
|
||||
|
||||
|
@ -268,6 +279,9 @@ class StoryMenuState extends MusicBeatState
|
|||
|
||||
scoreText.text = 'LEVEL SCORE: ${Math.round(highScoreLerp)}';
|
||||
|
||||
modeText.text = displayingModdedLevels ? 'Mods [TAB to switch]' : 'Base Game [TAB to switch]';
|
||||
modeText.screenCenter(X);
|
||||
|
||||
levelTitleText.text = currentLevel.getTitle();
|
||||
levelTitleText.x = FlxG.width - (levelTitleText.width + 10); // Right align.
|
||||
|
||||
|
@ -322,7 +336,7 @@ class StoryMenuState extends MusicBeatState
|
|||
changeDifficulty(-1);
|
||||
}
|
||||
|
||||
if (FlxG.keys.justPressed.TAB)
|
||||
if (FlxG.keys.justPressed.TAB && modeText.visible)
|
||||
{
|
||||
switchMode(!displayingModdedLevels);
|
||||
}
|
||||
|
@ -342,6 +356,11 @@ class StoryMenuState extends MusicBeatState
|
|||
}
|
||||
}
|
||||
|
||||
function hasModdedLevels():Bool
|
||||
{
|
||||
return LevelRegistry.instance.listModdedLevelIds().length > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the selected level.
|
||||
* @param change +1 (down), -1 (up)
|
||||
|
|
Loading…
Reference in a new issue