示例#1
0
        public void initialize()
        {
            debug = new info.FSdebugMessages(debugMode, "FSbladeLiftSurface");
            //liftTransform = part.FindModelTransform(liftTransformName);
            //referenceTransform = part.FindModelTransform(referenceTransformName);
            //debugCubeTransform = part.FindModelTransform(debugCubeName);

            liftTransform      = findTransform(liftTransformName);
            referenceTransform = findTransform(referenceTransformName);

            if (liftTransform == null)
            {
                debug.debugMessage("FSliftSurface: Can't find lift transform " + liftTransformName);
            }
            else
            {
                originalRotation = liftTransform.localRotation;
            }

            if (referenceTransform == null)
            {
                debug.debugMessage("FSliftSurface: Can't find lift transform " + liftTransformName);
            }

            //liftSurfaces = part.GetComponents<FSbladeLiftSurface>().ToList();

            initialized = true;
        }
示例#2
0
        public void initializeData()
        {
            if (!initialized)
            {
                debug = new info.FSdebugMessages(debugMode, "FSmeshSwitch");
                // you can't have fuel switching without symmetry, it breaks the editor GUI.
                if (useFuelSwitchModule)
                {
                    updateSymmetry = true;
                }

                parseObjectNames();
                fuelTankSetupList = Tools.parseIntegers(fuelTankSetups);
                objectDisplayList = Tools.parseNames(objectDisplayNames);

                if (useFuelSwitchModule)
                {
                    fuelSwitch = part.GetComponent <FSfuelSwitch>();
                    if (fuelSwitch == null)
                    {
                        useFuelSwitchModule = false;
                        debug.debugMessage("no FSfuelSwitch module found, despite useFuelSwitchModule being true");
                    }
                }
                initialized = true;
            }
        }
示例#3
0
        public override void OnStart(PartModule.StartState state)
        {
            getThrottleDelegate = getThrottle;
            debug = new info.FSdebugMessages(debugMode, "FSengine");

            this.PopulateModelTransforms();

            velocityCurve          = Firespitter.Tools.stringToFloatCurve(velocityLimit);
            atmosphericThrustCurve = Firespitter.Tools.stringToFloatCurve(atmosphericThrust);
            fuelConsumptionCurve   = Firespitter.Tools.stringToFloatCurve(fuelConsumption);
            throttleThrustCurve    = Firespitter.Tools.stringToFloatCurve(throttleThrust);
            fillResourceList(resources);
        }
示例#4
0
        //[KSPEvent(guiName = "Activate Full Sim", guiActive = true, guiActiveEditor = true)]
        //public void toggleFullSimulation()
        //{
        //    fullSimulation = !fullSimulation;

        //    setFullSimulation(fullSimulation);
        //}

        public override void OnStart(PartModule.StartState state)
        {
            base.OnStart(state);
            getThrottleDelegate = getThrottle;

            debugB = new FSdebugMessages(debugMode, "FSengineBladed");

            rotorHubTransform = part.FindModelTransform(rotorHubName);
            if (rotorHubTransform == null)
            {
                debugB.debugMessage("rotorHubTransform is null");
            }
            baseTransform = part.FindModelTransform(baseTransformName);
            if (baseTransform == null)
            {
                debugB.debugMessage("baseTransform is null");
            }

            if (HighLogic.LoadedSceneIsFlight)
            {
                setupBlades();
            }

            circumeference = span * Mathf.PI * 2f;
            bladeMidPoint  = span;
            if (propTweak != null)
            {
                circumeference *= propTweak.bladeLengthSlider;
                bladeMidPoint  *= propTweak.bladeLengthSlider;
            }

            if (HighLogic.LoadedSceneIsFlight)
            {
                flightStarted = true;
            }

            Fields["maxRPM"].guiActive            = true;
            Fields["maxRPM"].guiActiveEditor      = true;
            Fields["maxThrust"].guiActiveEditor   = false;
            Fields["maxThrottle"].guiActive       = false;
            Fields["maxThrottle"].guiActiveEditor = false;

            if (tailRotor)
            {
                Fields["useThrottleKeys"].guiActive        = false;
                Fields["useThrottleKeys"].guiActiveEditor  = false;
                Fields["useThrottleState"].guiActive       = false;
                Fields["useThrottleState"].guiActiveEditor = false;
            }
        }
示例#5
0
        public override void OnStart(PartModule.StartState state)
        {
            getThrottleDelegate = getThrottle;
            debug = new info.FSdebugMessages(debugMode, "FSengine");
            //part.stackIcon.SetIcon(DefaultIcons.LIQUID_ENGINE);
            part.stagingIcon = "LIQUID_ENGINE";
            thrustTransforms = part.FindModelTransforms(thrustTransformName);

            velocityCurve          = Firespitter.Tools.stringToFloatCurve(velocityLimit);
            atmosphericThrustCurve = Firespitter.Tools.stringToFloatCurve(atmosphericThrust);
            fuelConsumptionCurve   = Firespitter.Tools.stringToFloatCurve(fuelConsumption);
            throttleThrustCurve    = Firespitter.Tools.stringToFloatCurve(throttleThrust);
            fillResourceList(resources);
        }
示例#6
0
        public void initializeData()
        {
            if (!initialized)
            {
                debug = new info.FSdebugMessages(debugMode, "FSmeshSwitch");
                // you can't have fuel switching without symmetry, it breaks the editor GUI.
                if (useFuelSwitchModule)
                {
                    updateSymmetry = true;
                }

                parseObjectNames();
                fuelTankSetupList = Tools.parseIntegers(fuelTankSetups);
                objectDisplayList = Tools.parseNames(objectDisplayNames);

                initialized = true;
            }
        }
示例#7
0
        public override void OnStart(PartModule.StartState state)
        {
            getThrottleDelegate = getThrottle;
            debug = new info.FSdebugMessages(debugMode, "FSengine");
            //part.stackIcon.SetIcon(DefaultIcons.LIQUID_ENGINE);
            part.stagingIcon = "LIQUID_ENGINE";
            thrustTransforms = part.FindModelTransforms(thrustTransformName);

            velocityCurve = Firespitter.Tools.stringToFloatCurve(velocityLimit);
            atmosphericThrustCurve = Firespitter.Tools.stringToFloatCurve(atmosphericThrust);
            fuelConsumptionCurve = Firespitter.Tools.stringToFloatCurve(fuelConsumption);
            throttleThrustCurve = Firespitter.Tools.stringToFloatCurve(throttleThrust);
            fillResourceList(resources);
        }
        public void initialize()
        {
            debug = new info.FSdebugMessages(debugMode, "FSbladeLiftSurface");
            //liftTransform = part.FindModelTransform(liftTransformName);            
            //referenceTransform = part.FindModelTransform(referenceTransformName);
            //debugCubeTransform = part.FindModelTransform(debugCubeName);

            liftTransform = findTransform(liftTransformName);
            referenceTransform = findTransform(referenceTransformName);            

            if (liftTransform == null)
            {
                debug.debugMessage("FSliftSurface: Can't find lift transform " + liftTransformName);
            }
            else
            {
                originalRotation = liftTransform.localRotation;
            }

            if (referenceTransform == null)
            {
                debug.debugMessage("FSliftSurface: Can't find lift transform " + liftTransformName);
            }            

            //liftSurfaces = part.GetComponents<FSbladeLiftSurface>().ToList();

            initialized = true;
        }
示例#9
0
        public void initializeData()
        {
            if (!initialized)
            {
                debug = new info.FSdebugMessages(debugMode, "FSmeshSwitch");
                // you can't have fuel switching without symmetry, it breaks the editor GUI.
                if (useFuelSwitchModule) updateSymmetry = true;

                parseObjectNames();
                fuelTankSetupList = Tools.parseIntegers(fuelTankSetups);
                objectDisplayList = Tools.parseNames(objectDisplayNames);

                if (useFuelSwitchModule)
                {
                    fuelSwitch = part.GetComponent<FSfuelSwitch>();
                    if (fuelSwitch == null)
                    {
                        useFuelSwitchModule = false;
                        debug.debugMessage("no FSfuelSwitch module found, despite useFuelSwitchModule being true");
                    }
                }
                initialized = true;
            }
        }
示例#10
0
        //[KSPEvent(guiName = "Activate Full Sim", guiActive = true, guiActiveEditor = true)]
        //public void toggleFullSimulation()
        //{
        //    fullSimulation = !fullSimulation;

        //    setFullSimulation(fullSimulation);
        //}

        public override void OnStart(PartModule.StartState state)
        {
            base.OnStart(state);
            getThrottleDelegate = getThrottle;

            debugB = new FSdebugMessages(debugMode, "FSengineBladed");

            rotorHubTransform = part.FindModelTransform(rotorHubName);
            if (rotorHubTransform == null) debugB.debugMessage("rotorHubTransform is null");
            baseTransform = part.FindModelTransform(baseTransformName);
            if (baseTransform == null) debugB.debugMessage("baseTransform is null");

            if (HighLogic.LoadedSceneIsFlight)
            {
                setupBlades();
            }

            circumeference = span * Mathf.PI * 2f;
            bladeMidPoint = span;
            if (propTweak != null)
            {
                circumeference *= propTweak.bladeLengthSlider;
                bladeMidPoint *= propTweak.bladeLengthSlider;
            }

            if (HighLogic.LoadedSceneIsFlight)
                flightStarted = true;

            Fields["maxRPM"].guiActive = true;
            Fields["maxRPM"].guiActiveEditor = true;
            Fields["maxThrust"].guiActiveEditor = false;
            Fields["maxThrottle"].guiActive = false;
            Fields["maxThrottle"].guiActiveEditor = false;

            if (tailRotor)
            {
                Fields["useThrottleKeys"].guiActive = false;
                Fields["useThrottleKeys"].guiActiveEditor = false;
                Fields["useThrottleState"].guiActive = false;
                Fields["useThrottleState"].guiActiveEditor = false;
            }
        }