示例#1
0
        public override void OnStart(StartState state)
        {
            base.OnStart(state);

            // Setup GUI
            Fields["animationThrottle"].guiActive       = debugMode;
            Fields["animationThrottle"].guiActiveEditor = debugMode;

            // Get animated textures
            animatedTextures = getAnimatedTextureModules();

            // Get Waterfall module (if any)
            waterfallFXModule = WFModuleWaterfallFX.GetWaterfallModule(this.part);
        }
示例#2
0
        public override void OnStart(StartState state)
        {
            base.OnStart(state);
            if (!HighLogic.LoadedSceneIsFlight)
            {
                return;
            }

            // Get Waterfall module (if any)
            waterfallFXModule = WFModuleWaterfallFX.GetWaterfallModule(this.part);

            // Handle visitation
            if (!hasBeenVisited)
            {
                hasBeenVisited = true;
                unlockTechNode();
            }
        }
示例#3
0
        public static void Init()
        {
            //Get the assembly
            foreach (AssemblyLoader.LoadedAssembly loadedAssembly in AssemblyLoader.loadedAssemblies)
            {
                if (loadedAssembly.name == "Waterfall")
                {
                    waterfallAssembly = loadedAssembly.assembly;
                    break;
                }
            }
            if (waterfallAssembly == null)
            {
                return;
            }

            //Now init the classes
            WFModuleWaterfallFX.InitClass(waterfallAssembly);
        }
示例#4
0
        /// <summary>
        /// Attempts to obtain the Waterfall FX module from the supplied part.
        /// </summary>
        /// <param name="part">A Part that might contain a waterfall fx module</param>
        /// <returns>A WFModuleWaterfallFX if the part has a waterfall module, or null if not.</returns>
        public static WFModuleWaterfallFX GetWaterfallModule(Part part)
        {
            {
                int        count = part.Modules.Count;
                PartModule module;

                for (int index = 0; index < count; index++)
                {
                    module = part.Modules[index];
                    if (module.moduleName == "ModuleWaterfallFX")
                    {
                        WFModuleWaterfallFX waterfallFXModule = new WFModuleWaterfallFX(module);
                        return(waterfallFXModule);
                    }
                }
            }

            return(null);
        }
示例#5
0
        public override void OnStart(StartState state)
        {
            base.OnStart(state);
            loadCurve(warpCurve, "warpCurve");
            loadCurve(planetarySOISpeedCurve, "planetarySOISpeedCurve");

            ConfigNode defaultCurve = new ConfigNode("waterfallWarpEffectsCurve");

            defaultCurve.AddValue("key", "0 0");
            defaultCurve.AddValue("key", "1 0.5");
            defaultCurve.AddValue("key", "1.5 1");
            loadCurve(waterfallWarpEffectsCurve, "waterfallWarpEffectsCurve", defaultCurve);

            warpEngines       = new List <WBIWarpEngine>();
            warpCoils         = new List <WBIWarpCoil>();
            waterfallFXModule = WFModuleWaterfallFX.GetWaterfallModule(this.part);
            getAnimatedWarpEngineTextures();

            // Optional bow shock transform.
            if (!string.IsNullOrEmpty(bowShockTransformName))
            {
                bowShockTransform = this.part.FindModelTransform(bowShockTransformName);
            }

            // GUI setup
            Fields["realIsp"].guiActive     = false;
            Fields["finalThrust"].guiActive = false;
            Fields["fuelFlowGui"].guiActive = false;

            // Debug fields
            Fields["isInSpace"].guiActive                = debugEnabled;
            Fields["meetsWarpAltitude"].guiActive        = debugEnabled;
            Fields["hasWarpCapacity"].guiActive          = debugEnabled;
            Fields["applyWarpTranslation"].guiActive     = debugEnabled;
            Fields["totalDisplacementImpulse"].guiActive = debugEnabled;
            Fields["totalWarpCapacity"].guiActive        = debugEnabled;
            Fields["minPlanetaryRadius"].guiActive       = debugEnabled;
            Fields["effectiveWarpCapacity"].guiActive    = debugEnabled;
            Fields["maxWarpSpeed"].guiActive             = debugEnabled;
            Fields["warpDistance"].guiActive             = debugEnabled;
            Fields["effectsThrottle"].guiActive          = debugEnabled;
        }
示例#6
0
        public override void OnStart(StartState state)
        {
            base.OnStart(state);
            if (HighLogic.LoadedSceneIsEditor)
            {
                this.DisableModule();
            }
            else if (HighLogic.LoadedSceneIsFlight)
            {
                this.EnableModule();
            }

            // Setup GUI
            Fields["animationThrottle"].guiActive       = debugMode;
            Fields["animationThrottle"].guiActiveEditor = debugMode;

            // Get animated textures
            animatedTextures = getAnimatedTextureModules();

            // Get Waterfall module (if any)
            waterfallFXModule = WFModuleWaterfallFX.GetWaterfallModule(this.part);
        }