Пример #1
0
        public Model getHeadModel()
        {
            if (childrenIDs != null)
            {
                EntityDefinition definition = getChildDefinition();
                if (definition == null)
                {
                    return(null);
                }
                else
                {
                    return(definition.getHeadModel());
                }
            }

            if (headModelIds == null)
            {
                return(null);
            }
            bool someModelsNotCached = false;

            for (int i = 0; i < headModelIds.Length; i++)
            {
                if (!Model.isCached(headModelIds[i]))
                {
                    someModelsNotCached = true;
                }
            }

            if (someModelsNotCached)
            {
                return(null);
            }
            Model[] headModels = new Model[headModelIds.Length];
            for (int j = 0; j < headModelIds.Length; j++)
            {
                headModels[j] = Model.getModel(headModelIds[j]);
            }

            Model headModel;

            if (headModels.Length == 1)
            {
                headModel = headModels[0];
            }
            else
            {
                headModel = new Model(headModels.Length, headModels);
            }
            if (modifiedModelColours != null)
            {
                for (int c = 0; c < modifiedModelColours.Length; c++)
                {
                    headModel.recolour(modifiedModelColours[c], originalModelColours[c]);
                }
            }

            return(headModel);
        }
Пример #2
0
        public Model getHeadModel()
        {
            if (!visible)
            {
                return(null);
            }
            if (npcAppearance != null)
            {
                return(npcAppearance.getHeadModel());
            }
            bool flag = false;

            for (int i = 0; i < 12; i++)
            {
                int j = appearance[i];
                if (j >= 256 && j < 512 && !IdentityKit.cache[j - 256].headModelCached())
                {
                    flag = true;
                }
                if (j >= 512 && !ItemDefinition.getDefinition(j - 512).isDialogueModelCached(gender))
                {
                    flag = true;
                }
            }

            if (flag)
            {
                return(null);
            }
            Model[] models = new Model[12];
            int     k      = 0;

            for (int l = 0; l < 12; l++)
            {
                int i1 = appearance[l];
                if (i1 >= 256 && i1 < 512)
                {
                    Model model_1 = IdentityKit.cache[i1 - 256].getHeadModel();
                    if (model_1 != null)
                    {
                        models[k++] = model_1;
                    }
                }

                if (i1 >= 512)
                {
                    Model model_2 = ItemDefinition.getDefinition(i1 - 512).getDialogueModel(gender);
                    if (model_2 != null)
                    {
                        models[k++] = model_2;
                    }
                }
            }

            Model model = new Model(k, models);

            for (int j1 = 0; j1 < 5; j1++)
            {
                if (bodyPartColour[j1] != 0)
                {
                    model.recolour(ConstantData.GetAppearanceColor(j1, 0), ConstantData.GetAppearanceColor(j1, bodyPartColour[j1]));
                    if (j1 == 1)
                    {
                        model.recolour(ConstantData.GetBeardColor(0), ConstantData.GetBeardColor(bodyPartColour[j1]));
                    }
                }
            }

            return(model);
        }