Implement score update.

This commit is contained in:
2022-11-14 16:04:58 +08:00
parent d5d6465806
commit ba6166068b
4 changed files with 38 additions and 12 deletions

View File

@@ -24,6 +24,7 @@ namespace Cryville.Crtr {
var id = new Identifier(name);
PropSrc prop;
string str;
float num;
if (ContextEvent != null && ContextEvent.PropSrcs.TryGetValue(name, out prop)) {
prop.Get(out type, out value);
}
@@ -31,6 +32,12 @@ namespace Cryville.Crtr {
var vec = ContextState.GetRawValue(id);
new VectorSrc(() => vec).Get(out type, out value);
}
else if (ContextJudge != null && ContextJudge.scores.TryGetValue(name, out num)) {
type = PdtInternalType.Number;
LoadNum(num);
value = _numbuf;
RevokePotentialConstant();
}
else if (ContextJudge != null && ContextJudge.GetFormattedScoreStrings().TryGetValue(name, out str)) {
type = PdtInternalType.String;
value = GetBytes(str);