Pull current_time to container handler.
This commit is contained in:
@@ -66,6 +66,8 @@ namespace Cryville.Crtr.Event {
|
|||||||
get { return cs.Container; }
|
get { return cs.Container; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static readonly int _var_current_time = IdentifierManager.SharedInstance.Request("current_time");
|
||||||
|
public readonly Dictionary<int, PropSrc> PropSrcs = new Dictionary<int, PropSrc>();
|
||||||
SkinContainer skinContainer;
|
SkinContainer skinContainer;
|
||||||
protected Judge judge;
|
protected Judge judge;
|
||||||
public void AttachSystems(PdtSkin skin, Judge judge) {
|
public void AttachSystems(PdtSkin skin, Judge judge) {
|
||||||
@@ -120,6 +122,7 @@ namespace Cryville.Crtr.Event {
|
|||||||
a_cur = RegisterAnchor(_a_cur);
|
a_cur = RegisterAnchor(_a_cur);
|
||||||
a_head = RegisterAnchor(_a_head, true);
|
a_head = RegisterAnchor(_a_head, true);
|
||||||
a_tail = RegisterAnchor(_a_tail, true);
|
a_tail = RegisterAnchor(_a_tail, true);
|
||||||
|
PropSrcs.Add(_var_current_time, new PropSrc.Float(() => (float)cs.rootPrototype.Time));
|
||||||
}
|
}
|
||||||
public virtual void Init() {
|
public virtual void Init() {
|
||||||
skinContainer.MatchStatic(ps);
|
skinContainer.MatchStatic(ps);
|
||||||
@@ -182,6 +185,7 @@ namespace Cryville.Crtr.Event {
|
|||||||
protected static bool CanDoGraphicalUpdate(ContainerState s) { return s.CloneType >= 2 && s.CloneType < 16; }
|
protected static bool CanDoGraphicalUpdate(ContainerState s) { return s.CloneType >= 2 && s.CloneType < 16; }
|
||||||
#region Anchor
|
#region Anchor
|
||||||
public virtual void Anchor() {
|
public virtual void Anchor() {
|
||||||
|
foreach (var p in PropSrcs.Values) p.Invalidate();
|
||||||
foreach (var a in DynamicAnchors.Keys) DynamicAnchorSet[a] = false;
|
foreach (var a in DynamicAnchors.Keys) DynamicAnchorSet[a] = false;
|
||||||
skinContainer.MatchDynamic(cs);
|
skinContainer.MatchDynamic(cs);
|
||||||
if (cs.Active) PushAnchorEvent(cs.Time, a_cur);
|
if (cs.Active) PushAnchorEvent(cs.Time, a_cur);
|
||||||
|
|||||||
@@ -35,10 +35,9 @@ namespace Cryville.Crtr {
|
|||||||
var vec = ContextState.GetRawValue(id);
|
var vec = ContextState.GetRawValue(id);
|
||||||
VectorSrc.Construct(() => vec).Get(out type, out value);
|
VectorSrc.Construct(() => vec).Get(out type, out value);
|
||||||
}
|
}
|
||||||
else if (ContextState != null && name == _var_current_time) {
|
else if (ContextState != null && ContextState.Handler.PropSrcs.TryGetValue(name, out prop)) {
|
||||||
LoadNum((float)ContextState.rootPrototype.Time);
|
prop.Get(out type, out value);
|
||||||
type = PdtInternalType.Number;
|
RevokePotentialConstant();
|
||||||
value = _numbuf;
|
|
||||||
}
|
}
|
||||||
else if (ContextJudge != null && ContextJudge.TryGetScoreSrc(name, out prop)) {
|
else if (ContextJudge != null && ContextJudge.TryGetScoreSrc(name, out prop)) {
|
||||||
prop.Get(out type, out value);
|
prop.Get(out type, out value);
|
||||||
|
|||||||
Reference in New Issue
Block a user