Code cleanup.
This commit is contained in:
@@ -31,9 +31,9 @@ namespace Cryville.Crtr.Config.UI {
|
||||
void OnEnable() {
|
||||
try {
|
||||
PdtEvaluator.Instance.Reset();
|
||||
FileInfo file = new FileInfo(
|
||||
Game.GameDataPath + "/rulesets/" + Settings.Default.LoadRuleset
|
||||
);
|
||||
FileInfo file = new FileInfo(Path.Combine(
|
||||
Game.GameDataPath, "rulesets", Settings.Default.LoadRuleset
|
||||
));
|
||||
if (!file.Exists) {
|
||||
throw new FileNotFoundException("Ruleset for the chart not found\nMake sure you have imported the ruleset");
|
||||
}
|
||||
@@ -45,9 +45,9 @@ namespace Cryville.Crtr.Config.UI {
|
||||
if (ruleset.format != RulesetDefinition.CURRENT_FORMAT) throw new FormatException("Invalid ruleset file version");
|
||||
ruleset.LoadPdt(dir);
|
||||
}
|
||||
FileInfo cfgfile = new FileInfo(
|
||||
Game.GameDataPath + "/config/rulesets/" + Settings.Default.LoadRulesetConfig
|
||||
);
|
||||
FileInfo cfgfile = new FileInfo(Path.Combine(
|
||||
Game.GameDataPath, "config", "rulesets", Settings.Default.LoadRulesetConfig
|
||||
));
|
||||
if (!cfgfile.Exists) {
|
||||
if (!cfgfile.Directory.Exists) cfgfile.Directory.Create();
|
||||
_rscfg = new RulesetConfig();
|
||||
@@ -90,9 +90,9 @@ namespace Cryville.Crtr.Config.UI {
|
||||
_loaded = false;
|
||||
m_inputConfigPanel.proxy.SaveTo(_rscfg.inputs);
|
||||
m_inputConfigPanel.proxy.Dispose();
|
||||
FileInfo cfgfile = new FileInfo(
|
||||
Game.GameDataPath + "/config/rulesets/" + Settings.Default.LoadRulesetConfig
|
||||
);
|
||||
FileInfo cfgfile = new FileInfo(Path.Combine(
|
||||
Game.GameDataPath, "config", "rulesets", Settings.Default.LoadRulesetConfig
|
||||
));
|
||||
using (StreamWriter cfgwriter = new StreamWriter(cfgfile.FullName, false, Encoding.UTF8)) {
|
||||
cfgwriter.Write(JsonConvert.SerializeObject(_rscfg, Game.GlobalJsonSerializerSettings));
|
||||
}
|
||||
|
Reference in New Issue
Block a user