Add "at anchor" skin selector.
This commit is contained in:
@@ -28,7 +28,7 @@ namespace Cryville.Crtr {
|
||||
GetChar();
|
||||
if (cc == '.') {
|
||||
GetChar();
|
||||
s.Add(new SkinSelector.State(GetIdentifier()));
|
||||
s.Add(new SkinSelector.AtAnchor(GetIdentifier()));
|
||||
key = null;
|
||||
}
|
||||
else {
|
||||
|
@@ -104,6 +104,23 @@ namespace Cryville.Crtr {
|
||||
return h.Handler.Anchors[Name].Opened;
|
||||
}
|
||||
}
|
||||
public class AtAnchor : SkinSelector {
|
||||
public int Name { get; private set; }
|
||||
public AtAnchor(string name) {
|
||||
Name = IdentifierManager.SharedInstance.Request(name);
|
||||
}
|
||||
public override bool IsStatic {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public override Transform Match(ContainerState h, Transform a, bool dyn = false) {
|
||||
if (!dyn) throw new SelectorNotStaticException();
|
||||
return IsUpdatable(h) ? a : null;
|
||||
}
|
||||
public override bool IsUpdatable(ContainerState h) {
|
||||
return h.Handler.Anchors[Name].Opened;
|
||||
}
|
||||
}
|
||||
public class Property : SkinSelector {
|
||||
readonly PdtExpression _exp;
|
||||
readonly PdtOperator _op;
|
||||
|
Reference in New Issue
Block a user