void HandleTypeButtonClicked(object sender, EventArgs e) { TypeTab newTab = (TypeTab)((GradientButton)sender).Data; if (newTab != _SelectedTab) { _SelectedTab = newTab; switch (_SelectedTab) { case TypeTab.MeleeTab: SetupMeleeTab(); break; case TypeTab.RangedTab: SetupRangedTab(); break; } SetupAttackViews(); MeleeButton.StyleTab(_SelectedTab == TypeTab.MeleeTab); RangedButton.StyleTab(_SelectedTab == TypeTab.RangedTab); NaturalButton.StyleTab(_SelectedTab == TypeTab.NaturalTab); } }
public void MechanicsButtonPress() { MovementImage.GetComponent <MeshRenderer>().enabled = true; MovementImage.GetComponent <MovieScript>().PlayMovie(); ControlsImage.SetActive(false); ModesText.SetActive(false); ShootingImage.GetComponent <MeshRenderer>().enabled = false; ShieldImage.GetComponent <MeshRenderer>().enabled = false; MeleeImage.GetComponent <MeshRenderer>().enabled = false; FlagImage.GetComponent <MeshRenderer>().enabled = false; TeamAImage.GetComponent <MeshRenderer>().enabled = false; MovementButton.SetActive(true); ShootingButton.SetActive(true); ShieldButton.SetActive(true); MeleeButton.SetActive(true); FlagButton.SetActive(true); TeamAButton.SetActive(true); MovementText.SetActive(true); ModesText.SetActive(false); ShootingText.SetActive(false); ShieldText.SetActive(false); MeleeText.SetActive(false); FlagText.SetActive(false); TeamAText.SetActive(false); }
// Sets all buttons to false and defaults to controls screen. void Start() { ControlsImage.SetActive(false); MovementImage.GetComponent <MeshRenderer>().enabled = false; ShootingImage.GetComponent <MeshRenderer>().enabled = false; ShieldImage.GetComponent <MeshRenderer>().enabled = false; MeleeImage.GetComponent <MeshRenderer>().enabled = false; FlagImage.GetComponent <MeshRenderer>().enabled = false; TeamAImage.GetComponent <MeshRenderer>().enabled = false; MovementButton.SetActive(false); ShootingButton.SetActive(false); ShieldButton.SetActive(false); MeleeButton.SetActive(false); FlagButton.SetActive(false); TeamAButton.SetActive(false); ModesText.SetActive(false); MovementText.SetActive(false); ShootingText.SetActive(false); ShieldText.SetActive(false); MeleeText.SetActive(false); FlagText.SetActive(false); TeamAText.SetActive(false); ControlsButtonPress(); }
public override void ViewDidLoad() { base.ViewDidLoad(); StyleButton(OKButton); StyleButton(CancelButton); StylePanel1(this.AttackTextView); StyleBackground(BackgroundView); CMStyles.StyleBasicPanel(EditingView); MeleeView.Editable = false; MeleeView.Text = _Monster.MeleeString(_Attacks); RangedView.Editable = false; RangedView.Text = _Monster.RangedString(_Attacks); _ScrollView = new UIScrollView(); _SetChoiceView = new GradientView(); _SetControlView = new GradientView(); _NextSetButton = new GradientButton(); _NextSetButton.SetImage(UIExtensions.GetSmallIcon("next"), UIControlState.Normal); _NextSetButton.TouchUpInside += HandleNextSetButtonClicked; _LastSetButton = new GradientButton(); _LastSetButton.SetImage(UIExtensions.GetSmallIcon("prev"), UIControlState.Normal); _LastSetButton.TouchUpInside += HandleLastSetButtonClicked; _SetLabel = new UILabel(); _SetLabel.Font = UIFont.BoldSystemFontOfSize(16); _SetLabel.BackgroundColor = 0x00000000.UIColor(); _SetLabel.TextColor = 0xFFFFFFFF.UIColor(); _SetLabel.TextAlignment = UITextAlignment.Center; _SetChoiceView.Add(_NextSetButton); _SetChoiceView.Add(_LastSetButton); _SetChoiceView.Add(_SetLabel); _AddAttackButton = new GradientButton(); _AddAttackButton.SetText("Add Attack"); StyleButton(_AddAttackButton); _AddSetButton = new GradientButton(); _AddSetButton.SetText("Add"); StyleButton(_AddSetButton); _SetChoiceView.Add(_AddSetButton); _DeleteSetButton = new GradientButton(); _DeleteSetButton.SetText("Delete"); StyleButton(_DeleteSetButton); _SetChoiceView.Add(_DeleteSetButton); MeleeButton.Data = TypeTab.MeleeTab; RangedButton.Data = TypeTab.RangedTab; NaturalButton.Data = TypeTab.NaturalTab; foreach (var v in new GradientButton[] { MeleeButton, RangedButton, NaturalButton }) { v.TouchUpInside += HandleTypeButtonClicked; v.StyleTab(false); v.Border = 2; } EditingView.Add(_ScrollView); EditingView.Add(_SetChoiceView); EditingView.Add(_SetControlView); _SetControlView.Add(_AddAttackButton); CMStyles.StyleBasicPanel(_SetChoiceView); CMStyles.StyleBasicPanel(_SetControlView); _SetChoiceView.CornerRadii = new float[] { _SetChoiceView.CornerRadius, _SetChoiceView.CornerRadius, 0, 0 }; _SetControlView.CornerRadii = new float[] { 0, 0, _SetChoiceView.CornerRadius, _SetChoiceView.CornerRadius }; _AddSetButton.TouchUpInside += HandleAddSetButtonClicked; _DeleteSetButton.TouchUpInside += HandleDeleteSetClicked; _AddAttackPopover = new ButtonStringPopover(_AddAttackButton); _AddAttackPopover.WillShowPopover += HandleWillShowAddAttacksPopover; _AddAttackPopover.ItemClicked += HandleAddAttackItemClicked; _SelectedTab = TypeTab.MeleeTab; MeleeButton.StyleTab(true); SetupMeleeTab(); SetupAttackViews(); }
void ReleaseDesignerOutlets() { if (AbilitiesView != null) { AbilitiesView.Dispose(); AbilitiesView = null; } if (AttacksEditorButton != null) { AttacksEditorButton.Dispose(); AttacksEditorButton = null; } if (AttacksView != null) { AttacksView.Dispose(); AttacksView = null; } if (BurrowButton != null) { BurrowButton.Dispose(); BurrowButton = null; } if (ClimbButton != null) { ClimbButton.Dispose(); ClimbButton = null; } if (FlyButton != null) { FlyButton.Dispose(); FlyButton = null; } if (FlyQualityButton != null) { FlyQualityButton.Dispose(); FlyQualityButton = null; } if (MeleeButton != null) { MeleeButton.Dispose(); MeleeButton = null; } if (RangedButton != null) { RangedButton.Dispose(); RangedButton = null; } if (ReachButton != null) { ReachButton.Dispose(); ReachButton = null; } if (SpaceButton != null) { SpaceButton.Dispose(); SpaceButton = null; } if (SpecialAttacksButton != null) { SpecialAttacksButton.Dispose(); SpecialAttacksButton = null; } if (SpeedButton != null) { SpeedButton.Dispose(); SpeedButton = null; } if (SpeedView != null) { SpeedView.Dispose(); SpeedView = null; } if (SpellLikeAbilitiesButton != null) { SpellLikeAbilitiesButton.Dispose(); SpellLikeAbilitiesButton = null; } if (SpellsKnownButton != null) { SpellsKnownButton.Dispose(); SpellsKnownButton = null; } if (SpellsPreparedButton != null) { SpellsPreparedButton.Dispose(); SpellsPreparedButton = null; } if (SwimButton != null) { SwimButton.Dispose(); SwimButton = null; } }
void ReleaseDesignerOutlets() { if (OKButton != null) { OKButton.Dispose(); OKButton = null; } if (CancelButton != null) { CancelButton.Dispose(); CancelButton = null; } if (AttackTextView != null) { AttackTextView.Dispose(); AttackTextView = null; } if (MeleeView != null) { MeleeView.Dispose(); MeleeView = null; } if (RangedView != null) { RangedView.Dispose(); RangedView = null; } if (EditingView != null) { EditingView.Dispose(); EditingView = null; } if (MeleeButton != null) { MeleeButton.Dispose(); MeleeButton = null; } if (RangedButton != null) { RangedButton.Dispose(); RangedButton = null; } if (NaturalButton != null) { NaturalButton.Dispose(); NaturalButton = null; } if (BackgroundView != null) { BackgroundView.Dispose(); BackgroundView = null; } }