public GuiButtonList(GuiCard f) { FatherCard = f; EasyAnimation = new EasyAnimation(); EasyAnimation.AddAnimation(Animation0_FlyOut, 0.3f); EasyAnimation.AddAnimation(Animation1_Fade, Animation1_WhenEnd, 0.3f); Size = f.Size; Transform.SetTransform(FatherCard.Transform.Matrix); EasyInputAction = new EasyInputAction(this); EasyInputAction.AddEvent_MouseHoverFromInsideOut(CloseAllButtons); }
private void Event_MouseDownDragOutside() { if (Player.MainPlaceInfo.MainPlace.ElementsGoWithMouse.Count != 0) { if (Player.MainPlaceInfo.MainPlace.ElementsGoWithMouse[0] != null && Player.MainPlaceInfo.MainPlace.ElementsGoWithMouse[0] is GuiCard) { var temp = (GuiCard)Player.MainPlaceInfo.MainPlace.ElementsGoWithMouse[0]; this.takeOutCard = temp; temp.InHandCardPlace = false; if (HandCardContainers.IndexOf(temp.NowContainer) < 0) { } else { RemoveContainer(temp.NowContainer); } } } }
private void Event_OnlyInsideUp() { if (MainPlace.ElementsGoWithMouse.Count != 0) { if (MainPlace.ElementsGoWithMouse[0] != null && MainPlace.ElementsGoWithMouse[0] is GuiCard) { var gc = (GuiCard)MainPlace.ElementsGoWithMouse[0]; if (gc.InHandCardPlace == false) { gc.MouseUpContainer = this; gc.WhereIsCard = this.ContainerKind; AttachedCard = gc; gc.LastLayer = this.Layer; gc.Layer = this.Layer; MainPlace.TalkContainer = this; MainPlace.LayerController.MoveToLayerTop(gc, this.Layer.LayerName); } } } }
public void AddContainer_Auto(GuiCard gc) { if (HandCardContainers.IndexOf(gc.NowContainer) < 0) { gc.InHandCardPlace = true; var c = new Container(new Size(Program.placeWidth * 2 / 16, Program.totalHeight * 4 / 18), Player.MainPlaceInfo.MainPlace); c.ContainerKind = GuiCard.Where.HandCard; c.AddAttatchCard(gc); gc.MouseUpContainer = c; gc.MouseDownContainer = c; gc.WhereIsCard = GuiCard.Where.HandCard; HandCardContainers.Add(c); var temp = c.Transform.Matrix; temp.Translation = gc.Transform.Matrix.Translation; c.LastMatrix = temp; gc.InHandCardPlace = true; Player.HandCardController.AddTheCardToHandCard(gc.Card); Player.MainPlaceInfo.MainPlace.LayerController.MoveToLayerTop(gc, "HandCard"); //Console.WriteLine(Player.HandCardController.handCard[Player.HandCardController.handCard.Count-1]); sort_t = 0; sort = true; } }
private void Event_MouseDownDragOutside_MouseUp() { if (Player.MainPlaceInfo.MainPlace.ElementsGoWithMouse.Count != 0) { if (Player.MainPlaceInfo.MainPlace.ElementsGoWithMouse[0] != null && Player.MainPlaceInfo.MainPlace.ElementsGoWithMouse[0] is GuiCard) { var temp = (GuiCard)Player.MainPlaceInfo.MainPlace.ElementsGoWithMouse[0]; if (HandCardContainers.IndexOf(temp.NowContainer) < 0 && temp.MouseDownContainer == null) { var c = new Container(new Size(Program.placeWidth * 2 / 16, Program.totalHeight * 4 / 18), Player.MainPlaceInfo.MainPlace); c.ContainerKind = GuiCard.Where.HandCard; AddContainer(c, temp); temp.InHandCardPlace = true; } else if (HandCardContainers.IndexOf(temp.NowContainer) < 0 && temp.MouseDownContainer != null) { temp.WhereIsCard = GuiCard.Where.None; temp.MouseUpContainer = temp.MouseDownContainer; takeOutCard = null; } } } }
public void AddContainer(Container ct, GuiCard gc) { if (HandCardContainers.IndexOf(gc.NowContainer) > -1) { return; } ct.AddAttatchCard(gc); gc.MouseUpContainer = ct; gc.MouseDownContainer = ct; gc.WhereIsCard = GuiCard.Where.HandCard; var d = (Size.Width - 2 * border) / HandCardContainers.Count;//间隔 if (HandCardContainers.Count == 0) { HandCardContainers.Add(ct); Player.HandCardController.AddTheCardToHandCard(gc.Card); Player.MainPlaceInfo.MainPlace.LayerController.MoveToLayerTop(gc, "HandCard"); //foreach (var item in Player.HandCardController.handCard) //{ // Console.WriteLine(item); //} //Console.WriteLine(); } else { bool p = false; for (int k = 0; k < HandCardContainers.Count; k++) { if (Gui.Position.X < (Transform.Matrix.Translation.X + border + k * d + d / 2 - ct.Size.Width / 2)) { p = true; HandCardContainers.Insert(k, ct); Player.HandCardController.handCard.Insert(k, gc.Card); Player.MainPlaceInfo.MainPlace.LayerController.MoveToLayerTop(gc, "HandCard"); //foreach (var item in Player.HandCardController.handCard) //{ // Console.WriteLine(item); //} //Console.WriteLine(); break; } } if (p == false) { HandCardContainers.Add(ct); Player.HandCardController.AddTheCardToHandCard(gc.Card); Player.MainPlaceInfo.MainPlace.LayerController.MoveToLayerTop(gc, "HandCard"); //foreach (var item in Player.HandCardController.handCard) //{ // Console.WriteLine(item); //} //Console.WriteLine(); } } var temp = ct.Transform.Matrix; temp.Translation = gc.Transform.Matrix.Translation; ct.LastMatrix = temp; sort_t = 0; sort = true; }
public void AddAttatchCard(GuiCard gc) { this.AttachedCard = gc; }