public override void _Ready() { Claims = M1.Claims;// Just link to M1 for now since it's the only one. M1.Connect(nameof(MouseActionTracker.StateUpdate), this, nameof(OnStateUpdate)); M1.Connect(nameof(MouseActionTracker.Drag), this, nameof(OnDrag)); M1.Connect(nameof(MouseActionTracker.Drop), this, nameof(OnDrop)); collider = (IPickable)GetNode(AreaPath); collider.PickingMember = new PickingMixin(this, false, nameof(MouseOn), nameof(MouseOff)); }
public void OnChildPostUpdate(InputClaims claims, string layer) { foreach (string l in layerPriorities.SkipWhile(ll => ll == layer)) { if (layerMap.ContainsKey(l)) { layerMap[l].Claims.RecomputePosts(claims); return; } } //if this has been called on us by the final child, we emit our own update. Claims.RecomputePosts(claims); }
public void RecomputePosts(InputClaims priorClaimsObject) { PriorClaims = priorClaimsObject.PostClaims; //Most likely self assignment //but necessary if the source changed entirely. HashSet <string> newPosts = new HashSet <string>(); newPosts.UnionWith(PriorClaims); newPosts.UnionWith(Claims); if (!newPosts.SetEquals(PostClaims)) { PostClaims = newPosts; EmitSignal(nameof(PostClaimUpdate), this); } }