1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-25 16:24:40 +00:00

Fixed issue where ChartEditorState was not copying SongMetadata properly

This commit is contained in:
EliteMasterEric 2023-09-08 15:19:03 -04:00
parent f4bc682ea1
commit 8431e18d37
3 changed files with 35 additions and 14 deletions

View file

@ -290,7 +290,7 @@ class Conductor
if (timeChanges.length > 0)
{
trace('Done mapping time changes: ${timeChanges}' + timeChanges);
trace('Done mapping time changes: ${timeChanges}');
}
// Update currentStepTime

View file

@ -86,6 +86,11 @@ class SongMetadata
return result;
}
public function toString():String
{
return 'SongMetadata(${this.songName} by ${this.artist}, variation ${this.variation})';
}
}
enum abstract SongTimeFormat(String) from String to String
@ -162,6 +167,11 @@ class SongTimeChange
this.beatTime = beatTime == null ? DEFAULT_BEAT_TIME : beatTime;
this.beatTuplets = beatTuplets == null ? DEFAULT_BEAT_TUPLETS : beatTuplets;
}
public function toString():String
{
return 'SongTimeChange(${this.timeStamp}ms,${this.bpm}bpm)';
}
}
/**
@ -232,6 +242,11 @@ class SongMusicData
return result;
}
public function toString():String
{
return 'SongMusicData(${this.songName} by ${this.artist}, variation ${this.variation})';
}
}
typedef SongPlayData =
@ -271,6 +286,11 @@ class SongPlayableChar
this.opponent = opponent;
this.inst = inst;
}
public function toString():String
{
return 'SongPlayableChar(${this.girlfriend}, ${this.opponent}, ${this.inst})';
}
}
class SongChartData
@ -455,6 +475,11 @@ class SongEventData
{
return this.time <= other.time;
}
public function toString():String
{
return 'SongEventData(${this.time}ms, ${this.event}: ${this.value})';
}
}
class SongNoteData
@ -646,4 +671,10 @@ class SongNoteData
{
return this.time <= other.time;
}
public function toString():String
{
return 'SongNoteData(${this.time}ms, ' + (this.length > 0 ? '[${this.length}ms hold]' : '') + ' ${this.data}'
+ (this.kind != '' ? ' [kind: ${this.kind}])' : ')');
}
}

View file

@ -3961,7 +3961,7 @@ class ChartEditorState extends HaxeUIState
var variation = (metadata.variation == null || metadata.variation == '') ? 'default' : metadata.variation;
// Clone to prevent modifying the original.
var metadataClone = Reflect.copy(metadata);
var metadataClone:SongMetadata = metadata.clone(variation);
if (metadataClone != null) songMetadata.set(variation, metadataClone);
songChartData.set(variation, SongRegistry.instance.parseEntryChartData(songId, metadata.variation));
@ -3969,18 +3969,6 @@ class ChartEditorState extends HaxeUIState
loadSong(songMetadata, songChartData);
notePreviewDirty = true;
notePreviewViewportBoundsDirty = true;
if (audioInstTrack != null)
{
audioInstTrack.stop();
audioInstTrack = null;
}
Conductor.forceBPM(null); // Disable the forced BPM.
Conductor.mapTimeChanges(currentSongMetadata.timeChanges);
sortChartData();
clearVocals();
@ -4024,6 +4012,8 @@ class ChartEditorState extends HaxeUIState
Conductor.forceBPM(null); // Disable the forced BPM.
Conductor.mapTimeChanges(currentSongMetadata.timeChanges);
notePreviewDirty = true;
notePreviewViewportBoundsDirty = true;
difficultySelectDirty = true;
opponentPreviewDirty = true;
playerPreviewDirty = true;