public override void ViewDidLoad() { base.ViewDidLoad(); NameLabel.Text = _WeaponItem.Name.Capitalize(); SpecialButton.SetText(_WeaponItem.SpecialAbilities); SpecialButton.SetTitleColor(UIColor.White, UIControlState.Normal); _SpecialPopover = new ButtonStringPopover(SpecialButton); _SpecialPopover.ItemClicked += HandleSpecialItemClicked; _SpecialPopover.WillShowPopover += HandleWillShowBonusPopover; BonusButton.SetText(BonusText); BonusButton.SetTitleColor(UIColor.White, UIControlState.Normal); _BonusPopover = new ButtonStringPopover(BonusButton); _BonusPopover.WillShowPopover += HandleWillShowBonus; _BonusPopover.ItemClicked += HandleBonusItemClicked; DeleteButton.Gradient = new GradientHelper(0x00000000.UIColor()); DeleteButton.Border = 0; DeleteButton.SetImage(UIImage.FromFile("Images/External/redx.png"), UIControlState.Normal); DeleteButton.TouchUpInside += DeleteButtonClicked; ((GradientView)View).StyleBasicPanel(); NameView.BackgroundColor = 0x0.UIColor(); NameView.Gradient = new GradientHelper(CMUIColors.SecondaryColorBDarker); HandView.BackgroundColor = 0x0.UIColor(); HandView.Gradient = new GradientHelper(CMUIColors.SecondaryColorADarker); HandLabel.Text = _WeaponItem.Weapon.HandsUsed + " Hand" + (_WeaponItem.Weapon.HandsUsed != 1?"s":""); EnableButtons(); }
void ChangeButton(int num) { SpecialButton temp = allbutton[num]; int newvalue; if (temp.status == 1) { newvalue = 255; } else { newvalue = 0; } int A_value = temp.btn.BackColor.A + (newvalue - temp.btn.BackColor.A) / (30 - temp.step); temp.step++; if (temp.step >= 30 || temp.step <= 0) { temp.status = 0; } temp.btn.BackColor = Color.FromArgb(A_value, temp.btn.BackColor.R, temp.btn.BackColor.G, temp.btn.BackColor.B); temp.btn.FlatAppearance.MouseOverBackColor = temp.btn.BackColor; temp.btn.FlatAppearance.MouseDownBackColor = temp.btn.BackColor; }
void ReleaseDesignerOutlets() { if (BackgroundView != null) { BackgroundView.Dispose(); BackgroundView = null; } if (BenefitButton != null) { BenefitButton.Dispose(); BenefitButton = null; } if (CancelButton != null) { CancelButton.Dispose(); CancelButton = null; } if (NameButton != null) { NameButton.Dispose(); NameButton = null; } if (NormalButton != null) { NormalButton.Dispose(); NormalButton = null; } if (OKButton != null) { OKButton.Dispose(); OKButton = null; } if (PrerequisitesButton != null) { PrerequisitesButton.Dispose(); PrerequisitesButton = null; } if (SpecialButton != null) { SpecialButton.Dispose(); SpecialButton = null; } if (TypesButton != null) { TypesButton.Dispose(); TypesButton = null; } }
public void ToggleButton(SpecialButton button) { if (SpecialSource.Children.Contains(button)) { SpecialSource.Children.Remove(button); SpecialSink.Children.Add(button); } else { SpecialSink.Children.Remove(button); SpecialSource.Children.Add(button); } }
void HandleSpecialItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e) { var v = (Tuple <bool, WeaponSpecialAbility>)e.Tag; if (v.Item1) { _WeaponItem.SpecialAbilitySet.Remove(v.Item2.Name); } else { _WeaponItem.SpecialAbilitySet.Add(v.Item2.Name, v.Item2.Name); } _WeaponItem.SpecialAbilitySet = _WeaponItem.SpecialAbilitySet; SpecialButton.SetText(_WeaponItem.SpecialAbilities); }
private void PositionButtons(List <SpecialComponent> properties) { if (properties == null) { return; } foreach (SpecialComponent component in properties) { SpecialButton b = FindButton(component); if (b == null) { continue; } ToggleButton(b); } }
private void SetUpWrapPanels() { //List<SpecialButton.SpecialType> sorted = (from e in Enum.GetValues(typeof(SpecialButton.SpecialType)).Cast<SpecialButton.SpecialType>() //orderby e.ToString() select e).ToList(); List <SpecialButton.SpecialType> sorted = Enum.GetValues(typeof(SpecialButton.SpecialType)).Cast <SpecialButton.SpecialType>().OrderBy(e => SelectSortingString(e.ToString())).Select(e => e).ToList(); foreach (SpecialButton.SpecialType type in sorted) { if (type == SpecialButton.SpecialType.NoType) { continue; } SpecialButton sb = new SpecialButton(type.ToString(), this, type); buttons.Add(sb); SpecialSource.Children.Add(sb); } //buttons.Add(new SpecialButton("Extra Hot", this, SpecialButton.SpecialType.ExtraHot)); }
private void Form1_Load(object sender, EventArgs e) { allbutton[0] = new SpecialButton(); allbutton[1] = new SpecialButton(); allbutton[2] = new SpecialButton(); allbutton[3] = new SpecialButton(); allbutton[4] = new SpecialButton(); allbutton[0].btn = Button_title; allbutton[1].btn = Button_categories; allbutton[2].btn = Button_products; allbutton[3].btn = Button_result; allbutton[4].btn = Button_exit; myCategories.Real = listBoxCategories; myCategories.RealPr = listBox_Categories_p; myCategories.RealRes = listBoxResult; myCategories.RealProduct = listBoxProducts; myCategories.SetDefault(); }
private void EnqueueButtons() { // special button and basic button can not co-exist if (special_ON) { for (int i = 0; i < num_special_gen; i++) { int type; while (true) { type = Random.Range(0, 2); if (special_flag[type]) { break; } } int rand = Random.Range(0, 3); SpecialButton to_push = new SpecialButton(Instantiate(specialbutton_prefabs[rand], rb.position + add, Quaternion.identity), rand, type); to_push.button.transform.parent = gameObject.transform; to_push.button.SetActive(false); special_prequeue.Enqueue(to_push); } } else { int layer = layerFirst; for (int i = 0; i < core.GetMaxHealth(); i++) { int rand = Random.Range(0, 3); // rb.position + add == 첫 버튼 위치 BasicButton to_push = new BasicButton(Instantiate(button_prefabs[rand], rb.position + add, Quaternion.identity), rand); to_push.button.transform.parent = gameObject.transform; to_push.button.GetComponent <SpriteRenderer>().sortingOrder = layer; to_push.button.SetActive(false); prequeue.Enqueue(to_push); layer--; } } }
void HandleBonusItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e) { if (e.Tag == null) { _WeaponItem.MagicBonus = 0; _WeaponItem.Masterwork = true; _WeaponItem.SpecialAbilities = ""; } else { int bonus = (int)e.Tag; _WeaponItem.Masterwork = false; _WeaponItem.MagicBonus = bonus; if (bonus == 0) { _WeaponItem.SpecialAbilities = ""; } } BonusButton.SetText(BonusText); SpecialButton.SetText(_WeaponItem.SpecialAbilities); EnableButtons(); }
private void Update() { pretarget = target; if (EnemyPool.Instance.GetPoolSize() > 0) { target = EnemyPool.Instance.GetNearestEnemy(); } // when target changed if (target != null && target != pretarget) { if (buttonON) // means enemyshieldman passed target { target_controller.EmptyOutShowingQueue(); } target_controller = target.GetComponent <EnemyButtonInfo>(); // show button if (target_controller.special_ON) { target_controller.ShowSpecialButton(); } else { target_controller.ShowButtons(ShieldmanController.Instance.GetSight()); } Debug.Log(target + "show"); buttonON = true; } if (buttonON) { //Debug.Log("now target : " + target); if (target_controller.special_ON) { SpecialButton now = target_controller.GetPresentSpecial(); int idx = now.index; int type = now.type; switch (type) { case 0: Type0InputProcess(idx); break; case 1: Type1InputProcess(idx); break; } } else { //Debug.Log("now index : " + target_controller.GetTopIndex()); InputProcess(target_controller.GetTopIndex()); } } else { // Debug.Log("no button"); } }
void ReleaseDesignerOutlets() { if (BackgroundView != null) { BackgroundView.Dispose(); BackgroundView = null; } if (BasicButton != null) { BasicButton.Dispose(); BasicButton = null; } if (CancelButton != null) { CancelButton.Dispose(); CancelButton = null; } if (DefenseButton != null) { DefenseButton.Dispose(); DefenseButton = null; } if (DescriptionButton != null) { DescriptionButton.Dispose(); DescriptionButton = null; } if (FeatsButton != null) { FeatsButton.Dispose(); FeatsButton = null; } if (HeaderLabel != null) { HeaderLabel.Dispose(); HeaderLabel = null; } if (HeaderView != null) { HeaderView.Dispose(); HeaderView = null; } if (OffenseButton != null) { OffenseButton.Dispose(); OffenseButton = null; } if (OKButton != null) { OKButton.Dispose(); OKButton = null; } if (PageBorderView != null) { PageBorderView.Dispose(); PageBorderView = null; } if (PageView != null) { PageView.Dispose(); PageView = null; } if (SpecialButton != null) { SpecialButton.Dispose(); SpecialButton = null; } if (StatisticsButton != null) { StatisticsButton.Dispose(); StatisticsButton = null; } }
public void ShowSpecialButton() { SpecialDetail(special_prequeue.Peek().type); special_now = special_prequeue.Dequeue(); }