Update generatedBy to the latest value when saving a chart.

This commit is contained in:
EliteMasterEric 2024-05-31 18:09:30 -04:00
parent 98eda8ef55
commit 8bf26322e9

View file

@ -384,17 +384,32 @@ class ChartEditorImportExportHandler
if (variationId == '') if (variationId == '')
{ {
var variationMetadata:Null<SongMetadata> = state.songMetadata.get(variation); var variationMetadata:Null<SongMetadata> = state.songMetadata.get(variation);
if (variationMetadata != null) zipEntries.push(FileUtil.makeZIPEntry('${state.currentSongId}-metadata.json', variationMetadata.serialize())); if (variationMetadata != null)
{
variationMetadata.generatedBy = funkin.data.song.SongRegistry.DEFAULT_GENERATEDBY;
zipEntries.push(FileUtil.makeZIPEntry('${state.currentSongId}-metadata.json', variationMetadata.serialize()));
}
var variationChart:Null<SongChartData> = state.songChartData.get(variation); var variationChart:Null<SongChartData> = state.songChartData.get(variation);
if (variationChart != null) zipEntries.push(FileUtil.makeZIPEntry('${state.currentSongId}-chart.json', variationChart.serialize())); if (variationChart != null)
{
variationChart.generatedBy = funkin.data.song.SongRegistry.DEFAULT_GENERATEDBY;
zipEntries.push(FileUtil.makeZIPEntry('${state.currentSongId}-chart.json', variationChart.serialize()));
}
} }
else else
{ {
var variationMetadata:Null<SongMetadata> = state.songMetadata.get(variation); var variationMetadata:Null<SongMetadata> = state.songMetadata.get(variation);
if (variationMetadata != null) zipEntries.push(FileUtil.makeZIPEntry('${state.currentSongId}-metadata-$variationId.json', if (variationMetadata != null)
variationMetadata.serialize())); {
variationMetadata.generatedBy = funkin.data.song.SongRegistry.DEFAULT_GENERATEDBY;
zipEntries.push(FileUtil.makeZIPEntry('${state.currentSongId}-metadata-$variationId.json', variationMetadata.serialize()));
}
var variationChart:Null<SongChartData> = state.songChartData.get(variation); var variationChart:Null<SongChartData> = state.songChartData.get(variation);
if (variationChart != null) zipEntries.push(FileUtil.makeZIPEntry('${state.currentSongId}-chart-$variationId.json', variationChart.serialize())); if (variationChart != null)
{
variationChart.generatedBy = funkin.data.song.SongRegistry.DEFAULT_GENERATEDBY;
zipEntries.push(FileUtil.makeZIPEntry('${state.currentSongId}-chart-$variationId.json', variationChart.serialize()));
}
} }
} }