Code cleanup.
This commit is contained in:
@@ -17,6 +17,6 @@ namespace Cryville.Crtr.Browsing {
|
||||
string[] CurrentDirectory { get; }
|
||||
void ChangeDirectory(string[] dir);
|
||||
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) {
|
||||
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();
|
||||
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));
|
||||
}
|
||||
using (var writer = new StreamWriter(dir.FullName + "/.umgc")) {
|
||||
using (var writer = new StreamWriter(Path.Combine(dir.FullName, ".umgc"))) {
|
||||
tres.Meta.data = "";
|
||||
writer.Write(JsonConvert.SerializeObject(tres.Meta, Game.GlobalJsonSerializerSettings));
|
||||
}
|
||||
@@ -133,18 +133,18 @@ namespace Cryville.Crtr.Browsing {
|
||||
DirectoryInfo dest;
|
||||
bool singleFileFlag = false;
|
||||
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) {
|
||||
dest = new DirectoryInfo(_rootPath + "/extensions");
|
||||
dest = new DirectoryInfo(Path.Combine(_rootPath, "extensions"));
|
||||
singleFileFlag = true;
|
||||
Popup.Create("Please restart the game to reload the extensions");
|
||||
}
|
||||
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)
|
||||
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)
|
||||
dest = new DirectoryInfo(_rootPath + "/songs/" + res.Name);
|
||||
dest = new DirectoryInfo(Path.Combine(_rootPath, "songs", res.Name));
|
||||
else {
|
||||
LogAndPopup(3, "Attempt to import unsupported file resource: {0}", res);
|
||||
continue;
|
||||
|
@@ -63,8 +63,8 @@ namespace Cryville.Crtr.Browsing.UI {
|
||||
Master.ShowDetail(id, ResourceManager[id]);
|
||||
}
|
||||
|
||||
public void OnPathClicked(int id) {
|
||||
ResourceManager.ReturnToDirectory(id);
|
||||
public void OnPathClicked(int index) {
|
||||
ResourceManager.ReturnToDirectory(index);
|
||||
}
|
||||
|
||||
[Obsolete]
|
||||
|
Reference in New Issue
Block a user