コード例 #1
0
 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]);
     }
 }
コード例 #2
0
 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;
 }
コード例 #3
0
ファイル: ModChange.cs プロジェクト: yalov/CKAN
        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();
            }
        }
コード例 #4
0
 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();
     }
 }
コード例 #5
0
 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);
         }
     }
 }
コード例 #6
0
 internal override void ProcessShiftSelection(RowColumnIndex newRowColumnIndex, RowColumnIndex previousRowColumnIndex, SelectionReason reason, Key key)
 {
     base.ProcessShiftSelection(newRowColumnIndex, previousRowColumnIndex, reason, key);
     SelectRowsBasedOnCheckedNodes();
 }
コード例 #7
0
        protected override bool ProcessSelection(RowColumnIndex rowColumnIndex, RowColumnIndex previousCurrentCellIndex, SelectionReason reason)
        {
            var isSelectionAdded = base.ProcessSelection(rowColumnIndex, previousCurrentCellIndex, reason);

            if (isSelectionAdded)
            {
                SelectRowsBasedOnCheckedNodes();
            }
            return(isSelectionAdded);
        }
コード例 #8
0
 private void LL_Reason_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     SelectionReason?.Invoke();
 }