Esempio n. 1
0
        private void StatScreen()
        {
            _scrollPos = GUILayout.BeginScrollView(_scrollPos, _scrollStyle, GUILayout.Width(680), GUILayout.Height(380));
            GUILayout.BeginVertical();

            GUILayout.BeginHorizontal();
            GUILayout.Label(String.Format("Body Name"), _labelStyle, GUILayout.Width(135));
            GUILayout.Label(String.Format("Geology"), _labelStyle, GUILayout.Width(80));
            GUILayout.Label(String.Format("Botany"), _labelStyle, GUILayout.Width(80));
            GUILayout.Label(String.Format("Kolonization"), _labelStyle, GUILayout.Width(80));
            GUILayout.EndHorizontal();

            var focusedPlanet = GetFocusedPlanet();
            var planetList    = KolonizationManager.Instance.KolonizationInfo.Select(p => p.BodyIndex).Distinct().OrderByDescending(pId => pId == focusedPlanet);

            foreach (var p in planetList)
            {
                var body = FlightGlobals.Bodies[p];
                var geo  = KolonizationManager.GetGeologyResearchBonus(p);
                var kol  = KolonizationManager.GetKolonizationResearchBonus(p);
                var bot  = KolonizationManager.GetBotanyResearchBonus(p);
                GUILayout.BeginHorizontal();
                GUILayout.Label(String.Format("<color=#FFFFFF>{0}</color>", body.bodyName), _labelStyle, GUILayout.Width(135));
                GUILayout.Label(String.Format("<color=#FFD900>{0:n3}%</color>", geo * 100d), _labelStyle, GUILayout.Width(80));
                GUILayout.Label(String.Format("<color=#FFD900>{0:n3}%</color>", bot * 100d), _labelStyle, GUILayout.Width(80));
                GUILayout.Label(String.Format("<color=#FFD900>{0:n3}%</color>", kol * 100d), _labelStyle, GUILayout.Width(80));
                GUILayout.EndHorizontal();
            }

            GUILayout.EndVertical();
            GUILayout.EndScrollView();
        }
Esempio n. 2
0
        private float GetPlanetaryBonus()
        {
            var bodyId = vessel.mainBody.flightGlobalsIndex;

            switch (BonusEffect)
            {
            case "RepBoost":
                return(KolonizationManager.GetKolonizationResearchBonus(bodyId));

            case "ScienceBoost":
                return(KolonizationManager.GetBotanyResearchBonus(bodyId));

            default:
                return(KolonizationManager.GetGeologyResearchBonus(bodyId));
            }
        }
Esempio n. 3
0
        private float GetPlanetaryBonus()
        {
            var bodyId = vessel.mainBody.flightGlobalsIndex;

            if (BonusEffect == "RepBoost")
            {
                return(KolonizationManager.GetKolonizationResearchBonus(bodyId));
            }
            else if (BonusEffect == "ScienceBoost")
            {
                return(KolonizationManager.GetBotanyResearchBonus(bodyId));
            }
            else
            {
                return(KolonizationManager.GetGeologyResearchBonus(bodyId));
            }
        }