-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f331b30
commit f88c10d
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System; | ||
using System.IO; | ||
using System.Reflection; | ||
using UnityEngine; | ||
|
||
namespace RP0InstallChecker | ||
{ | ||
[KSPAddon(KSPAddon.Startup.Instantly, true)] | ||
public class StartupPopup : MonoBehaviour | ||
{ | ||
private const string PreferenceFileName = "RP1UpgradeWarning"; | ||
private static string PreferenceFilePath => Path.Combine( | ||
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), | ||
"PluginData", | ||
PreferenceFileName); | ||
|
||
public void Start() | ||
{ | ||
if (File.Exists(PreferenceFilePath)) return; | ||
|
||
|
||
PopupDialog.SpawnPopupDialog( | ||
new Vector2(0, 0), | ||
new Vector2(0, 0), | ||
new MultiOptionDialog( | ||
"RP1StartupDialog", | ||
"This is the legacy version of RP-1, and is no longer supported. There is a new version of RP-1, the Programs and Launch Complexes rework, now available. It is savebreaking, and a work in progress, but if you are starting a new save it is highly recommended to switch to that version. Please uninstall RP-1 (Legacy) and install RP-1 (PLC). You can do this by uninstalling and reinstalling the RP-1 Express Install and choosing one of the non-Legacy options.", | ||
"RP-1", | ||
HighLogic.UISkin, | ||
new DialogGUIVerticalLayout( | ||
new DialogGUIButton("Don't show again", RememberPreference, true), | ||
new DialogGUIButton("Ok", () => { }, true) | ||
) | ||
), | ||
true, | ||
HighLogic.UISkin); | ||
} | ||
|
||
private static void RememberPreference() | ||
{ | ||
// create empty file | ||
File.Create(PreferenceFilePath).Close(); | ||
} | ||
} | ||
} |