/// <summary> /// Enables all interface elements. Including buttons and text fields. /// The search button states are preserved. /// </summary> private void EnableInterfaceElements() { animatedButtonList.ForEach((x) => x.Enable()); filterButtonList.ForEach((x) => x.Enable()); avatarButtonList.ForEach((x) => x.ShouldUpdate = true); tabButtonList.Enable(); AnimatedButton button; switch (searchFilter.AvatarCategory) { case AvatarCategory.Hat: button = filterHatButton; break; case AvatarCategory.Body: button = filterBodyButton; break; case AvatarCategory.Goggles: button = filterGogglesButton; break; case AvatarCategory.Flag: button = filterFlagButton; break; case AvatarCategory.ExItem: button = filterExItemButton; break; case AvatarCategory.Pet: button = filterPetButton; break; case AvatarCategory.Misc: button = filterMiscButton; break; default: button = filterExtraButton; break; } button.ChangeButtonState(ButtonAnimationState.Activated); giftButton.Disable(true); cashChargeButton.Disable(true); //Update filter buttons if (searchFilter.CurrentPage == 0) { filterLeftButton.Disable(true); } else if (filterLeftButton.IsDisabled) { filterLeftButton.Enable(); } if (searchFilter.CurrentPage + 1 == searchFilter.LastPage) { filterRightButton.Disable(true); } else if (filterRightButton.IsDisabled) { filterRightButton.Enable(); } //Search text field searchTextField.Enable(); searchTextField.ActivateElement(); }
public void AddSearchTextToScene() { SpriteText spriteText = new SpriteText(FontTextType.FontAwesome10, "" + (char)0xf002, Color.White, Alignment.Left, DepthParameter.InterfaceButtonText, Parameter.ScreenCenter + new Vector2(242, -253), Color.Black); spriteTextList.Add(spriteText); searchTextField = new TextField(Parameter.ScreenCenter + new Vector2(260, -252), 120, 16, 16, FontTextType.Consolas10, Color.White, DepthParameter.InterfaceButtonText, Color.Black); searchTextField.ActivateElement(); searchTextField.OnTextChange = OnFilterTextChange; }