Fix import error due to invalid file name.
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using Cryville.Common;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Browsing {
|
namespace Cryville.Crtr.Browsing {
|
||||||
public abstract class ResourceConverter {
|
public abstract class ResourceConverter {
|
||||||
public abstract string[] GetSupportedFormats();
|
public abstract string[] GetSupportedFormats();
|
||||||
@@ -7,7 +9,7 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
}
|
}
|
||||||
public abstract class Resource {
|
public abstract class Resource {
|
||||||
protected Resource(string name) {
|
protected Resource(string name) {
|
||||||
Name = name;
|
Name = StringUtils.EscapeFileName(name);
|
||||||
}
|
}
|
||||||
public string Name { get; private set; }
|
public string Name { get; private set; }
|
||||||
}
|
}
|
||||||
|
@@ -94,10 +94,11 @@ namespace Cryville.Crtr.Extensions.Malody {
|
|||||||
var tev = (MalodyChart.Note)ev;
|
var tev = (MalodyChart.Note)ev;
|
||||||
if (tev.type == 1) {
|
if (tev.type == 1) {
|
||||||
if (tev.beat[0] == 0 && tev.beat[1] == 0) {
|
if (tev.beat[0] == 0 && tev.beat[1] == 0) {
|
||||||
result.Add(new SongResource(meta.song.name, new FileInfo(file.DirectoryName + "/" + tev.sound)));
|
var res = new SongResource(meta.song.name, new FileInfo(file.DirectoryName + "/" + tev.sound));
|
||||||
|
result.Add(res);
|
||||||
chart.sounds.Add(new Chart.Sound {
|
chart.sounds.Add(new Chart.Sound {
|
||||||
time = new BeatTime(0, 0, 1),
|
time = new BeatTime(0, 0, 1),
|
||||||
id = meta.song.name,
|
id = res.Name,
|
||||||
offset = -tev.offset / 1000f,
|
offset = -tev.offset / 1000f,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user