void ChildSelector_OnSelectionModified(string arg, Entry entry) { CurrentValue = entry; OnSelectionModified.Invoke(arg); Parent.RemoveChild(this); IsDead = true; InputManager.MouseClickedCallback -= InputManager_MouseClickedCallback; GUI.FocusComponent = null; }
private void InputManager_MouseClickedCallback(InputManager.MouseButton button) { if (ClickTimer.HasTriggered && !IsDead) { OnSelectionModified.Invoke(CurrentValue); Parent.RemoveChild(this); Box.Selector = null; IsDead = true; InputManager.MouseClickedCallback -= InputManager_MouseClickedCallback; } }
private void InputManager_MouseClickedCallback(InputManager.MouseButton button) { if (ClickTimer.HasTriggered && !IsDead) { if (CurrentValue != null && (CurrentValue.Children == null || CurrentValue.Children.Count == 0)) { OnSelectionModified.Invoke(CurrentValue.GlobalName); Parent.RemoveChild(this); IsDead = true; InputManager.MouseClickedCallback -= InputManager_MouseClickedCallback; } else if (CurrentValue != null) { if (CurrentValue.ChildSelector == null || CurrentValue.ChildSelector.IsDead) { MouseState mouse = Mouse.GetState(); CurrentValue.ChildSelector = new ComboBoxSelector(GUI, Box, CurrentValue.Children, mouse.X - Box.GlobalBounds.X, mouse.Y - Box.GlobalBounds.Y); GUI.FocusComponent = CurrentValue.ChildSelector; Entry value = CurrentValue; CurrentValue.ChildSelector.OnSelectionModified += (string arg) => ChildSelector_OnSelectionModified(arg, value); } } } }
public void InvokeSelectionModified() { OnSelectionModified.Invoke(CurrentValue); }
private void Selector_OnSelectionModified(string value) { CurrentIndex = Values.IndexOf(value); OnSelectionModified.Invoke(value); Selector = null; }
private void Selector_OnSelectionModified(string value) { CurrentIndex = Selector.GetCurrentIndex(); OnSelectionModified.Invoke(value); }