Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Distribution/GameData/REPOSoftTech/DeepFreeze/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
V0.22.1.0 "KSP 1.1.2 Update"
V0.22.2.0 "Bug Fixes"
Fixed bug with Icons not loading on Linux.
Efficiency clean-up on code modules (speed and memory use).
Fix bug where DeepFreeze is not maintaining and updating Vessel Information for Vessels with Freezer parts, causing Exceptions in the log and vessels not
appearing in the Vessel List in the DeepFreeze GUI window.
Moved Config.cfg file from Plugins to /Plugins/PluginData to prevent resetting Module Manager cache every time you change a setting.
V0.22.1.0 "KSP 1.1.2 Update"
Fixed portrait camera issues.
Fixed On-Screen messages for Kerbal Name when in Alternate - Cryopod Camera mode.
Fixed spacing (scroll lists) in the DeepFreeze GUI menus.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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":22,"PATCH":1,"BUILD":0},
"VERSION":{"MAJOR":0,"MINOR":22,"PATCH":2,"BUILD":0},
"KSP_VERSION":{"MAJOR":1,"MINOR":1,"PATCH":2},
"KSP_VERSION_MIN":{"MAJOR":1,"MINOR":1,"PATCH":1},
"KSP_VERSION_MIN":{"MAJOR":1,"MINOR":1,"PATCH":2},
"KSP_VERSION_MAX":{"MAJOR":1,"MINOR":1,"PATCH":2}
}

This file was deleted.

This file was deleted.

25 changes: 23 additions & 2 deletions Source/DFEditorFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
using KSP.UI.Screens;
using RUI.Icons.Selectable;
using UnityEngine;
using System.Reflection;
using System.Linq;

namespace DF
{
Expand All @@ -46,15 +48,33 @@ private void Awake()
{
Debug.Log("DFEditorFilter Awake");
GameEvents.onGUIEditorToolbarReady.Add(SubCategories);
//ModuleManager.MMPatchLoader.addPostPatchCallback(DFMMCallBack);
/*
//Attempt to add Module Manager callback - find the base type
System.Type MMType = AssemblyLoader.loadedAssemblies
.Select(a => a.assembly.GetExportedTypes())
.SelectMany(t => t)
.FirstOrDefault(t => t.FullName == "ModuleManager.MMPatchLoader");
if (MMType != null)
{
MethodInfo MMPatchLoaderInstanceMethod = MMType.GetMethod("get_Instance", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public);
if (MMPatchLoaderInstanceMethod != null)
{
object actualMM = MMPatchLoaderInstanceMethod.Invoke(null,
BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static, null, null, null);
MethodInfo MMaddPostPatchCallbackMethod = MMType.GetMethod("addPostPatchCallback", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public);
if (actualMM != null && MMaddPostPatchCallbackMethod != null)
MMaddPostPatchCallbackMethod.Invoke(actualMM, new object[] { this.DFMMCallBack() });
}

}*/
DFMMCallBack();
//load the icons
icon_DeepFreeze_Editor.LoadImage(File.ReadAllBytes("GameData/REPOSoftTech/DeepFreeze/Icons/DeepFreezeEditor.png"));

Debug.Log("DFEditorFilter Awake Complete");
}

public void DFMMCallBack()
public bool DFMMCallBack()
{
Debug.Log("DFEDitorFilter DFMMCallBack");
avPartItems.Clear();
Expand All @@ -68,6 +88,7 @@ public void DFMMCallBack()
}
}
Debug.Log("DFEDitorFilter DFMMCallBack end");
return true;
}

private bool EditorItemsFilter(AvailablePart avPart)
Expand Down
32 changes: 32 additions & 0 deletions Source/DFEnums.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* DeepFreeze Continued...
* (C) Copyright 2015, Jamie Leighton
*
* Kerbal Space Program is Copyright(C) 2013 Squad.See http://kerbalspaceprogram.com/. This
* project is in no way associated with nor endorsed by Squad.
*
* This file is part of JPLRepo's DeepFreeze (continued...) - a Fork of DeepFreeze. Original Author of DeepFreeze is 'scottpaladin' on the KSP Forums.
* This File was not part of the original Deepfreeze but was written by Jamie Leighton.
* (C) Copyright 2015, Jamie Leighton
*
* Continues to be licensed under the Attribution-NonCommercial-ShareAlike 3.0 (CC BY-NC-SA 4.0)
* creative commons license.See<https://creativecommons.org/licenses/by-nc-sa/4.0/>
* for full details.
*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DF
{
public enum DoorState
{
OPEN,
CLOSED,
OPENING,
CLOSING,
UNKNOWN
}
}
93 changes: 93 additions & 0 deletions Source/DFExtDoorMgr.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*
* DeepFreeze Continued...
* (C) Copyright 2015, Jamie Leighton
*
* Kerbal Space Program is Copyright(C) 2013 Squad.See http://kerbalspaceprogram.com/. This
* project is in no way associated with nor endorsed by Squad.
*
* This file is part of JPLRepo's DeepFreeze (continued...) - a Fork of DeepFreeze. Original Author of DeepFreeze is 'scottpaladin' on the KSP Forums.
* This File was not part of the original Deepfreeze but was written by Jamie Leighton.
* (C) Copyright 2015, Jamie Leighton
*
* Continues to be licensed under the Attribution-NonCommercial-ShareAlike 3.0 (CC BY-NC-SA 4.0)
* creative commons license.See<https://creativecommons.org/licenses/by-nc-sa/4.0/>
* for full details.
*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RSTUtils;

namespace DF
{
public class DFExtDoorMgr : InternalModule
{
private DeepFreezer Freezer;

public override void OnUpdate()
{
base.OnUpdate();
if (HighLogic.LoadedSceneIsFlight && FlightGlobals.ready && FlightGlobals.ActiveVessel != null)
{
if (Freezer == null)
{
Freezer = part.FindModuleImplementing<DeepFreezer>();
Utilities.Log_Debug("DFExtDoorMgr OnUpdate Set part " + part.name);
}
}
}

public void ButtonExtDoor(bool state)
{
if (Freezer == null)
{
Freezer = part.FindModuleImplementing<DeepFreezer>();
Utilities.Log_Debug("DFExtDoorMgr buttonExtDoorState set part " + part.name);
}
if (Freezer == null) return; // If freezer is still null just return
if (!Freezer.ExternalDoorActive) return; // if freezer doesn't have an external door just return.

if (Freezer._externaldoorstate == DoorState.OPEN)
{
//Door is open so we trigger a closedoor.
Freezer.eventCloseDoors();
Utilities.Log_Debug("DFExtDoorMgr ButtonExtDoor fired triggerred eventCloseDoors");
}
else
{
if (Freezer._externaldoorstate == DoorState.CLOSED)
{
//Door is closed so we trigger a opendoor.
Freezer.eventOpenDoors();
Utilities.Log_Debug("DFExtDoorMgr ButtonExtDoor fired triggerred eventOpenDoors");
}
else
{
// door already opening or closing...
Utilities.Log_Debug("DFExtDoorMgr ButtonExtDoor fired but door state is opening, closing or unknown");
}
}
}

public bool ButtonExtDoorState()
{
// Utilities.Log_Debug("DFExtDoorMgr ButtonExtDoorState fired");
if (Freezer == null)
{
Freezer = part.FindModuleImplementing<DeepFreezer>();
Utilities.Log_Debug("DFExtDoorMgr buttonExtDoorState set part " + part.name);
}
if (Freezer == null) return false; // if freezer still null return false
if (!Freezer.ExternalDoorActive) return false; // if freezer doesn't have an external door just return.
if (Freezer._externaldoorstate == DoorState.CLOSED || Freezer._externaldoorstate == DoorState.CLOSING || Freezer._externaldoorstate == DoorState.UNKNOWN)
{
Utilities.Log_Debug("DFExtDoorMgr Door is closed or closing or unknown return state false");
return false;
}
Utilities.Log_Debug("DFExtDoorMgr Door is open or opening return state true");
return true;
}
}
}
Loading