Ejemplo n.º 1
0
 public void ReviewSpecialProperties(ArticyData articyData)
 {
     foreach (var articyEntity in articyData.entities.Values)
     {
         var conversionSetting = ConversionSettings.GetConversionSetting(articyEntity.id);
         if (conversionSetting.Include)
         {
             if (ArticyConverter.HasField(articyEntity.features, "IsNPC", false))
             {
                 conversionSetting.Category = EntityCategory.NPC;
             }
             if (ArticyConverter.HasField(articyEntity.features, "IsPlayer", true))
             {
                 conversionSetting.Category = EntityCategory.Player;
             }
             if (ArticyConverter.HasField(articyEntity.features, "IsItem", true))
             {
                 conversionSetting.Category = EntityCategory.Item;
             }
             if (ArticyConverter.HasField(articyEntity.features, "IsQuest", true))
             {
                 conversionSetting.Category = EntityCategory.Quest;
             }
         }
     }
 }
Ejemplo n.º 2
0
        public static ConverterPrefs Load()
        {
            var converterPrefs = new ConverterPrefs();

            converterPrefs.ProjectFilename             = EditorPrefs.GetString(ArticyProjectFilenameKey);
            converterPrefs.PortraitFolder              = EditorPrefs.GetString(ArticyPortraitFolderKey);
            converterPrefs.StageDirectionsAreSequences = EditorPrefs.HasKey(ArticyStageDirectionsAreSequencesKey) ? EditorPrefs.GetBool(ArticyStageDirectionsAreSequencesKey) : true;
            converterPrefs.FlowFragmentMode            = (ConverterPrefs.FlowFragmentModes)(EditorPrefs.HasKey(ArticyFlowFragmentModeKey) ? EditorPrefs.GetInt(ArticyFlowFragmentModeKey) : 0);
            converterPrefs.DocumentsSubmenu            = EditorPrefs.GetString(ArticyDocumentsSubmenuKey);
            converterPrefs.TextTableDocument           = EditorPrefs.GetString(ArticyTextTableDocumentKey);
            converterPrefs.OutputFolder       = EditorPrefs.GetString(ArticyOutputFolderKey, "Assets");
            converterPrefs.Overwrite          = EditorPrefs.GetBool(ArticyOverwriteKey, false);
            converterPrefs.ConversionSettings = ConversionSettings.FromXml(EditorPrefs.GetString(ArticyConversionSettingsKey));
            converterPrefs.EncodingType       = EditorPrefs.HasKey(ArticyEncodingKey) ? (EncodingType)EditorPrefs.GetInt(ArticyEncodingKey) : EncodingType.Default;
            converterPrefs.RecursionMode      = EditorPrefs.HasKey(ArticyRecursionKey) ? (ConverterPrefs.RecursionModes)EditorPrefs.GetInt(ArticyRecursionKey) : ConverterPrefs.RecursionModes.On;
            converterPrefs.ConvertDropdownsAs = EditorPrefs.HasKey(ArticyDropdownsKey) ? (ConverterPrefs.ConvertDropdownsModes)EditorPrefs.GetInt(ArticyDropdownsKey) : ConverterPrefs.ConvertDropdownsModes.Ints;
            converterPrefs.ConvertSlotsAs     = EditorPrefs.HasKey(ArticySlotsKey) ? (ConverterPrefs.ConvertSlotsModes)EditorPrefs.GetInt(ArticySlotsKey) : ConverterPrefs.ConvertSlotsModes.DisplayName;
            converterPrefs.UseTechnicalNames  = EditorPrefs.GetBool(ArticyUseTechnicalNamesKey, false);
            converterPrefs.DirectConversationLinksToEntry1 = EditorPrefs.GetBool(ArticyDirectConversationLinksToEntry1Key, false);
            converterPrefs.ConvertMarkupToRichText         = EditorPrefs.GetBool(ArticyConvertMarkupToRichTextKey, false);
            converterPrefs.FlowFragmentScript = EditorPrefs.GetString(ArticyFlowFragmentScriptKey, ConverterPrefs.DefaultFlowFragmentScript);
            converterPrefs.VoiceOverProperty  = EditorPrefs.GetString(ArticyVoiceOverPropertyKey, ConverterPrefs.DefaultVoiceOverProperty);
            converterPrefs.LocalizationXlsx   = EditorPrefs.GetString(ArticyLocalizationXlsKey);
            converterPrefs.emVarSet           = ArticyEmVarSetFromXML(EditorPrefs.GetString(ArticyEmVarsKey));
            return(converterPrefs);
        }
 public ConverterPrefs()
 {
     ProjectFilename = string.Empty;
     PortraitFolder  = string.Empty;
     UseDefaultActorsIfNoneAssignedToDialogue = true;
     StageDirectionsAreSequences = true;
     FlowFragmentMode            = FlowFragmentModes.ConversationGroups;
     OtherScriptFields           = string.Empty;
     DocumentsSubmenu            = string.Empty;
     TextTableDocument           = string.Empty;
     OutputFolder       = "Assets";
     Overwrite          = false;
     ConversionSettings = new ConversionSettings();
     EncodingType       = EncodingType.Default;
     RecursionMode      = RecursionModes.On;
     ConvertDropdownsAs = ConvertDropdownsModes.Ints;
     ConvertSlotsAs     = ConvertSlotsModes.DisplayName;
     UseTechnicalNames  = false;
     DirectConversationLinksToEntry1 = false;
     ConvertMarkupToRichText         = true;
     SplitTextOnPipes   = true;
     FlowFragmentScript = DefaultFlowFragmentScript;
     VoiceOverProperty  = DefaultVoiceOverProperty;
     LocalizationXlsx   = string.Empty;
 }
Ejemplo n.º 4
0
 public void Save()
 {
     EditorPrefs.SetString(ArticyProjectFilenameKey, ProjectFilename);
     EditorPrefs.SetString(ArticyPortraitFolderKey, PortraitFolder);
     EditorPrefs.SetBool(ArticyStageDirectionsAreSequencesKey, StageDirectionsAreSequences);
     EditorPrefs.SetString(ArticyOutputFolderKey, OutputFolder);
     EditorPrefs.SetBool(ArticyOverwriteKey, Overwrite);
     EditorPrefs.SetString(ArticyConversionSettingsKey, ConversionSettings.ToXml());
     EditorPrefs.SetInt(ArticyEncodingKey, (int)EncodingType);
 }
Ejemplo n.º 5
0
 public ConverterPrefs()
 {
     ProjectFilename             = EditorPrefs.GetString(ArticyProjectFilenameKey);
     PortraitFolder              = EditorPrefs.GetString(ArticyPortraitFolderKey);
     StageDirectionsAreSequences = EditorPrefs.HasKey(ArticyStageDirectionsAreSequencesKey) ? EditorPrefs.GetBool(ArticyStageDirectionsAreSequencesKey) : true;
     OutputFolder       = EditorPrefs.GetString(ArticyOutputFolderKey, "Assets");
     Overwrite          = EditorPrefs.GetBool(ArticyOverwriteKey, false);
     ConversionSettings = ConversionSettings.FromXml(EditorPrefs.GetString(ArticyConversionSettingsKey));
     EncodingType       = EditorPrefs.HasKey(ArticyEncodingKey) ? (EncodingType)EditorPrefs.GetInt(ArticyEncodingKey) : EncodingType.Default;
 }
Ejemplo n.º 6
0
 public static ConversionSettings FromXml(string xml)
 {
     ConversionSettings conversionSettings = null;
     if (string.IsNullOrEmpty(xml)) {
         conversionSettings = new ConversionSettings();
     } else {
         XmlSerializer xmlSerializer = new XmlSerializer(typeof(ConversionSettings));
         conversionSettings = xmlSerializer.Deserialize(new StringReader(xml)) as ConversionSettings;
         if (conversionSettings != null) conversionSettings.AfterDeserialization();
     }
     return conversionSettings;
 }
Ejemplo n.º 7
0
 public ConverterPrefs()
 {
     ProjectFilename             = string.Empty;
     PortraitFolder              = string.Empty;
     StageDirectionsAreSequences = true;
     FlowFragmentMode            = FlowFragmentModes.ConversationGroups;
     OutputFolder       = "Assets";
     Overwrite          = false;
     ConversionSettings = new ConversionSettings();
     EncodingType       = EncodingType.Default;
     RecursionMode      = RecursionModes.On;
     ConvertDropdownsAs = ConvertDropdownsModes.Ints;
     ConvertSlotsAs     = ConvertSlotsModes.DisplayName;
     DirectConversationLinksToEntry1 = false;
     ConvertMarkupToRichText         = true;
     FlowFragmentScript = DefaultFlowFragmentScript;
     VoiceOverProperty  = DefaultVoiceOverProperty;
     LocalizationXlsx   = string.Empty;
 }
Ejemplo n.º 8
0
        public static ConversionSettings FromXml(string xml)
        {
            ConversionSettings conversionSettings = null;

            if (string.IsNullOrEmpty(xml))
            {
                conversionSettings = new ConversionSettings();
            }
            else
            {
                XmlSerializer xmlSerializer = new XmlSerializer(typeof(ConversionSettings));
                conversionSettings = xmlSerializer.Deserialize(new StringReader(xml)) as ConversionSettings;
                if (conversionSettings != null)
                {
                    conversionSettings.AfterDeserialization();
                }
            }
            return(conversionSettings);
        }