Add chart file resource.
This commit is contained in:
@@ -133,8 +133,8 @@ namespace Cryville.Crtr.Browsing {
|
||||
if (!res.Valid) {
|
||||
Logger.Log("main", 3, "Resource", "Attempt to import invalid resource {0}", res);
|
||||
}
|
||||
else if (res is ChartResource) {
|
||||
var tres = (ChartResource)res;
|
||||
else if (res is RawChartResource) {
|
||||
var tres = (RawChartResource)res;
|
||||
var dir = new DirectoryInfo(_rootPath + "/charts/" + res.Name);
|
||||
if (!dir.Exists) dir.Create();
|
||||
using (var writer = new StreamWriter(dir.FullName + "/.umgc")) {
|
||||
|
@@ -17,8 +17,8 @@ namespace Cryville.Crtr.Browsing {
|
||||
return string.Format("{0} ({1})", Name, ReflectionHelper.GetSimpleName(GetType()));
|
||||
}
|
||||
}
|
||||
public class ChartResource : Resource {
|
||||
public ChartResource(string name, Chart main, ChartMeta meta) : base(name) {
|
||||
public class RawChartResource : Resource {
|
||||
public RawChartResource(string name, Chart main, ChartMeta meta) : base(name) {
|
||||
Main = main; Meta = meta;
|
||||
}
|
||||
public Chart Main { get; private set; }
|
||||
@@ -32,6 +32,9 @@ namespace Cryville.Crtr.Browsing {
|
||||
public FileInfo Source { get; private set; }
|
||||
public override bool Valid { get { return Source.Exists; } }
|
||||
}
|
||||
public class ChartResource : FileResource {
|
||||
public ChartResource(string name, FileInfo src) : base(name, src) { }
|
||||
}
|
||||
public class CoverResource : FileResource {
|
||||
public CoverResource(string name, FileInfo src) : base(name, src) { }
|
||||
}
|
||||
|
@@ -151,7 +151,7 @@ namespace Cryville.Crtr.Extensions.Malody {
|
||||
result.Add(new CoverResource(chartName, new FileInfo(file.DirectoryName + "/" + src.meta.background)));
|
||||
meta.cover = src.meta.background;
|
||||
}
|
||||
result.Add(new ChartResource(chartName, chart, meta));
|
||||
result.Add(new RawChartResource(chartName, chart, meta));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user