Code cleanup.
This commit is contained in:
@@ -17,6 +17,6 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
string[] CurrentDirectory { get; }
|
string[] CurrentDirectory { get; }
|
||||||
void ChangeDirectory(string[] dir);
|
void ChangeDirectory(string[] dir);
|
||||||
void OpenDirectory(int id);
|
void OpenDirectory(int id);
|
||||||
void ReturnToDirectory(int id);
|
void ReturnToDirectory(int index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,12 +113,12 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
}
|
}
|
||||||
else if (res is RawChartResource) {
|
else if (res is RawChartResource) {
|
||||||
var tres = (RawChartResource)res;
|
var tres = (RawChartResource)res;
|
||||||
var dir = new DirectoryInfo(_rootPath + "/charts/" + res.Name);
|
var dir = new DirectoryInfo(Path.Combine(_rootPath, "charts", res.Name));
|
||||||
if (!dir.Exists) dir.Create();
|
if (!dir.Exists) dir.Create();
|
||||||
using (var writer = new StreamWriter(dir.FullName + "/.json")) {
|
using (var writer = new StreamWriter(Path.Combine(dir.FullName, ".json"))) {
|
||||||
writer.Write(JsonConvert.SerializeObject(ConvertChartData(tres.Main), Game.GlobalJsonSerializerSettings));
|
writer.Write(JsonConvert.SerializeObject(ConvertChartData(tres.Main), Game.GlobalJsonSerializerSettings));
|
||||||
}
|
}
|
||||||
using (var writer = new StreamWriter(dir.FullName + "/.umgc")) {
|
using (var writer = new StreamWriter(Path.Combine(dir.FullName, ".umgc"))) {
|
||||||
tres.Meta.data = "";
|
tres.Meta.data = "";
|
||||||
writer.Write(JsonConvert.SerializeObject(tres.Meta, Game.GlobalJsonSerializerSettings));
|
writer.Write(JsonConvert.SerializeObject(tres.Meta, Game.GlobalJsonSerializerSettings));
|
||||||
}
|
}
|
||||||
@@ -133,18 +133,18 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
DirectoryInfo dest;
|
DirectoryInfo dest;
|
||||||
bool singleFileFlag = false;
|
bool singleFileFlag = false;
|
||||||
if (res is ChartResource)
|
if (res is ChartResource)
|
||||||
dest = new DirectoryInfo(_rootPath + "/charts/" + res.Name);
|
dest = new DirectoryInfo(Path.Combine(_rootPath, "charts", res.Name));
|
||||||
else if (res is ExtensionResource) {
|
else if (res is ExtensionResource) {
|
||||||
dest = new DirectoryInfo(_rootPath + "/extensions");
|
dest = new DirectoryInfo(Path.Combine(_rootPath, "extensions"));
|
||||||
singleFileFlag = true;
|
singleFileFlag = true;
|
||||||
Popup.Create("Please restart the game to reload the extensions");
|
Popup.Create("Please restart the game to reload the extensions");
|
||||||
}
|
}
|
||||||
else if (res is RulesetResource)
|
else if (res is RulesetResource)
|
||||||
dest = new DirectoryInfo(_rootPath + "/rulesets/" + res.Name);
|
dest = new DirectoryInfo(Path.Combine(_rootPath, "rulesets", res.Name));
|
||||||
else if (res is SkinResource)
|
else if (res is SkinResource)
|
||||||
dest = new DirectoryInfo(_rootPath + "/skins/" + (res as SkinResource).RulesetName + "/" + res.Name);
|
dest = new DirectoryInfo(Path.Combine(_rootPath, "skins", (res as SkinResource).RulesetName, res.Name));
|
||||||
else if (res is SongResource)
|
else if (res is SongResource)
|
||||||
dest = new DirectoryInfo(_rootPath + "/songs/" + res.Name);
|
dest = new DirectoryInfo(Path.Combine(_rootPath, "songs", res.Name));
|
||||||
else {
|
else {
|
||||||
LogAndPopup(3, "Attempt to import unsupported file resource: {0}", res);
|
LogAndPopup(3, "Attempt to import unsupported file resource: {0}", res);
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -63,8 +63,8 @@ namespace Cryville.Crtr.Browsing.UI {
|
|||||||
Master.ShowDetail(id, ResourceManager[id]);
|
Master.ShowDetail(id, ResourceManager[id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnPathClicked(int id) {
|
public void OnPathClicked(int index) {
|
||||||
ResourceManager.ReturnToDirectory(id);
|
ResourceManager.ReturnToDirectory(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Obsolete]
|
[Obsolete]
|
||||||
|
|||||||
Reference in New Issue
Block a user