public TaxCollectorSimpleDialog(string title, int funds, List<ObjectPicker.TabInfo> listObjs, List<ObjectPicker.HeaderInfo> headers, bool viewTypeToggle, Vector2 position)
            : base("SimplePurchaseDialog", 1, true, ModalDialog.PauseMode.PauseSimulator, null)
        {
            if (this.mModalDialogWindow != null)
            {
                Text text = this.mModalDialogWindow.GetChildByID(99576787u, false) as Text;
                text.Caption = title;
                this.mFunds = funds;
                text = (this.mModalDialogWindow.GetChildByID(99576788u, false) as Text);
                text.Caption = Responder.Instance.LocalizationModel.LocalizeString("Ui/Caption/Shopping/Cart:AvailableFunds", new object[]
				{
					UIUtils.FormatMoney(funds)
				});
                this.mTable = (this.mModalDialogWindow.GetChildByID(99576784u, false) as ObjectPicker);
                this.mTable.ObjectTable.TableChanged += new TableContainer.TableChangedEventHandler(this.OnTableChanged);
                this.mTable.ObjectTable.SelectionChanged += new UIEventHandler<UISelectionChangeEventArgs>(this.OnSelectionChanged);
                this.mOkayButton = (this.mModalDialogWindow.GetChildByID(99576785u, false) as Button);
                this.mOkayButton.Enabled = false;
                this.mOkayButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnOkayButtonClick);
                this.mOkayButton.Caption = CMStoreSet.LocalizeString("Select", new object[0]);

                base.OkayID = this.mOkayButton.ID;
                base.SelectedID = this.mOkayButton.ID;
                this.mCloseButton = (this.mModalDialogWindow.GetChildByID(99576786u, false) as Button);
                this.mCloseButton.Click += 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.Populate(listObjs, headers, 1);
                this.mTable.ViewTypeToggle = viewTypeToggle;
                this.mModalDialogWindow.Area = new Rect(this.mModalDialogWindow.Area.TopLeft, this.mModalDialogWindow.Area.TopLeft + this.mTable.TableArea.BottomRight + this.mTableOffset);
                float x = position.x;
                float y = position.y;
                if (x < 0f && y < 0f)
                {
                    this.mModalDialogWindow.CenterInParent();
                }
                else
                {
                    Rect area = this.mModalDialogWindow.Area;
                    float num = area.BottomRight.x - area.TopLeft.x;
                    float num2 = area.BottomRight.y - area.TopLeft.y;
                    area.Set(x, y, x + num, y + num2);
                    this.mModalDialogWindow.Area = area;
                }
                this.mModalDialogWindow.Visible = true;
            }
        }
Example #2
0
 public static List<ObjectPicker.RowInfo> Show(string title, int funds, List<ObjectPicker.TabInfo> listObjs, List<ObjectPicker.HeaderInfo> headers, bool viewTypeToggle, Vector2 position, string okayCaption)
 {
     List<ObjectPicker.RowInfo> result;
     using (SimpleListDialog simplePurchaseDialog = new SimpleListDialog(title, funds, listObjs, headers, viewTypeToggle, position))
     {
         if (okayCaption != string.Empty)
         {
             simplePurchaseDialog.mOkayButton.Caption = okayCaption;
         }
         simplePurchaseDialog.StartModal();
         if (simplePurchaseDialog.Result == null || simplePurchaseDialog.Result.Count == 0)
         {
             result = null;
         }
         else
         {
             List<ObjectPicker.RowInfo> result2 = simplePurchaseDialog.Result;
             result = result2;
         }
     }
     return result;
 }
Example #3
0
 public SettingsKey(Vector2 hours)
 {
     mHours = hours;
 }
Example #4
0
 public static List<ObjectPicker.RowInfo> Show(string title, int funds, List<ObjectPicker.TabInfo> listObjs, List<ObjectPicker.HeaderInfo> headers, bool viewTypeToggle, Vector2 position)
 {
     return SimpleListDialog.Show(title, funds, listObjs, headers, viewTypeToggle, position, string.Empty);
 }
Example #5
0
 public override Tooltip CreateTooltip(Vector2 mousePosition, WindowBase mousedOverWindow, ref Vector2 tooltipPosition)
 {
     return new SimpleTextTooltip(this.info.Name + ": " + this.info.Funds + "ยง");
 }