Example #1
0
 internal static void Close(this GwenForm form)
 {
     if (form.Window.IsClosable)
     {
         form.Window.Close();
     }
 }
Example #2
0
        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;
        }
Example #3
0
        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);
        }
Example #4
0
        //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);
            }
        }
Example #5
0
 internal static bool Exists(this GwenForm form)
 {
     try
     {
         return(form.Window != null);
     }
     catch
     {
         return(false);
     }
 }
Example #6
0
 internal static bool IsOpen(this GwenForm form)
 {
     try
     {
         return(form.Window.IsVisible);
     }
     catch
     {
         return(false);
     }
 }
Example #7
0
 internal static bool IsOnTop(this GwenForm form)
 {
     try
     {
         return(form.Window.IsOnTop);
     }
     catch
     {
         return(false);
     }
 }
Example #8
0
 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);
     }
 }
Example #9
0
 internal static void Close(this GwenForm form)
 {
     try
     {
         if (form == null)
         {
             return;
         }
         if (form.Window.IsClosable)
         {
             form.Window.Close();
         }
     }
     catch { }
 }
Example #10
0
        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;
        }
Example #11
0
 internal NavigationEntry(GwenForm form, bool isRoot = false)
 {
     this.form   = form;
     this.isRoot = isRoot;
 }
Example #12
0
 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));
 }