Implement anchor related annotations.
This commit is contained in:
@@ -68,7 +68,7 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
public override bool IsValueRequired { get { return false; } }
|
||||
public override void ExecuteStatic(ContainerState state, RuntimeSkinContext ctx, PdtExpression exp) {
|
||||
// TODO
|
||||
state.Handler.RegisterAnchor(Name);
|
||||
}
|
||||
public override void ExecuteDynamic(ContainerState state, RuntimeSkinContext ctx, PdtExpression exp) {
|
||||
throw new InvalidOperationException("Anchor creation in dynamic context is not allowed");
|
||||
@@ -76,15 +76,25 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
public class SetAnchor : SkinPropertyKey {
|
||||
public int Name { get; set; }
|
||||
public SetAnchor() {
|
||||
_timeOp = new PropOp.Float(v => _time = v);
|
||||
}
|
||||
public override string ToString() {
|
||||
return string.Format("@at {0}", IdentifierManager.SharedInstance.Retrieve(Name));
|
||||
}
|
||||
public override bool IsValueRequired { get { return true; } }
|
||||
public override void ExecuteStatic(ContainerState state, RuntimeSkinContext ctx, PdtExpression exp) {
|
||||
// TODO
|
||||
throw new InvalidOperationException("Setting anchor in static context is not allowed");
|
||||
}
|
||||
float _time;
|
||||
readonly PropOp _timeOp;
|
||||
public override void ExecuteDynamic(ContainerState state, RuntimeSkinContext ctx, PdtExpression exp) {
|
||||
// TODO
|
||||
if (state.CloneType > 1) return;
|
||||
var psrcs = ctx.ReadContext.PropSrcs;
|
||||
if (psrcs != null) ChartPlayer.etor.ContextCascadeInsert(psrcs);
|
||||
ChartPlayer.etor.Evaluate(_timeOp, exp);
|
||||
if (psrcs != null) ChartPlayer.etor.ContextCascadeDiscard();
|
||||
state.Handler.PushAnchorEvent(_time, Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user