Skip to content

Commit 3995d43

Browse files
committed
Merge 3.8.5.0 to master
2 parents 78485dc + cbc76fc commit 3995d43

File tree

10 files changed

+55
-26
lines changed

10 files changed

+55
-26
lines changed

KerbalAlarmClock/KerbalAlarmClock.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ private void HandleKeyStrokes()
378378

379379
if (settings.KillWarpOnThrottleCutOffKeystroke)
380380
{
381-
if (Input.GetKeyDown(GameSettings.THROTTLE_CUTOFF.primary) || Input.GetKeyDown(GameSettings.THROTTLE_CUTOFF.secondary))
381+
if (Input.GetKeyDown(GameSettings.THROTTLE_CUTOFF.primary.code) || Input.GetKeyDown(GameSettings.THROTTLE_CUTOFF.secondary.code))
382382
{
383383
//Make sure we cancel autowarp if its engaged
384384
if (TimeWarp.fetch != null)

KerbalAlarmClock/KerbalAlarmClock.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@
3838
<Prefer32Bit>false</Prefer32Bit>
3939
</PropertyGroup>
4040
<ItemGroup>
41-
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
41+
<Reference Include="Assembly-CSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
4242
<SpecificVersion>False</SpecificVersion>
43-
<HintPath>..\..\_Versions\KSP_win_PluginTest_Minimal\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
43+
<HintPath>C:\Squad\KSP\KSP\Library\ScriptAssemblies\Assembly-CSharp.dll</HintPath>
4444
</Reference>
4545
<Reference Include="System" />
4646
<Reference Include="System.Data" />
4747
<Reference Include="System.Xml" />
4848
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
4949
<SpecificVersion>False</SpecificVersion>
50-
<HintPath>..\..\_Versions\KSP_win_PluginTest_Minimal\KSP_Data\Managed\UnityEngine.dll</HintPath>
50+
<HintPath>C:\Squad\KSP\KSP\Library\UnityAssemblies\UnityEngine.dll</HintPath>
5151
</Reference>
5252
</ItemGroup>
5353
<ItemGroup>

KerbalAlarmClock/KerbalAlarmClock.version

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55
"VERSION": {
66
"MAJOR": 3,
77
"MINOR": 8,
8-
"PATCH": 4,
8+
"PATCH": 5,
99
"BUILD": 0
1010
},
1111
"KSP_VERSION": {
1212
"MAJOR": 1,
13-
"MINOR": 2,
14-
"PATCH": 2
13+
"MINOR": 3,
14+
"PATCH": 0
1515
},
1616
"KSP_VERSION_MIN": {
1717
"MAJOR": 1,
18-
"MINOR": 2,
18+
"MINOR": 3,
1919
"PATCH": 0
2020
},
2121
"KSP_VERSION_MAX": {
2222
"MAJOR": 1,
23-
"MINOR": 2,
23+
"MINOR": 3,
2424
"PATCH": 99
2525
}
2626
}

KerbalAlarmClock/KerbalAlarmClock_Window.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ public partial class KerbalAlarmClock
3838
Int32 intTooltipMaxWidth = 250;
3939
//timer so it only displays for a preriod of time
4040
float fltTooltipTime = 0f;
41-
float fltMaxToolTipTime = 15f;
4241

4342

4443
private void DrawToolTip()
4544
{
46-
if (strToolTipText != "" && (fltTooltipTime < fltMaxToolTipTime))
45+
//reset display time if text changed
46+
if (strToolTipText != strLastTooltipText)
47+
fltTooltipTime = Time.unscaledTime + settings.MaxToolTipTimeFloat;
48+
if (strToolTipText != "" && (Time.unscaledTime <= fltTooltipTime))
4749
{
4850
GUIContent contTooltip = new GUIContent(strToolTipText);
4951
if (!blnToolTipDisplayed || (strToolTipText != strLastTooltipText))
5052
{
51-
//reset display time if text changed
52-
fltTooltipTime = 0f;
5353
//Calc the size of the Tooltip
5454
rectToolTipPosition = new Rect(Event.current.mousePosition.x, Event.current.mousePosition.y + intTooltipVertOffset, 0, 0);
5555
float minwidth, maxwidth;
@@ -64,16 +64,14 @@ private void DrawToolTip()
6464
//On top of everything
6565
GUI.depth = 0;
6666

67-
//update how long the tip has been on the screen and reset the flags
68-
fltTooltipTime += Time.deltaTime;
67+
//reset the flags
6968
blnToolTipDisplayed = true;
7069
}
7170
else
7271
{
7372
//clear the flags
7473
blnToolTipDisplayed = false;
7574
}
76-
if (strToolTipText != strLastTooltipText) fltTooltipTime = 0f;
7775
strLastTooltipText = strToolTipText;
7876
}
7977

KerbalAlarmClock/KerbalAlarmClock_WindowDropDowns.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,27 +47,27 @@ internal void InitDropDowns()
4747
ddlChecksPerSec = new DropDownList(strChecksPerSecChoices,_WindowSettingsRect);
4848
ddlChecksPerSec.OnSelectionChanged += ddlChecksPerSec_OnSelectionChanged;
4949

50-
ddlSettingsSkin = new DropDownList(EnumExtensions.ToEnumDescriptions<Settings.DisplaySkin>(), (Int32)settings.SelectedSkin, _WindowSettingsRect);
50+
ddlSettingsSkin = new DropDownList(KSPPluginFramework.EnumExtensions.ToEnumDescriptions<Settings.DisplaySkin>(), (Int32)settings.SelectedSkin, _WindowSettingsRect);
5151
ddlSettingsSkin.OnSelectionChanged += ddlSettingsSkin_OnSelectionChanged;
5252

53-
ddlSettingsButtonStyle = new DropDownList(EnumExtensions.ToEnumDescriptions<Settings.ButtonStyleEnum>(), (Int32)settings.ButtonStyleChosen, _WindowSettingsRect);
53+
ddlSettingsButtonStyle = new DropDownList(KSPPluginFramework.EnumExtensions.ToEnumDescriptions<Settings.ButtonStyleEnum>(), (Int32)settings.ButtonStyleChosen, _WindowSettingsRect);
5454
ddlSettingsButtonStyle.OnSelectionChanged += ddlSettingsButtonStyle_OnSelectionChanged;
5555

56-
ddlSettingsAlarmSpecs = new DropDownList(EnumExtensions.ToEnumDescriptions<SettingsAlarmSpecsEnum>(), (int)SettingsAlarmSpecSelected, _WindowSettingsRect);
56+
ddlSettingsAlarmSpecs = new DropDownList(KSPPluginFramework.EnumExtensions.ToEnumDescriptions<SettingsAlarmSpecsEnum>(), (int)SettingsAlarmSpecSelected, _WindowSettingsRect);
5757
ddlSettingsAlarmSpecs.OnSelectionChanged += ddlSettingsAlarmSpecs_OnSelectionChanged;
5858

59-
ddlSettingsContractAutoOffered = new DropDownList(EnumExtensions.ToEnumDescriptions<Settings.AutoContractBehaviorEnum>(), (Int32)settings.AlarmAddContractAutoOffered, _WindowSettingsRect);
59+
ddlSettingsContractAutoOffered = new DropDownList(KSPPluginFramework.EnumExtensions.ToEnumDescriptions<Settings.AutoContractBehaviorEnum>(), (Int32)settings.AlarmAddContractAutoOffered, _WindowSettingsRect);
6060
ddlSettingsContractAutoOffered.OnSelectionChanged += ddlSettingsContractAutoOffered_OnSelectionChanged;
61-
ddlSettingsContractAutoActive = new DropDownList(EnumExtensions.ToEnumDescriptions<Settings.AutoContractBehaviorEnum>(), (Int32)settings.AlarmAddContractAutoActive, _WindowSettingsRect);
61+
ddlSettingsContractAutoActive = new DropDownList(KSPPluginFramework.EnumExtensions.ToEnumDescriptions<Settings.AutoContractBehaviorEnum>(), (Int32)settings.AlarmAddContractAutoActive, _WindowSettingsRect);
6262
ddlSettingsContractAutoActive.OnSelectionChanged += ddlSettingsContractAutoActive_OnSelectionChanged;
6363

64-
ddlSettingsCalendar = new DropDownList(EnumExtensions.ToEnumDescriptions<CalendarTypeEnum>(), (Int32)settings.SelectedCalendar,_WindowSettingsRect );
64+
ddlSettingsCalendar = new DropDownList(KSPPluginFramework.EnumExtensions.ToEnumDescriptions<CalendarTypeEnum>(), (Int32)settings.SelectedCalendar,_WindowSettingsRect );
6565
//NOTE:Pull out the custom option for now
6666
ddlSettingsCalendar.Items.Remove(CalendarTypeEnum.Custom.Description());
6767
ddlSettingsCalendar.OnSelectionChanged += ddlSettingsCalendar_OnSelectionChanged;
6868

69-
ddlKERNodeMargin = new DropDownList(EnumExtensions.ToEnumDescriptions<Settings.BurnMarginEnum>(), _WindowAddRect);
70-
ddlSettingsKERNodeMargin = new DropDownList(EnumExtensions.ToEnumDescriptions<Settings.BurnMarginEnum>(), (int)settings.DefaultKERMargin, _WindowSettingsRect);
69+
ddlKERNodeMargin = new DropDownList(KSPPluginFramework.EnumExtensions.ToEnumDescriptions<Settings.BurnMarginEnum>(), _WindowAddRect);
70+
ddlSettingsKERNodeMargin = new DropDownList(KSPPluginFramework.EnumExtensions.ToEnumDescriptions<Settings.BurnMarginEnum>(), (int)settings.DefaultKERMargin, _WindowSettingsRect);
7171
ddlSettingsKERNodeMargin.OnSelectionChanged += ddlSettingsKERNodeMargin_OnSelectionChanged;
7272

7373

KerbalAlarmClock/KerbalAlarmClock_WindowSettings.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,12 @@ private void WindowLayout_SettingsGlobal()
228228
GUILayout.Label("Max alarms before scrolling the list", KACResources.styleAddHeading);
229229
GUILayout.EndHorizontal();
230230

231+
GUILayout.BeginHorizontal();
232+
if(DrawTextBox(ref settings.MaxToolTipTime, KACResources.styleAddField, GUILayout.Width(45)))
233+
settings.Save();
234+
GUILayout.Label("Max time before tooltip is auto-hidden", KACResources.styleAddHeading);
235+
GUILayout.EndHorizontal();
236+
231237
if (DrawCheckbox(ref settings.HideOnPause, "Hide Alarm Clock when game is paused"))
232238
settings.Save();
233239

KerbalAlarmClock/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("3.8.4.0")]
36-
[assembly: AssemblyFileVersion("3.8.4.0")]
35+
[assembly: AssemblyVersion("3.8.5.0")]
36+
[assembly: AssemblyFileVersion("3.8.5.0")]

KerbalAlarmClock/Settings.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,18 @@ internal TimeSpanStringFormatsEnum TimeSpanFormat
158158
}
159159

160160

161+
[Persistent] internal String MaxToolTipTime = "15";
162+
public float MaxToolTipTimeFloat
163+
{
164+
get
165+
{
166+
float v;
167+
if(float.TryParse(MaxToolTipTime, out v))
168+
return v;
169+
else
170+
return 15;
171+
}
172+
}
161173
[Persistent] internal Boolean ShowTooltips = true;
162174
[Persistent] internal Boolean ShowEarthTime = false;
163175

KerbalAlarmClock/Utilities.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,14 @@ private static void PurgeOldBackups(String OriginalName)
105105
for (int i = SaveBackupsToDelete.Count - 1; i >= 0; i--)
106106
{
107107
MonoBehaviourExtended.LogFormatted("\tDeleting {0}", SaveBackupsToDelete[i].Name);
108+
109+
//bin the loadmeta if it exists too
110+
string loadmetaFile = SaveBackupsToDelete[i].DirectoryName + "/" + System.IO.Path.GetFileNameWithoutExtension(SaveBackupsToDelete[i].FullName) + ".loadmeta";
111+
if (System.IO.File.Exists(loadmetaFile))
112+
{
113+
System.IO.File.Delete(loadmetaFile);
114+
}
115+
108116
SaveBackupsToDelete[i].Delete();
109117
}
110118
}

PlugInFiles/ReadMe-KerbalAlarmClock.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ ATTRIBUTION-SOUNDS
3232
Included Sounds are from freesfx.co.uk (http://www.freesfx.co.uk). EULA can be found here: http://www.freesfx.co.uk/info/eula/
3333

3434
VERSION HISTORY
35+
Version 3.8.5.0 - KSP Version: 1.3.0
36+
- Recompiled for 1.3.0 (Issue #191)
37+
- Merged in configurable tooltip period (Issue #190)
38+
- Added Purge stuff for meta files (Issue #189)
39+
3540
Version 3.8.4.0 - KSP Version: 1.2.2
3641
- Fixed bug in HideWhenPaused logic - (Issue #184)
3742
- Hide the KAC when in the SpaceCenter overlay scenes Issue #186)

0 commit comments

Comments
 (0)