Skip to content

Commit

Permalink
LOTS of bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
BobPalmer committed Feb 4, 2016
1 parent 57e747f commit 30f2996
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 104 deletions.
4 changes: 4 additions & 0 deletions FOR_RELEASE/GameData/000_USITools/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.6.1 - 2016.02.02
------------------
Fixed an issue where distributed warehouses were excessively greedy

0.6.0 - 2016.02.01
------------------
Added new module for structural supports (versus horribly abusing fairings)
Expand Down
Binary file modified FOR_RELEASE/GameData/000_USITools/USITools.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion FOR_RELEASE/GameData/000_USITools/USITools.version
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"VERSION":{
"MAJOR":0,
"MINOR":6,
"PATCH":0,
"PATCH":1,
"BUILD":0
},
"KSP_VERSION":{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
0.3.8 - 2016.02.03
------------------
Performance update, general bug fixing

0.3.7 - 2016.02.02
------------------
Fixed a gui glich showing an unused menu option
Added kerbal experience trait (P/E/S) to LS GUI
Removed habitation by default as it was causing some confusion. Recyclers remain on by default.

0.3.6 - 2016.02.01
------------------
Lots of optimizations and small bug fixes


0.3.5 - 2016.01.25
------------------
Fixed an issue with the cupola config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ LIFE_SUPPORT_SETTINGS
NoSupplyEffectVets = 1 //Effect if a Kerbal is a vet and has no supplies or EC
EVAEffect = 1 //Effect if a Kerbal exceeds EVA time
EVAEffectVets = 1 //Effect if a Kerbal is a vet and exceeds EVA time
NoHomeEffect = 1 //Effect if a Kerbal becomes homesick
NoHomeEffectVets = 1 //Effect if a Kerbal is a vet and becomes homesick
NoHomeEffect = 0 //Effect if a Kerbal becomes homesick
NoHomeEffectVets = 0 //Effect if a Kerbal is a vet and becomes homesick
HabMultiplier = 1 //Bonus to hab values (1 = default = 100% of the part's rated value)
HomeWorldAltitude = 25000 //Altitude on Kerbin that negative effects are removed
BaseHabTime = 1 //How long can 1 crew capacity support 1 Kerbal, expressed in Kerbal Months
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"VERSION":{
"MAJOR":0,
"MINOR":3,
"PATCH":6,
"PATCH":8,
"BUILD":0
},
"KSP_VERSION":{
Expand Down
Binary file not shown.
33 changes: 12 additions & 21 deletions Source/USILifeSupport/LifeSupportMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,25 +253,9 @@ private void OnWindow(int windowId)
GenerateWindow();
}

private double LastUpdate;
private double checkTime = 1d;
private double _lastGUIUpdate;
private double _guiCheckInterval = 1d;

private void FixedUpdate()
{
//if (LastUpdate < ResourceUtilities.FLOAT_TOLERANCE)
// LastUpdate = Planetarium.GetUniversalTime();

//if (Planetarium.GetUniversalTime() < checkTime + LastUpdate)
// return;

//LastUpdate = Planetarium.GetUniversalTime();
//_guiStats = UpdateGUIStats();
CheckEVAKerbals();
LifeSupportManager.Instance.UpdateVesselStats();
}



private void CheckEVAKerbals()
{
if (!HighLogic.LoadedSceneIsFlight)
Expand Down Expand Up @@ -505,7 +489,7 @@ private List<LifeSupportVesselDisplayStat> UpdateGUIStats()
{
var cStat = new LifeSupportCrewDisplayStat();
var cls = LifeSupportManager.Instance.FetchKerbal(c);
cStat.CrewName = String.Format("<color=#FFFFFF>{0}</color>", c.name);
cStat.CrewName = String.Format("<color=#FFFFFF>{0} ({1})</color>", c.name,c.experienceTrait.Title.Substring(0,1));

var snacksLeft = supAmount / supPerDay * 60 * 60 * 6;
if (supAmount <= ResourceUtilities.FLOAT_TOLERANCE && !LifeSupportManager.IsOnKerbin(thisVessel))
Expand Down Expand Up @@ -558,15 +542,22 @@ private List<LifeSupportVesselDisplayStat> UpdateGUIStats()

private void GenerateWindow()
{
_guiStats = UpdateGUIStats();
if (Planetarium.GetUniversalTime() > _lastGUIUpdate + _guiCheckInterval)
{
_lastGUIUpdate = Planetarium.GetUniversalTime();
_guiStats = UpdateGUIStats();
CheckEVAKerbals();
LifeSupportManager.Instance.UpdateVesselStats();
}

GUILayout.BeginVertical();
scrollPos = GUILayout.BeginScrollView(scrollPos, _scrollStyle, GUILayout.Width(600), GUILayout.Height(350));
GUILayout.BeginVertical();


try
{
foreach (var v in _guiStats.OrderByDescending(s => s.LastUpdate))
foreach (var v in _guiStats.OrderByDescending(s => (int)s.LastUpdate + " " + s.VesselName))
{
GUILayout.BeginHorizontal();
GUILayout.Label("", _labelStyle, GUILayout.Width(10));
Expand Down
Loading

0 comments on commit 30f2996

Please sign in to comment.