示例#1
0
 private void GoBack(UIElement button)
 {
     if (Mode == UICASMode.FamilyEdit)
     {
         if (ConfirmDialog == null)
         {
             ConfirmDialog = new UIMobileAlert(new UIAlertOptions()
             {
                 Title   = GameFacade.Strings.GetString("129", "7"),
                 Message = GameFacade.Strings.GetString("129", "8"),
                 Buttons = UIAlertButton.YesNo(
                     (ybtn) => { ConfirmDialog.Close(); GoBack(ybtn); ConfirmDialog = null; },
                     (nbtn) => { ConfirmDialog.Close(); ConfirmDialog = null; }
                     )
             });
             UIScreen.GlobalShowDialog(ConfirmDialog, true);
             return;
         }
         else
         {
             ClearFamily();
         }
     }
     SetMode((UICASMode)(((int)Mode) - 1));
 }
示例#2
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);
 }
示例#3
0
        public void NeighSelection(NeighSelectionMode mode)
        {
            var nbd = (ushort)((mode == NeighSelectionMode.MoveInMagic) ? 7 : 4);

            TS1NeighPanel = new UINeighborhoodSelectionPanel(nbd);
            var switcher = new UINeighbourhoodSwitcher(TS1NeighPanel, nbd, mode != NeighSelectionMode.Normal);

            TS1NeighPanel.OnHouseSelect += (house) =>
            {
                if (MoveInFamily != null)
                {
                    //move them in first
                    //confirm it
                    UIMobileAlert confirmDialog = null;
                    confirmDialog = new UIMobileAlert(new UIAlertOptions()
                    {
                        Title   = GameFacade.Strings.GetString("132", "0"),
                        Message = GameFacade.Strings.GetString("132", "1"),
                        Buttons = UIAlertButton.YesNo((b) =>
                        {
                            confirmDialog.Close();
                            MoveInAndPlay((short)house, MoveInFamily.Value, switcher);
                        },
                                                      (b) => confirmDialog.Close())
                    });
                    UIScreen.GlobalShowDialog(confirmDialog, true);
                }
                else
                {
                    PlayHouse((short)house, switcher);
                }
            };
            Add(TS1NeighPanel);
            Add(switcher);
        }
示例#4
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);
     }
 }
示例#5
0
        private void Accept(UIElement button)
        {
            switch (Mode)
            {
            case UICASMode.SimEdit:
                //add or replace the sim in the family
                AcceptMember();
                break;

            case UICASMode.FamilyEdit:
                //add or replace the family in the neighbourhood
                //need to generate an actual FAMI and save it for this
                if (ConfirmDialog == null)
                {
                    ConfirmDialog = new UIMobileAlert(new UIAlertOptions()
                    {
                        Title   = GameFacade.Strings.GetString("129", "13"),
                        Message = GameFacade.Strings.GetString("129", "14"),
                        Buttons = UIAlertButton.YesNo(
                            (ybtn) => { ConfirmDialog.Close(); Accept(ybtn); ConfirmDialog = null; },
                            (nbtn) => { ConfirmDialog.Close(); ConfirmDialog = null; }
                            )
                    });
                    UIScreen.GlobalShowDialog(ConfirmDialog, true);
                    return;
                }
                else
                {
                    SaveFamily();
                }
                break;

            case UICASMode.FamilySelect:
                //accept button here is move in. notify the neighbourhood screen that we're moving in now.
                MoveInFamily = FamiliesPanel.Families[FamiliesPanel.Selection].ChunkID;
                break;
            }
            SetMode((UICASMode)(((int)Mode) - 1));
        }