internal static void Close(this GwenForm form) { if (form.Window.IsClosable) { form.Window.Close(); } }
private static void ShowPoliceComputer() { Game.IsPaused = true; if (!Configs.SkipLogin) { login = new ComputerLogin(); login.Show(); while (login.Window.IsVisible || ComputerLogin.next_form.IsAlive || ComputerMain.form_ped_db.IsAlive || ComputerMain.form_veh_db.IsAlive || ComputerMain.form_backup.IsAlive || ComputerMain.form_active_calls.IsAlive || ComputerPedDB.form_main.IsAlive || ComputerVehDB.form_main.IsAlive || ComputerRequestBackup.form_main.IsAlive || ComputerCurrentCallDetails.form_main.IsAlive) { GameFiber.Yield(); } } else { main = new ComputerMain(); main.Show(); while (main.Window.IsVisible || ComputerMain.form_ped_db.IsAlive || ComputerMain.form_veh_db.IsAlive || ComputerMain.form_backup.IsAlive || ComputerMain.form_active_calls.IsAlive || ComputerPedDB.form_main.IsAlive || ComputerPedDB.form_main.IsAlive || ComputerVehDB.form_main.IsAlive || ComputerRequestBackup.form_main.IsAlive || ComputerCurrentCallDetails.form_main.IsAlive) { GameFiber.Yield(); } } Function.DisableBackground(); _opened = false; Game.IsPaused = false; }
internal NavigationEntry Push(GwenForm form, bool notify = true) { var entry = new NavigationEntry(form); Stack.Push(entry); if (notify && OnFormAdded != null) { OnFormAdded(this, entry); } return(entry); }
//internal void PopToRoot() //{ // if (!IsEmpty) // { // var first = Stack.First().form; // this.Replace(first); // } //} internal void Replace(GwenForm form) { Clear(); var entry = new NavigationEntry(form, true); Stack.Push(entry); if (OnFormAdded != null) { OnFormAdded(this, entry); } }
internal static bool Exists(this GwenForm form) { try { return(form.Window != null); } catch { return(false); } }
internal static bool IsOpen(this GwenForm form) { try { return(form.Window.IsVisible); } catch { return(false); } }
internal static bool IsOnTop(this GwenForm form) { try { return(form.Window.IsOnTop); } catch { return(false); } }
internal static bool IsOpen(this GwenForm form) { try { if (form == null || form.Window == null) { return(false); } return(form.Window.IsVisible || form.Window.IsOnTop || form.Window.IsClosable); } catch { return(false); } }
internal static void Close(this GwenForm form) { try { if (form == null) { return; } if (form.Window.IsClosable) { form.Window.Close(); } } catch { } }
private void ShowForm(GwenForm gwenForm) { Game.IsPaused = true; gwenForm.Show(); var screenSize = Game.Resolution; var formSize = gwenForm.Size; var formX = screenSize.Width / 2 - formSize.Width / 2; var formY = screenSize.Height / 3 - formSize.Height / 2; gwenForm.Position = new System.Drawing.Point(formX, formY); while (gwenForm.Window.IsVisible) { GameFiber.Yield(); } Game.IsPaused = false; }
internal NavigationEntry(GwenForm form, bool isRoot = false) { this.form = form; this.isRoot = isRoot; }
internal static Point GetLaunchPosition(this GwenForm form) { return(new Point(Game.Resolution.Width / 2 - form.Window.Width / 2, Game.Resolution.Height / 2 - form.Window.Height / 2)); }