Ejemplo n.º 1
0
        //
        // Helper Function
        //
        private bool GetModelStrings(long nameID, long sknID, long sklID, 
            long textureID, ref ModelDefinition m)
        {
            bool result = false;

            // Sometimes the first skin is named by the root directory.
            if (properties.ContainsKey(nameID))
            {
                m.name = (String)properties[nameID];
            }

            if (properties.ContainsKey(sknID) &&
                properties.ContainsKey(sklID) &&
                properties.ContainsKey(textureID))
            {
                m.skn = (String)properties[sknID];
                m.skn = m.skn.ToLower();
                m.skl = (String)properties[sklID];
                m.skl = m.skl.ToLower();
                m.tex = (String)properties[textureID];
                m.tex = m.tex.ToLower();

                result = true;
            }

            return result;
        }
Ejemplo n.º 2
0
        public List<ModelDefinition> GetModelStrings()
        {
            List<ModelDefinition> result = new List<ModelDefinition>();

            // Read in model 1
            ModelDefinition def = new ModelDefinition();
            def.anmListKey = GetAnimationList(directory);

            bool modelStringsResult = GetModelStrings((long)InibinHashID.SKIN_ONE_NAME,
                    (long)InibinHashID.SKIN_ONE_SKN,
                    (long)InibinHashID.SKIN_ONE_SKL,
                    (long)InibinHashID.SKIN_ONE_TEXTURE, ref def);

            if (modelStringsResult == true)
            {
                def.skin = 1;
                result.Add(def);
            }

            // Read in model 2
            def = new ModelDefinition();
            def.anmListKey = directory.Name;
            modelStringsResult = GetModelStrings((long)InibinHashID.SKIN_TWO_NAME,
                (long)InibinHashID.SKIN_TWO_SKN,
                (long)InibinHashID.SKIN_TWO_SKL,
                (long)InibinHashID.SKIN_TWO_TEXTURE, ref def);

            if (modelStringsResult == true)
            {
                def.skin = 2;
                result.Add(def);
            }

            // Read in model 3
            def = new ModelDefinition();
            def.anmListKey = directory.Name;
            modelStringsResult = GetModelStrings((long)InibinHashID.SKIN_THREE_NAME,
                (long)InibinHashID.SKIN_THREE_SKN,
                (long)InibinHashID.SKIN_THREE_SKL,
                (long)InibinHashID.SKIN_THREE_TEXTURE, ref def);

            if (modelStringsResult == true)
            {
                def.skin = 3;
                result.Add(def);
            }

            // Read in model 4
            def = new ModelDefinition();
            def.anmListKey = directory.Name;
            modelStringsResult = GetModelStrings((long)InibinHashID.SKIN_FOUR_NAME,
                (long)InibinHashID.SKIN_FOUR_SKN,
                (long)InibinHashID.SKIN_FOUR_SKL,
                (long)InibinHashID.SKIN_FOUR_TEXTURE, ref def);

            if (modelStringsResult == true)
            {
                def.skin = 4;
                result.Add(def);
            }

            // Read in model 5
            def = new ModelDefinition();
            def.anmListKey = directory.Name;
            modelStringsResult = GetModelStrings((long)InibinHashID.SKIN_FIVE_NAME,
                (long)InibinHashID.SKIN_FIVE_SKN,
                (long)InibinHashID.SKIN_FIVE_SKL,
                (long)InibinHashID.SKIN_FIVE_TEXTURE, ref def);

            if (modelStringsResult == true)
            {
                def.skin = 5;
                result.Add(def);
            }

            // Read in model 6
            def = new ModelDefinition();
            def.anmListKey = directory.Name;
            modelStringsResult = GetModelStrings((long)InibinHashID.SKIN_SIX_NAME,
                (long)InibinHashID.SKIN_SIX_SKN,
                (long)InibinHashID.SKIN_SIX_SKL,
                (long)InibinHashID.SKIN_SIX_TEXTURE, ref def);

            if (modelStringsResult == true)
            {
                def.skin = 6;
                result.Add(def);
            }

            // Read in model 7
            def = new ModelDefinition();
            def.anmListKey = directory.Name;
            modelStringsResult = GetModelStrings((long)InibinHashID.SKIN_SEVEN_NAME,
                (long)InibinHashID.SKIN_SEVEN_SKN,
                (long)InibinHashID.SKIN_SEVEN_SKL,
                (long)InibinHashID.SKIN_SEVEN_TEXTURE, ref def);

            if (modelStringsResult == true)
            {
                def.skin = 7;
                result.Add(def);
            }

            // Read in model 8
            def = new ModelDefinition();
            def.anmListKey = directory.Name;
            modelStringsResult = GetModelStrings((long)InibinHashID.SKIN_EIGHT_NAME,
                (long)InibinHashID.SKIN_EIGHT_SKN,
                (long)InibinHashID.SKIN_EIGHT_SKL,
                (long)InibinHashID.SKIN_EIGHT_TEXTURE, ref def);

            if (modelStringsResult == true)
            {
                def.skin = 8;
                result.Add(def);
            }

            return result;
        }
Ejemplo n.º 3
0
        private bool StoreModel(ModelDefinition def, out LOLModel model, Logger logger)
        {
            model = new LOLModel();
            model.skinNumber = def.skin;
            model.animationList = def.anmListKey.ToLower();

            // Find the skn.
            if (skns.ContainsKey(def.skn))
            {
                model.skn = skns[def.skn];
            }
            else
            {
                logger.Error("Unable to find skn file: " + def.skn);
                return false;
            }

            // Find the skl.
            if (skls.ContainsKey(def.skl))
            {
                model.skl = skls[def.skl];
            }
            else
            {
                logger.Error("Unable to find skl file: " + def.skl);
                return false;
            }

            // Find the texture.
            if (textures.ContainsKey(def.tex))
            {
                model.texture = textures[def.tex];
            }
            else
            {
                logger.Error("Unable to find texture file: " + def.tex);
                return false;
            }

            return true;
        }