Fix attempt to save config when failed to load.
This commit is contained in:
@@ -22,6 +22,8 @@ namespace Cryville.Crtr.Config {
|
||||
public Ruleset ruleset;
|
||||
RulesetConfig _rscfg;
|
||||
|
||||
bool _loaded;
|
||||
|
||||
void OnEnable() {
|
||||
try {
|
||||
ChartPlayer.etor = new PdtEvaluator();
|
||||
@@ -61,6 +63,8 @@ namespace Cryville.Crtr.Config {
|
||||
m_inputConfigPanel.proxy = proxy;
|
||||
|
||||
m_inputConfigPanel.OnConfigEnable();
|
||||
|
||||
_loaded = true;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
Popup.CreateException(ex);
|
||||
@@ -77,6 +81,8 @@ namespace Cryville.Crtr.Config {
|
||||
}
|
||||
|
||||
void OnDisable() {
|
||||
if (_loaded) {
|
||||
_loaded = false;
|
||||
m_inputConfigPanel.proxy.SaveTo(_rscfg.inputs);
|
||||
m_inputConfigPanel.proxy.Dispose();
|
||||
FileInfo cfgfile = new FileInfo(
|
||||
@@ -88,4 +94,5 @@ namespace Cryville.Crtr.Config {
|
||||
m_inputConfigPanel.OnConfigDisable();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user