Allow playing chart without input config completed.

This commit is contained in:
2023-05-25 15:07:45 +08:00
parent 5f4d35b3b3
commit 7deff3c6be
2 changed files with 7 additions and 1 deletions

View File

@@ -647,7 +647,8 @@ namespace Cryville.Crtr {
inputProxy = new InputProxy(pruleset, judge, screenSize);
inputProxy.LoadFrom(_rscfg.inputs);
if (!inputProxy.IsCompleted()) {
throw new ArgumentException("Input config not completed\nPlease complete the input settings");
Logger.Log("main", 2, "Game", "Input config not completed. Input disabled");
inputProxy.Clear();
}
Logger.Log("main", 0, "Load/WorkerThread", "Attaching handlers"); loadPregress = .40f;

View File

@@ -69,6 +69,11 @@ namespace Cryville.Crtr {
});
}
}
public void Clear() {
_tproxies.Clear();
_sproxies.Clear();
foreach (var i in _rev) _use[i.Key] = 0;
}
public void Set(InputProxyEntry proxy) {
var target = proxy.Target;
if (!_ruleset.inputs.ContainsKey(target)) throw new ArgumentException("Invalid input name");