public static void BringWindowToFront(Core.Window window) { if (mOpenWindows.Contains(window)) { SwitchWindows(mOpenWindows.IndexOf(window), mOpenWindows.Count - 1); } }
private static void SwitchWindows(int oldSlot, int newSlot) { if (mOpenWindows.Count > oldSlot && mOpenWindows.Count > newSlot) { Core.Window temp = mOpenWindows[oldSlot]; mOpenWindows[oldSlot] = mOpenWindows[newSlot]; mOpenWindows[newSlot] = temp; } }
public static void RemoveWindowQuick(Core.Window windowToRemove) { if (windowToRemove != null) { Globals.GameScreen.TaskBar.RemoveButton(windowToRemove); mOpenWindows.Remove(windowToRemove); windowToRemove = null; } }
public static bool IsWindowTopMost(Core.Window window) { if (mOpenWindows.Count > 0) { return(window == mOpenWindows[mOpenWindows.Count - 1]); } else { return(false); } }
public static void AddWindow(Core.Window windowToAdd) { if (windowToAdd != null && mOpenWindows.Contains(windowToAdd) == false) { bool autoSwitch = false; if (mOpenWindows.Count > 0) { if (mOpenWindows[mOpenWindows.Count - 1].AlwaysOnTop) { autoSwitch = true; } } mOpenWindows.Add(windowToAdd); if (autoSwitch) { SwitchWindows(mOpenWindows.Count - 2, mOpenWindows.Count - 1); } if (windowToAdd.ShowInTaskBar && windowToAdd.TaskBarText != "") { Globals.GameScreen.TaskBar.AddButton(new Client.Logic.Gui.TaskBar.TaskBarButton(windowToAdd)); } } }
public static bool IsWindowOpen(Core.Window windowToCheck) { return(mOpenWindows.Contains(windowToCheck)); }