Skip to content

Commit

Permalink
V0.16.0.3
Browse files Browse the repository at this point in the history
KSP 1.0.4
Heat settings added to config screen
Fixed ElecCharge and Heat monitoring
New Ship Manifest Interface, fixed bug if crew Xfer into full freezer.
  • Loading branch information
Jamie Leighton committed Jun 25, 2015
1 parent c81af1a commit 142ff34
Show file tree
Hide file tree
Showing 15 changed files with 282 additions and 115 deletions.
Binary file modified DeepFreeze.zip
Binary file not shown.
Binary file not shown.
6 changes: 3 additions & 3 deletions GameData/REPOSoftTech/DeepFreeze/DeepFreezeContinued.version
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":"https://kerbalstuff.com/mod/895/DeepFreeze%20Continued...",
"VERSION":{"MAJOR":0,"MINOR":16,"PATCH":0,"BUILD":2},
"KSP_VERSION":{"MAJOR":1,"MINOR":0,"PATCH":3},
"VERSION":{"MAJOR":0,"MINOR":16,"PATCH":0,"BUILD":3},
"KSP_VERSION":{"MAJOR":1,"MINOR":0,"PATCH":4},
"KSP_VERSION_MIN":{"MAJOR":1,"MINOR":0,"PATCH":0},
"KSP_VERSION_MAX":{"MAJOR":1,"MINOR":0,"PATCH":3}
"KSP_VERSION_MAX":{"MAJOR":1,"MINOR":0,"PATCH":4}
}
6 changes: 4 additions & 2 deletions GameData/REPOSoftTech/DeepFreeze/Plugins/Config.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DFSettings
{
{
DFwindowPosX = 40
DFwindowPosY = 50
DFwindowPosY = 50
CFwindowPosX = 450
CFwindowPosY = 50
ECreqdForFreezer = False
Expand All @@ -14,5 +14,7 @@ DFSettings
RegTempReqd = False
RegTempFreeze = 300
RegTempMonitor = 400
heatamtMonitoringFrznKerbals = 100
heatamtThawFreezeKerbal = 1000
TempinKelvin = True
}
Binary file modified GameData/REPOSoftTech/DeepFreeze/Plugins/DeepFreeze.dll
Binary file not shown.
Binary file modified GameData/REPOSoftTech/DeepFreeze/Plugins/SMInterface.dll
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 43 additions & 3 deletions Source/DFSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,43 +23,73 @@ public class DFSettings

public float DFwindowPosX { get; set; }
public float DFwindowPosY { get; set; }
public float CFwindowPosX { get; set; }
public float CFwindowPosY { get; set; }
public bool UseAppLauncher { get; set; }
public bool debugging { get; set; }
public bool ECreqdForFreezer { get; set; }
public bool AutoRecoverFznKerbals { get; set; }
public float KSCcostToThawKerbal { get; set; }
public int ECReqdToFreezeThaw { get; set; }
public int GlykerolReqdToFreeze { get; set; }
public bool RegTempReqd { get; set; }
public double RegTempFreeze { get; set; }
public double RegTempMonitor { get; set; }
public double heatamtMonitoringFrznKerbals { get; set; }
public double heatamtThawFreezeKerbal { get; set; }
public bool TempinKelvin { get; set; }

public DFSettings()
internal DFSettings()
{
DFwindowPosX = 40;
DFwindowPosY = 50;
CFwindowPosX = 380;
CFwindowPosY = 50;
UseAppLauncher = true;
debugging = true;
ECreqdForFreezer = true;
AutoRecoverFznKerbals = true;
KSCcostToThawKerbal = 10000f;
ECReqdToFreezeThaw = 3000;
GlykerolReqdToFreeze = 5;
RegTempReqd = false;
RegTempFreeze = 300f;
RegTempMonitor = 400f;
heatamtMonitoringFrznKerbals = 10f;
heatamtThawFreezeKerbal = 100f;
TempinKelvin = true;
}

//Settings Functions Follow

public void Load(ConfigNode node)
internal void Load(ConfigNode node)
{
if (node.HasNode(configNodeName))
{
ConfigNode DFsettingsNode = node.GetNode(configNodeName);

DFwindowPosX = Utilities.GetNodeValue(DFsettingsNode, "DFwindowPosX", DFwindowPosX);
DFwindowPosY = Utilities.GetNodeValue(DFsettingsNode, "DFwindowPosY", DFwindowPosY);
CFwindowPosX = Utilities.GetNodeValue(DFsettingsNode, "CFwindowPosX", CFwindowPosX);
CFwindowPosY = Utilities.GetNodeValue(DFsettingsNode, "CFwindowPosY", CFwindowPosY);
ECreqdForFreezer = Utilities.GetNodeValue(DFsettingsNode, "ECreqdForFreezer", ECreqdForFreezer);
UseAppLauncher = Utilities.GetNodeValue(DFsettingsNode, "UseAppLauncher", UseAppLauncher);
debugging = Utilities.GetNodeValue(DFsettingsNode, "debugging", debugging);
AutoRecoverFznKerbals = Utilities.GetNodeValue(DFsettingsNode, "AutoRecoverFznKerbals", AutoRecoverFznKerbals);
KSCcostToThawKerbal = Utilities.GetNodeValue(DFsettingsNode, "KSCcostToThawKerbal", KSCcostToThawKerbal);
ECReqdToFreezeThaw = Utilities.GetNodeValue(DFsettingsNode, "ECReqdToFreezeThaw", ECReqdToFreezeThaw);
GlykerolReqdToFreeze = Utilities.GetNodeValue(DFsettingsNode, "GlykerolReqdToFreeze", GlykerolReqdToFreeze);
RegTempReqd = Utilities.GetNodeValue(DFsettingsNode, "RegTempReqd", RegTempReqd);
RegTempFreeze = Utilities.GetNodeValue(DFsettingsNode, "RegTempFreeze", RegTempFreeze);
RegTempMonitor = Utilities.GetNodeValue(DFsettingsNode, "RegTempMonitor", RegTempMonitor);
heatamtMonitoringFrznKerbals = Utilities.GetNodeValue(DFsettingsNode, "heatamtMonitoringFrznKerbals", heatamtMonitoringFrznKerbals);
heatamtThawFreezeKerbal = Utilities.GetNodeValue(DFsettingsNode, "heatamtThawFreezeKerbal", heatamtThawFreezeKerbal);
TempinKelvin = Utilities.GetNodeValue(DFsettingsNode, "TempinKelvin", TempinKelvin);
this.Log_Debug("DFSettings load complete");
}
}

public void Save(ConfigNode node)
internal void Save(ConfigNode node)
{
ConfigNode settingsNode;
if (node.HasNode(configNodeName))
Expand All @@ -74,11 +104,21 @@ public void Save(ConfigNode node)

settingsNode.AddValue("DFwindowPosX", DFwindowPosX);
settingsNode.AddValue("DFwindowPosY", DFwindowPosY);
settingsNode.AddValue("CFwindowPosX", CFwindowPosX);
settingsNode.AddValue("CFwindowPosY", CFwindowPosY);
settingsNode.AddValue("ECreqdForFreezer", ECreqdForFreezer);
settingsNode.AddValue("UseAppLauncher", UseAppLauncher);
settingsNode.AddValue("debugging", debugging);
settingsNode.AddValue("AutoRecoverFznKerbals", AutoRecoverFznKerbals);
settingsNode.AddValue("KSCcostToThawKerbal", KSCcostToThawKerbal);
settingsNode.AddValue("ECReqdToFreezeThaw", ECReqdToFreezeThaw);
settingsNode.AddValue("GlykerolReqdToFreeze", GlykerolReqdToFreeze);
settingsNode.AddValue("RegTempReqd", RegTempReqd);
settingsNode.AddValue("RegTempFreeze", RegTempFreeze);
settingsNode.AddValue("RegTempMonitor", RegTempMonitor);
settingsNode.AddValue("heatamtMonitoringFrznKerbals", heatamtMonitoringFrznKerbals);
settingsNode.AddValue("heatamtThawFreezeKerbal", heatamtThawFreezeKerbal);
settingsNode.AddValue("TempinKelvin", TempinKelvin);
this.Log_Debug("DFSettings save complete");
}
}
Expand Down
28 changes: 9 additions & 19 deletions Source/DeepFreeze.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,10 @@ public class DeepFreeze : ScenarioModule, IDFInterface
{
public static DeepFreeze Instance { get; private set; }
internal DFSettings DFsettings { get; private set; }
internal DFGameSettings DFgameSettings { get; private set; }

private readonly string globalConfigFilename;
//private readonly string FilePath;
private ConfigNode globalNode = new ConfigNode();

private readonly List<Component> children = new List<Component>();

internal DFGameSettings DFgameSettings { get; private set; }
private readonly string globalConfigFilename;
private ConfigNode globalNode = new ConfigNode();
private readonly List<Component> children = new List<Component>();

public Dictionary<string, KerbalInfo> FrozenKerbals
{
Expand All @@ -52,13 +48,10 @@ protected DeepFreeze()
Utilities.Log("DeepFreeze", "Constructor");
Instance = this;
DFsettings = new DFSettings();
DFgameSettings = new DFGameSettings();
DFgameSettings = new DFGameSettings();
globalConfigFilename = System.IO.Path.Combine(_AssemblyFolder, "Config.cfg").Replace("\\", "/");
this.Log("globalConfigFilename = " + globalConfigFilename);


DeepFreezeEventAdd();

this.Log("globalConfigFilename = " + globalConfigFilename);
DeepFreezeEventAdd();
}

public override void OnAwake()
Expand Down Expand Up @@ -109,9 +102,7 @@ public override void OnLoad(ConfigNode gameNode)
this.Log("DeepFreeze Child Load Call for " + s.ToString());
s.Load(globalNode);
}
}


}
this.Log("OnLoad: \n " + gameNode + "\n" + globalNode);
}

Expand All @@ -125,8 +116,7 @@ public override void OnSave(ConfigNode gameNode)
s.Save(globalNode);
}
DFsettings.Save(globalNode);
globalNode.Save(globalConfigFilename);

globalNode.Save(globalConfigFilename);
this.Log("OnSave: " + gameNode + "\n" + globalNode);
}

Expand Down
6 changes: 0 additions & 6 deletions Source/DeepFreeze.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@

xcopy "$(TargetPath)" "$(SolutionDir)..\GameData\REPOSoftTech\$(ProjectName)\Plugins\" /Y

xcopy "$(ProjectDir)$(OutDir)$(TargetName).pdb" "$(SolutionDir)..\GameData\REPOSoftTech\$(ProjectName)\Plugins\" /Y

cd "$(TargetDir)"
call "C:\Program Files (x86)\Unity\Editor\Data\MonoBleedingEdge\bin\cli.bat" "C:\Program Files (x86)\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.0\pdb2mdb.exe" $(TargetFileName)
xcopy "$(ProjectDir)$(OutDir)$(TargetFileName).mdb" "$(SolutionDir)..\GameData\REPOSoftTech\$(ProjectName)\Plugins\" /Y

where /q "C:\7za\:7za.exe"
if %25ERRORLEVEL%25 == 1 (
echo Cannot find 7-zip to package build
Expand Down
34 changes: 33 additions & 1 deletion Source/DeepFreezeGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ public class DeepFreezeGUI : MonoBehaviour, Savable
private double InputVRegTempFreeze = 0f;
private string InputSRegTempMonitor = "";
private double InputVRegTempMonitor = 0f;
private string InputSheatamtMonitoringFrznKerbals = "";
private double InputVheatamtMonitoringFrznKerbals = 0f;
private string InputSheatamtThawFreezeKerbal = "";
private double InputVheatamtThawFreezeKerbal = 0f;
private bool InputVTempinKelvin = true;

//Settings vars
Expand All @@ -76,6 +80,8 @@ public class DeepFreezeGUI : MonoBehaviour, Savable
private bool RegTempReqd;
private double RegTempFreeze;
private double RegtempMonitor;
private double heatamtMonitoringFrznKerbals;
private double heatamtThawFreezeKerbal;
private bool TempinKelvin;

//GuiVisibility
Expand Down Expand Up @@ -339,7 +345,9 @@ private void onDraw()
InputSglykerolReqdToFreeze = GlykerolReqdToFreeze.ToString();
InputVRegTempReqd = RegTempReqd;
InputSRegTempFreeze = RegTempFreeze.ToString();
InputSRegTempMonitor = RegtempMonitor.ToString();
InputSRegTempMonitor = RegtempMonitor.ToString();
InputSheatamtMonitoringFrznKerbals = heatamtMonitoringFrznKerbals.ToString();
InputSheatamtThawFreezeKerbal = heatamtThawFreezeKerbal.ToString();
InputVTempinKelvin = TempinKelvin;
LoadConfig = false;
}
Expand Down Expand Up @@ -685,6 +693,24 @@ private void windowCF(int id)
{
InputVRegTempMonitor = RegtempMonitor;
}

GUILayout.BeginHorizontal();
GUILayout.Box(new GUIContent("Heat generated in thaw/freeze process (kW)", "Amount of thermal heat (kW) generated with each thaw/freeze process"), statusStyle, GUILayout.Width(250));
InputSheatamtThawFreezeKerbal = Regex.Replace(GUILayout.TextField(InputSheatamtThawFreezeKerbal, 3, GUILayout.MinWidth(30.0F)), "[^.0-9]", ""); //you can play with the width of the text box
GUILayout.EndHorizontal();
if (!double.TryParse(InputSheatamtThawFreezeKerbal, out InputVheatamtThawFreezeKerbal))
{
InputVheatamtThawFreezeKerbal = heatamtThawFreezeKerbal;
}

GUILayout.BeginHorizontal();
GUILayout.Box(new GUIContent("Equip. heat generated per frozen kerbal (kW)", "Amount of thermal heat (kW) generated by equip. for each frozen kerbal"), statusStyle, GUILayout.Width(250));
InputSheatamtMonitoringFrznKerbals = Regex.Replace(GUILayout.TextField(InputSheatamtMonitoringFrznKerbals, 3, GUILayout.MinWidth(30.0F)), "[^.0-9]", ""); //you can play with the width of the text box
GUILayout.EndHorizontal();
if (!double.TryParse(InputSheatamtMonitoringFrznKerbals, out InputVheatamtMonitoringFrznKerbals))
{
InputVheatamtMonitoringFrznKerbals = heatamtMonitoringFrznKerbals;
}

GUI.enabled = true;

Expand Down Expand Up @@ -717,6 +743,8 @@ private void windowCF(int id)
RegTempReqd = InputVRegTempReqd;
RegTempFreeze = InputVRegTempFreeze;
RegtempMonitor = InputVRegTempMonitor;
heatamtMonitoringFrznKerbals = InputVheatamtMonitoringFrznKerbals;
heatamtThawFreezeKerbal = InputVheatamtThawFreezeKerbal;
TempinKelvin = InputVTempinKelvin;
showConfigGUI = false;
LoadConfig = true;
Expand Down Expand Up @@ -788,6 +816,8 @@ public void Load(ConfigNode globalNode)
RegTempReqd = DFsettings.RegTempReqd;
RegTempFreeze = DFsettings.RegTempFreeze;
RegtempMonitor = DFsettings.RegTempMonitor;
heatamtMonitoringFrznKerbals = DFsettings.heatamtMonitoringFrznKerbals;
heatamtThawFreezeKerbal = DFsettings.heatamtThawFreezeKerbal;
TempinKelvin = DFsettings.TempinKelvin;
this.Log_Debug("DeepFreezeGUI Load end");
}
Expand All @@ -809,6 +839,8 @@ public void Save(ConfigNode globalNode)
DFsettings.RegTempReqd = RegTempReqd;
DFsettings.RegTempFreeze = RegTempFreeze;
DFsettings.RegTempMonitor = RegtempMonitor;
DFsettings.heatamtThawFreezeKerbal = heatamtThawFreezeKerbal;
DFsettings.heatamtMonitoringFrznKerbals = heatamtMonitoringFrznKerbals;
DFsettings.TempinKelvin = TempinKelvin;
this.Log_Debug("DeepFreezeGUI Save end");
}
Expand Down
Loading

0 comments on commit 142ff34

Please sign in to comment.