public void mainWindow(int windowid) { GUILayout.BeginVertical(); if (GUILayout.Button("Overlay")) { showOverlayWindow = !showOverlayWindow; } GUILayout.Space(1); GUILayout.Space(1); if (MapOverlay.getHoverCell().HasValue) { Cell cell = MapOverlay.getHoverCell().Value; GUILayout.Label("Temperature: " + WeatherFunctions.GetCellTemperature(PD.index, currentLayer, cell) + " °K"); GUILayout.Label("Pressure: " + WeatherFunctions.GetCellPressure(PD.index, currentLayer, cell) + " Pa"); GUILayout.Label("Rel Humidity: " + WeatherFunctions.GetCellRH(PD.index, currentLayer, cell) * 100 + " %"); GUILayout.Label("Air Density: " + String.Format("{0:0.000000}", WeatherFunctions.D_Wet(PD.index, cell, WeatherFunctions.GetCellAltitude(PD.index, currentLayer, cell))) + " Kg/m³"); GUILayout.Label("wind horz: " + String.Format("{0:0.0000}", WeatherFunctions.GetCellwindH(PD.index, currentLayer, cell)) + " m/s"); GUILayout.Label("wind Dir : " + String.Format("{0:000.0}", WeatherFunctions.GetCellwindDir(PD.index, currentLayer, cell)) + " °"); GUILayout.Label("wind vert : " + String.Format("{0:+0.00000;-0.00000}", WeatherFunctions.GetCellwindV(PD.index, currentLayer, cell)) + " m/s"); GUILayout.Label("CCN : " + WeatherFunctions.GetCellCCN(PD.index, currentLayer, cell) * 100 + " %"); GUILayout.Label("Cloud water : " + WeatherFunctions.GetCellWaterContent(PD.index, currentLayer, cell) + " Kg/m³"); int Iced = Math.Sign(WeatherFunctions.GetCelldropletSize(PD.index, currentLayer, cell)); GUILayout.Label("droplet Size: " + Math.Abs(WeatherFunctions.GetCelldropletSize(PD.index, currentLayer, cell) * 1000.0f) + " mm"); GUILayout.Label("cloud thickness: " + WeatherFunctions.GetCellthickness(PD.index, currentLayer, cell) + " m " + (Iced < 0 ? "Iced" : Iced > 0 ? "Liqd" : "None")); GUILayout.Label("rain duration: " + WeatherFunctions.GetCellrainDuration(PD.index, currentLayer, cell) + " cycles"); GUILayout.Label("rain decay: " + WeatherFunctions.GetCellrainDecay(PD.index, currentLayer, cell) / 256.0f); } GUILayout.EndVertical(); GUI.DragWindow(); }
private static Color32 getCellColor(int layer, Cell cell) { double?deposit = 0; double deposit2 = 0; switch (resource.Resource) { case "Temperature": deposit = PD.LiveMap[layer][cell].temperature; break; case "Delta Temp": deposit = (WeatherSimulator.GetInitTemperature(PD, currentLayer, cell) - WeatherFunctions.GetCellTemperature(PD.index, currentLayer, cell)); break; case "Temp. Change": deposit = PD.LiveMap[layer][cell].TempChange; break; case "Pressure": deposit = PD.LiveMap[layer][cell].pressure; break; case "Pressure Delta": deposit = ((PD.LiveMap[0][cell].pressure - FlightGlobals.getStaticPressure(0, PD.body) * 1000) * PD.LiveMap[layer][cell].pressure / PD.LiveMap[0][cell].pressure + PD.LiveMap[layer][cell].flowPChange); break; case "Wind H Speed": deposit = WeatherFunctions.GetCellwindH(PD.index, layer, cell); break; case "Wind H Vector": //deposit = WeatherFunctions.GetCellwindDir(PD.index, layer, cell); deposit = PD.LiveMap[layer][cell].windVector.x; deposit2 = PD.LiveMap[layer][cell].windVector.z; break; case "Wind Vertical": deposit = PD.LiveMap[layer][cell].windVector.y; break; case "Rel. Humidity": deposit = PD.LiveMap[layer][cell].relativeHumidity; break; case "Cloud water": deposit = PD.LiveMap[layer][cell].cloud.getwaterContent(); deposit2 = WeatherFunctions.GetSunriseFactor(PD.index, cell); break; case "Geodesy": // deposit = Math.Sqrt(cell.Position.x * cell.Position.x + cell.Position.y * cell.Position.y + cell.Position.z * cell.Position.z); deposit = (cell.Position - PD.LiveSoilMap[cell].centroid).magnitude; break; case "DeltaDistanceDiff": double DDD = 0.0; double DDD2 = 0.0; int n = 0; foreach (Cell neighbor in cell.GetNeighbors(PD.gridLevel)) { double DeltaDistance = WeatherFunctions.GetDistanceBetweenCells(PD.index, cell.Position, neighbor.Position, WeatherFunctions.GetCellAltitude(PD.index, layer, cell)); DDD += DeltaDistance; DDD2 += DeltaDistance * DeltaDistance; n++; } DDD /= n; DDD2 /= n; deposit = Math.Sqrt(Math.Abs(DDD2 - DDD * DDD)) / DDD; break; } var scanned = true; var color = (revealAll ? deposit != null : scanned) ? getDepositColor(resource, deposit, deposit2) : colorUnknown; return(color); }