Пример #1
0
        public static Texture2D GetKerbalIcon(ProtoCrewMember pcm)
        {
            string type = "suit";

            switch (pcm.type)
            {
            case (ProtoCrewMember.KerbalType.Applicant):
                type = "recruit";
                break;

            case (ProtoCrewMember.KerbalType.Tourist):
                type = "tourist";
                break;

            default:
                if (pcm.rosterStatus == ProtoCrewMember.RosterStatus.Assigned && pcm.KerbalRef.InVessel.vesselType == VesselType.EVA)
                {
                    type = "eva";
                }
                else if (pcm.veteran)
                {
                    type += "_orange";
                }
                break;
            }
            string textureName = "kerbalicon_" + type + (pcm.gender == ProtoCrewMember.Gender.Female ? "_female" : string.Empty);

            string suffix = pcm.GetKerbalIconSuitSuffix();

            if (string.IsNullOrEmpty(suffix))
            {
                return(AssetBase.GetTexture(textureName));
            }
            else
            {
                return(Expansions.Missions.MissionsUtils.METexture("Kerbals/Textures/kerbalIcons/" + textureName + suffix + ".tif"));
            }
        }