Skip to content
This repository has been archived by the owner on Feb 10, 2018. It is now read-only.

Commit

Permalink
v1.01
Browse files Browse the repository at this point in the history
  • Loading branch information
malahx committed May 9, 2015
1 parent 49b8cd2 commit 5fe4c46
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 33 deletions.
Binary file modified GameData/QuickStart/Plugins/QuickStart.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion GameData/QuickStart/QuickStart.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"NAME":"QuickStart","URL":"https://raw.githubusercontent.com/malahx/QuickStart/master/QuickStart.version","DOWNLOAD":"https://github.com/malahx/QuickStart/releases","CHANGE_LOG_URL":"https://raw.githubusercontent.com/malahx/QuickStart/master/README.md","VERSION":{"MAJOR":1,"MINOR":0,"PATCH":0,"BUILD":0},"KSP_VERSION":{"MAJOR":1,"MINOR":0,"PATCH":2}}
{"NAME":"QuickStart","URL":"https://raw.githubusercontent.com/malahx/QuickStart/master/QuickStart.version","DOWNLOAD":"https://github.com/malahx/QuickStart/releases","CHANGE_LOG_URL":"https://raw.githubusercontent.com/malahx/QuickStart/master/README.md","VERSION":{"MAJOR":1,"MINOR":0,"PATCH":1n,"BUILD":0},"KSP_VERSION":{"MAJOR":1,"MINOR":0,"PATCH":2}}
12 changes: 7 additions & 5 deletions GameData/QuickStart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,25 @@ Unzip all files. Merge the new QuickStart folder with the old folder which is in

Delete the QuickStart folder in your KSP/GameData folder.

#### Troubleshooting?

If you use a plugin which needs to work on the mainmenu, It can be blocked by QuickStart.

#### Changelog

v1.01 - 2015.05.09
* Fix: Corrected the launch of QuickStart to allow others plugins to load at the Main menu.

v1.00 - 2015.05.08
* First release.

#### Thanks!

* to curiousepic and 5thHorseman to have requested this mod,
* to sirkut for his mod Magic Smoke Industries DevHelper,
* to all other mod developers which make this game really huge,
* to my friend Neimad who corrects my bad english ...
* and to Squad for this awesome game.

#### Links

* http://forum.kerbalspaceprogram.com/threads/95168#QuickStart
* https://github.com/malahx/QuickStart
* https://kerbalstuff.com/mod/763/QuickStart
* https://github.com/malahx/QuickStart
* Magic Smoke Industries DevHelper: http://forum.kerbalspaceprogram.com/threads/60880
2 changes: 1 addition & 1 deletion Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion ("1.0.0.*")]
[assembly: AssemblyVersion ("1.0.1.*")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
Expand Down
42 changes: 24 additions & 18 deletions QS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ You should have received a copy of the GNU General Public License
*/

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEngine;

namespace QuickStart {
Expand All @@ -40,9 +40,9 @@ public static QuickStart Instance {

private string LastSaveGameUsed {
get {
DirectoryInfo[] _directories = new DirectoryInfo (SaveFolder).GetDirectories ();
DateTime _lastWriteTime = DateTime.MinValue;
string _lastDirectoryUsed = string.Empty;
DirectoryInfo[] _directories = new DirectoryInfo (SaveFolder).GetDirectories ();
foreach (DirectoryInfo _directory in _directories) {
FileInfo[] _files = _directory.GetFiles ();
FileInfo _file = Array.Find (_files, f => f.Name == "persistent.sfs");
Expand Down Expand Up @@ -71,22 +71,23 @@ private void Awake() {
}
Instance = this;
DontDestroyOnLoad (Instance);
GameEvents.onLevelWasLoadedGUIReady.Add (OnLevelWasLoadedGUIReady);
lastSaveGameUsed = LastSaveGameUsed;
StartCoroutine (QStart ());
}

private void Start() {
QSettings.Instance.Load ();
}

private void OnDestroy() {
GameEvents.onLevelWasLoadedGUIReady.Remove (OnLevelWasLoadedGUIReady);
Quick.Log ("Bye, have fun");
}

private void OnLevelWasLoadedGUIReady(GameScenes gameScene) {
if (gameScene != GameScenes.MAINMENU) {
return;
private IEnumerator QStart() {
while (MainMenu.FindObjectOfType(typeof(MainMenu)) == null) {
yield return 0;
}
Quick.Log ("MainMenu Loaded");
if (QSettings.Instance.Enabled) {
if (!string.IsNullOrEmpty(lastSaveGameUsed)) {
Quick.Warning ("The last game found: " + lastSaveGameUsed);
Expand All @@ -98,25 +99,30 @@ private void OnLevelWasLoadedGUIReady(GameScenes gameScene) {
}
HighLogic.CurrentGame.Start ();
Destroy (this);
return;
yield break;
}
}
Quick.Warning ("Can't load the last save game");
}
Destroy (this);
Destroy (this);
}

private void OnGUI() {
if (!string.IsNullOrEmpty(lastSaveGameUsed)) {
GUI.skin = HighLogic.Skin;
GUILayout.BeginArea (RectGUI);
bool _Enabled = GUILayout.Toggle (QSettings.Instance.Enabled, "Enable QuickStart to the last game: " + (lastSaveGameUsed != null ? lastSaveGameUsed : "Not found the last game"));
if (_Enabled != QSettings.Instance.Enabled) {
QSettings.Instance.Enabled = _Enabled;
QSettings.Instance.Save ();
}
GUILayout.EndArea ();
if (HighLogic.LoadedSceneIsGame) {
Destroy (this);
return;
}
if (string.IsNullOrEmpty (lastSaveGameUsed) || HighLogic.LoadedScene != GameScenes.LOADING) {
return;
}
GUI.skin = HighLogic.Skin;
GUILayout.BeginArea (RectGUI);
bool _Enabled = GUILayout.Toggle (QSettings.Instance.Enabled, "Enable QuickStart to the last game: " + (lastSaveGameUsed != null ? lastSaveGameUsed : "Not found the last game"));
if (_Enabled != QSettings.Instance.Enabled) {
QSettings.Instance.Enabled = _Enabled;
QSettings.Instance.Save ();
}
GUILayout.EndArea ();
}
}
}
3 changes: 1 addition & 2 deletions QuickStart.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<RootNamespace>QuickStart</RootNamespace>
<AssemblyName>QuickStart</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<ReleaseVersion>1.00</ReleaseVersion>
<ReleaseVersion>1.01</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -21,7 +21,6 @@
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
Expand Down
2 changes: 1 addition & 1 deletion QuickStart.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"NAME":"QuickStart","URL":"https://raw.githubusercontent.com/malahx/QuickStart/master/QuickStart.version","DOWNLOAD":"https://github.com/malahx/QuickStart/releases","CHANGE_LOG_URL":"https://raw.githubusercontent.com/malahx/QuickStart/master/README.md","VERSION":{"MAJOR":1,"MINOR":0,"PATCH":0,"BUILD":0},"KSP_VERSION":{"MAJOR":1,"MINOR":0,"PATCH":2}}
{"NAME":"QuickStart","URL":"https://raw.githubusercontent.com/malahx/QuickStart/master/QuickStart.version","DOWNLOAD":"https://github.com/malahx/QuickStart/releases","CHANGE_LOG_URL":"https://raw.githubusercontent.com/malahx/QuickStart/master/README.md","VERSION":{"MAJOR":1,"MINOR":0,"PATCH":1n,"BUILD":0},"KSP_VERSION":{"MAJOR":1,"MINOR":0,"PATCH":2}}
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,25 @@ Unzip all files. Merge the new QuickStart folder with the old folder which is in

Delete the QuickStart folder in your KSP/GameData folder.

#### Troubleshooting?

If you use a plugin which needs to work on the mainmenu, It can be blocked by QuickStart.

#### Changelog

v1.01 - 2015.05.09
* Fix: Corrected the launch of QuickStart to allow others plugins to load at the Main menu.

v1.00 - 2015.05.08
* First release.

#### Thanks!

* to curiousepic and 5thHorseman to have requested this mod,
* to sirkut for his mod Magic Smoke Industries DevHelper,
* to all other mod developers which make this game really huge,
* to my friend Neimad who corrects my bad english ...
* and to Squad for this awesome game.

#### Links

* http://forum.kerbalspaceprogram.com/threads/95168#QuickStart
* https://github.com/malahx/QuickStart
* https://kerbalstuff.com/mod/763/QuickStart
* https://github.com/malahx/QuickStart
* Magic Smoke Industries DevHelper: http://forum.kerbalspaceprogram.com/threads/60880

0 comments on commit 5fe4c46

Please sign in to comment.