Example #1
0
    private void ContactsTextGUI(TextBundle bundle)
    {
        var contactsText = bundle.GetContactsText();

        EditorGUILayout.LabelField("Contact", EditorStyles.boldLabel);

        string contactName = UpdateTextDictionary(contactsText, contactsHandle);

        AddDeleteWidget(contactsText, contactsHandle);

        EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
        EditorGUILayout.LabelField("Contact Message Pack", EditorStyles.boldLabel);

        string contactMessageName = UpdateTextDictionary(contactsText[contactName], contactMessageHandle);

        if (contactMessageName == "")
        {
            return;
        }

        AddDeleteWidget(contactsText[contactName], contactMessageHandle);

        EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
        EditorGUILayout.LabelField("Messages", EditorStyles.boldLabel);

        if (!contactsText[contactName].ContainsKey(contactMessageName))
        {
            contactsText[contactName][contactMessageName] = new List <TextBundle.Message>();
        }

        UpdateMessages(contactsText[contactName][contactMessageName], () => new TextBundle.Message(), (messages, index) => {
            messages[index].isYou = GUILayout.Toggle(messages[index].isYou, "Is You");
            messages[index].text  = EditorGUILayout.TextArea(messages[index].text, GUILayout.Height(50.0f));
        });
    }
Example #2
0
    private void ItemTextGUI(TextBundle bundle)
    {
        var itemText = bundle.GetItemText();

        string sceneName = SceneManager.GetActiveScene().name;

        if (!itemText.ContainsKey(sceneName))
        {
            itemText[sceneName] = new Dictionary <string, List <string> >();
        }

        if (Selection.gameObjects.Length != 1 ||
            Selection.gameObjects[0].GetComponent <Item>() == null)
        {
            EditorGUILayout.LabelField("No item selected", EditorStyles.boldLabel);
            return;
        }

        var item = Selection.gameObjects[0];

        EditorGUILayout.LabelField(item.name, EditorStyles.boldLabel);

        if (!itemText[sceneName].ContainsKey(item.name))
        {
            itemText[sceneName][item.name] = new List <string>();
        }

        UpdateMessages(itemText[sceneName][item.name], () => "", (messages, index) => {
            messages[index] = EditorGUILayout.TextArea(messages[index], GUILayout.Height(50.0f));
        });
    }
Example #3
0
		public void TestFixtureSetup()
		{
			using (var zippedBundle = CreateZippedTextBundleFromResources())
				m_bundle = new TextBundle<DblTextMetadata<DblMetadataLanguage>, DblMetadataLanguage>(zippedBundle.Path);
			using (var zippedBundle = CreateZippedTextBundleFromResources(false))
				m_bundleWithoutLdml = new TextBundle<DblTextMetadata<DblMetadataLanguage>, DblMetadataLanguage>(zippedBundle.Path);
		}
Example #4
0
 public void TestFixtureSetup()
 {
     using (var zippedBundle = CreateZippedTextBundleFromResources())
         m_bundle = new TextBundle <DblTextMetadata <DblMetadataLanguage>, DblMetadataLanguage>(zippedBundle.Path);
     using (var zippedBundle = CreateZippedTextBundleFromResources(false))
         m_bundleWithoutLdml = new TextBundle <DblTextMetadata <DblMetadataLanguage>, DblMetadataLanguage>(zippedBundle.Path);
 }
Example #5
0
    private void TwitterTextGUI(TextBundle bundle)
    {
        var twitterText = bundle.GetTwitterText();

        UpdateMessages(twitterText, () => new Tweet(), (tweets, index) => {
            tweets[index].name    = EditorGUILayout.TextField(tweets[index].name);
            tweets[index].text    = EditorGUILayout.TextArea(tweets[index].text, GUILayout.Height(50.0f));
            tweets[index].likes   = EditorGUILayout.IntField(tweets[index].likes);
            tweets[index].reposts = EditorGUILayout.IntField(tweets[index].reposts);
            tweets[index].sprite  = EditorGUILayout.TextField(tweets[index].sprite);
        });
    }
Example #6
0
    private void MessageTextGUI(TextBundle bundle)
    {
        var messageText = bundle.GetMessageText();

        string messageName = UpdateTextDictionary(messageText, messageHandle);

        AddDeleteWidget(messageText, messageHandle);

        if (!messageText.ContainsKey(messageName))
        {
            messageText[messageName] = new List <string>();
        }

        UpdateMessages(messageText[messageName], () => "", (messages, index) => {
            messages[index] = EditorGUILayout.TextArea(messages[index], GUILayout.Height(50.0f));
        });
    }
Example #7
0
 public void UpdateLanguage()
 {
     currentBundle = GameSettings.language == Language.Russian ? russianBundle : englishBundle;
 }