public static LocalizationData GetPhraseCategoryData(PhraseDataCategory cat)
        {
            LocalizationDataId loc = LocalizationDataId.UI_None;

            switch (cat)
            {
            case PhraseDataCategory.Question:
                loc = LocalizationDataId.UI_Phrases_Questions;
                break;

            case PhraseDataCategory.Reply:
                loc = LocalizationDataId.UI_Phrases_Replies;
                break;

            case PhraseDataCategory.Greetings:
                loc = LocalizationDataId.UI_Phrases_Greetings;
                break;

            case PhraseDataCategory.Year:
                loc = LocalizationDataId.UI_Phrases_Years;
                break;

            case PhraseDataCategory.Sentence:
                loc = LocalizationDataId.UI_Phrases_Sentences;
                break;

            case PhraseDataCategory.Expression:
                loc = LocalizationDataId.UI_Phrases_Expressions;
                break;
            }
            return(GetLocalizationData(loc));
        }
예제 #2
0
        void PhrasesPanel(PhraseDataCategory _category = PhraseDataCategory.None)
        {
            ListPanel.SetActive(true);
            DetailPanel.SetActive(false);
            currentPhraseCategory = _category;

            List <PhraseData> list;

            switch (currentPhraseCategory)
            {
            case PhraseDataCategory.None:
                list = new List <PhraseData>();
                break;

            default:
                list = AppManager.I.DB.FindPhraseData((x) => (x.Category == currentPhraseCategory));
                break;
            }
            emptyListContainers();

            List <PhraseInfo> info_list = AppManager.I.ScoreHelper.GetAllPhraseInfo();

            foreach (var info_item in info_list)
            {
                if (list.Contains(info_item.data))
                {
                    btnGO = Instantiate(PhraseItemPrefab);
                    btnGO.transform.SetParent(ListContainer.transform, false);
                    btnGO.GetComponent <ItemPhrase>().Init(this, info_item);
                }
            }

            foreach (PhraseDataCategory cat in GenericHelper.SortEnums <PhraseDataCategory>())
            {
                if (cat == PhraseDataCategory.None)
                {
                    continue;
                }
                btnGO = Instantiate(CategoryItemPrefab);
                btnGO.transform.SetParent(SubmenuContainer.transform, false);
                CategoryData = LocalizationManager.GetPhraseCategoryData(cat);
                btnGO.GetComponent <MenuItemCategory>().Init(
                    this,
                    new GenericCategoryData
                {
                    area           = VocabularyChapter.Phrases,
                    phraseCategory = cat,
                    Id             = cat.ToString(),
                    TitleLearning  = CategoryData.LearningText,
                    TitleNative    = CategoryData.NativeText
                },
                    currentPhraseCategory == cat
                    );
            }
        }
예제 #3
0
 public List <PhraseData> GetPhrasesByCategory(PhraseDataCategory choice, WordFilters wordFilters, PhraseFilters phraseFilters)
 {
     return(dbManager.FindPhraseData(x => x.Category == choice && CheckFilters(wordFilters, phraseFilters, x)));
 }
예제 #4
0
        public static LocalizationData GetPhraseCategoryData(PhraseDataCategory cat)
        {
            LocalizationDataId locId = (LocalizationDataId)Enum.Parse(typeof(LocalizationDataId), $"UI_Phrases_{cat}");

            return(GetLocalizationData(locId));
        }