Exemplo n.º 1
0
        public override void OnDecodeFromConfigNode()
        {
            body = FlightGlobals.Bodies.FirstOrDefault(b => b.flightGlobalsIndex == index);
            if (body != null)
            {
                name = body.name;
            }

            colorPal = SCANUtil.paletteLoader(paletteName, paletteSize);

            float tempClamp = 0;

            if (clampHeight == "Null" || clampHeight == "null" || string.IsNullOrEmpty(clampHeight))
            {
                clampTerrain = null;
            }
            else if (float.TryParse(clampHeight, out tempClamp))
            {
                clampTerrain = tempClamp;
            }
            else
            {
                clampTerrain = null;
            }

            setDefaultValues();

            SCANUtil.SCANdebugLog("SCANsat Terrain Config Decode");
            SCANUtil.SCANdebugLog("-------->Body Name             =>   {0}", name);
            SCANUtil.SCANdebugLog("-------->Body Index            =>   {0}", index);
            SCANUtil.SCANdebugLog("-------->Min Height Range      =>   {0}", minHeightRange);
            SCANUtil.SCANdebugLog("-------->Max Height Range      =>   {0}", maxHeightRange);
            SCANUtil.SCANdebugLog("-------->Clamp Height          =>   {0}", clampHeight);
            SCANUtil.SCANdebugLog("-------->Palette Name          =>   {0}", paletteName);
            SCANUtil.SCANdebugLog("-------->Palette Size          =>   {0}", paletteSize);
            SCANUtil.SCANdebugLog("-------->Palette Reverse       =>   {0}", paletteReverse);
            SCANUtil.SCANdebugLog("-------->Palette Discrete      =>   {0}", paletteDiscrete);
        }
Exemplo n.º 2
0
        /* MAP: constructor */
        internal SCANdata(CelestialBody b)
        {
            body = b;
            float?clamp = null;

            if (b.ocean)
            {
                clamp = 0;
            }

            terrainConfig = SCANcontroller.getTerrainNode(b.name);

            if (terrainConfig == null)
            {
                terrainConfig = new SCANterrainConfig(SCANconfigLoader.SCANNode.DefaultMinHeightRange, SCANconfigLoader.SCANNode.DefaultMaxHeightRange, clamp, SCANUtil.paletteLoader(SCANconfigLoader.SCANNode.DefaultPalette, 7), 7, false, false, body);
                SCANcontroller.addToTerrainConfigData(body.name, terrainConfig);
            }
        }