public void OnChooseButtonInWaitListTapped(PvZChooseButton button) { RectangleF destRect = this.chosenList.MakeDestination(); if (!destRect.IsEmpty && !button.IsDisabled) { PvZChooseButtonAvatar avatar = new PvZChooseButtonAvatar(this.Game, 1f, 0.2f, 0.5f); avatar.Background = button.Background; avatar.Canvas.Bound.Alter(button.Canvas.Bound); avatar.Parent = button; avatar.OnCompleteAnimating += this.OnAvatarCompleted; this.uiManager.Add(avatar); avatar.StartAnimating(destRect); button.IsDisabled = true; } }
private void ArrageButton(PvZChooseButton grButton, int i) { int nCols = (int) (this.Canvas.Content.Width / (this.elemWidth + this.elemPad)); int j = i / nCols; i %= nCols; grButton.Canvas.Bound.Position.X = this.Canvas.Bound.Position.X + this.Canvas.Content.Position.X + (this.elemWidth + this.ElemPad) * i; grButton.Canvas.Bound.Position.Y = this.Canvas.Bound.Position.Y + this.Canvas.Content.Position.Y + (this.elemHeight + this.ElemPad) * j; grButton.Canvas.Bound.Size.X = this.elemWidth; grButton.Canvas.Bound.Size.Y = this.elemHeight; }
public void OnChooseButtonInChosenListTapped(PvZChooseButton button) { var chButton = this.waitList.GetButton(button.Name); if (chButton != null) { chButton.IsDisabled = false; } this.chosenList.RemoveChooseButton(button); }
public void RemoveChooseButton(PvZChooseButton chButton) { if (this.chooseButtons.Contains(chButton)) { chButton.KillMe(); } }
public void OnPvZChooseButtonMoveComplete(PvZChooseButton chooseButton) { if (this.OnButtonMoveCompleted != null) { this.OnButtonMoveCompleted(this, chooseButton); } }
public void AddChooseButton(PvZChooseButton chButton) { this.ArrageButton(chButton, this.chooseButtons.Count); this.chooseButtons.Add(chButton); this.uiManager.AddTarget<Tap>(chButton); }
public void OnChooseButtonInWaitListTapped(PvZChooseButton button) { RectangleF destRect = this.chosenList.MakeDestination(); if (!destRect.IsEmpty && !button.IsDisabled) { SCSServices.Instance.AudioManager.PlaySound(this.buttonChoosedSound, false, true); PvZChooseButtonAvatar avatar = new PvZChooseButtonAvatar(this.Game, 1f, 0.2f, 0.5f); avatar.Background = button.Background; avatar.Canvas.Bound.Alter(button.Canvas.Bound); avatar.Parent = button; avatar.OnCompleteAnimating += this.OnAvatarCompleted; this.uiManager.Add(avatar); avatar.StartAnimating(destRect); this.chosenList.NumberOfBufferedButtons++; button.IsDisabled = true; } else { SCSServices.Instance.AudioManager.PlaySound(this.buttonTouchedFail, false, true); } }
public void OnChooseButtonInChosenListTapped(PvZChooseButton button) { var chButton = this.waitList.GetButton(button.Name); if (chButton != null) { SCSServices.Instance.AudioManager.PlaySound(this.buttonChoosedSound, false, true); chButton.IsDisabled = false; } this.chosenList.RemoveChooseButton(button); this.chosenList.NumberOfBufferedButtons--; }