public bool OnMouseReleased(ALayer2D parentLayer, ControlEventType eventType) { if (parentLayer.FocusedGraphicEntity2D == this) { Layer2D.BoardPlayerLayer2D.BoardPlayerLayer2D boardPlayerLayer2D = parentLayer as Layer2D.BoardPlayerLayer2D.BoardPlayerLayer2D; if (boardPlayerLayer2D != null && boardPlayerLayer2D.LevelTurnPhase == Model.Node.TestWorld.TurnPhase.MAIN) { Vector2i mousePosition = parentLayer.MousePosition; mousePosition.Y -= (int)(this.Bounds.Height / 2); if (eventType == ControlEventType.MOUSE_LEFT_CLICK) { parentLayer.SendEventToWorld(Model.Event.EventType.PICK_CARD, parentLayer.GetEntityFromEntity2D(this), mousePosition.X + ":" + mousePosition.Y); } } Layer2D.BoardNotifLayer2D.BoardNotifLayer2D boardNotifLayer2D = parentLayer as Layer2D.BoardNotifLayer2D.BoardNotifLayer2D; if (boardNotifLayer2D != null && boardNotifLayer2D.LevelTurnPhase == Model.Node.TestWorld.TurnPhase.MAIN) { Vector2i mousePosition = parentLayer.MousePosition; mousePosition.Y -= (int)(this.Bounds.Height / 2); if (eventType == ControlEventType.MOUSE_LEFT_CLICK) { parentLayer.SendEventToWorld(Model.Event.EventType.PICK_CARD, parentLayer.GetEntityFromEntity2D(this), mousePosition.X + ":" + mousePosition.Y); } } } return(true); }
public void OnMouseFocused(ALayer2D parentLayer, ControlEventType eventType) { StarEntity starEntity = parentLayer.GetEntityFromEntity2D(this) as StarEntity; if (starEntity.CardSocketed != null) { parentLayer.SendEventToWorld(Model.Event.EventType.FOCUS_CARD_BOARD, starEntity.CardSocketed, null); } }
public void OnMouseFocused(ALayer2D parentLayer, ControlEventType eventType) { CJStarDomain domainEntity = parentLayer.GetEntityFromEntity2D(this) as CJStarDomain; if (domainEntity != null) { parentLayer.SendEventToWorld(Model.Event.EventType.FOCUS_DOMAIN_BOARD, domainEntity, null); } }
public void OnMouseUnFocused(ALayer2D parentLayer, ControlEventType eventType) { parentLayer.SendEventToWorld(Model.Event.EventType.FOCUS_CARD_HAND, null, null); Layer2D.BoardPlayerLayer2D.BoardPlayerLayer2D boardPlayerLayer2D = parentLayer as Layer2D.BoardPlayerLayer2D.BoardPlayerLayer2D; if (boardPlayerLayer2D == null || boardPlayerLayer2D.SourceCardEntities2D == null || boardPlayerLayer2D.SourceCardEntities2D.Count == 0) { this.IsFocused = false; } }
//public override bool OnMouseClicked(ALayer2D parentLayer, ControlEventType eventType) //{ // return base.OnMouseClicked(; //} public override bool OnMouseReleased(ALayer2D parentLayer, ControlEventType eventType) { if (parentLayer.FocusedGraphicEntity2D == this) { base.OnMouseReleased(parentLayer, eventType); parentLayer.SendEventToWorld(Model.Event.EventType.LEVEL_CHANGE, null, "CardBoardLevel"); } this.Zoom = 1f; return(false); }
public void OnMouseUnFocused(ALayer2D parentLayer, ControlEventType eventType) { parentLayer.SendEventToWorld(Model.Event.EventType.FOCUS_CARD_BOARD, null, null); }