From edd1c07648a36008b6c36287211411cf4fe1bbb7 Mon Sep 17 00:00:00 2001 From: dlane Date: Sun, 28 May 2017 11:15:18 -0500 Subject: [PATCH] 1.3 recompile --- .../HullBreach/Plugins/HullBreach.dll | Bin 11776 -> 14336 bytes Distribution/GameData/HullBreach/settings.cfg | 10 +++ HullBreach.csproj | 26 ++---- HullBreachConfig.cs | 84 ++++++++++++++++++ HullBreachToolBar.cs | 10 ++- LocalDev/ksp_dir.txt | 2 +- ModuleHullBreach.cs | 38 ++++---- PreSettings.cs | 79 ---------------- Properties/AssemblyInfo.cs | 4 +- 9 files changed, 131 insertions(+), 122 deletions(-) create mode 100644 Distribution/GameData/HullBreach/settings.cfg create mode 100644 HullBreachConfig.cs delete mode 100644 PreSettings.cs diff --git a/Distribution/GameData/HullBreach/Plugins/HullBreach.dll b/Distribution/GameData/HullBreach/Plugins/HullBreach.dll index fb0074af2e9f22e37f33a49b3483ef793c4cd479..8e7de625bf10948672e4b42fc1f4089327101cf5 100644 GIT binary patch literal 14336 zcmeHOeRLevb-y#aJG)wG*Ivn%KYbZs|l)mR021ZhLG-sK^mY#_w^laA5M~954RmetD*=X0!cr;@sjpk4&xZG8} ztDC4#@z8B=uG&``?IpTATCKDY;g2+j`$s!*kK%I}AELQ}tB&2wVEg4d1qeQ09%{Rj zMftCMcS&a9>VsZZ&3ezXBQCy*L^a^e+d;JS;tC}s_N`MmE4g=wdUX4%1)rRG2wv4n1LAI5O_^_@G_*7hNL>(2RphcOy zW1C7oYH7w;mk}u!3%*Bs@gxTJuDVn$%6;)9d@7{e7f-@`A?3b!(&v(LUp$G$mR7kh zp7gt<+&5D!%;BIGtC$UYmb9pJ7I)YhA+m7G#pV$OX%eV6HXmqEvwFcc>w(u_P-+5A zz8AlQE-rfk*wuc^WRZoyV~ZHTa*h1fiRoNe%-l~+=fYCvet9|+!}E+)mpPg&i;3V0uAsAv zG2buFHs1@2d2LJcef(>*nCE+)I&T7A^{TNb`qQdrt4gI@kr#SZ9pV51z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gc)7k_saG&lyz)W_s+4gLl8DC3a`u;0t)X%${MkE>9lUDmbLXLW zr7NJt)A$VsvhUSZKJ5zdg#`007Zh1I`iQm) zx-Mhp%UmE9CKKG1@D5Z)Q41$}@d%LM{O0n19YN;9+g2&636E_0e zMHG0+dBr4)hb_zy;S(w`WSlaroxj1b`aZ85OvrlhhTmZ1GVjPt@R{i;8V%>o!a-Ry z!;LaP^)o*Dwcbp$9z|d=UBJmM4<)eRWUo@Y+^?4Ikd!_t{Rrg|Z8ky?hN}81kusN4&lsGWfH{@2=l^3-GrIB7C*2ELPR~ zih9HapnLn|$7yW_a;Lv4nyn7AHO|8tJt zym9<#s0ga}F4>E3a=3H+)?Vy-0#dpD8kAL!0htB54Rsb@>*T0$^y;9xsEN4tF=Z_$ z8R%2$Pazc9+po2_g1b`ES0qmd-l2MbTTxlT1}Kg@Ft!i!^7u0_2MTr2GngYUt50t} zmby@>F0Kl_sxcvTcEHsOXuv|{pylUS$vr4_+V9I?8?#PTn=r<^%6@(26HBdb+odf>Ajf;^ z;L5#rKb9KL3T%}&Ts-b_OI~ir9db+$R>Adt9-e5y3f?n7?G9W%PA>SDfo|`+c84 - - False - ..\..\..\..\..\..\Games\KSP\KSP_x64_Data\Managed\Assembly-CSharp.dll - False + + ..\KSP\1.3\Assembly-CSharp.dll - - False - ..\..\..\..\..\..\Games\KSP\KSP_x64_Data\Managed\Assembly-CSharp-firstpass.dll - False + + ..\KSP\1.3\Assembly-CSharp-firstpass.dll - - False - ..\..\..\..\..\..\Games\KSP\KSP_x64_Data\Managed\UnityEngine.dll - False + + ..\KSP\1.3\UnityEngine.dll - - False - ..\..\..\..\..\..\Games\KSP\KSP_x64_Data\Managed\UnityEngine.UI.dll - False + + ..\KSP\1.3\UnityEngine.UI.dll - + diff --git a/HullBreachConfig.cs b/HullBreachConfig.cs new file mode 100644 index 0000000..bd6cfc1 --- /dev/null +++ b/HullBreachConfig.cs @@ -0,0 +1,84 @@ +using System; +using KSP.UI.Screens; +using UnityEngine; + +namespace HullBreach +{ + [KSPAddon(KSPAddon.Startup.EveryScene, false)] + public class config : MonoBehaviour + { + + public static string SettingsConfigUrl = "GameData/HullBreach/settings.cfg"; + + public static double flowRate { get; set; } + public static double critFlowRate { get; set; } + public static double breachTemp { get; set; } + public static double critBreachTemp { get; set; } + + public static bool ecDrain { get; set; } + public static bool isHullBreachEnabled { get; set; } + + public ModuleHullBreach vesselHullBreach = null; + public static config Instance; + + void Awake() + { + LoadConfig(); + Instance = this; + } + + public static void LoadConfig() + { + try + { + Debug.Log("[HullBreach]: Loading settings.cfg "); + + ConfigNode fileNode = ConfigNode.Load(SettingsConfigUrl); + if (!fileNode.HasNode("HullBreachSettings")) return; + + ConfigNode settings = fileNode.GetNode("HullBreachSettings"); + + flowRate = double.Parse(settings.GetValue("flowRate")); + critFlowRate = double.Parse(settings.GetValue("critFlowRate")); + breachTemp = double.Parse(settings.GetValue("breachTemp")); + critBreachTemp = double.Parse(settings.GetValue("critBreachTemp")); + + ecDrain = bool.Parse(settings.GetValue("ecDrain")); + isHullBreachEnabled = bool.Parse(settings.GetValue("isHullBreachEnabled")); + + } + catch (Exception ex) + { + Debug.Log("[HullBreach]: Failed to load settings config:" + ex.Message); + } + } + + public static void SaveConfig() + { + try + { + Debug.Log("[HullBreach]: Saving settings.cfg =="); + ConfigNode fileNode = ConfigNode.Load(SettingsConfigUrl); + + if (!fileNode.HasNode("HullBreachSettings")) return; + + ConfigNode settings = fileNode.GetNode("HullBreachSettings"); + + settings.SetValue("flowRate", flowRate); + settings.SetValue("critFlowRate", critBreachTemp); + settings.SetValue("breachTemp", breachTemp); + settings.SetValue("critBreachTemp", critBreachTemp); + settings.SetValue("ecDrain", ecDrain); + settings.SetValue("isHullBreachEnabled", isHullBreachEnabled); + + fileNode.Save(SettingsConfigUrl); + } + catch (Exception ex) + { + Debug.Log("[HullBreach]: Failed to save settings config:" + ex.Message); throw; + } + } + + } +} + diff --git a/HullBreachToolBar.cs b/HullBreachToolBar.cs index 875b4ae..469c4c6 100644 --- a/HullBreachToolBar.cs +++ b/HullBreachToolBar.cs @@ -55,21 +55,23 @@ void ToolbarWindow(int windowID) if (!FlightGlobals.ActiveVessel) { return; } - if (ModuleHullBreach.Instance) + if (config.Instance.vesselHullBreach != null) { - if (ModuleHullBreach.ecDrain) + if (config.ecDrain) { if (GUI.Button(LineRect(ref line, 1.5f), "EC Drain ON", HighLogic.Skin.button)) { //ModuleHullBreach.Instance.ToggleHullBreach(); - ModuleHullBreach.ecDrain = false; + config.ecDrain = false; + config.SaveConfig(); } } else { if (GUI.Button(LineRect(ref line, 2), "EC Drain OFF", HighLogic.Skin.button)) { - ModuleHullBreach.ecDrain = true; + config.ecDrain = true; + config.SaveConfig(); } } diff --git a/LocalDev/ksp_dir.txt b/LocalDev/ksp_dir.txt index 4bb2f0f..9093325 100644 --- a/LocalDev/ksp_dir.txt +++ b/LocalDev/ksp_dir.txt @@ -1 +1 @@ -C:\Games\KSP_Debug \ No newline at end of file +S:\Games\KSP_1.3_Debug \ No newline at end of file diff --git a/ModuleHullBreach.cs b/ModuleHullBreach.cs index d1c531d..429fbda 100644 --- a/ModuleHullBreach.cs +++ b/ModuleHullBreach.cs @@ -8,15 +8,6 @@ public class ModuleHullBreach : PartModule static ModuleHullBreach instance; public static ModuleHullBreach Instance => instance; - public static bool _ecDrain = true; - - public static bool ecDrain - { - get { return _ecDrain; } - set { _ecDrain = value; } - - } - #region KSP Fields public bool isHullBreached; @@ -91,6 +82,8 @@ public override void OnStart(StartState state) { part.force_activate(); instance = this; + if(part.FindModulesImplementing().Count !=0) + config.Instance.vesselHullBreach = this; } //if (state != StartState.Editor & vessel != null & partDebug == false) @@ -126,10 +119,14 @@ public void CheckCatastrophicBreach(PartJoint partJoint, float breakForce) public void FixedUpdate() { - //if (vessel == null || !vessel.FindPartModuleImplementing()) - //{ - // return; - //} + try + { + if (vessel == null || !vessel.FindPartModuleImplementing()) + return; + } + catch (Exception e) + { } + part.rigidAttachment = true; if (vessel.situation != Vessel.Situations.SPLASHED) return; @@ -165,7 +162,7 @@ public void FixedUpdate() else if (crushable && part.submergedPortion == 1.00 && !part.localRoot.name.StartsWith("Sub")) { - if(_ecDrain) + if(config.ecDrain) part.RequestResource("ElectricCharge", 1000); //kill EC if sumberged if (crushable) part.buoyancy = -1.0f; // trying to kill floaty bits that never sink @@ -188,11 +185,14 @@ public void FixedUpdate() public void LateUpdate() { - //if (vessel == null || !vessel.FindPartModuleImplementing()) - //{ - // return; - //} - + try + { + if (vessel == null || !vessel.FindPartModuleImplementing()) + return; + } + catch (Exception e) + { } + //vesselSituation = vessel.situation.ToString(); //currentAlt = Math.Round(TrueAlt(),2); pctHeat = Math.Round((part.temperature/part.maxTemp)*100); diff --git a/PreSettings.cs b/PreSettings.cs deleted file mode 100644 index 9cd7f6d..0000000 --- a/PreSettings.cs +++ /dev/null @@ -1,79 +0,0 @@ -//using System; -//using UnityEngine; - -//namespace HullBreach -//{ -// [KSPAddon(KSPAddon.Startup.EveryScene, false)] -// public class HullBreachSettings : MonoBehaviour -// { -// public static string SettingsConfigUrl = "GameData/HullBreach/settings.cfg"; - -// public static double _flowRate { get; set; } -// public static double _critFlowRate { get; set; } -// public static double _breachTemp { get; set; } -// public static double _critBreachTemp { get; set; } - -// public static bool _ecDrain { get; set; } -// public static bool _isHullBreachEnabled { get; set; } - - -// void Awake() -// { -// LoadConfig(); -// } - -// public static void LoadConfig() -// { -// try -// { -// Debug.Log("[HullBreach]: Loading settings.cfg "); - -// ConfigNode fileNode = ConfigNode.Load(SettingsConfigUrl); -// if (!fileNode.HasNode("HullBreachSettings")) return; - -// ConfigNode settings = fileNode.GetNode("HullBreachSettings"); - -// _flowRate = double.Parse(settings.GetValue("flowRate")); -// _critFlowRate = double.Parse(settings.GetValue("critFlowRate")); -// _breachTemp = double.Parse(settings.GetValue("breachTemp")); -// _critBreachTemp = double.Parse(settings.GetValue("critBreachTemp")); - -// _ecDrain = bool.Parse(settings.GetValue("ecDrain")); -// _isHullBreachEnabled = bool.Parse(settings.GetValue("isHullBreachEnabled")); - -// } -// catch (Exception ex) -// { -// Debug.Log("[HullBreach]: Failed to load settings config:" + ex.Message); -// } -// } - -// public static void SaveConfig() -// { -// try -// { -// Debug.Log("[HullBreach]: Saving settings.cfg =="); -// ConfigNode fileNode = ConfigNode.Load(SettingsConfigUrl); - -// if (!fileNode.HasNode("HullBreachSettings")) return; - -// ConfigNode settings = fileNode.GetNode("PreSettings"); - -// settings.SetValue("flowRate", _flowRate); -// settings.SetValue("critFlowRate", _critBreachTemp); -// settings.SetValue("breachTemp", _breachTemp); -// settings.SetValue("critBreachTemp", _critBreachTemp); -// settings.SetValue("ecDrain", _flowRate, _ecDrain); -// settings.SetValue("isHullBreachEnabled", _isHullBreachEnabled); - -// fileNode.Save(SettingsConfigUrl); -// } -// catch (Exception ex) -// { -// Debug.Log("[HullBreach]: Failed to save settings config:" + ex.Message); throw; -// } -// } - - -// } -//} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index c966157..c504311 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.1.5.6")] -[assembly: AssemblyFileVersion("0.1.5.6")] +[assembly: AssemblyVersion("0.1.6.0")] +[assembly: AssemblyFileVersion("0.1.6.0")]