Exemplo n.º 1
0
 public override bool CloseAttempt()
 {
     GameThread.NextUpdate(x =>
     {
         if (CloseAlert == null)
         {
             var canSave = vm != null;
             CloseAlert  = new UIMobileAlert(new FSO.Client.UI.Controls.UIAlertOptions
             {
                 Title   = GameFacade.Strings.GetString("153", "1"),             //quit?
                 Message = GameFacade.Strings.GetString("153", canSave?"6":"2"), //are you sure (2), save before quitting (3)
                 Buttons =
                     canSave?
                     UIAlertButton.YesNoCancel(
                         (b) => { Save(); GameFacade.Game.Exit(); },
                         (b) => { GameFacade.Game.Exit(); },
                         (b) => { CloseAlert.Close(); CloseAlert = null; }
                         )
                 :
                     UIAlertButton.YesNo(
                         (b) => { GameFacade.Game.Exit(); },
                         (b) => { CloseAlert.Close(); CloseAlert = null; }
                         )
             });
             GlobalShowDialog(CloseAlert, true);
         }
     });
     return(false);
 }
Exemplo n.º 2
0
        void BtnPurchase_OnButtonClick(UIElement button)
        {
            var selectedOutfit = GetSelectedOutfit();

            if (selectedOutfit == null)
            {
                return;
            }

            UIAlert alert = null;

            alert = UIScreen.GlobalShowAlert(new UIAlertOptions()
            {
                Title   = GameFacade.Strings.GetString("264", "5"),
                Message = GameFacade.Strings.GetString("264", "6"),
                Buttons = UIAlertButton.YesNoCancel(
                    yes => {
                    Send("rack_purchase", selectedOutfit.outfit_id.ToString() + ",true");
                    UIScreen.RemoveDialog(alert);
                },
                    no => {
                    Send("rack_purchase", selectedOutfit.outfit_id.ToString() + ",false");
                    UIScreen.RemoveDialog(alert);
                },
                    cancel => { UIScreen.RemoveDialog(alert); }
                    ),
                Alignment = TextAlignment.Left
            }, true);
        }
Exemplo n.º 3
0
 public void ReturnToNeighbourhood()
 {
     if (CloseAlert == null)
     {
         CloseAlert = new UIMobileAlert(new FSO.Client.UI.Controls.UIAlertOptions
         {
             Title   = GameFacade.Strings.GetString("153", "3"), //save
             Message = GameFacade.Strings.GetString("153", "4"), //Do you want to save the game?
             Buttons =
                 UIAlertButton.YesNoCancel(
                     (b) => { Save(); ExitLot(); CloseAlert.Close(); CloseAlert = null; },
                     (b) => { ExitLot(); CloseAlert.Close(); CloseAlert = null; },
                     (b) => { CloseAlert.Close(); CloseAlert = null; }
                     )
         });
         GlobalShowDialog(CloseAlert, true);
     }
 }