Esempio n. 1
0
        void drawCrewList()
        {
            if (crewList == null)
            {
                return;
            }
            else if (crewList.Count == 0)
            {
                return;
            }

            int count = crewList.Count;

            GUILayout.BeginVertical();

            crewListScrollPos = GUILayout.BeginScrollView(crewListScrollPos, crewPanelWidth);

            for (int index = 0; index < count; index++)
            {
                if (GUILayout.Button(crewList[index].name))
                {
                    selectedCrew  = crewList[index];
                    selectedCombo = suitCombos.GetCombo(selectedCrew.ComboId);
                    updateSuitCombos();
                }
            }

            GUILayout.EndScrollView();
            GUILayout.EndVertical();
        }
Esempio n. 2
0
        public override void SetVisible(bool newValue)
        {
            base.SetVisible(newValue);

            if (newValue)
            {
                // Get the suit combos
                suitCombos = GameDatabase.Instance.GetComponent <SuitCombos>();
                List <SuitCombo> maleSuits   = new List <SuitCombo>();
                List <SuitCombo> femaleSuits = new List <SuitCombo>();

                // Get stock suits
                SuitCombo suitCombo;
                int       count = suitCombos.StockCombos.Count;
                for (int index = 0; index < count; index++)
                {
                    suitCombo = suitCombos.StockCombos[index];
                    if (suitCombo.gender.ToLower() == "male")
                    {
                        maleSuits.Add(suitCombo);
                    }
                    else
                    {
                        femaleSuits.Add(suitCombo);
                    }
                }

                // Get extra suits
                count = suitCombos.ExtraCombos.Count;
                for (int index = 0; index < count; index++)
                {
                    suitCombo = suitCombos.ExtraCombos[index];
                    if (suitCombo.gender.ToLower() == "male")
                    {
                        maleSuits.Add(suitCombo);
                    }
                    else
                    {
                        femaleSuits.Add(suitCombo);
                    }
                }
                maleSuitCombos   = maleSuits.ToArray();
                femaleSuitCombos = femaleSuits.ToArray();

                // Get wardrobe icons
                getWardrobeIcons();

                for (int index = 0; index < maleSuitCombos.Length; index++)
                {
                    Debug.Log("[WBIWardrobeGUI] - " + maleSuitCombos[index].name + " " + Localizer.Format(maleSuitCombos[index].displayName));
                }

                for (int index = 0; index < femaleSuitCombos.Length; index++)
                {
                    Debug.Log("[WBIWardrobeGUI] - " + femaleSuitCombos[index].name + " " + Localizer.Format(femaleSuitCombos[index].displayName));
                }

                // Get crew list
                crewList = part.protoModuleCrew;
                if (crewList != null && crewList.Count > 0)
                {
                    selectedCrew  = crewList[0];
                    selectedCombo = suitCombos.GetCombo(selectedCrew.ComboId);
                    updateSuitCombos();
                }
            }
        }