Skip to content

Commit 31b2ea0

Browse files
author
Nifty255
committed
v2.4.2:
- Fixed bug which caused the draft app to blank out on the flight scene. - Fixed bug which caused scene switching issues after entering one save, leaving, and then entering another.
1 parent ff33f21 commit 31b2ea0

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed
0 Bytes
Binary file not shown.

DraftTwitchViewers/README.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Draft Twitch Viewers
2-
v2.3: Release
2+
v2.4.2: Release
33

44
This software is provided "as-is" with no warranties.
55

@@ -30,6 +30,10 @@ Draft Twitch Viewers (DTV) uses web requests to connect to Twitch, and can pick
3030

3131
CHANGELOG:
3232

33+
v2.4.2:
34+
- Fixed bug which caused the draft app to blank out on the flight scene.
35+
- Fixed bug which caused scene switching issues after entering one save, leaving, and then entering another.
36+
3337
v2.4.1:
3438
- Modified DraftKerbal method to invoke success using a generic Dictionary instead of a specialized DraftInfo object.
3539
- ScenarioDraftManager now destroys itself when returning to the main menu (and reloads when entering another save) to prevent potential load/save issues.

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Draft Twitch Viewers
2-
v2.3: Release
2+
v2.4.2: Release
33

44
This software is provided "as-is" with no warranties.
55

@@ -30,6 +30,10 @@ Draft Twitch Viewers (DTV) uses web requests to connect to Twitch, and can pick
3030

3131
CHANGELOG:
3232

33+
v2.4.2:
34+
- Fixed bug which caused the draft app to blank out on the flight scene.
35+
- Fixed bug which caused scene switching issues after entering one save, leaving, and then entering another.
36+
3337
v2.4.1:
3438
- Modified DraftKerbal method to invoke success using a generic Dictionary instead of a specialized DraftInfo object.
3539
- ScenarioDraftManager now destroys itself when returning to the main menu (and reloads when entering another save) to prevent potential load/save issues.

Source/DraftTwitchViewers/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("2.4.1.0")]
36-
[assembly: AssemblyFileVersion("2.3.1.0")]
35+
[assembly: AssemblyVersion("2.4.2.2")]
36+
[assembly: AssemblyFileVersion("2.4.2.2")]

Source/DraftTwitchViewers/README.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Draft Twitch Viewers
2-
v2.3: Release
2+
v2.4.2: Release
33

44
This software is provided "as-is" with no warranties.
55

@@ -30,6 +30,10 @@ Draft Twitch Viewers (DTV) uses web requests to connect to Twitch, and can pick
3030

3131
CHANGELOG:
3232

33+
v2.4.2:
34+
- Fixed bug which caused the draft app to blank out on the flight scene.
35+
- Fixed bug which caused scene switching issues after entering one save, leaving, and then entering another.
36+
3337
v2.4.1:
3438
- Modified DraftKerbal method to invoke success using a generic Dictionary instead of a specialized DraftInfo object.
3539
- ScenarioDraftManager now destroys itself when returning to the main menu (and reloads when entering another save) to prevent potential load/save issues.

Source/DraftTwitchViewers/ScenarioDraftManager.cs

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace DraftTwitchViewers
99
/// <summary>
1010
/// A KSP Scenario module which handles all draft functions, both internal and external.
1111
/// </summary>
12-
[KSPScenario(ScenarioCreationOptions.AddToAllGames, new GameScenes[] { GameScenes.SPACECENTER })]
12+
[KSPScenario(ScenarioCreationOptions.AddToAllGames, new GameScenes[] { GameScenes.SPACECENTER, GameScenes.FLIGHT, GameScenes.TRACKSTATION })]
1313
class ScenarioDraftManager : ScenarioModule
1414
{
1515
#region Instance
@@ -109,7 +109,6 @@ public override void OnAwake()
109109
if (!Instance)
110110
{
111111
Instance = this;
112-
DontDestroyOnLoad(gameObject);
113112

114113
#region Global Settings Load
115114

@@ -245,15 +244,13 @@ public override void OnAwake()
245244

246245
#endregion
247246

248-
// Destroy this instance if the Main Menu is loaded.
249-
GameEvents.onGameSceneLoadRequested.Add(SceneRequested);
250-
251247
// Initialize the regex array.
252248
InitRegexes();
253249
}
254250
else
255251
{
256-
Destroy(gameObject);
252+
Logger.DebugWarning("ScenarioDraftManager instance still exists.");
253+
DestroyImmediate(this);
257254
}
258255
}
259256

@@ -277,7 +274,10 @@ void Update()
277274

278275
void OnDestroy()
279276
{
280-
Instance = null;
277+
if (Instance == this)
278+
{
279+
Instance = null;
280+
}
281281
}
282282

283283
#endregion
@@ -417,18 +417,6 @@ public void LegacyLoadLocalSettings()
417417
}
418418
}
419419

420-
/// <summary>
421-
/// Destroys this instance if the requested scene is the Main Menu.
422-
/// </summary>
423-
/// <param name="requestedScene">The requested scene.</param>
424-
void SceneRequested(GameScenes requestedScene)
425-
{
426-
if (requestedScene == GameScenes.MAINMENU)
427-
{
428-
Destroy(gameObject);
429-
}
430-
}
431-
432420
#endregion
433421

434422
#region Draft function

0 commit comments

Comments
 (0)