some fixes

This commit is contained in:
Yoshman29
2022-11-01 17:44:25 +01:00
parent e9c028489a
commit ced676cd12
4 changed files with 24 additions and 7 deletions
+1 -1
View File
@@ -1 +1 @@
938
939
+2 -1
View File
@@ -45,6 +45,7 @@ class Note extends FlxSprite
}
public var sustainLength:Float = 0;
public var stepLength:Float = 0;
public var isSustainNote:Bool = false;
public var noteTypeID:Int = 0;
@@ -199,7 +200,7 @@ class Note extends FlxSprite
// is long sustain
lastScrollSpeed = scrollSpeed;
scale.y = Conductor.stepCrochet / 100 * 1.5 * scrollSpeed * 0.7;
scale.y = stepLength / 100 * 1.5 * scrollSpeed * 0.7;
updateHitbox();
}
+7 -3
View File
@@ -442,12 +442,14 @@ class PlayState extends MusicBeatState
var noteData:Array<SwagSection> = songData.notes;
var playerCounter:Int = 0;
var daBeats:Int = 0; // Not exactly representative of 'daBeats' lol, just how much it has looped
var stepCrochet = Conductor.stepCrochet;
for (section in noteData)
{
if (section == null || section.sectionNotes == null) continue;
// var coolSection:Int = Std.int(section.lengthInSteps / 4);
if (section.changeBPM && section.bpm > 0)
stepCrochet = ((60 / section.bpm) * 250);
for (songNotes in section.sectionNotes)
{
@@ -473,17 +475,19 @@ class PlayState extends MusicBeatState
swagNote.nextNote = (swagNote = new Note(daStrumTime, daNoteData % 4, daNoteType, gottaHitNote, swagNote));
swagNote.sustainLength = songNotes[2];
swagNote.scrollFactor.set(0, 0);
swagNote.stepLength = stepCrochet;
notes.add(swagNote);
// calculate sustain length and fix
var susLength:Float = swagNote.sustainLength / Conductor.stepCrochet;
var susLength:Float = swagNote.sustainLength / stepCrochet;
if (susLength > 0.75) susLength++;
// create sustains
for (susNote in 0...Math.floor(susLength))
{
swagNote = new Note(daStrumTime + (Conductor.stepCrochet * susNote), daNoteData % 4, daNoteType, gottaHitNote, swagNote, true);
swagNote = new Note(daStrumTime + (stepCrochet * susNote), daNoteData % 4, daNoteType, gottaHitNote, swagNote, true);
swagNote.scrollFactor.set();
swagNote.stepLength = stepCrochet;
notes.add(swagNote);
}
}
+14 -2
View File
@@ -147,8 +147,20 @@ class ZipFolderLibrary extends AssetLibrary implements ModsAssetLibrary {
}
public function getFiles(folder:String):Array<String> {
// TODO
return [];
var content:Array<String> = [];
if (!folder.endsWith("/")) folder = folder + "/";
if (!__parseAsset(folder)) return [];
@:privateAccess
for(k=>e in assets) {
if (k.toLowerCase().startsWith(_parsedAsset)) {
var fileName = k.substr(_parsedAsset.length);
if (!fileName.contains("/"))
content.push(fileName);
}
}
return content;
}
#end
}