Fix "at anchor" selector not working in effects.
This commit is contained in:
@@ -8,7 +8,7 @@ namespace Cryville.Crtr {
|
||||
public class SkinContainer {
|
||||
readonly ISkinnableGroup _group;
|
||||
readonly SkinElement _rootElement;
|
||||
readonly DynamicStack[] _stacks = new DynamicStack[2];
|
||||
readonly DynamicStack[] _stacks = new DynamicStack[3];
|
||||
readonly HashSet<SkinPropertyKey> _once = new HashSet<SkinPropertyKey>();
|
||||
public readonly IntKeyedDictionary<SkinVariable> Variables = new IntKeyedDictionary<SkinVariable>();
|
||||
|
||||
@@ -93,21 +93,26 @@ namespace Cryville.Crtr {
|
||||
DynamicElement e = stack.Elements[i];
|
||||
var psrcs = e.Context.ReadContext.PropSrcs;
|
||||
if (psrcs != null) ChartPlayer.etor.ContextCascadeInsert(psrcs);
|
||||
SkinContext nctx = null;
|
||||
try {
|
||||
nctx = e.Selectors.MatchDynamic(_group, e.Context.ReadContext);
|
||||
}
|
||||
catch (SelectorNotAvailableException) {
|
||||
if (nstack == null) throw;
|
||||
nstack.Elements.Add(e);
|
||||
}
|
||||
if (nctx != null) {
|
||||
MatchDynamic(e.Element, dl, nstack, new RuntimeSkinContext(
|
||||
nctx, e.Context, e.Selectors.annotations.Contains("if"), e.Selectors.annotations.Contains("then")
|
||||
));
|
||||
if (e.Selectors.annotations.Contains("once")) {
|
||||
stack.Elements.RemoveAt(i--);
|
||||
if (e.Selectors.IsUpdatable(_group, dl)) {
|
||||
try {
|
||||
var nctx = e.Selectors.MatchDynamic(_group, e.Context.ReadContext);
|
||||
if (nctx != null) {
|
||||
MatchDynamic(e.Element, dl, nstack, new RuntimeSkinContext(
|
||||
nctx, e.Context, e.Selectors.annotations.Contains("if"), e.Selectors.annotations.Contains("then")
|
||||
));
|
||||
if (e.Selectors.annotations.Contains("once")) {
|
||||
stack.Elements.RemoveAt(i--);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (SelectorNotAvailableException) {
|
||||
if (nstack == null) throw;
|
||||
nstack.Elements.Add(e);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (nstack == null) throw new SelectorNotAvailableException();
|
||||
nstack.Elements.Add(e);
|
||||
}
|
||||
if (psrcs != null) ChartPlayer.etor.ContextCascadeDiscard();
|
||||
}
|
||||
@@ -203,6 +208,7 @@ namespace Cryville.Crtr {
|
||||
public interface ISkinnableGroup {
|
||||
string TypeName { get; }
|
||||
SkinContext SkinContext { get; }
|
||||
int AtAnchorDynamicLevel { get; }
|
||||
int OpenedAnchorName { get; }
|
||||
bool TryGetAnchorsByName(int name, out IReadOnlyCollection<Anchor> result);
|
||||
void RegisterAnchor(int name);
|
||||
|
Reference in New Issue
Block a user