コード例 #1
0
 private void OnNameChanged(string deckName)
 {
     m_settingValue = true;
     m_value?.SetName(deckName);
     m_saveButton.set_interactable(!DeckUtility.DecksAreEqual(m_value?.DeckInfo, m_uneditedValue?.DeckInfo));
     m_settingValue = false;
 }
コード例 #2
0
 private void OnSpellChange(SpellData previousSpellData, SpellData spellData, int index)
 {
     m_settingValue = true;
     m_value?.SetSpellAt((spellData != null) ? spellData.definition.get_id() : (-1), index);
     m_saveButton.set_interactable(!DeckUtility.DecksAreEqual(m_value?.DeckInfo, m_uneditedValue?.DeckInfo));
     UpdateInvalidDeck();
     m_settingValue = false;
 }
コード例 #3
0
 private void OnCompanionChange(CompanionData previousCompanionData, CompanionData companionData, int index)
 {
     m_settingValue = true;
     m_value?.SetCompanionAt((companionData != null) ? companionData.definition.get_id() : (-1), index);
     m_saveButton.set_interactable(!DeckUtility.DecksAreEqual(m_value?.DeckInfo, m_uneditedValue?.DeckInfo));
     UpdateInvalidDeck();
     m_settingValue = false;
 }
コード例 #4
0
 private void OnCancel()
 {
     if (!m_inAnimation)
     {
         if (!m_selectedSlot.Preconstructed && !DeckUtility.DecksAreEqual(m_previousSlot?.DeckInfo, m_selectedSlot?.DeckInfo))
         {
             OnSave();
         }
         else
         {
             OnCancelConfirm();
         }
     }
 }
コード例 #5
0
        private IEnumerator HideAllEnumerator()
        {
            bool wasOpen = false;

            if (m_ui != null)
            {
                wasOpen = m_ui.IsOpen();
                yield return(m_ui.GotoSelectMode());
            }
            if (wasOpen && !m_safeExit && !DeckUtility.DecksAreEqual(m_previousSlot?.DeckInfo, m_selectedSlot?.DeckInfo))
            {
                OnSaveConfirm();
            }
            m_safeExit = false;
            if (wasOpen)
            {
                this.OnCloseComplete?.Invoke();
            }
            RuntimeData.currentKeywordContext = KeywordContext.FightSolo;
        }
コード例 #6
0
 private void OnSave()
 {
     if (m_inAnimation)
     {
         return;
     }
     if (!m_selectedSlot.DeckInfo.IsValid() && m_wasValid)
     {
         ButtonData[] buttons = new ButtonData[2]
         {
             new ButtonData(75192, OnSaveConfirm),
             new ButtonData(38763)
         };
         StateLayer val = default(StateLayer);
         if (StateManager.TryGetLayer("PlayerUI", ref val))
         {
             PopupInfoManager.ClearAllMessages();
             PopupInfoManager.Show(val.GetChainEnd(), new PopupInfo
             {
                 title          = 56031,
                 message        = 57158,
                 buttons        = buttons,
                 selectedButton = 1,
                 style          = PopupStyle.Error
             });
         }
     }
     else if (!DeckUtility.DecksAreEqual(m_previousSlot?.DeckInfo, m_selectedSlot?.DeckInfo))
     {
         OnSaveConfirm();
     }
     else
     {
         OnExit();
     }
 }