Ejemplo n.º 1
0
        public void overlayWindow(int windowid)
        {
            GUILayout.BeginVertical();
            if (GUILayout.Button("Show overlay"))
            {
                MapOverlay.ToggleOverlay();
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label("Opacity: ");
            //byte temp0 = 0;
            opacity          = (byte)GUILayout.HorizontalSlider(opacity, 0, 255);
            MapOverlay.alpha = opacity;
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("<"))
            {
                MapOverlay.prevResource(); RegrabVals();
            }
            GUILayout.TextField(MapOverlay.resource.Resource);
            if (GUILayout.Button(">"))
            {
                MapOverlay.nextResource(); RegrabVals();
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            minVal = GUILayout.TextField(minVal);
            maxVal = GUILayout.TextField(maxVal);
            double temp1, temp2;

            double.TryParse(maxVal, out temp1);
            double.TryParse(minVal, out temp2);
            MapOverlay.resource.MaxQuantity = temp1;
            MapOverlay.resource.MinQuantity = temp2;
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            GUILayout.Label("Layer:");
            if (GUILayout.Button("-"))
            {
                currentLayer = currentLayer > 0 ? currentLayer - 1 : 0; MapOverlay.currentLayer = currentLayer;
            }
            GUILayout.Label("" + currentLayer);
            if (GUILayout.Button("+"))
            {
                currentLayer = currentLayer == PD.LiveMap.Count + PD.LiveStratoMap.Count - 1 ? PD.LiveMap.Count + PD.LiveStratoMap.Count - 1 : currentLayer + 1; MapOverlay.currentLayer = currentLayer;
            }
            GUILayout.EndHorizontal();
            if (GUILayout.Button("Apply"))
            {
                MapOverlay.refreshCellColours();
            }
            int height = MapOverlay.getOverlayTextureScale(MapOverlay.resource.Resource).height;

            GUI.DrawTexture(new Rect(25, 192, 150, height), MapOverlay.getOverlayTextureScale(MapOverlay.resource.Resource));
            GUILayout.Label("Colour Scale");
            GUILayout.EndVertical();
            GUI.DragWindow();
        }