Skip to content

Commit

Permalink
Temp revert of 1.3 changes to release a 1.2 patch
Browse files Browse the repository at this point in the history
  • Loading branch information
sarbian committed May 6, 2017
1 parent b301cb9 commit 29df624
Showing 1 changed file with 35 additions and 46 deletions.
81 changes: 35 additions & 46 deletions moduleManager.cs
Expand Up @@ -35,9 +35,10 @@ public class ModuleManager : MonoBehaviour
private Sprite[] catFrames;
private Texture2D rainbow;

private bool nyan = false;

private PopupDialog menu;
private int activePos = 0;

private bool nyan = false;

#endregion state

Expand Down Expand Up @@ -107,9 +108,7 @@ internal void Awake()
MMPatchLoader loader = aGameObject.AddComponent<MMPatchLoader>();

log(string.Format("Adding ModuleManager to the loading screen {0}", list.Count));

int gameDatabaseIndex = list.FindIndex(s => s is GameDatabase);
list.Insert(gameDatabaseIndex + 1, loader);
list.Insert(1, loader);
}

nyan = (DateTime.Now.Month == 4 && DateTime.Now.Day == 1)
Expand Down Expand Up @@ -238,46 +237,36 @@ internal void Update()
&& (HighLogic.LoadedScene == GameScenes.SPACECENTER || HighLogic.LoadedScene == GameScenes.MAINMENU)
&& !inRnDCenter)
{
if (menu == null)
{
menu = PopupDialog.SpawnPopupDialog(new Vector2(0.5f, 0.5f),
new Vector2(0.5f, 0.5f),
new MultiOptionDialog(
"ModuleManagerMenu",
"",
"ModuleManager",
HighLogic.UISkin,
new Rect(0.5f, 0.5f, 150f, 60f),
PopupDialog.SpawnPopupDialog(new Vector2(0.5f, 0.5f),
new Vector2(0.5f, 0.5f),
new MultiOptionDialog("",
"ModuleManager",
HighLogic.UISkin,
new Rect(0.5f, 0.5f, 150f, 60f),
new DialogGUIFlexibleSpace(),
new DialogGUIVerticalLayout(
new DialogGUIFlexibleSpace(),
new DialogGUIVerticalLayout(
new DialogGUIFlexibleSpace(),
new DialogGUIButton("Reload Database",
delegate
{
MMPatchLoader.keepPartDB = false;
StartCoroutine(DataBaseReloadWithMM());
}, 140.0f, 30.0f, true),
new DialogGUIButton("Quick Reload Database",
delegate
{
MMPatchLoader.keepPartDB = true;
StartCoroutine(DataBaseReloadWithMM());
}, 140.0f, 30.0f, true),
new DialogGUIButton("Dump Database to Files",
delegate
{
StartCoroutine(DataBaseReloadWithMM(true));
}, 140.0f, 30.0f, true),
new DialogGUIButton("Close", () => { }, 140.0f, 30.0f, true)
)),
false,
HighLogic.UISkin);
}
else
{
menu.Dismiss();
menu = null;
}
new DialogGUIButton("Reload Database",
delegate
{
MMPatchLoader.keepPartDB = false;
StartCoroutine(DataBaseReloadWithMM());
}, 140.0f, 30.0f, true),
new DialogGUIButton("Quick Reload Database",
delegate
{
MMPatchLoader.keepPartDB = true;
StartCoroutine(DataBaseReloadWithMM());
}, 140.0f, 30.0f, true),
new DialogGUIButton("Dump Database to Files",
delegate
{
StartCoroutine(DataBaseReloadWithMM(true));
}, 140.0f, 30.0f, true),
new DialogGUIButton("Close",() => {}, 140.0f, 30.0f, true)
)),
false,
HighLogic.UISkin);
}

if (totalTime.IsRunning && HighLogic.LoadedScene == GameScenes.MAINMENU)
Expand All @@ -288,7 +277,7 @@ internal void Update()
Application.runInBackground = GameSettings.SIMULATE_IN_BACKGROUND;
}

float offsetY = Mathf.FloorToInt(0.23f * Screen.height);
float offsetY = Mathf.FloorToInt(0.3f * Screen.height);
float h;
if (warning)
{
Expand Down Expand Up @@ -436,7 +425,7 @@ public bool ElectionAndCheck()
string status =
"You have old versions of Module Manager (older than 1.5) or MMSarbianExt.\nYou will need to remove them for Module Manager and the mods using it to work\nExit KSP and delete those files :\n" +
String.Join("\n", badPaths.ToArray());
PopupDialog.SpawnPopupDialog(new Vector2(0f, 1f), new Vector2(0f, 1f), "ModuleManagerOldVersions", "Old versions of Module Manager", status, "OK", false, UISkinManager.defaultSkin);
PopupDialog.SpawnPopupDialog(new Vector2(0f, 1f), new Vector2(0f, 1f), "Old versions of Module Manager", status, "OK", false, UISkinManager.defaultSkin);
log("Old version of Module Manager present. Stopping");
return false;
}
Expand Down

0 comments on commit 29df624

Please sign in to comment.