public static ReplyKeyboardMarkup GetKeyboard(EDialogState state)
        {
            switch (state)
            {
            case EDialogState.Main:
                return(TelegramKeyboard.MainKeyboard);

            case EDialogState.ManageLicense:
                return(TelegramKeyboard.ManageLicenseKeyboard);

            case EDialogState.LicenseRenewSubscription:
                return(TelegramKeyboard.LicenseRenewSubscriptionKeyboard);

            case EDialogState.LicenseDuration:
                return(TelegramKeyboard.LicenseDurationKeyboard);

            case EDialogState.LicenseKeyAdd:
                return(TelegramKeyboard.LicenseAddKeyKeyboard);

            case EDialogState.LicenseKeyRemove:
                return(TelegramKeyboard.LicenseRemoveKeyboard);

            case EDialogState.PaymentMethod:
                return(TelegramKeyboard.PaymentMethodKeyboard);

            case EDialogState.QiwiPaymentVerification:
                return(TelegramKeyboard.QiwiPaymentMethodKeyboard);

            default:
                throw new ArgumentException();
            }
        }
Beispiel #2
0
 internal void CheckCondition(Npc p_npc)
 {
     DialogCondition[] conditions = m_staticData.m_conditions;
     m_state = EDialogState.NORMAL;
     if (conditions != null)
     {
         for (Int32 i = 0; i < conditions.Length; i++)
         {
             EDialogState edialogState = conditions[i].CheckCondition(p_npc);
             if (edialogState > m_state)
             {
                 m_state = edialogState;
                 if (m_state == EDialogState.HIDDEN)
                 {
                     break;
                 }
             }
         }
     }
 }
Beispiel #3
0
        public EDialogState CheckConditions(Npc p_npc)
        {
            EDialogState edialogState = EDialogState.NORMAL;

            if (m_conditions != null)
            {
                for (Int32 i = 0; i < m_conditions.Length; i++)
                {
                    EDialogState edialogState2 = m_conditions[i].CheckCondition(p_npc);
                    if (edialogState2 > edialogState)
                    {
                        edialogState = edialogState2;
                        if (edialogState == EDialogState.HIDDEN)
                        {
                            break;
                        }
                    }
                }
            }
            return(edialogState);
        }
Beispiel #4
0
 internal void CheckEntry(Npc p_npc)
 {
     DialogCondition[] conditions = m_staticData.m_conditions;
     m_state = EDialogState.NORMAL;
     if (conditions != null)
     {
         for (Int32 i = 0; i < conditions.Length; i++)
         {
             EDialogState edialogState = conditions[i].CheckCondition(p_npc);
             if (edialogState > m_state)
             {
                 m_state = edialogState;
                 if (m_state == EDialogState.HIDDEN)
                 {
                     break;
                 }
             }
         }
     }
     m_text = null;
     if (m_state != EDialogState.HIDDEN)
     {
         for (Int32 j = 0; j < m_texts.Length; j++)
         {
             m_texts[j].CheckCondition(p_npc);
             if (m_texts[j].State != EDialogState.HIDDEN)
             {
                 m_text = m_texts[j];
                 break;
             }
         }
         if (m_text == null)
         {
             throw new InvalidDataException("All DialogText Conditions failed!!!!");
         }
     }
 }
Beispiel #5
0
 public BackMessageHandler(EDialogState dialogState, string message)
 {
     this.dialogState = dialogState;
     this.message     = message;
 }
        public static void UpdateUserDialogState(ShopUserModel user, EDialogState state)
        {
            user.CurrentDialogState = state;

            UpdateFile();
        }