예제 #1
0
        public static List <ObjectPicker.RowInfo> Show(bool modal, ModalDialog.PauseMode pauseType, string title, string buttonTrue, string buttonFalse, List <ObjectPicker.TabInfo> listObjs, List <ObjectPicker.HeaderInfo> headers, int numSelectableRows, Vector2 position, bool viewTypeToggle, List <ObjectPicker.RowInfo> preSelectedRows, bool showHeadersAndToggle)
        {
            List <ObjectPicker.RowInfo> result;

            using (BigObjectPickerDialog bigObjectPickerDialog = new BigObjectPickerDialog(modal, pauseType, title, buttonTrue, buttonFalse, listObjs, headers, numSelectableRows, position, viewTypeToggle, preSelectedRows, showHeadersAndToggle))
            {
                bigObjectPickerDialog.StartModal();
                if (bigObjectPickerDialog.Result == null || bigObjectPickerDialog.Result.Count == 0)
                {
                    result = null;
                }
                else
                {
                    result = bigObjectPickerDialog.Result;
                }
            }
            return(result);
        }
예제 #2
0
        public TripPlannerDialogEx(List <IDestinationInfo> destinations, List <int> durations, List <ISimTravelInfo> simTravelInfoList, ISimTravelInfo defaultTraveler, ModalDialog.PauseMode pauseMode)
            : base(destinations, durations, simTravelInfoList, defaultTraveler, pauseMode)
        {
            mDestinationGrid.Clear();

            PopulateDestinationGrids(destinations);

            mDestinationGrid.ItemClicked -= OnDestinationGridItemClicked;
            mDestinationGrid.ItemClicked += OnDestinationGridItemClickedEx;

            mSimListGrid[0x0].ItemDoubleClicked -= OnGridItemDoubleClicked;
            mSimListGrid[0x0].ItemDoubleClicked += OnGridItemDoubleClickedEx;

            mSimListGrid[0x1].ItemDoubleClicked -= OnGridItemDoubleClicked;
            mSimListGrid[0x1].ItemDoubleClicked += OnGridItemDoubleClickedEx;

            mAcceptButton.Click -= OnOKClick;
            mAcceptButton.Click += OnOKClickEx;

            mLeftArrow.Click -= OnArrowClick;
            mLeftArrow.Click += OnArrowClickEx;

            mRightArrow.Click -= OnArrowClick;
            mRightArrow.Click += OnArrowClickEx;

            mAcceptButton.Enabled     = (GameStates.sTravelData == null);
            mAcceptButton.TooltipText = Common.Localize("Travel::IncludeAll");

            if (GameStates.sTravelData != null)
            {
                mAcceptButton.Enabled = (mSimListGrid[1].Count == GameStates.sTravelData.mTravelerIds.Count);
            }
        }
예제 #3
0
        public ChangeLotTypeDialogEx(LotType currentLotType, CommercialLotSubType currentCommercialSubType, ResidentialLotSubType currentResidentialSubType, Vector2 position, ModalDialog.PauseMode pauseMode, bool isHouseboatLot)
            : base(currentLotType, currentCommercialSubType, currentResidentialSubType, position, pauseMode, isHouseboatLot)
        {
            PopulateComboBox(currentLotType == LotType.Residential, isHouseboatLot);

            Button childByID = mModalDialogWindow.GetChildByID(3, true) as Button;

            childByID.Click -= OnLotTypeClick;
            childByID.Click += OnLotTypeClickEx;

            childByID        = mModalDialogWindow.GetChildByID(2, true) as Button;
            childByID.Click -= OnLotTypeClick;
            childByID.Click += OnLotTypeClickEx;
        }
예제 #4
0
 public static new bool Show(ref LotType currentType, ref CommercialLotSubType currentCommercialSubType, ref ResidentialLotSubType currentResidentialSubType, ref string lotTypeName, Vector2 position, ModalDialog.PauseMode pauseMode, bool isHouseboatLot)
 {
     if (ModalDialog.EnableModalDialogs)
     {
         using (ChangeLotTypeDialogEx dialog = new ChangeLotTypeDialogEx(currentType, currentCommercialSubType, currentResidentialSubType, position, pauseMode, isHouseboatLot))
         {
             dialog.StartModal();
             currentType = dialog.mCurrentLotType;
             currentCommercialSubType  = dialog.mCurrentCommercialSubType;
             currentResidentialSubType = dialog.mCurrentResidentialSubType;
             lotTypeName = dialog.mLotTypeName;
             return(dialog.Result);
         }
     }
     return(false);
 }
예제 #5
0
 public BigObjectPickerDialog(bool modal, ModalDialog.PauseMode pauseMode, string title, string buttonTrue, string buttonFalse, List <ObjectPicker.TabInfo> listObjs, List <ObjectPicker.HeaderInfo> headers, int numSelectableRows, Vector2 position, bool viewTypeToggle, List <ObjectPicker.RowInfo> preSelectedRows, bool showHeadersAndToggle)
     : base("cmo_BigObjectPicker", 1, modal, pauseMode, null)
 {
     if (this.mModalDialogWindow != null)
     {
         Text text = this.mModalDialogWindow.GetChildByID(99576787u, false) as Text;
         text.Caption = title;
         this.mTable  = (this.mModalDialogWindow.GetChildByID(99576784u, false) as ObjectPicker);
         this.mTable.ObjectTable.TableChanged += new TableContainer.TableChangedEventHandler(this.OnTableChanged);
         this.mTable.SelectionChanged         += new ObjectPicker.ObjectPickerSelectionChanged(this.OnSelectionChanged);
         this.mTable.RowSelected     += new ObjectPicker.ObjectPickerSelectionChanged(this.OnSelectionChanged);
         this.mOkayButton             = (this.mModalDialogWindow.GetChildByID(99576785u, false) as Button);
         this.mOkayButton.TooltipText = buttonTrue;
         this.mOkayButton.Enabled     = false;
         //this.mOkayButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnOkayButtonClick);
         UIManager.RegisterEvent <UIButtonClickEventArgs>(this.mOkayButton, 678582774u, new UIEventHandler <UIButtonClickEventArgs>(this.OnOkayButtonClick));
         base.OkayID                   = this.mOkayButton.ID;
         base.SelectedID               = this.mOkayButton.ID;
         this.mCloseButton             = (this.mModalDialogWindow.GetChildByID(99576786u, false) as Button);
         this.mCloseButton.TooltipText = buttonFalse;
         //this.mCloseButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnCloseButtonClick);
         UIManager.RegisterEvent <UIButtonClickEventArgs>(this.mCloseButton, 678582774u, new UIEventHandler <UIButtonClickEventArgs>(this.OnCloseButtonClick));
         base.CancelID           = this.mCloseButton.ID;
         this.mTableOffset       = this.mModalDialogWindow.Area.BottomRight - this.mModalDialogWindow.Area.TopLeft - (this.mTable.Area.BottomRight - this.mTable.Area.TopLeft);
         this.mTable.ShowHeaders = showHeadersAndToggle;
         this.mTable.ShowToggle  = showHeadersAndToggle;
         this.mTable.ObjectTable.NoAutoSizeGridResize = true;
         this.mTable.Populate(listObjs, headers, numSelectableRows);
         this.mTable.ViewTypeToggle           = viewTypeToggle;
         this.mPreSelectedRows                = preSelectedRows;
         this.mTable.TablePopulationComplete += new VoidEventHandler(this.OnPopulationCompleted);
         if (!this.mTable.ShowToggle)
         {
             Window window  = this.mModalDialogWindow.GetChildByID(99576788u, false) as Window;
             Window window2 = this.mModalDialogWindow.GetChildByID(99576789u, false) as Window;
             this.mTable.Area = new Rect(this.mTable.Area.TopLeft.x, this.mTable.Area.TopLeft.y - 64f, this.mTable.Area.BottomRight.x, this.mTable.Area.BottomRight.y);
             window2.Area     = new Rect(window2.Area.TopLeft.x, window2.Area.TopLeft.y - 64f, window2.Area.BottomRight.x, window2.Area.BottomRight.y);
             window.Area      = new Rect(window.Area.TopLeft.x, window.Area.TopLeft.y - 64f, window.Area.BottomRight.x, window.Area.BottomRight.y);
         }
         this.mModalDialogWindow.Area = new Rect(this.mModalDialogWindow.Area.TopLeft, this.mModalDialogWindow.Area.TopLeft + this.mTable.TableArea.BottomRight + this.mTableOffset);
         Rect  area = this.mModalDialogWindow.Area;
         float num  = area.BottomRight.x - area.TopLeft.x;
         float num2 = area.BottomRight.y - area.TopLeft.y;
         if (!this.mTable.ShowToggle)
         {
             num2 -= 50f;
         }
         float num3 = position.x;
         float num4 = position.y;
         if (num3 < 0f && num4 < 0f)
         {
             Rect  area2 = this.mModalDialogWindow.Parent.Area;
             float num5  = area2.BottomRight.x - area2.TopLeft.x;
             float num6  = area2.BottomRight.y - area2.TopLeft.y;
             num3 = (float)Math.Round((double)((num5 - num) / 2f));
             num4 = (float)Math.Round((double)((num6 - num2) / 2f));
         }
         area.Set(num3, num4, num3 + num, num4 + num2);
         this.mModalDialogWindow.Area    = area;
         this.mModalDialogWindow.Visible = true;
     }
 }
예제 #6
0
 public static List <ObjectPicker.RowInfo> Show(bool modal, ModalDialog.PauseMode pauseType, string title, string buttonTrue, string buttonFalse, List <ObjectPicker.TabInfo> listObjs, List <ObjectPicker.HeaderInfo> headers, int numSelectableRows, Vector2 position, bool viewTypeToggle, List <ObjectPicker.RowInfo> preSelectedRows)
 {
     return(BigObjectPickerDialog.Show(modal, pauseType, title, buttonTrue, buttonFalse, listObjs, headers, numSelectableRows, position, viewTypeToggle, preSelectedRows, true));
 }
예제 #7
0
 public static List <ObjectPicker.RowInfo> Show(bool modal, ModalDialog.PauseMode pauseType, string title, string buttonTrue, string buttonFalse, List <ObjectPicker.TabInfo> listObjs, List <ObjectPicker.HeaderInfo> headers, int numSelectableRows)
 {
     return(BigObjectPickerDialog.Show(modal, pauseType, title, buttonTrue, buttonFalse, listObjs, headers, numSelectableRows, new Vector2(-1f, -1f), false));
 }