Example #1
0
        private void Start()
        {
            //Update suits
            defaultSuit = SetDefaultSuit(HighLogic.CurrentGame.Parameters.CustomParams <StripeSettings>().DefaultSuit);
            veteranSuit = SetDefaultSuit(HighLogic.CurrentGame.Parameters.CustomParams <StripeSettings>().VeteranSuit);
            Debug.Log("[EarnYourStripes] Set suits: Default: " + defaultSuit + " Veteran: " + veteranSuit);
            //Remove veteranhood from Kerbals who don't deserve it.
            List <ProtoCrewMember> crewMembers = HighLogic.CurrentGame.CrewRoster.Crew.ToList();

            for (int i = 0; i < crewMembers.Count; i++)
            {
                ProtoCrewMember p  = crewMembers.ElementAt(i);
                StripyKerbal    sk = trackedCrew[p.name];
                if (StripHonours(p))
                {
                    p.veteran = sk.Promoted;
                    Debug.Log("[EarnYourStripes]: StripHonours for " + p.name + " Veteran: " + p.veteran);
                }

                if (sk.SuitSet)
                {
                    continue;
                }
                p.suit = GetSuit(p);
                Debug.Log("[EarnYourStripes]: Set Default Suit for " + p.name + " - " + p.suit);
                sk.SuitSet = true;
            }
        }
Example #2
0
        private void OnCrewHire(ProtoCrewMember p, int numberOfEmployees)
        {
            p.suit = GetSuit(p);
            StripyKerbal sk = new StripyKerbal(p);

            trackedCrew.Add(p.name, sk);
            sk.SuitSet = true;
        }
Example #3
0
 public void OnSave(ConfigNode saveNode)
 {
     for (int i = 0; i < trackedCrew.Count; i++)
     {
         StripyKerbal s = trackedCrew.ElementAt(i).Value;
         s.OnSave(saveNode);
     }
 }