Exemplo n.º 1
0
        public static GameObject ReturnTaxCollector(TaxCollector active, List <GameObject> objects)
        {
            ThumbnailKey thumbnail           = ThumbnailKey.kInvalidThumbnailKey;
            string       text                = string.Empty;
            List <ObjectPicker.RowInfo> list = new List <ObjectPicker.RowInfo>();

            foreach (GameObject t in objects)
            {
                List <ObjectPicker.ColumnInfo> list2 = new List <ObjectPicker.ColumnInfo>();

                int num = 0;
                thumbnail = t.GetThumbnailKey();

                if (t.GetType() == typeof(TaxCollector))
                {
                    text = (t as TaxCollector).info.Name;
                    num  = (t as TaxCollector).info.Funds;
                }

                if (t.GetType() == typeof(DonationBox))
                {
                    text = (t as DonationBox).info.Name;
                    num  = (t as DonationBox).info.Funds;
                }

                //common
                list2.Add(new ObjectPicker.ThumbAndTextColumn(thumbnail, text));
                list2.Add(new ObjectPicker.MoneyColumn(num));
                ObjectPicker.RowInfo item = new ObjectPicker.RowInfo(t, list2);
                list.Add(item);
            }


            List <ObjectPicker.HeaderInfo> list3 = new List <ObjectPicker.HeaderInfo>();
            List <ObjectPicker.TabInfo>    list4 = new List <ObjectPicker.TabInfo>();

            list3.Add(new ObjectPicker.HeaderInfo(string.Empty, string.Empty, 200));
            list3.Add(new ObjectPicker.HeaderInfo(CommonMethodsTaxCollector.LocalizeString("Funds", new object[0]), CommonMethodsTaxCollector.LocalizeString("Funds", new object[0])));
            list4.Add(new ObjectPicker.TabInfo("coupon", ShoppingRegister.LocalizeString("AvailableConcessionsFoods", new object[0]), list));
            List <ObjectPicker.RowInfo> list5 = TaxCollectorSimpleDialog.Show(CommonMethodsTaxCollector.LocalizeString("TransferToObject", new object[0]), 0, list4, list3, true);

            if (list5 == null || list5.Count != 1)
            {
                return(null);
            }
            return(list5[0].Item as GameObject);
        }
Exemplo n.º 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 (TaxCollectorSimpleDialog simplePurchaseDialog = new TaxCollectorSimpleDialog(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);
        }
Exemplo n.º 3
0
 public static List <ObjectPicker.RowInfo> Show(string title, int funds, List <ObjectPicker.TabInfo> listObjs, List <ObjectPicker.HeaderInfo> headers, bool viewTypeToggle, Vector2 position)
 {
     return(TaxCollectorSimpleDialog.Show(title, funds, listObjs, headers, viewTypeToggle, position, string.Empty));
 }
Exemplo n.º 4
0
 public static List <ObjectPicker.RowInfo> Show(string title, int funds, List <ObjectPicker.TabInfo> listObjs, List <ObjectPicker.HeaderInfo> headers, bool viewTypeToggle, string okayCaption)
 {
     return(TaxCollectorSimpleDialog.Show(title, funds, listObjs, headers, viewTypeToggle, new Vector2(-1f, -1f), okayCaption));
 }
Exemplo n.º 5
0
 public static List <ObjectPicker.RowInfo> Show(string title, int funds, List <ObjectPicker.TabInfo> listObjs, List <ObjectPicker.HeaderInfo> headers)
 {
     return(TaxCollectorSimpleDialog.Show(title, funds, listObjs, headers, false));
 }