From 064a98027886fb8dcaa3abcbfa0eec2685030b2d Mon Sep 17 00:00:00 2001 From: Jamie Leighton Date: Sat, 26 Nov 2016 21:06:15 +1100 Subject: [PATCH 1/2] KSP 1.2.2 Remove RSTKSPGameEvents and use new KSP 1.2.2 GameEvents extensions. --- .../REPOSoftTech/DeepFreeze/Changelog.txt | 6 +++- .../DeepFreeze/DeepFreezeContinued.version | 8 ++--- Source/APIs/DFGameEvents.cs | 36 +++++++++++++++++++ Source/DeepFreeze.cs | 8 ++--- Source/DeepFreeze.csproj | 4 +-- Source/DeepFreezerPart.cs | 5 ++- Source/Properties/AssemblyInfo.cs | 4 +-- 7 files changed, 54 insertions(+), 17 deletions(-) create mode 100644 Source/APIs/DFGameEvents.cs diff --git a/Distribution/GameData/REPOSoftTech/DeepFreeze/Changelog.txt b/Distribution/GameData/REPOSoftTech/DeepFreeze/Changelog.txt index 246f4df..dcd2f62 100644 --- a/Distribution/GameData/REPOSoftTech/DeepFreeze/Changelog.txt +++ b/Distribution/GameData/REPOSoftTech/DeepFreeze/Changelog.txt @@ -1,4 +1,8 @@ -V0.23.1.0 +V0.23.2.0 +Compile for KSP 1.2.2 +Remove need for RSTKSPEvents and utilize new KSP 1.2.2 GameEvents extension. + +V0.23.1.0 Compile for KSP 1.2.1 Fix Editor customer Filter for DeepFreeze parts. Fix problem with EC and Heat settings being disabled in new game difficulty settings. https://github.com/JPLRepo/DeepFreeze/issues/63 diff --git a/Distribution/GameData/REPOSoftTech/DeepFreeze/DeepFreezeContinued.version b/Distribution/GameData/REPOSoftTech/DeepFreeze/DeepFreezeContinued.version index 097f161..64cf9a0 100644 --- a/Distribution/GameData/REPOSoftTech/DeepFreeze/DeepFreezeContinued.version +++ b/Distribution/GameData/REPOSoftTech/DeepFreeze/DeepFreezeContinued.version @@ -2,8 +2,8 @@ "NAME":"DeepFreeze Continued...", "URL":"http://ksp-avc.cybutek.net/version.php?id=183", "DOWNLOAD":"http://spacedock.info/mod/142/DeepFreeze%20Continued...", -"VERSION":{"MAJOR":0,"MINOR":23,"PATCH":1,"BUILD":0}, -"KSP_VERSION":{"MAJOR":1,"MINOR":2,"PATCH":1}, -"KSP_VERSION_MIN":{"MAJOR":1,"MINOR":2,"PATCH":0}, -"KSP_VERSION_MAX":{"MAJOR":1,"MINOR":2,"PATCH":1} +"VERSION":{"MAJOR":0,"MINOR":23,"PATCH":2,"BUILD":0}, +"KSP_VERSION":{"MAJOR":1,"MINOR":2,"PATCH":2}, +"KSP_VERSION_MIN":{"MAJOR":1,"MINOR":2,"PATCH":2}, +"KSP_VERSION_MAX":{"MAJOR":1,"MINOR":2,"PATCH":2} } \ No newline at end of file diff --git a/Source/APIs/DFGameEvents.cs b/Source/APIs/DFGameEvents.cs new file mode 100644 index 0000000..9fdac58 --- /dev/null +++ b/Source/APIs/DFGameEvents.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace DF +{ + class DFGameEvents + { + /// + /// Fires when DeepFreeze Completes the Freezing process on a Kerbal. + /// Part is the DeepFreeze Freezer Part and ProtoCrewMember is the Kerbal. + /// + public static EventData onKerbalFrozen = new EventData("onKerbalFrozen"); + /// + /// Fires when DeepFreeze Completes the Thawing process on a Kerbal. + /// Part is the DeepFreeze Freezer Part and ProtoCrewMember is the Kerbal. + /// + public static EventData onKerbalThaw = new EventData("onKerbalThaw"); + /// + /// Fires when DeepFreeze sets a Kerbal to Comatose Status. + /// Part is the DeepFreeze Freezer Part and ProtoCrewMember is the Kerbal. + /// + public static EventData onKerbalSetComatose = new EventData("onKerbalSetComatose"); + /// + /// Fires when DeepFreeze Unsets a Kerbal from Comatose Status. + /// Part is the DeepFreeze Freezer Part and ProtoCrewMember is the Kerbal. + /// + public static EventData onKerbalUnSetComatose = new EventData("onKerbalUnSetComatose"); + /// + /// Fires when DeepFreeze has to Kill a Frozen Kerbal. + /// + public static EventData onFrozenKerbalDied = new EventData("onFrozenKerbalDied"); + + } +} diff --git a/Source/DeepFreeze.cs b/Source/DeepFreeze.cs index d9280b9..5507961 100644 --- a/Source/DeepFreeze.cs +++ b/Source/DeepFreeze.cs @@ -376,7 +376,7 @@ internal void KillFrozenCrew(string FrozenCrew) Utilities.Log("DeepFreezeEvents " + kerbal.name + " killed"); kerbal.type = ProtoCrewMember.KerbalType.Crew; kerbal.rosterStatus = ProtoCrewMember.RosterStatus.Dead; - RSTKSPGameEvents.RSTEvents.onFrozenKerbalDied.Fire(kerbal); + DFGameEvents.onFrozenKerbalDied.Fire(kerbal); if (HighLogic.CurrentGame.Parameters.Difficulty.MissingCrewsRespawn) { kerbal.StartRespawnPeriod(); @@ -392,7 +392,7 @@ internal void KillFrozenCrew(string FrozenCrew) Utilities.Log("DeepFreezeEvents " + crew.name + " killed"); crew.type = ProtoCrewMember.KerbalType.Crew; crew.rosterStatus = ProtoCrewMember.RosterStatus.Dead; - RSTKSPGameEvents.RSTEvents.onFrozenKerbalDied.Fire(crew); + DFGameEvents.onFrozenKerbalDied.Fire(crew); if (HighLogic.CurrentGame.Parameters.Difficulty.MissingCrewsRespawn) { crew.StartRespawnPeriod(); @@ -411,7 +411,7 @@ internal bool setComatoseKerbal(Part part, ProtoCrewMember crew, ProtoCrewMember if (start) { crew.UnregisterExperienceTraits(part); - RSTKSPGameEvents.RSTEvents.onKerbalSetComatose.Fire(part, crew); + DFGameEvents.onKerbalSetComatose.Fire(part, crew); } crew.type = type; @@ -427,7 +427,7 @@ internal bool setComatoseKerbal(Part part, ProtoCrewMember crew, ProtoCrewMember KerbalRoster.SetExperienceTrait(crew, "Tourist"); } crew.RegisterExperienceTraits(part); - RSTKSPGameEvents.RSTEvents.onKerbalUnSetComatose.Fire(part, crew); + DFGameEvents.onKerbalUnSetComatose.Fire(part, crew); ScreenMessages.PostScreenMessage( crew.name + " has recovered from emergency thaw and resumed normal duties.", 5.0f, ScreenMessageStyle.UPPER_CENTER); diff --git a/Source/DeepFreeze.csproj b/Source/DeepFreeze.csproj index ec1a0cf..c02ab36 100644 --- a/Source/DeepFreeze.csproj +++ b/Source/DeepFreeze.csproj @@ -40,9 +40,6 @@ False ..\..\KSPDLLs - 1.2\Assembly-CSharp.dll - - ..\..\REPOSoftTechKSPUtils\RSTKSPGameEvents\bin\Debug\RSTKSPGameEvents.dll - @@ -71,6 +68,7 @@ ToolBarManager.cs + diff --git a/Source/DeepFreezerPart.cs b/Source/DeepFreezerPart.cs index 84aee2c..559912b 100644 --- a/Source/DeepFreezerPart.cs +++ b/Source/DeepFreezerPart.cs @@ -19,7 +19,6 @@ using System.Collections; using System.Collections.Generic; using DeepFreeze; -using RSTKSPGameEvents; using RSTUtils; using UnityEngine; using Object = System.Object; @@ -2163,7 +2162,7 @@ private void FreezeKerbalConfirm(ProtoCrewMember CrewMember) ScreenMessages.PostScreenMessage(CrewMember.name + " frozen", 5.0f, ScreenMessageStyle.UPPER_CENTER); onvslchgInternal = true; - RSTEvents.onKerbalFrozen.Fire(this.part, CrewMember); + DFGameEvents.onKerbalFrozen.Fire(this.part, CrewMember); CrewHatchController.fetch.EnableInterface(); GameEvents.onVesselChange.Fire(vessel); GameEvents.onVesselWasModified.Fire(vessel); @@ -2815,7 +2814,7 @@ private void ThawKerbalStep4(String frozenkerbal) } } CrewHatchController.fetch.EnableInterface(); - RSTEvents.onKerbalThaw.Fire(this.part, kerbal); + DFGameEvents.onKerbalThaw.Fire(this.part, kerbal); GameEvents.onVesselChange.Fire(vessel); GameEvents.onVesselWasModified.Fire(vessel); Utilities.Log_Debug("ThawKerbalConfirm End"); diff --git a/Source/Properties/AssemblyInfo.cs b/Source/Properties/AssemblyInfo.cs index 471d6b8..403e1dd 100644 --- a/Source/Properties/AssemblyInfo.cs +++ b/Source/Properties/AssemblyInfo.cs @@ -31,6 +31,6 @@ // 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.23.1.0")] -[assembly: AssemblyFileVersion("0.23.1.0")] +[assembly: AssemblyVersion("0.23.2.0")] +[assembly: AssemblyFileVersion("0.23.2.0")] [assembly: KSPAssembly("DeepFreeze", 0, 23)] \ No newline at end of file From 6b4a04afe3f532f308d9aaee661277ca1221b97e Mon Sep 17 00:00:00 2001 From: Jamie Leighton Date: Tue, 6 Dec 2016 20:00:24 +1100 Subject: [PATCH 2/2] Update Changelog for 1.2.2 --- Distribution/GameData/REPOSoftTech/DeepFreeze/Changelog.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/Distribution/GameData/REPOSoftTech/DeepFreeze/Changelog.txt b/Distribution/GameData/REPOSoftTech/DeepFreeze/Changelog.txt index dcd2f62..6ff3902 100644 --- a/Distribution/GameData/REPOSoftTech/DeepFreeze/Changelog.txt +++ b/Distribution/GameData/REPOSoftTech/DeepFreeze/Changelog.txt @@ -1,7 +1,6 @@ V0.23.2.0 Compile for KSP 1.2.2 Remove need for RSTKSPEvents and utilize new KSP 1.2.2 GameEvents extension. - V0.23.1.0 Compile for KSP 1.2.1 Fix Editor customer Filter for DeepFreeze parts.