public void InitiateExchange() { // a bit more complex, this method gets called by the exchange button, and it then sets up the // behind the scenes stuff for drawing extra cards and assigning that Ui. the ugly if statements // are there to cover the eventuality of having only one influence when taking the action // I would have liked to just use a null in the array, but apparently you cant do that with an array of enums (?) // so yeah...thats how we got this playerActions.SetActive(false); influenceSelections.SetActive(true); isSelecting = true; currentReason = SelectionReason.Exchange; exchangeOptions[0] = localPlayer.influences[0]; if (localPlayer.influences.Count > 1) { exchangeOptions[1] = localPlayer.influences[1]; } exchangeOptions[2] = GameMaster.Instance.DrawInfluence(); exchangeOptions[3] = GameMaster.Instance.DrawInfluence(); for (int i = 0; i < 4; i++) { if (localPlayer.influences.Count > 1 && i == 1) { influenceButtons[i].gameObject.SetActive(false); } else { influenceIcons[i].sprite = GameMaster.Instance.influenceImages[(int)exchangeOptions[i]]; } } currentExchangeSelection = new List <Toggle>(); currentExchangeSelection.Add(influenceButtons[0]); if (localPlayer.influences.Count > 1) { currentExchangeSelection.Add(influenceButtons[1]); } }
public void InitiateSteal() { // also simple method that gets called by the steal button and opens the selection interface playerActions.SetActive(false); playerSelections.SetActive(true); isSelecting = true; currentReason = SelectionReason.Steal; }
public ModChange(GUIMod mod, GUIModChangeType changeType, SelectionReason reason) { Mod = mod; ChangeType = changeType; Reason = reason; if (Reason == null) { // Hey, we don't have a Reason // Most likely the user wanted to install it Reason = new SelectionReason.UserRequested(); } }
private void EditingReasonCustomerForm_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if (e.Control && e.KeyCode == Keys.Enter) { SelectionReason?.Invoke(); } else if (e.KeyCode == Keys.Enter) { TSB_Save.PerformClick(); } else if (e.KeyCode == Keys.Escape) { Close(); } }
internal void OnSelectionChanged(SelectionReason reason) { if (_suspendSelectionEvent) { _fireSelectionEvent = true; } else { _fireSelectionEvent = false; if (SelectionChanged != null) { int n = Selection.Count; if (n < 1) { reason = SelectionReason.NoSelection; } else if (n > 1) { reason = SelectionReason.Multi; } SelectionChanged.Invoke(this, reason); } } }
internal override void ProcessShiftSelection(RowColumnIndex newRowColumnIndex, RowColumnIndex previousRowColumnIndex, SelectionReason reason, Key key) { base.ProcessShiftSelection(newRowColumnIndex, previousRowColumnIndex, reason, key); SelectRowsBasedOnCheckedNodes(); }
protected override bool ProcessSelection(RowColumnIndex rowColumnIndex, RowColumnIndex previousCurrentCellIndex, SelectionReason reason) { var isSelectionAdded = base.ProcessSelection(rowColumnIndex, previousCurrentCellIndex, reason); if (isSelectionAdded) { SelectRowsBasedOnCheckedNodes(); } return(isSelectionAdded); }
private void LL_Reason_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { SelectionReason?.Invoke(); }