diff --git a/.vs/KerbalWeatherProject/v16/.suo b/.vs/KerbalWeatherProject/v16/.suo index a78b250..b17c53a 100644 Binary files a/.vs/KerbalWeatherProject/v16/.suo and b/.vs/KerbalWeatherProject/v16/.suo differ diff --git a/GameData/KerbalWeatherProject/KerbalWeatherProject.dll b/GameData/KerbalWeatherProject/KerbalWeatherProject.dll deleted file mode 100644 index 931417e..0000000 Binary files a/GameData/KerbalWeatherProject/KerbalWeatherProject.dll and /dev/null differ diff --git a/GameData/KerbalWeatherProject_v1.0.2.zip b/GameData/KerbalWeatherProject_v1.0.3.zip similarity index 99% rename from GameData/KerbalWeatherProject_v1.0.2.zip rename to GameData/KerbalWeatherProject_v1.0.3.zip index 196304b..9fe717a 100644 Binary files a/GameData/KerbalWeatherProject_v1.0.2.zip and b/GameData/KerbalWeatherProject_v1.0.3.zip differ diff --git a/GameData/KerbalWeatherProject/Binary/Climatology/height.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Climatology/height.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Climatology/height.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Climatology/height.bin diff --git a/GameData/KerbalWeatherProject/Binary/Climatology/latitude.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Climatology/latitude.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Climatology/latitude.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Climatology/latitude.bin diff --git a/GameData/KerbalWeatherProject/Binary/Climatology/longitude.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Climatology/longitude.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Climatology/longitude.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Climatology/longitude.bin diff --git a/GameData/KerbalWeatherProject/Binary/Climatology/time.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Climatology/time.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Climatology/time.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Climatology/time.bin diff --git a/GameData/KerbalWeatherProject/Binary/Climatology/year_surface_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Climatology/year_surface_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Climatology/year_surface_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Climatology/year_surface_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Climatology/year_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Climatology/year_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Climatology/year_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Climatology/year_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/BKN_surface_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/BKN_surface_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/BKN_surface_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/BKN_surface_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/BKN_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/BKN_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/BKN_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/BKN_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/CKR_surface_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/CKR_surface_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/CKR_surface_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/CKR_surface_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/CKR_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/CKR_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/CKR_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/CKR_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/DLS_surface_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/DLS_surface_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/DLS_surface_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/DLS_surface_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/DLS_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/DLS_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/DLS_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/DLS_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/KAT_surface_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/KAT_surface_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/KAT_surface_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/KAT_surface_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/KAT_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/KAT_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/KAT_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/KAT_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/KHV_surface_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/KHV_surface_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/KHV_surface_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/KHV_surface_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/KHV_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/KHV_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/KHV_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/KHV_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/KRS_surface_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/KRS_surface_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/KRS_surface_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/KRS_surface_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/KRS_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/KRS_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/KRS_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/KRS_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/KSC_surface_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/KSC_surface_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/KSC_surface_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/KSC_surface_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/KSC_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/KSC_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/KSC_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/KSC_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/SLK_surface_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/SLK_surface_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/SLK_surface_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/SLK_surface_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/SLK_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/SLK_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/SLK_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/SLK_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/WLS_surface_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/WLS_surface_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/WLS_surface_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/WLS_surface_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/WLS_wx.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/WLS_wx.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/WLS_wx.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/WLS_wx.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/height.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/height.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/height.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/height.bin diff --git a/GameData/KerbalWeatherProject/Binary/Point/time.bin b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/time.bin similarity index 100% rename from GameData/KerbalWeatherProject/Binary/Point/time.bin rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Binary/Point/time.bin diff --git a/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/KerbalWeatherProject.dll b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/KerbalWeatherProject.dll new file mode 100644 index 0000000..63ea85f Binary files /dev/null and b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/KerbalWeatherProject.dll differ diff --git a/GameData/KerbalWeatherProject/Localization/en-us.cfg b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Localization/en-us.cfg similarity index 100% rename from GameData/KerbalWeatherProject/Localization/en-us.cfg rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Localization/en-us.cfg diff --git a/GameData/KerbalWeatherProject/Textures/KWP_icon_large.png b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Textures/KWP_icon_large.png similarity index 100% rename from GameData/KerbalWeatherProject/Textures/KWP_icon_large.png rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Textures/KWP_icon_large.png diff --git a/GameData/KerbalWeatherProject/Textures/KWP_icon_small.png b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Textures/KWP_icon_small.png similarity index 100% rename from GameData/KerbalWeatherProject/Textures/KWP_icon_small.png rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Textures/KWP_icon_small.png diff --git a/GameData/KerbalWeatherProject/Textures/KWP_minimal_large.png b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Textures/KWP_minimal_large.png similarity index 100% rename from GameData/KerbalWeatherProject/Textures/KWP_minimal_large.png rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Textures/KWP_minimal_large.png diff --git a/GameData/KerbalWeatherProject/Textures/KWP_minimal_small.png b/GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Textures/KWP_minimal_small.png similarity index 100% rename from GameData/KerbalWeatherProject/Textures/KWP_minimal_small.png rename to GameData/KerbalWeatherProject_v1.0.3/KerbalWeatherProject/Textures/KWP_minimal_small.png diff --git a/KerbalWeatherProject/KerbalWxClimo.cs b/KerbalWeatherProject/KerbalWxClimo.cs index 0e35ee2..28a52fc 100644 --- a/KerbalWeatherProject/KerbalWxClimo.cs +++ b/KerbalWeatherProject/KerbalWxClimo.cs @@ -43,9 +43,6 @@ public bool CheckFAR() //Define type methods Type WindFunction2 = null; Type FARAtm = null; - Type PresFunction = typeof(PropertyDelegate); - Type TempFunction = typeof(PropertyDelegate); - Type WindFunction = typeof(WindDelegate); foreach (var assembly in AssemblyLoader.loadedAssemblies) { @@ -108,13 +105,16 @@ public bool CheckFAR() } // Set FAR Atmosphere functions - var del1 = Delegate.CreateDelegate(WindFunction, this, typeof(KerbalWxClimo).GetMethod("GetTheWind"), true); // typeof(KerbalWxPoint).GetMethod("GetTheWindPoint"), true); //Util.Log("del1: " + del1); + WindDelegate del1 = GetTheWind; + //var del1 = Delegate.CreateDelegate(WindFunction, this, typeof(KerbalWxClimo).GetMethod("GetTheWind"), true); // typeof(KerbalWxPoint).GetMethod("GetTheWindPoint"), true); //Util.Log("del1: " + del1); SetWindFunction.Invoke(null, new object[] { del1 }); - var del2 = Delegate.CreateDelegate(TempFunction, this, typeof(KerbalWxClimo).GetMethod("GetTheTemperature"), true); // typeof(KerbalWxPoint).GetMethod("GetTheWindPoint"), true); + PropertyDelegate del2 = GetTheTemperature; + //var del2 = Delegate.CreateDelegate(TempFunction, this, typeof(KerbalWxClimo).GetMethod("GetTheTemperature"), true); // typeof(KerbalWxPoint).GetMethod("GetTheWindPoint"), true); SetTempFunction.Invoke(null, new object[] { del2 }); - var del3 = Delegate.CreateDelegate(PresFunction, this, typeof(KerbalWxClimo).GetMethod("GetThePressure"), true); // typeof(KerbalWxPoint).GetMethod("GetTheWindPoint"), true); + PropertyDelegate del3 = GetThePressure; + //var del3 = Delegate.CreateDelegate(PresFunction, this, typeof(KerbalWxClimo).GetMethod("GetThePressure"), true); // typeof(KerbalWxPoint).GetMethod("GetTheWindPoint"), true); SetPresFunction.Invoke(null, new object[] { del3 }); //Util.Log("SetWindFunc: " + SetWindFunction); diff --git a/KerbalWeatherProject/KerbalWxPoint.cs b/KerbalWeatherProject/KerbalWxPoint.cs index 2ccc790..1449ec6 100644 --- a/KerbalWeatherProject/KerbalWxPoint.cs +++ b/KerbalWeatherProject/KerbalWxPoint.cs @@ -49,9 +49,6 @@ public bool CheckFAR() //Define type methods Type WindFunction2 = null; Type FARAtm = null; - Type PresFunction = typeof(PropertyDelegate); - Type TempFunction = typeof(PropertyDelegate); - Type WindFunction = typeof(WindDelegate); foreach (var assembly in AssemblyLoader.loadedAssemblies) { @@ -94,7 +91,7 @@ public bool CheckFAR() return false; } //Set FARWind function - var del = Delegate.CreateDelegate(WindFunction2, this, typeof(KerbalWxClimo).GetMethod("GetTheWind"), true); + var del = Delegate.CreateDelegate(WindFunction2, this, typeof(KerbalWxPoint).GetMethod("GetTheWind"), true); SetWindFunction.Invoke(null, new object[] { del }); //Util.Log("SetWindFunc: " + SetWindFunction); @@ -114,16 +111,14 @@ public bool CheckFAR() } // Set FAR Atmosphere functions - var del1 = Delegate.CreateDelegate(WindFunction, this, typeof(KerbalWxClimo).GetMethod("GetTheWind"), true); // typeof(KerbalWxPoint).GetMethod("GetTheWindPoint"), true); //Util.Log("del1: " + del1); + WindDelegate del1 = GetTheWind; SetWindFunction.Invoke(null, new object[] { del1 }); - var del2 = Delegate.CreateDelegate(TempFunction, this, typeof(KerbalWxClimo).GetMethod("GetTheTemperature"), true); // typeof(KerbalWxPoint).GetMethod("GetTheWindPoint"), true); + PropertyDelegate del2 = GetTheTemperature; SetTempFunction.Invoke(null, new object[] { del2 }); - var del3 = Delegate.CreateDelegate(PresFunction, this, typeof(KerbalWxClimo).GetMethod("GetThePressure"), true); // typeof(KerbalWxPoint).GetMethod("GetTheWindPoint"), true); + PropertyDelegate del3 = GetThePressure; SetPresFunction.Invoke(null, new object[] { del3 }); - - //Util.Log("SetWindFunc: " + SetWindFunction); } return true; // jump out } diff --git a/KerbalWeatherProject/Settings.cs b/KerbalWeatherProject/Settings.cs index e213bec..f79d81a 100644 --- a/KerbalWeatherProject/Settings.cs +++ b/KerbalWeatherProject/Settings.cs @@ -40,6 +40,20 @@ public class KerbalWxCustomParams : GameParameters.CustomParameterNode toolTip = "#autoLOC_024")] public bool allow_aero = true; + public override void SetDifficultyPreset(GameParameters.Preset preset) + { + switch (preset) + { + case GameParameters.Preset.Easy: + break; + case GameParameters.Preset.Normal: + break; + case GameParameters.Preset.Moderate: + break; + case GameParameters.Preset.Hard: + break; + } + } //Switch between climatology and point forecast booleans (only one can be selected at a time) public override bool Enabled(MemberInfo member, GameParameters parameters) @@ -102,6 +116,21 @@ public class KerbalWxCustomParams_Sec2 : GameParameters.CustomParameterNode public bool disable_surface_wind = false; + public override void SetDifficultyPreset(GameParameters.Preset preset) + { + switch (preset) + { + case GameParameters.Preset.Easy: + break; + case GameParameters.Preset.Normal: + break; + case GameParameters.Preset.Moderate: + break; + case GameParameters.Preset.Hard: + break; + } + } + //Switch between wind profile booleans (only one can be selected at a time) public override bool Enabled(MemberInfo member, GameParameters parameters) { @@ -171,6 +200,21 @@ public class KerbalWxCustomParams_Sec3 : GameParameters.CustomParameterNode public string precipunit = "mm"; + public override void SetDifficultyPreset(GameParameters.Preset preset) + { + switch (preset) + { + case GameParameters.Preset.Easy: + break; + case GameParameters.Preset.Normal: + break; + case GameParameters.Preset.Moderate: + break; + case GameParameters.Preset.Hard: + break; + } + } + //Switch between wind profile booleans (only one can be selected at a time) public override bool Enabled(MemberInfo member, GameParameters parameters) { diff --git a/KerbalWeatherProject/WxUnityGUI.cs b/KerbalWeatherProject/WxUnityGUI.cs index e54dc01..bcd7759 100644 --- a/KerbalWeatherProject/WxUnityGUI.cs +++ b/KerbalWeatherProject/WxUnityGUI.cs @@ -21,9 +21,6 @@ public class WxUnityGUI : MonoBehaviour public KerbalWxClimo _kwx_climo; public KerbalWxPoint _kwx_point; - //Initialize wind vector - Vector3d kwind; - //Initialize toolbar controler private ToolbarControl toolbarController; private bool toolbarButtonAdded = false; @@ -173,10 +170,6 @@ void Start() //Check to see if weather is enabled //Util.Log("Wx Enabled, " + wx_enabled.ToString()); Util.CacheKWPLocalization(); - //Initialize wind vector - kwind.x = 0.0f; - kwind.y = 0.0f; - kwind.z = 0.0f; //Initialize variable lists for (int i = 0; i < 6; i++) @@ -217,22 +210,42 @@ void Update() } void FixedUpdate() { - if (Util.use_climo) - { - //Retrieve climatological data - kwind = _kwx_climo.get3DWind(); - vel_list = _kwx_climo.getAero(); - wx_list3d = _kwx_climo.getWx3D(); - wx_list2d = _kwx_climo.getWx2D(); - } - else if (Util.use_point) + if (!gui_removed) { - //Retrieve point forecast data - lsite = Util.get_last_lsite_short(); - kwind = _kwx_point.get3DWind(); - vel_list = _kwx_point.getAero(); - wx_list3d = _kwx_point.getWx3D(); - wx_list2d = _kwx_point.getWx2D(); + if (Util.use_climo) + { + //Retrieve climatological data + vel_list = _kwx_climo.getAero(); + if (showAmbient) + { + wx_list3d = _kwx_climo.getWx3D(); + } + if (showSfc || showSat) + { + wx_list2d = _kwx_climo.getWx2D(); + } + } + else if (Util.use_point) + { + //Retrieve point forecast data + lsite = Util.get_last_lsite_short(); + if (showVelocity) + { + vel_list = _kwx_point.getAero(); + } + if (showWind || showWindRelative || showAmbient) + { + wx_list3d = _kwx_point.getWx3D(); + } + if (showSfc || showSat) + { + wx_list2d = _kwx_point.getWx2D(); + } + } + if (showAero) + { + aero_sdata = GetAeroStats(); + } } //Check to see if outside of Kerbin's SOI @@ -254,7 +267,6 @@ void FixedUpdate() gui_removed = false; } } - aero_sdata = GetAeroStats(); } Util.aero_stats GetAeroStats() @@ -347,8 +359,6 @@ void OnGUI() } } - - //Draw GUI public void DrawWindow(int windowID) { @@ -432,7 +442,7 @@ public void DrawWindow(int windowID) windowPos0.width = xwidth; windowPos0.height = yheight; showPos = !showPos; - OnGUI(); + //OnGUI(); windowPos = windowPos0; } @@ -443,7 +453,7 @@ public void DrawWindow(int windowID) windowPos0.width = xwidth; windowPos0.height = yheight; showPos = !showPos; //Set showPos false on update (now that UI has been resized) - OnGUI(); + //OnGUI(); windowPos = windowPos0; } @@ -462,7 +472,7 @@ public void DrawWindow(int windowID) windowPos0.width = xwidth; windowPos0.height = yheight; showPos = true; //Set showPos to true to fill in GUI when switching scenes (set showPos false on update) - OnGUI(); + //OnGUI(); windowPos = windowPos0; } inspace = false; @@ -474,7 +484,7 @@ public void DrawWindow(int windowID) windowPos0.width = xwidth; windowPos0.height = yheight; showVelocity = !showVelocity; - OnGUI(); + //OnGUI(); windowPos = windowPos0; } //Add wind info button @@ -484,7 +494,7 @@ public void DrawWindow(int windowID) windowPos0.width = xwidth; windowPos0.height = yheight; showWind = !showWind; - OnGUI(); + //OnGUI(); windowPos = windowPos0; } //Add button for cross/headwind info @@ -494,7 +504,7 @@ public void DrawWindow(int windowID) windowPos0.width = xwidth; windowPos0.height = yheight; showWindRelative = !showWindRelative; - OnGUI(); + //OnGUI(); windowPos = windowPos0; } //Add button to overlay ambient environmental data @@ -504,7 +514,7 @@ public void DrawWindow(int windowID) windowPos0.width = xwidth; windowPos0.height = yheight; showAmbient = !showAmbient; - OnGUI(); + //OnGUI(); windowPos = windowPos0; } //Add button for aero data (adapted from AeroGUI) @@ -514,7 +524,7 @@ public void DrawWindow(int windowID) windowPos0.width = xwidth; windowPos0.height = yheight; showAero = !showAero; - OnGUI(); + //OnGUI(); windowPos = windowPos0; } GUILayout.EndHorizontal(); @@ -531,7 +541,7 @@ public void DrawWindow(int windowID) windowPos0.width = xwidth; windowPos0.height = yheight; showPos = true; //Set showPos to true to fill in GUI when switching scenes (set showPos false on update) - OnGUI(); + //OnGUI(); windowPos = windowPos0; } inspace = true; @@ -543,7 +553,7 @@ public void DrawWindow(int windowID) windowPos0.width = xwidth; windowPos0.height = yheight; showSfc = !showSfc; - OnGUI(); + //OnGUI(); windowPos = windowPos0; } //Add button to display satellite meteorological data (from space) @@ -553,7 +563,7 @@ public void DrawWindow(int windowID) windowPos0.width = xwidth; windowPos0.height = yheight; showSat = !showSat; - OnGUI(); + //OnGUI(); windowPos = windowPos0; } GUILayout.EndHorizontal(); @@ -567,18 +577,8 @@ public void DrawWindow(int windowID) if (HighLogic.LoadedSceneIsFlight) { - //If weather is not enabled set wind to zero - if (!Util.wx_enabled) - { - kwind = Vector3.zero; - /*for (int v = 0; v < vel_list.Count; v++) - { - vel_list[v] = 0; - }*/ - } - //Convert wind components to wind direction - int wdir2 = (int)Math.Round(((180.0 / Math.PI) * Math.Atan2(-1.0 * kwind.z, -1.0 * kwind.x)), 0); // Direction wind is blowing from. + int wdir2 = (int)Math.Round(((180.0 / Math.PI) * Math.Atan2(-1.0 * wx_list3d[1], -1.0 * wx_list3d[0])), 0); // Direction wind is blowing from. if (wdir2 < 0) { wdir2 += 360; @@ -593,7 +593,7 @@ public void DrawWindow(int windowID) //Get cardinal wind direction from direction in degrees string wdir_str = Util.get_wind_card(wdir2, wstr); //Calculate wind speed - double wspd = Math.Sqrt(Math.Pow(kwind.x, 2) + Math.Pow(kwind.z, 2)); + double wspd = Math.Sqrt(Math.Pow(wx_list3d[0], 2) + Math.Pow(wx_list3d[1], 2)); //Position text biome_txt = Util.KWPTags["#autoLOC_biome"] + ": " + bname; @@ -602,7 +602,7 @@ public void DrawWindow(int windowID) ter_txt = string.Format("{0:F2} {1}", ter_height, Localizer.Format("m")); //Wind text formatting - wwind_txt = string.Format("{0:F2} {1}", kwind.y * 1000.0, Localizer.Format("mm/s")); + wwind_txt = string.Format("{0:F2} {1}", wx_list3d[2] * 1000.0, Localizer.Format("mm/s")); wspd_txt = string.Format("{0:F2} {1}", Util.convert_wspeed(wspd, wind_unit), Localizer.Format(wind_unit)); wdir_txt = string.Format("{0:F1} {1}", wdir2, Localizer.Format("°") + "(" + wdir_str + ")"); wdir_txt = string.Format("{0:F1} {1}", wdir2, Localizer.Format("°")); diff --git a/KerbalWeatherProject/bin/Debug/KerbalWeatherProject.dll b/KerbalWeatherProject/bin/Debug/KerbalWeatherProject.dll index 931417e..63ea85f 100644 Binary files a/KerbalWeatherProject/bin/Debug/KerbalWeatherProject.dll and b/KerbalWeatherProject/bin/Debug/KerbalWeatherProject.dll differ diff --git a/KerbalWeatherProject/bin/Debug/KerbalWeatherProject.pdb b/KerbalWeatherProject/bin/Debug/KerbalWeatherProject.pdb index 095ab2a..e7504aa 100644 Binary files a/KerbalWeatherProject/bin/Debug/KerbalWeatherProject.pdb and b/KerbalWeatherProject/bin/Debug/KerbalWeatherProject.pdb differ diff --git a/KerbalWeatherProject/obj/Debug/KerbalWeatherProject.csproj.FileListAbsolute.txt b/KerbalWeatherProject/obj/Debug/KerbalWeatherProject.csproj.FileListAbsolute.txt index 547e399..edbd1f5 100644 --- a/KerbalWeatherProject/obj/Debug/KerbalWeatherProject.csproj.FileListAbsolute.txt +++ b/KerbalWeatherProject/obj/Debug/KerbalWeatherProject.csproj.FileListAbsolute.txt @@ -213,4 +213,3 @@ C:\Users\Conor M\source\repos\KerbalWeatherProject-Release\KerbalWeatherProject\ C:\Users\Conor M\source\repos\KerbalWeatherProject-Release\KerbalWeatherProject\obj\Debug\KerbalWeatherProject.csproj.CopyComplete C:\Users\Conor M\source\repos\KerbalWeatherProject-Release\KerbalWeatherProject\obj\Debug\KerbalWeatherProject.dll C:\Users\Conor M\source\repos\KerbalWeatherProject-Release\KerbalWeatherProject\obj\Debug\KerbalWeatherProject.pdb -C:\Users\Conor M\source\repos\KerbalWeatherProject-Release\KerbalWeatherProject\obj\Debug\KerbalWeatherProject.csprojAssemblyReference.cache diff --git a/KerbalWeatherProject/obj/Debug/KerbalWeatherProject.csprojAssemblyReference.cache b/KerbalWeatherProject/obj/Debug/KerbalWeatherProject.csprojAssemblyReference.cache deleted file mode 100644 index 9e6f9d2..0000000 Binary files a/KerbalWeatherProject/obj/Debug/KerbalWeatherProject.csprojAssemblyReference.cache and /dev/null differ diff --git a/KerbalWeatherProject/obj/Debug/KerbalWeatherProject.dll b/KerbalWeatherProject/obj/Debug/KerbalWeatherProject.dll index 931417e..63ea85f 100644 Binary files a/KerbalWeatherProject/obj/Debug/KerbalWeatherProject.dll and b/KerbalWeatherProject/obj/Debug/KerbalWeatherProject.dll differ diff --git a/KerbalWeatherProject/obj/Debug/KerbalWeatherProject.pdb b/KerbalWeatherProject/obj/Debug/KerbalWeatherProject.pdb index 095ab2a..e7504aa 100644 Binary files a/KerbalWeatherProject/obj/Debug/KerbalWeatherProject.pdb and b/KerbalWeatherProject/obj/Debug/KerbalWeatherProject.pdb differ