Skip to content

Commit

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


private int activePos = 0;

private bool nyan = false;

private PopupDialog menu;

#endregion state

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

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

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

nyan = (DateTime.Now.Month == 4 && DateTime.Now.Day == 1)
Expand Down Expand Up @@ -237,36 +238,46 @@ internal void Update()
&& (HighLogic.LoadedScene == GameScenes.SPACECENTER || HighLogic.LoadedScene == GameScenes.MAINMENU)
&& !inRnDCenter)
{
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(
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),
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);
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;
}
}

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

float offsetY = Mathf.FloorToInt(0.3f * Screen.height);
float offsetY = Mathf.FloorToInt(0.23f * Screen.height);
float h;
if (warning)
{
Expand Down Expand Up @@ -425,7 +436,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), "Old versions of Module Manager", status, "OK", false, UISkinManager.defaultSkin);
PopupDialog.SpawnPopupDialog(new Vector2(0f, 1f), new Vector2(0f, 1f), "ModuleManagerOldVersions", "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 d61f725

Please sign in to comment.