private void Start() { sB = FindObjectOfType <SelectButton>(); bGI = FindObjectOfType <BoardGestureInput>(); btn = null; selected = true; }
void ReleaseDesignerOutlets() { if (ImageView != null) { ImageView.Dispose(); ImageView = null; } if (ListButton != null) { ListButton.Dispose(); ListButton = null; } if (SelectButton != null) { SelectButton.Dispose(); SelectButton = null; } if (UploadButton != null) { UploadButton.Dispose(); UploadButton = null; } }
public void Initialize() { this.subElements = new List <UIelement>(); switch (this.mode) { default: case TabMode.single: //Nothing to draw break; case TabMode.tab: for (int i = 0; i < _tabCount; i++) { SelectTab tab = new SelectTab(i, this); this.subElements.Add(tab); menu.pages[0].subObjects.Add(tab.rect); } break; case TabMode.button: for (int i = 0; i < _tabCount; i++) { SelectButton btn = new SelectButton(i, this); this.subElements.Add(btn); menu.pages[0].subObjects.Add(btn.rect); } break; } }
private void ButtonAddImage_Click(object sender, RoutedEventArgs e) { SelectButton button = new SelectButton() { MinWidth = 10, MinHeight = 10, DefaultBrush = new SolidColorBrush(Color.FromRgb(236, 240, 241)), Hover = new SolidColorBrush(Color.FromArgb(60, 233, 30, 99)), OnChecked = new SolidColorBrush(Color.FromRgb(240, 98, 146)) }; button.Content = new Image() { Source = new BitmapImage(new Uri(@"pack://application:,,,/Resources/Controls/image.png")), }; ContentPanel.Children.Add(button); if (lastChecked != null) { lastChecked.SetCheckedNoCall(false); } Content_Image content_Image = new Content_Image(); content.contents.Add(content_Image); button.Tag = content_Image; button.OnCheckChanged += Button_OnCheckChanged; button.SetChecked(true); lastChecked = button; }
/// <summary> /// 修改按钮选择状态 /// </summary> /// <param name="button"></param> private void ChangeSelectButton(SelectButton button) { foreach (SelectButton item in spTool.Children) { item.IsSelect = item.Name.Equals(button.Name); } }
private void Start() { audioSource = GetComponent<AudioSource>(); nRS = FindObjectOfType<NumberReaderScript>(); sB = FindObjectOfType<SelectButton>(); bGI = FindObjectOfType<BoardGestureInput>(); }
private void ButtonAddDateCount_Click(object sender, RoutedEventArgs e) { SelectButton button = new SelectButton() { DefaultBrush = new SolidColorBrush(Color.FromRgb(236, 240, 241)), Hover = new SolidColorBrush(Color.FromArgb(60, 233, 30, 99)), OnChecked = new SolidColorBrush(Color.FromRgb(240, 98, 146)) }; button.Content = "D"; button.FontSize = 20; button.VerticalContentAlignment = VerticalAlignment.Center; ContentPanel.Children.Add(button); if (lastChecked != null) { lastChecked.SetCheckedNoCall(false); } Content_Date Acontent = new Content_Date(); content.contents.Add(Acontent); button.Tag = Acontent; button.OnCheckChanged += Button_OnCheckChanged; button.SetChecked(true); lastChecked = button; }
//This function should be called to switch a Scene public void SceneSwitch() { Scene _currentScene = SceneManager.GetActiveScene(); //this part of the script knows what scene to switch to switch (_currentScene.buildIndex) { case 0: //go to map SceneManager.LoadScene(_currentScene.buildIndex + 1); _selectButton = null; break; case 1: //go to battle SceneManager.LoadScene(_currentScene.buildIndex + 1); _em = null; break; case 2: //go to end screen SceneManager.LoadScene(_currentScene.buildIndex + 1); break; case 3: //back to map SceneManager.LoadScene(_currentScene.buildIndex - 2); break; default: break; } GC.Collect(); }
public ContentEditor_Image(DataStore dataStore, SelectButton control) { InitializeComponent(); data = dataStore; cont = control; R_ImageFill.Fill = new ImageBrush(((Image)cont.Content).Source); ((ImageBrush)R_ImageFill.Fill).Stretch = Stretch.UniformToFill; TB_Width.Text = "" + cont.Width; TB_Height.Text = "" + cont.Height; TB_MarginLeft.Text = "" + cont.Margin.Left; ComboBox_Stretch.SelectedIndex = (int)((Image)cont.Content).Stretch; BitmapScalingMode bitmapScalingMode = ((Content_Image)cont.Tag).scalingMode; if (bitmapScalingMode == BitmapScalingMode.Fant) { ComboBox_Quality.SelectedIndex = 0; } else if (((Content_Image)cont.Tag).scalingMode == BitmapScalingMode.NearestNeighbor) { ComboBox_Quality.SelectedIndex = 2; } else { ComboBox_Quality.SelectedIndex = 1; } }
public void SelectGroupOnSelectedChanged() { tlog.Debug(tag, $"SelectGroupOnSelectedChanged START"); var testingTarget = new MySelectGroup(); Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf <SelectGroup>(testingTarget, "Should return SelectGroup instance."); SelectButton selection = new SelectButton(); testingTarget.MyAddSelection(selection); try { testingTarget.MyOnSelectedChanged(selection); } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception : Failed!"); } tlog.Debug(tag, $"SelectGroupOnSelectedChanged END (OK)"); }
public ContentEditor_Answers(DataStore dataStore, SelectButton control) { InitializeComponent(); data = dataStore; cont = control; ComboBox_FontSize.Text = "" + cont.FontSize; TB_MarginLeft.Text = "" + cont.Margin.Left; if (cont.Foreground is SolidColorBrush) { Rect_BackColor.Fill = cont.Foreground; } if (cont.FontWeight == FontWeights.Bold) { SButton_Bold.SetCheckedNoCall(true); } if (cont.FontStyle == FontStyles.Italic) { SButton_Italic.SetCheckedNoCall(true); } RB_WrongAns.IsChecked = !((Content_Answers)cont.Tag).ShowGood; try { ComboBox_FontName.Text = cont.FontFamily.ToString(); if (Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\GoodTeacher\\Temp\\")) { foreach (System.Windows.Media.FontFamily fm in Fonts.GetFontFamilies(new Uri(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\GoodTeacher\\Temp\\"))) { Label labelf = new Label(); labelf.Content = fm.ToString().Substring(3); labelf.FontFamily = fm; labelf.FontSize = 14; labelf.ToolTip = fm.ToString(); labelf.Foreground = new SolidColorBrush(Color.FromRgb(19, 87, 48)); ComboBox_FontName.Items.Add(labelf); } } foreach (System.Windows.Media.FontFamily fm in Fonts.SystemFontFamilies) { Label labelf = new Label(); labelf.Content = fm; labelf.FontFamily = fm; labelf.FontSize = 14; labelf.ToolTip = fm.ToString(); ComboBox_FontName.Items.Add(labelf); } } catch (Exception ex) { Debug.WriteLine("Font not found: " + ex); } }
void HidePlayerSelectButton() { GameObject[] SelectButtons = GameObject.FindGameObjectsWithTag("PlayerSelectButton"); foreach (GameObject SelectButton in SelectButtons) { SelectButton.GetComponent <Button> ().interactable = true; } }
public void RegisterButton(SelectButton button) { if (m_selectButtons == null) { m_selectButtons = new ArrayList(); } m_selectButtons.Add(button); }
public ClassrunUI(IWebDriver driver) { ClickMenu = new SelectTabMenu(driver, ""); ClickButton = new SelectButton(driver, ""); ClickSubMenu = new SelectSubMenu(driver, ""); EnterTextBox = new EnterText(driver, ""); EnterTextBoxByElement = new EnterText(driver, ""); }
private void ButtonDelete_Click(object sender, RoutedEventArgs e) { if (lastChecked != null) { content.contents.Remove(((Content_Default)lastChecked.Tag)); ContentPanel.Children.Remove(lastChecked); lastChecked = null; editor.Content = ""; } }
private void LoadKeyPoints() { var list = gameController.LoadKeyPoins(); foreach (var item in list) { SelectButton btn = Instantiate(prefab, svContent); btn.keyPoint = JsonUtility.FromJson <KeyPoint>(item); btn.GetComponentInChildren <Text>().text = btn.keyPoint.name; } }
/// <summary> /// 添加工具栏 /// </summary> private void AddTools() { try { int index = 0; foreach (var item in ModuleDispather.Instance.Modules) { item.ShowViewNotice += item_ShowViewNotice; SelectButton button = new SelectButton() { Name = "Name" + item.ModuleNavigable.Index, DefaultSource = item.ModuleNavigable.DefaultSource, MouseOverSource = item.ModuleNavigable.MouseOverSource, SelectImageSource = item.ModuleNavigable.MouseDownSource, Tag = item.ModuleCode }; button.SetResourceReference(Button.ContentProperty, item.ModuleNavigable.Name); button.Style = TryFindResource("syToolButton") as Style; button.Click += (sender, e) => { if (button.IsSelect) { return; } if (!button.Name.Equals("Name" + ModuleDispather.Instance.Modules[0].ModuleNavigable.Index) && !AppHelper.CheckAppState(this)) { return; } ButtonClick(button, item); }; spTool.Children.Add(button); index++; if (index == 1) { ButtonClick(button, item); } toolButtons.Add(item.ModuleCode, button); } } catch (Exception e) { LogHelper.Instance.WirteErrorMsg(e.Message); } }
// Start is called before the first frame update void Start() { if (m_FadeObject) { m_Fade = m_FadeObject.GetComponent <FadeManager>(); } m_eSelect = SelectButton.SELECT_CONTENUE; m_ePhase = OverPhase.OVERPHASE_INIT; m_bFlag = false; SoundObj = GameObject.Find("SoundManager"); SoundObj.GetComponent <SoundManager>().State(); }
public FloatButton(ref ContentView contentView, string image_source, Color color, SelectButton Selection, object viewPage) { grid_main = new Grid(); AbsoluteLayout.SetLayoutBounds(contentView, new Rectangle(0, 0, 1, 1)); AbsoluteLayout.SetLayoutFlags(contentView, AbsoluteLayoutFlags.All); contentView.Padding = new Thickness(0, 0, 30, 30); contentView.HorizontalOptions = new LayoutOptions(LayoutAlignment.End, false); contentView.VerticalOptions = new LayoutOptions(LayoutAlignment.End, false); select = Selection; this.viewPage = viewPage; button_main = CreateButtonMain(image_source, color); optiones = new List <OPTION>(); }
public void TurnTruePlayerButtons() { GameObject[] SelectButtons = GameObject.FindGameObjectsWithTag("PlayerButton"); foreach (GameObject SelectButton in SelectButtons) { SelectButton.GetComponent <Button> ().interactable = true; } GameObject[] SelectButtonsCanvas = GameObject.FindGameObjectsWithTag("PlayerButtonCanvas"); foreach (GameObject SelectButtonCanvas in SelectButtonsCanvas) { SelectButtonCanvas.GetComponent <GraphicRaycaster> ().enabled = true; } }
private async Task <List <MoveContext> > getPlayerCreatureMoveRequests() { //TODO properly implement //List<Pair<BattleCreature, Move>> moveReqs = new List<Pair<BattleCreature, Move>>(); List <BattleCreature> activeCreatures = positionManager.getActiveCreatures(); BattleCreature c = positionManager.getActiveCreatures()[0]; List <SelectButton <Move> > buttons = new List <SelectButton <Move> >(); c.getMoves().ForEach(m => { buttons.Add(SelectButton <Move> .create(m)); }); List <SelectButton <Move> > dblButtons = new List <SelectButton <Move> >(); dblButtons.AddRange(buttons); dblButtons.AddRange(buttons); Move move = await battleUIManager.getSelection <Move>(dblButtons, c.creature.creatureName + " move selection:"); List <BattleCreature> targets = new List <BattleCreature>(); switch (move.targetClass) { case TargetClass.ENEMY_SINGLE: break; case TargetClass.ALLY_SINGLE: break; case TargetClass.ALLY_ALL: break; case TargetClass.ENEMY_ALL: break; case TargetClass.ALL: break; } Debug.Log("Move selected: " + move.ToString()); MoveContext context = new MoveContext(move, c, null, null, null); return(new List <MoveContext> { context }); }
void Update() { //Plays the easter egg sound if (GestureInputManager.CurrentInput == InputAction.TrippleFingerDoubleTap || GestureInputManager.CurrentInput == InputAction.TrippleFingerPressed) { if (!source.isPlaying && source.isActiveAndEnabled) { easterEgg.onClick.Invoke(); } } //Selects and plays the button name else if (GestureInputManager.CurrentInput == InputAction.Click) { try { btn.Select(); aSG = btn.GetComponent <AudioSG>(); aSG.HoverSound(); } catch { Debug.Log("no btn selected"); } } //Access the selected buttons on click method else if (GestureInputManager.CurrentInput == InputAction.DoubleClick) { try { sB = FindObjectOfType <SelectButton>(); btn = sB.GetButton(); if (btn != null) { btn.onClick.Invoke(); EventSystem.current.SetSelectedGameObject(null); btn = null; } } catch { Debug.Log("Error"); } } }
public ContentEditor_Splitter(DataStore dataStore, SelectButton selectButton) { InitializeComponent(); data = dataStore; cont = selectButton; TB_Width.Text = "" + ((Rectangle)cont.Content).Width; TB_MarginLeft.Text = "" + cont.Margin.Left; if (cont.Foreground is SolidColorBrush) { Rect_BackColor.Fill = cont.Foreground; } }
public virtual void SelectButton(int number) { foreach (SelectButton m_button in m_selectButtons) { if (m_button.m_trackNumber == number) { m_selectedButtonIndex = number; m_selectedButton = m_button; m_button.Activate(); } else { m_button.Deactivate(); } } }
/// <summary> /// 切换语言 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button_Click(object sender, RoutedEventArgs e) { SelectButton button = sender as SelectButton; if (button.IsSelect) { return; } foreach (SelectButton item in grid.Children) { item.IsSelect = button.Name.Equals(item.Name); } lanuageID = button.Tag.ToString(); }
void EnemyButtons() { foreach (GameObject enemy in Enemies) { GameObject newButton = Instantiate(enemyButton) as GameObject; SelectButton button = newButton.GetComponent <SelectButton>(); EnemyStateMachine cur_enemy = enemy.GetComponent <EnemyStateMachine>(); Text buttonText = newButton.transform.Find("Text").gameObject.GetComponent <Text>(); buttonText.text = cur_enemy.enemy.name; button.EnemyPrefab = enemy; newButton.transform.SetParent(enemyButtonSpacer, false); } }
private void Awake() { Debug.Log("Initiating GameManager"); //Singleton pattern if (INSTANCE != null && INSTANCE != this) { Destroy(gameObject); } else { INSTANCE = this; } //(example) Enemy constructor: vit, str, dex, weight //ICombatant enemy1 = new Enemy(2, 2, 2, 30); //Instantiate objects _im = new InputManager(); //Check the current scene _currentScene = SceneManager.GetActiveScene(); _currentSceneID = _currentScene.buildIndex; //This happens here because it's the best way to detect if it's the start of the game, and this needs to happen then if (_currentScene.buildIndex == 0) { _selectButton = new SelectButton(Resources.Load <Sprite>("Sprites/PlayerSelect"), Resources.Load <Sprite>("Sprites/PlayerDeselect"), Resources.Load <GameObject>("Prefabs/Button")); _im.OnLeftButtonPressed += _selectButton.SelectedActionLeft; _im.OnRightButtonPressed += _selectButton.SelectedActionRight; _im.OnSelectButtonPressed += _selectButton.Use; } if (_currentScene.buildIndex == 1) { //instantiate a new encountermanager script which handles the map logic _em = new EncounterManager(); _im.OnLeftButtonPressed += _em.SelectedEncounterLeft; _im.OnRightButtonPressed += _em.SelectedEncounterRight; _im.OnSelectButtonPressed += _em.Use; } }
private void ChooseFileFromDBForm_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.Delete) { e.Handled = true; Delete.PerformClick(); } else if (e.KeyData == Keys.Escape) { e.Handled = true; Cancel.PerformClick(); } else if (e.KeyData == Keys.Enter) { e.Handled = true; SelectButton.PerformClick(); } }
private void Awake() { selectButton = FindObjectOfType <SelectButton>(); if (isTopButtonInMenu == true) { SetSelectedText(); } else if (GetComponent <Button>().interactable == false) { SetLockedText(); } else { SetText(); } selectedButtonScrollController = GetComponentInParent <SelectedButtonScrollController>(); dialRotateHandler = FindObjectOfType <DialRotateHandler>(); }
/// <summary> /// 添加关键点 /// </summary> private void AddKeyPoint() { if (!string.IsNullOrEmpty(inputField.text) && selected != null) { SelectButton btn = Instantiate(prefab, svContent); btn.keyPoint.name = inputField.text; btn.keyPoint.position = selected.localPosition; btn.keyPoint.pointType = dropdown.value; btn.GetComponentInChildren <Text>().text = inputField.text; inputField.text = ""; selected = null; info.text = "添加成功。"; btnAdd.interactable = false; } }