/// <summary> /// Removes the specified value from the set of selected values. /// /// Removes the relevant node from the list of added nodes and adds it to the list of possible values. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void TeammateRemoved(object sender, TeammateControlClickedEventArgs e) { var selectedTeammateId = e.SelectedValue.Teammate.Id; var teammate = _allTeammates.Where(x => x.Id == selectedTeammateId).FirstOrDefault(); if (teammate == null) { return; } teammate.IsAddedToTeam = false; _teammatesSideScrollControl.AddPossibleTeammate(teammate); _teammatesHorizontalContainer.RemoveChild(e.SelectedValue); RemoveSelectedValueFromComponent(selectedTeammateId); }
private void OnInputsChanged(object sender, NotifyCollectionChangedEventArgs e) { switch (e.Action) { case NotifyCollectionChangedAction.Add: foreach (InputEventItem newItem in e.NewItems) { inputEventsContainer.AddChild(newItem); } inputEventsContainer.MoveChild(addInputEvent, Inputs.Count); break; case NotifyCollectionChangedAction.Remove: foreach (InputEventItem oldItem in e.OldItems) { inputEventsContainer.RemoveChild(oldItem); } break; default: throw new NotSupportedException($"{e.Action} is not supported on {nameof(Inputs)}"); } }
/// <summary> /// Deletes all currently shown value nodes from the control. /// </summary> protected void DeleteContent() { var contentNodes = _contentContainer.GetChildren(); foreach (var item in contentNodes) { _contentContainer.RemoveChild((Node)item); } }
public void RemoveHand(Hand hand) { var button = hand.Button; if (button != null) { _handsContainer.RemoveChild(button); } }
private void DeleteLastRune() { Godot.Collections.Array runePanelChildren = runePanel.GetChildren(); if (runePanelChildren.Count > 0) { Control lastChild = (Control)runePanelChildren[runePanelChildren.Count - 1]; runePanel.RemoveChild(lastChild); runes.Remove(runes.Last()); } }
public void Exit() { _moneyContainer.RemoveChild(_global.Money); }