private CharacterElement CreateCharacterGUI(VisualElement root, CharacterAsset asset, CharacterRow character)
        {
            var contentElems  = new List <ContentElement>();
            var characterElem = new CharacterElement {
                userData = contentElems,
                text     = character.Id.Or("<none>")
            };

            var languages      = new List <string>(asset.Languages);
            var languagesPopup = new LanguagePopup("Language Id", languages, 0);

            languagesPopup.RegisterValueChangedCallback(OnChangeLanguage);
            characterElem.Content.Add(languagesPopup);

            CreateAvatarGUI(characterElem.Content, character);
            CreateP1GUI(characterElem.Content, character);
            CreateP1BackgroundGUI(characterElem.Content, character);
            CreateP2GUI(characterElem.Content, character);
            CreateP2BackgroundGUI(characterElem.Content, character);
            CreateP3GUI(characterElem.Content, character);
            CreateP3BackgroundGUI(characterElem.Content, character);
            CreateContentGUI(characterElem.Content, asset, character, contentElems, languages[0]);

            root.Add(characterElem);
            return(characterElem);
        }
        private L10nTextElement CreateLocalTextGUI(VisualElement root, L10nAsset asset, L10nTextRow text)
        {
            var contentElems = new List <ContentElement>();
            var textElem     = new L10nTextElement {
                userData = contentElems,
                text     = text.Id
            };

            var languages      = new List <string>(asset.Languages);
            var languagesPopup = new LanguagePopup("Language Id", languages, 0);

            languagesPopup.RegisterValueChangedCallback(OnChangeLanguage);
            textElem.Content.Add(languagesPopup);

            CreateContentGUI(textElem.Content, asset, text, contentElems, languages[0]);

            root.Add(textElem);
            return(textElem);
        }
Esempio n. 3
0
        private ConversationElement CreateConversationGUI(VisualElement root, NovelAsset asset,
                                                          ConversationRow conversation)
        {
            var contentElems     = new List <ContentElement>();
            var conversationElem = new ConversationElement {
                userData = contentElems,
                text     = conversation.Id
            };

            var languages      = new List <string>(asset.Languages);
            var languagesPopup = new LanguagePopup("Language Id", languages, 0);

            languagesPopup.RegisterValueChangedCallback(OnChangeLanguage);
            conversationElem.Add(languagesPopup);

            foreach (var kv in conversation.Dialogues)
            {
                CreateDialogueGUI(conversationElem.Content, conversation, kv.Value, contentElems, languages[0]);
            }

            root.Add(conversationElem);
            return(conversationElem);
        }