Beispiel #1
0
        protected void setupInfoBox()
        {
            if (infoBox != null)
            {
                return;
            }

            try
            {
                getMaxTotalFuel();
                resourceBroker = new ResourceBroker();
                ResourceRatio[] inputs = inputList.ToArray();
                Color           clr;
                for (int index = 0; index < inputs.Length; index++)
                {
                    if (inputs[index].ResourceName == fuelGaugeResource)
                    {
                        infoBox = this.part.stackIcon.StageIcon.DisplayInfo();
                        infoBox.SetMessage(fuelGaugeResource);
                        clr   = XKCDColors.GreenYellow; //XKCDColors.BrightOlive;
                        clr.a = 0.55f;
                        infoBox.SetMsgTextColor(clr);
                        clr   = XKCDColors.Asparagus;
                        clr.a = 0.5f;
                        infoBox.SetMsgBgColor(clr);
                        infoBox.SetProgressBarBgColor(clr);
                        infoBox.Collapse();
                        break;
                    }
                }
            }
            catch { }
        }
        public void Expand(bool isOn)
        {
            display = isOn;

            if (display)
            {
                if (!infoBar.gameObject.activeSelf)
                {
                    infoBar.Expand();
                }
            }
            else if (infoBar.gameObject.activeSelf)
            {
                infoBar.Collapse();
            }
        }
Beispiel #3
0
        public void TurnOffGenerator()
        {
            turbineState   = ETurbineStates.SpoolingDown;
            turbineStateID = (int)turbineState;
            if (!string.IsNullOrEmpty(stopEffect))
            {
                this.part.Effect(stopEffect, 1.0f);
            }

            //Clear info box
            if (infoBox != null)
            {
                infoBox.Collapse();
            }

            setupGUI();
        }