Beispiel #1
0
 protected override void Start()
 {
     Visible = SCANcontroller.controller.kscMapVisible;
     if (b == null)
     {
         b = Planetarium.fetch.Home;
     }
     if (bigmap == null)
     {
         bigmap = new SCANmap(b, true);
         bigmap.setProjection((MapProjection)SCANcontroller.controller.projection);
         bigmap.setWidth(720);
     }
     currentColor  = SCANcontroller.controller.colours == 0;
     lastColor     = currentColor;
     lastResource  = SCANcontroller.controller.map_ResourceOverlay;
     WindowCaption = string.Format("Map of {0}", b.theName);
     data          = SCANUtil.getData(b);
     if (data == null)
     {
         data = new SCANdata(b);
         SCANcontroller.controller.addToBodyData(b, data);
     }
     bigmap.setBody(b);
     if (SCANconfigLoader.GlobalResource)
     {
         loadedResources = SCANcontroller.setLoadedResourceList();
     }
     TooltipsEnabled = SCANcontroller.controller.toolTips;
 }
Beispiel #2
0
 protected override void Start()
 {
     //Initialize the map object
     Visible = SCANcontroller.controller.bigMapVisible;
     if (v == null)
     {
         v = FlightGlobals.ActiveVessel;
     }
     if (b == null)
     {
         b = v.mainBody;
     }
     if (bigmap == null)
     {
         bigmap = new SCANmap(b, true);
         bigmap.setProjection((MapProjection)SCANcontroller.controller.projection);
         bigmap.setWidth(SCANcontroller.controller.map_width);
     }
     WindowRect.x  = SCANcontroller.controller.map_x;
     WindowRect.y  = SCANcontroller.controller.map_y;
     currentColor  = SCANcontroller.controller.colours == 0;
     lastColor     = currentColor;
     lastResource  = SCANcontroller.controller.map_ResourceOverlay;
     WindowCaption = string.Format("Map of {0}", b.theName);
     data          = SCANUtil.getData(b);
     if (data == null)
     {
         data = new SCANdata(b);
         SCANcontroller.controller.addToBodyData(b, data);
     }
     bigmap.setBody(b);
     if (SCANconfigLoader.GlobalResource)
     {
         loadedResources = SCANcontroller.setLoadedResourceList();
     }
     TooltipsEnabled = SCANcontroller.controller.toolTips;
 }
Beispiel #3
0
 internal List <SCANresourceGlobal> GetLoadedResourceList()
 {
     return(SCANcontroller.setLoadedResourceList());
 }
Beispiel #4
0
        protected override void Start()
        {
            if (HighLogic.LoadedScene == GameScenes.SPACECENTER || HighLogic.LoadedScene == GameScenes.TRACKSTATION)
            {
                kscMapObj = (SCANkscMap)SCANcontroller.controller.kscMap;
                if (SCANkscMap.BigMap != null)
                {
                    bigMap = SCANkscMap.BigMap;
                }
                if (kscMapObj.Data != null)
                {
                    data = kscMapObj.Data;
                }
            }
            else if (HighLogic.LoadedSceneIsFlight)
            {
                bigMapObj = (SCANBigMap)SCANcontroller.controller.BigMap;
                if (SCANBigMap.BigMap != null)
                {
                    bigMap = SCANBigMap.BigMap;
                }
                if (bigMapObj.Data != null)
                {
                    data = bigMapObj.Data;
                }
            }

            if (data == null)
            {
                data = SCANUtil.getData(Planetarium.fetch.Home);
                if (data == null)
                {
                    data = new SCANdata(Planetarium.fetch.Home);
                    SCANcontroller.controller.addToBodyData(Planetarium.fetch.Home, data);
                }
            }

            currentTerrain = new SCANterrainConfig(data.TerrainConfig);

            stockBiomes = SCANcontroller.controller.useStockBiomes;

            minTerrainSlider   = new SCANuiSlider(data.TerrainConfig.DefaultMinHeight - SCANconfigLoader.SCANNode.RangeBelowMinHeight, data.TerrainConfig.MaxTerrain - 100, data.TerrainConfig.MinTerrain, "Min: ", "m", -2);
            maxTerrainSlider   = new SCANuiSlider(data.TerrainConfig.MinTerrain + 100, data.TerrainConfig.DefaultMaxHeight + SCANconfigLoader.SCANNode.RangeAboveMaxHeight, data.TerrainConfig.MaxTerrain, "Max: ", "m", -2);
            clampTerrainSlider = new SCANuiSlider(data.TerrainConfig.MinTerrain + 10, data.TerrainConfig.MaxTerrain - 10, data.TerrainConfig.ClampTerrain ?? data.TerrainConfig.MinTerrain + 10, "Clamp: ", "m", -1);
            paletteSizeSlider  = new SCANuiSlider(3, 12, data.TerrainConfig.PalSize, "Palette Size: ", "", 0);

            slopeColorPickerLow  = new SCANuiColorPicker(SCANcontroller.controller.lowSlopeColorOne, SCANcontroller.controller.highSlopeColorOne, true);
            slopeColorPickerHigh = new SCANuiColorPicker(SCANcontroller.controller.lowSlopeColorTwo, SCANcontroller.controller.highSlopeColorTwo, true);

            slopeColorPickerLow.updateOldSwatches();
            slopeColorPickerHigh.updateOldSwatches();

            bTrans           = SCANcontroller.controller.biomeTransparency;
            biomeTransSlider = new SCANuiSlider(0, 80, bTrans, "Ter. Trans: ", "%", 0);

            biomeColorPicker = new SCANuiColorPicker(SCANcontroller.controller.lowBiomeColor, SCANcontroller.controller.highBiomeColor, true);

            biomeColorPicker.updateOldSwatches();

            if (SCANconfigLoader.GlobalResource)
            {
                loadedResources = SCANcontroller.setLoadedResourceList();
                currentResource = new SCANresourceGlobal(loadedResources[0]);
                currentResource.CurrentBodyConfig(data.Body.name);

                if (currentResource != null)
                {
                    resourceMinSlider   = new SCANuiSlider(0, currentResource.CurrentBody.MinValue - 0.1f, currentResource.CurrentBody.MinValue, "Min: ", "%", 1);
                    resourceMaxSlider   = new SCANuiSlider(currentResource.CurrentBody.MinValue + 0.1f, 100, currentResource.CurrentBody.MaxValue, "Max: ", "%", 1);
                    resourceTransSlider = new SCANuiSlider(0, 80, currentResource.Transparency, "Trans: ", "%", 0);

                    resourceColorPicker = new SCANuiColorPicker(currentResource.MinColor, currentResource.MaxColor, true);
                }
            }

            bodyIndex = data.Body.flightGlobalsIndex;

            if (windowMode > 3 || (windowMode > 2 && !SCANconfigLoader.GlobalResource))
            {
                windowMode = 0;
            }

            setSizeSlider(currentTerrain.ColorPal.kind);
        }