Exemple #1
0
 private void DrawArticyEntities()
 {
     articyEntitiesFoldout = EditorGUILayout.Foldout(articyEntitiesFoldout, "Entities (Actors & Items)");
     if (articyEntitiesFoldout)
     {
         StartIndentedSection();
         foreach (ArticyData.Entity entity in articyData.entities.Values)
         {
             EditorGUILayout.BeginHorizontal();
             bool needToSetCategory = !prefs.ConversionSettings.ConversionSettingExists(entity.id);
             ConversionSetting conversionSetting = prefs.ConversionSettings.GetConversionSetting(entity.id);
             if (needToSetCategory)
             {
                 conversionSetting.Category = entity.technicalName.StartsWith("Chr") ? EntityCategory.NPC : EntityCategory.Item;
             }
             conversionSetting.Include  = EditorGUILayout.Toggle(conversionSetting.Include, GUILayout.Width(ToggleWidth));
             conversionSetting.Category = (EntityCategory)EditorGUILayout.EnumPopup(conversionSetting.Category, GUILayout.Width(64));
             EditorGUI.BeginDisabledGroup(true);
             EditorGUILayout.TextField(entity.displayName.DefaultText);
             EditorGUILayout.TextField(entity.technicalName);
             EditorGUI.EndDisabledGroup();
             EditorGUILayout.EndHorizontal();
         }
         EndIndentedSection();
     }
 }
 private void DrawArticyFlow()
 {
     articyFlowFoldout = EditorGUILayout.Foldout(articyFlowFoldout, "Flow (Quests)");
     if (articyFlowFoldout)
     {
         StartIndentedSection();
         EditorGUILayout.BeginHorizontal();
         if (GUILayout.Button("All", EditorStyles.miniButton, GUILayout.Width(40)))
         {
             MassSelectFlowFragments(true);
         }
         if (GUILayout.Button("None", EditorStyles.miniButton, GUILayout.Width(40)))
         {
             MassSelectFlowFragments(false);
         }
         EditorGUILayout.EndHorizontal();
         foreach (ArticyData.FlowFragment flowFragment in articyData.flowFragments.Values)
         {
             EditorGUILayout.BeginHorizontal();
             ConversionSetting conversionSetting = prefs.ConversionSettings.GetConversionSetting(flowFragment.id);
             conversionSetting.Include = EditorGUILayout.Toggle(conversionSetting.Include, GUILayout.Width(ToggleWidth));
             EditorGUI.BeginDisabledGroup(true);
             EditorGUILayout.LabelField(flowFragment.displayName.DefaultText);
             EditorGUILayout.TextField(flowFragment.technicalName);
             EditorGUILayout.EndHorizontal();
             EditorGUILayout.BeginHorizontal();
             EditorGUILayout.TextArea(flowFragment.text.DefaultText);
             EditorGUI.EndDisabledGroup();
             EditorGUILayout.EndHorizontal();
         }
         EndIndentedSection();
     }
 }
 private void DrawArticyVariables()
 {
     articyVariablesFoldout = EditorGUILayout.Foldout(articyVariablesFoldout, "Variables");
     if (articyVariablesFoldout)
     {
         StartIndentedSection();
         EditorGUILayout.BeginHorizontal();
         if (GUILayout.Button("All", EditorStyles.miniButton, GUILayout.Width(40)))
         {
             MassSelectVariables(true);
         }
         if (GUILayout.Button("None", EditorStyles.miniButton, GUILayout.Width(40)))
         {
             MassSelectVariables(false);
         }
         EditorGUILayout.EndHorizontal();
         foreach (ArticyData.VariableSet variableSet in articyData.variableSets.Values)
         {
             foreach (ArticyData.Variable variable in variableSet.variables)
             {
                 EditorGUILayout.BeginHorizontal();
                 string            id = ArticyData.FullVariableName(variableSet, variable);
                 ConversionSetting conversionSetting = prefs.ConversionSettings.GetConversionSetting(id);
                 conversionSetting.Include = EditorGUILayout.Toggle(conversionSetting.Include, GUILayout.Width(ToggleWidth));
                 EditorGUI.BeginDisabledGroup(true);
                 EditorGUILayout.TextField(id);
                 EditorGUILayout.TextField(variable.technicalName);
                 EditorGUI.EndDisabledGroup();
                 EditorGUILayout.EndHorizontal();
             }
         }
         EndIndentedSection();
     }
 }
 private void MassSelectVariables(bool value)
 {
     foreach (ArticyData.VariableSet variableSet in articyData.variableSets.Values)
     {
         foreach (ArticyData.Variable variable in variableSet.variables)
         {
             string            id = ArticyData.FullVariableName(variableSet, variable);
             ConversionSetting conversionSetting = prefs.ConversionSettings.GetConversionSetting(id);
             conversionSetting.Include = value;
         }
     }
 }
 public ConversionSetting GetConversionSetting(string Id)
 {
     if (string.IsNullOrEmpty(Id))
     {
         return(null);
     }
     if (!dict.ContainsKey(Id))
     {
         dict[Id] = new ConversionSetting(Id);
     }
     return(dict[Id]);
 }
Exemple #6
0
        /// <summary>
        /// Converts articy entities into Dialogue System actors and items.
        /// </summary>
        private void ConvertEntities()
        {
            foreach (ArticyData.Entity articyEntity in articyData.entities.Values)
            {
                ConversionSetting conversionSetting = prefs.ConversionSettings.GetConversionSetting(articyEntity.id);
                if (conversionSetting.Include)
                {
                    switch (conversionSetting.Category)
                    {
                    case EntityCategory.NPC:
                    case EntityCategory.Player:
                        actorID++;
                        bool  isPlayer = (conversionSetting.Category == EntityCategory.Player);
                        Actor actor    = template.CreateActor(actorID, articyEntity.displayName.DefaultText, isPlayer);
                        Field.SetValue(actor.fields, ArticyIdFieldTitle, articyEntity.id, FieldType.Text);
                        Field.SetValue(actor.fields, ArticyTechnicalNameFieldTitle, articyEntity.technicalName, FieldType.Text);
                        Field.SetValue(actor.fields, "Description", articyEntity.text.DefaultText, FieldType.Text);
                        if (!string.IsNullOrEmpty(articyEntity.previewImage))
                        {
                            Field.SetValue(actor.fields, "Pictures", string.Format("[{0}]", articyEntity.previewImage), FieldType.Text);
                        }
                        SetFeatureFields(actor.fields, articyEntity.features);
                        database.actors.Add(actor);
                        break;

                    case EntityCategory.Item:
                        itemID++;
                        Item item = template.CreateItem(itemID, articyEntity.displayName.DefaultText);
                        Field.SetValue(item.fields, ArticyIdFieldTitle, articyEntity.id, FieldType.Text);
                        Field.SetValue(item.fields, ArticyTechnicalNameFieldTitle, articyEntity.technicalName, FieldType.Text);
                        Field.SetValue(item.fields, "Description", articyEntity.text.DefaultText, FieldType.Text);
                        Field.SetValue(item.fields, "Is Item", "True", FieldType.Boolean);
                        SetFeatureFields(item.fields, articyEntity.features);
                        database.items.Add(item);
                        break;

                    default:
                        Debug.LogError(string.Format("{0}: Internal error converting entity type '{1}'", DialogueDebug.Prefix, conversionSetting.Category));
                        break;
                    }
                }
            }
            if (!string.IsNullOrEmpty(prefs.PortraitFolder))
            {
                database.actors.ForEach(a => FindPortraitTexture(a));
            }
        }
Exemple #7
0
 private void DrawArticyDialogues()
 {
     articyDialoguesFoldout = EditorGUILayout.Foldout(articyDialoguesFoldout, "Dialogues");
     if (articyDialoguesFoldout)
     {
         StartIndentedSection();
         foreach (ArticyData.Dialogue dialogue in articyData.dialogues.Values)
         {
             EditorGUILayout.BeginHorizontal();
             ConversionSetting conversionSetting = prefs.ConversionSettings.GetConversionSetting(dialogue.id);
             conversionSetting.Include = EditorGUILayout.Toggle(conversionSetting.Include, GUILayout.Width(ToggleWidth));
             EditorGUI.BeginDisabledGroup(true);
             EditorGUILayout.LabelField(dialogue.displayName.DefaultText);
             EditorGUILayout.TextField(dialogue.technicalName);
             EditorGUILayout.EndHorizontal();
             EditorGUILayout.BeginHorizontal();
             EditorGUILayout.TextArea(dialogue.text.DefaultText);
             EditorGUI.EndDisabledGroup();
             EditorGUILayout.EndHorizontal();
         }
         EndIndentedSection();
     }
 }
 private void DrawArticyEntities()
 {
     articyEntitiesFoldout = EditorGUILayout.Foldout(articyEntitiesFoldout, "Entities (Actors & Items)");
     if (articyEntitiesFoldout)
     {
         StartIndentedSection();
         EditorGUILayout.HelpBox("If an entity has a custom property named IsPlayer, IsNPC, IsItem, or IsQuest, it will override the dropdown value below.", MessageType.None);
         EditorGUILayout.BeginHorizontal();
         if (GUILayout.Button("All", EditorStyles.miniButton, GUILayout.Width(40)))
         {
             MassSelectEntities(true);
         }
         if (GUILayout.Button("None", EditorStyles.miniButton, GUILayout.Width(40)))
         {
             MassSelectEntities(false);
         }
         EditorGUILayout.EndHorizontal();
         foreach (ArticyData.Entity entity in articyData.entities.Values)
         {
             EditorGUILayout.BeginHorizontal();
             bool needToSetCategory = !prefs.ConversionSettings.ConversionSettingExists(entity.id);
             ConversionSetting conversionSetting = prefs.ConversionSettings.GetConversionSetting(entity.id);
             if (needToSetCategory)
             {
                 conversionSetting.Category = entity.technicalName.StartsWith("Chr") ? EntityCategory.NPC : EntityCategory.Item;
             }
             conversionSetting.Include  = EditorGUILayout.Toggle(conversionSetting.Include, GUILayout.Width(ToggleWidth));
             conversionSetting.Category = (EntityCategory)EditorGUILayout.EnumPopup(conversionSetting.Category, GUILayout.Width(64));
             EditorGUI.BeginDisabledGroup(true);
             EditorGUILayout.TextField(entity.displayName.DefaultText);
             EditorGUILayout.TextField(entity.technicalName);
             EditorGUI.EndDisabledGroup();
             EditorGUILayout.EndHorizontal();
         }
         EndIndentedSection();
     }
 }
 public ConversionSetting GetConversionSetting(string Id)
 {
     if (string.IsNullOrEmpty(Id)) return null;
     if (!dict.ContainsKey(Id)) dict[Id] = new ConversionSetting(Id);
     return dict[Id];
 }