Improve the error message on judge not found.

This commit is contained in:
2023-12-02 00:49:07 +08:00
parent 00d47cde0c
commit df3f7203d3

View File

@@ -90,7 +90,10 @@ namespace Cryville.Crtr.Ruleset {
}
void InsertEvent(Chart.Judge ev, Clip clip, Identifier id, NoteHandler handler, JudgeCallContext call = default(JudgeCallContext)) {
if (id.Key == _var_pause) throw new InvalidOperationException("Cannot assign the special judge \"pause\" to notes");
var def = _rs.judges[id];
JudgeDefinition def;
if (!_rs.judges.TryGetValue(id, out def)) {
throw new ArgumentException(string.Format("The chart uses a judge named \"{0}\" that is undefined in the ruleset.", id));
}
_etor.Evaluate(_identop, def.input);
_etor.Evaluate(_clipop, def.clip);
var list = evs[_identbuf];