-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Incepting ChillingOut - an (naive) attempt to handle the new bug on l…
…aunching some old parts on KSP 1.11
- Loading branch information
Showing
6 changed files
with
236 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@PART[*]:NEEDS[KSPRECALL-CHILLINGOUT] | ||
{ | ||
%MODULE[ChillingOut] | ||
{ | ||
active = True | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{BCB11210-C285-4919-A134-52F9136554AC}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<RootNamespace>ChillingOut</RootNamespace> | ||
<AssemblyName>ChillingOut</AssemblyName> | ||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> | ||
<BaseIntermediateOutputPath>..\..\obj\ChillingOut</BaseIntermediateOutputPath> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>..\..\bin\Debug</OutputPath> | ||
<DefineConstants>DEBUG;</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<ConsolePause>false</ConsolePause> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<Optimize>true</Optimize> | ||
<OutputPath>..\..\bin\Release</OutputPath> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<ConsolePause>false</ConsolePause> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="Assembly-CSharp"> | ||
<HintPath>..\..\..\..\..\..\LIB\managed\1.4.1\Assembly-CSharp.dll</HintPath> | ||
</Reference> | ||
<Reference Include="KSPe.Light.Recall"> | ||
<HintPath>..\..\..\..\..\..\LIB\plugins\KSPe.Light.Recall.dll</HintPath> | ||
</Reference> | ||
<Reference Include="UnityEngine"> | ||
<HintPath>..\..\..\..\..\..\LIB\managed\1.4.1\UnityEngine.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\KSP-Recall\KSP-Recall.csproj"> | ||
<Project>{40E7A5F2-C30E-43E9-B345-51971959149F}</Project> | ||
<Name>KSP-Recall</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
/* | ||
This file is part of Resourceful, a component of KSP-Recall | ||
(C) 2020-2021 Lisias T : http://lisias.net <[email protected]> | ||
KSP-Recall is double licensed, as follows: | ||
* SKL 1.0 : https://ksp.lisias.net/SKL-1_0.txt | ||
* GPL 2.0 : https://www.gnu.org/licenses/gpl-2.0.txt | ||
And you are allowed to choose the License that better suit your needs. | ||
KSP-Recall is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
You should have received a copy of the SKL Standard License 1.0 | ||
along with KSP-Recall. If not, see <https://ksp.lisias.net/SKL-1_0.txt>. | ||
You should have received a copy of the GNU General Public License 2.0 | ||
along with KSP-Recall. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
using System; | ||
using UnityEngine; | ||
|
||
namespace KSP_Recall { namespace ChillingOut | ||
{ | ||
public class ChillingOut : PartModule | ||
{ | ||
#region KSP UI | ||
|
||
[KSPField(isPersistant = false, guiActive = true, guiActiveEditor = false, guiName = "KSP-Recall::ChillingOut")] | ||
[UI_Toggle(disabledText = "Disabled", enabledText = "Enabled", scene = UI_Scene.Flight)] | ||
public bool active = false; | ||
|
||
#endregion | ||
|
||
|
||
#region KSP Life Cycle | ||
|
||
public override void OnAwake() | ||
{ | ||
Log.dbg("OnAwake {0}:{1:X}", this.name, this.part.GetInstanceID()); | ||
base.OnAwake(); | ||
} | ||
|
||
public override void OnStart(StartState state) | ||
{ | ||
Log.dbg("OnStart {0}:{1:X} {2} {3}", this.name, this.part.GetInstanceID(), state, this.active); | ||
base.OnStart(state); | ||
} | ||
|
||
public override void OnCopy(PartModule fromModule) | ||
{ | ||
Log.dbg("OnCopy {0}:{1:X} from {2:X}", this.name, this.part.GetInstanceID(), fromModule.part.GetInstanceID()); | ||
base.OnCopy(fromModule); | ||
} | ||
|
||
public override void OnLoad(ConfigNode node) | ||
{ | ||
Log.dbg("OnLoad {0}:{1:X} {2}", this.name, this.part.GetInstanceID(), null != node); | ||
base.OnLoad(node); | ||
} | ||
|
||
public override void OnSave(ConfigNode node) | ||
{ | ||
Log.dbg("OnSave {0}:{1:X} {2}", this.name, this.part.GetInstanceID(), null != node); | ||
base.OnSave(node); | ||
} | ||
|
||
public override void OnInitialize() | ||
{ | ||
Log.dbg("OnInitialize {0}:{1:X}", this.name, this.part.GetInstanceID()); | ||
base.OnInitialize(); | ||
this.init(); | ||
} | ||
|
||
public override void OnActive() | ||
{ | ||
Log.dbg("OnActive {0}:{1:X}", this.name, this.part.GetInstanceID()); | ||
base.OnActive(); | ||
this.init(); | ||
} | ||
|
||
// Needed because I had overriden OnActive. | ||
// See https://kerbalspaceprogram.com/api/class_part_module.html#a6f2dd76038326c527e64d2ce96bb45fe | ||
public override bool IsStageable() | ||
{ | ||
return false; | ||
} | ||
|
||
public override void OnInactive() | ||
{ | ||
Log.dbg("OnInactive {0}:{1:X}", this.name, this.part.GetInstanceID()); | ||
base.OnInactive(); | ||
this.deinit(); | ||
} | ||
|
||
#endregion | ||
|
||
|
||
#region Unity Life Cycle | ||
|
||
private void FixedUpdate() | ||
{ | ||
if (!HighLogic.LoadedSceneIsFlight) return; | ||
if (this.vessel.missionTime > DELTA) this.enabled = false; // We are not needed anymore | ||
|
||
this.part.temperature = 0; | ||
this.part.skinTemperature = 0; | ||
this.part.skinUnexposedTemperature = 0; | ||
this.part.skinUnexposedExternalTemp = 0; | ||
} | ||
|
||
private void OnDestroy() | ||
{ | ||
Log.dbg("OnDestroy {0}:{1:X}", this.name, this.part.GetInstanceID()); | ||
} | ||
|
||
#endregion | ||
|
||
|
||
private const float DELTA = 1.0f; // 1 second | ||
private void init() | ||
{ | ||
} | ||
|
||
private void deinit() | ||
{ | ||
} | ||
|
||
private static readonly KSPe.Util.Log.Logger Log = KSPe.Util.Log.Logger.CreateForType<ChillingOut>("KSP-Recall", "ChillingOut"); | ||
static ChillingOut() | ||
{ | ||
Log.level = | ||
#if DEBUG | ||
KSPe.Util.Log.Level.TRACE | ||
#else | ||
KSPe.Util.Log.Level.INFO | ||
#endif | ||
; | ||
} | ||
} | ||
} } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
|
||
// Information about this assembly is defined by the following attributes. | ||
// Change them to the values specific to your project. | ||
|
||
[assembly: AssemblyTitle("KSP-Recall :: ChillingOut")] | ||
[assembly: AssemblyDescription("<TBD>")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany(KSP_Recall.LegalMamboJambo.Company)] | ||
[assembly: AssemblyProduct(KSP_Recall.LegalMamboJambo.Product)] | ||
[assembly: AssemblyCopyright(KSP_Recall.LegalMamboJambo.Copyight)] | ||
[assembly: AssemblyTrademark(KSP_Recall.LegalMamboJambo.Trademark)] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". | ||
// The form "{Major}.{Minor}.*" will automatically update the build and revision, | ||
// and "{Major}.{Minor}.{Build}.*" will update just the revision. | ||
|
||
[assembly: AssemblyVersion(KSP_Recall.Version.Number)] | ||
|
||
// The following attributes are used to specify the signing key for the assembly, | ||
// if desired. See the Mono documentation for more information about signing. | ||
|
||
//[assembly: AssemblyDelaySign(false)] | ||
//[assembly: AssemblyKeyFile("")] |