Exemplo n.º 1
0
        public static void SaveEntity(string path, FindLogic.Combo.ComboInfo info,
                                      ulong entityGuid)
        {
            FindLogic.Combo.EntityInfoNew entityInfo = info.Entities[entityGuid];

            Entity.OverwatchEntity entity = new Entity.OverwatchEntity(entityInfo, info);

            string entityDir  = Path.Combine(path, "Entities", entityInfo.GetName());
            string outputFile = Path.Combine(entityDir, entityInfo.GetName() + $".{entity.Extension}");

            CreateDirectoryFromFile(outputFile);

            using (Stream entityOutputStream = File.OpenWrite(outputFile)) {
                entityOutputStream.SetLength(0);
                entity.Write(entityOutputStream);
            }

            if (!info.SaveConfig.SaveAnimationEffects)
            {
                return;
            }
            if (entityInfo.Model == 0)
            {
                return;
            }
            foreach (ulong animation in entityInfo.Animations)
            {
                SaveAnimationEffectReference(entityDir, info, animation, entityInfo.Model);
            }
        }
Exemplo n.º 2
0
        public static void SaveEntity(ICLIFlags flags, string path, SaveContext context, ulong entityGuid)
        {
            FindLogic.Combo.EntityAsset entityInfo = context.m_info.m_entities[entityGuid];

            Entity.OverwatchEntity entity = new Entity.OverwatchEntity(entityInfo, context.m_info);

            string entityDir  = Path.Combine(path, "Entities", entityInfo.GetName());
            string outputFile = Path.Combine(entityDir, entityInfo.GetName() + $".{entity.Extension}");

            CreateDirectoryFromFile(outputFile);

            using (Stream entityOutputStream = File.OpenWrite(outputFile)) {
                entityOutputStream.SetLength(0);
                entity.Write(entityOutputStream);
            }

            if (!context.m_saveAnimationEffects)
            {
                return;
            }
            if (entityInfo.m_modelGUID == 0)
            {
                return;
            }

            foreach (ulong effect in entityInfo.m_effects)
            {
                SaveEffect(flags, entityDir, context, effect);
            }

            foreach (ulong animation in entityInfo.m_animations)
            {
                SaveAnimationEffectReference(entityDir, context.m_info, animation, entityInfo.m_modelGUID);
            }
        }