public UICitySelector()
            : base(UIDialogStyle.Standard, true)
        {
            this.Opacity = 0.9f;


            CityListBoxBackground = new UIImage(UITextBox.StandardBackground);
            this.Add(CityListBoxBackground);
            CityDescriptionBackground = new UIImage(UITextBox.StandardBackground);
            this.Add(CityDescriptionBackground);

            var script = this.RenderScript("cityselector.uis");

            this.DialogSize = (Point)script.GetControlProperty("DialogSize");

            var cityThumbBG = new UIImage(thumbnailBackgroundImage);

            cityThumbBG.Position = (Vector2)script.GetControlProperty("CityThumbnailBackgroundPosition");
            this.Add(cityThumbBG);
            CityThumb          = new UIImage();
            CityThumb.Position = (Vector2)script.GetControlProperty("CityThumbnailPosition");
            this.Add(CityThumb);

            CityDescriptionSlider.AttachButtons(CityDescriptionScrollUpButton, CityDescriptionDownButton, 1);
            DescriptionText.AttachSlider(CityDescriptionSlider);

            OkButton.Disabled           = true;
            OkButton.OnButtonClick     += new ButtonClickDelegate(OkButton_OnButtonClick);
            CancelButton.OnButtonClick += new ButtonClickDelegate(CancelButton_OnButtonClick);

            this.Caption = (string)script["TitleString"];


            /** Parse the list styles **/
            listStyleNormal   = script.Create <UIListBoxTextStyle>("CityListBoxColors", CityListBox.FontStyle);
            listStyleBusy     = script.Create <UIListBoxTextStyle>("CityListBoxColorsBusy", CityListBox.FontStyle);
            listStyleFull     = script.Create <UIListBoxTextStyle>("CityListBoxColorsFull", CityListBox.FontStyle);
            listStyleReserved = script.Create <UIListBoxTextStyle>("CityListBoxColorsReserved", CityListBox.FontStyle);

            UpdateItems();

            CityListBox.OnChange += new ChangeDelegate(CityListBox_OnChange);
            NetworkFacade.Controller.OnNewCityServer     += new OnNewCityServerDelegate(Controller_OnNewCityServer);
            NetworkFacade.Controller.OnCityServerOffline += new OnCityServerOfflineDelegate(Controller_OnCityServerOffline);
        }
Example #2
0
        public UICitySelector() : base(UIDialogStyle.Standard, true)
        {
            this.Opacity = 0.9f;


            CityListBoxBackground = new UIImage(UITextBox.StandardBackground);
            this.Add(CityListBoxBackground);
            CityDescriptionBackground = new UIImage(UITextBox.StandardBackground);
            this.Add(CityDescriptionBackground);


            var script = this.RenderScript("cityselector.uis");

            this.DialogSize = (Point)script.GetControlProperty("DialogSize");


            var cityThumbBG = new UIImage(thumbnailBackgroundImage);

            cityThumbBG.Position = (Vector2)script.GetControlProperty("CityThumbnailBackgroundPosition");
            this.Add(cityThumbBG);
            CityThumb          = new UIImage();
            CityThumb.Position = (Vector2)script.GetControlProperty("CityThumbnailPosition");
            this.Add(CityThumb);


            CityDescriptionSlider.AttachButtons(CityDescriptionScrollUpButton, CityDescriptionDownButton, 1);
            DescriptionText.AttachSlider(CityDescriptionSlider);

            OkButton.Disabled           = true;
            OkButton.OnButtonClick     += new ButtonClickDelegate(OkButton_OnButtonClick);
            CancelButton.OnButtonClick += new ButtonClickDelegate(CancelButton_OnButtonClick);


            this.Caption = (string)script["TitleString"];


            /** Parse the list styles **/
            var listStyleNormal   = script.Create <UIListBoxTextStyle>("CityListBoxColors", CityListBox.FontStyle);
            var listStyleBusy     = script.Create <UIListBoxTextStyle>("CityListBoxColorsBusy", CityListBox.FontStyle);
            var listStyleFull     = script.Create <UIListBoxTextStyle>("CityListBoxColorsFull", CityListBox.FontStyle);
            var listStyleReserved = script.Create <UIListBoxTextStyle>("CityListBoxColorsReserved", CityListBox.FontStyle);

            var statusToStyle = new Dictionary <CityInfoStatus, UIListBoxTextStyle>();

            statusToStyle.Add(CityInfoStatus.Ok, listStyleNormal);
            statusToStyle.Add(CityInfoStatus.Busy, listStyleBusy);
            statusToStyle.Add(CityInfoStatus.Full, listStyleFull);
            statusToStyle.Add(CityInfoStatus.Reserved, listStyleReserved);

            var statusToLabel = new Dictionary <CityInfoStatus, string>();

            statusToLabel.Add(CityInfoStatus.Ok, StatusOk);
            statusToLabel.Add(CityInfoStatus.Busy, StatusBusy);
            statusToLabel.Add(CityInfoStatus.Full, StatusFull);
            statusToLabel.Add(CityInfoStatus.Reserved, StatusOk);


            CityListBox.TextStyle = listStyleNormal;
            CityListBox.Items     =
                NetworkFacade.Cities.Select(
                    x => new UIListBoxItem(x, CityIconImage, x.Name, x.Online ? OnlineStatusUp : OnlineStatusDown, statusToLabel[x.Status])
            {
                //Disabled = x.Status != TSOServiceClient.Model.CityInfoStatus.Ok,
                CustomStyle = statusToStyle[x.Status]
            }
                    ).ToList();

            CityListBox.OnChange += new ChangeDelegate(CityListBox_OnChange);
            //CityListBox.SelectedIndex = 0;
        }
Example #3
0
        public UIQueryPanel(LotView.World world)
        {
            World   = world;
            Active  = false;
            Opacity = 0;
            Visible = false;

            AdStrings = new string[14];
            for (int i = 0; i < 14; i++)
            {
                string str = GameFacade.Strings.GetString("206", (i + 4).ToString());
                AdStrings[i] = ((i < 7)?str.Substring(0, str.Length - 2) + "{0}":str) + "\r\n";
            }

            var useSmall = (GlobalSettings.Default.GraphicsWidth < 1024) || FSOEnvironment.UIZoomFactor > 1f;
            var script   = this.RenderScript("querypanel" + (useSmall?"":"1024") + ".uis");

            //NOTE: the background and position of this element changes with the context it is used in.
            //other elements that are only used for certain modes will be flagged as such with comments.

            QuerybackPanel   = new UIImage(BackgroundImagePanel);
            QuerybackPanel.Y = 0;
            QuerybackPanel.BlockInput();
            this.AddAt(0, QuerybackPanel);

            QuerybackCatalog          = new UIImage(BackgroundImageCatalog);
            QuerybackCatalog.Position = new Vector2(-22, 0);
            QuerybackCatalog.BlockInput();
            this.AddAt(1, QuerybackCatalog);

            QuerybackTrade   = new UIImage(BackgroundImageTrade);
            QuerybackTrade.Y = 0;
            QuerybackTrade.BlockInput();
            this.AddAt(2, QuerybackTrade);

            //init general tab specific backgrounds

            DescriptionBackgroundImage          = new UIImage(ImageDescriptionBackground);
            DescriptionBackgroundImage.Position = new Microsoft.Xna.Framework.Vector2(119, 7);
            this.AddAt(3, DescriptionBackgroundImage);

            MotivesBackgroundImage          = new UIImage(ImageMotivesBackground);
            MotivesBackgroundImage.Position = new Microsoft.Xna.Framework.Vector2(useSmall ? 395:619, 7);
            this.AddAt(3, MotivesBackgroundImage);

            GeneralTabImage          = new UIImage(ImageGeneralTab);
            GeneralTabImage.Position = new Microsoft.Xna.Framework.Vector2(useSmall ? 563 : 787, 0);
            this.AddAt(3, GeneralTabImage);

            SpecificTabImage          = new UIImage(ImageSpecificTab);
            SpecificTabImage.Position = new Microsoft.Xna.Framework.Vector2(useSmall ? 563 : 787, 0);
            this.AddAt(3, SpecificTabImage);

            OwnerPriceBack          = new UIImage(GeneralOwnerPriceBack);
            OwnerPriceBack.Position = new Microsoft.Xna.Framework.Vector2(useSmall ? 501 : 725, 80);
            this.AddAt(3, OwnerPriceBack);

            Thumbnail          = new UIImage();
            Thumbnail.Position = new Vector2(24, 11);
            Thumbnail.SetSize(90, 90);
            this.Add(Thumbnail);

            DescriptionText.CurrentText = "No Object Selected"; //user should not see this.
            DescriptionSlider.AttachButtons(DescriptionScrollUpButton, DescriptionScrollDownButton, 1);
            DescriptionText.AttachSlider(DescriptionSlider);

            MotivesText.CurrentText = "";
            MotivesSlider.AttachButtons(MotivesScrollUpButton, MotivesScrollDownButton, 1);
            MotivesText.AttachSlider(MotivesSlider);

            GeneralTabButton.OnButtonClick  += new ButtonClickDelegate(GeneralTabButton_OnButtonClick);
            SpecificTabButton.OnButtonClick += new ButtonClickDelegate(SpecificTabButton_OnButtonClick);
            SellBackButton.OnButtonClick    += new ButtonClickDelegate(SellBackButton_OnButtonClick);

            Mode = 1;
            Tab  = 0;
        }
Example #4
0
        public UIQueryPanel(LotView.World world)
        {
            World   = world;
            Active  = false;
            Opacity = 0;
            Visible = false;

            AdStrings = new string[14];
            for (int i = 0; i < 14; i++)
            {
                string str = GameFacade.Strings.GetString("206", (i + 4).ToString());
                AdStrings[i] = ((i < 7)?str.Substring(0, str.Length - 2) + "{0}":str) + "\r\n";
            }

            var useSmall = (GlobalSettings.Default.GraphicsWidth < 1024) || FSOEnvironment.UIZoomFactor > 1f;
            var script   = this.RenderScript("querypanel" + (useSmall?"":"1024") + ".uis");

            //NOTE: the background and position of this element changes with the context it is used in.
            //other elements that are only used for certain modes will be flagged as such with comments.

            QuerybackPanel   = new UIImage(BackgroundImagePanel);
            QuerybackPanel.Y = 0;
            this.AddAt(0, QuerybackPanel);

            ListenForMouse(new Rectangle(0, 0, QuerybackPanel.Texture.Width, QuerybackPanel.Texture.Height), (t, s) => { });

            Size       = QuerybackPanel.Size.ToVector2() + new Vector2(22, 42);
            BackOffset = new Point(40, 0);

            QuerybackCatalog          = new UIImage(BackgroundImageCatalog);
            QuerybackCatalog.Position = new Vector2(-22, 0);
            this.AddAt(1, QuerybackCatalog);

            QuerybackTrade   = new UIImage(BackgroundImageTrade);
            QuerybackTrade.X = -40;
            QuerybackTrade.Y = 0;
            this.AddAt(2, QuerybackTrade);

            //init general tab specific backgrounds

            DescriptionBackgroundImage          = new UIImage(ImageDescriptionBackground);
            DescriptionBackgroundImage.Position = new Microsoft.Xna.Framework.Vector2(119, 7);
            this.AddAt(3, DescriptionBackgroundImage);

            MotivesBackgroundImage          = new UIImage(ImageMotivesBackground);
            MotivesBackgroundImage.Position = new Microsoft.Xna.Framework.Vector2(useSmall ? 395:619, 7);
            this.AddAt(3, MotivesBackgroundImage);

            GeneralTabImage          = new UIImage(ImageGeneralTab);
            GeneralTabImage.Position = new Microsoft.Xna.Framework.Vector2(useSmall ? 563 : 787, 0);
            this.AddAt(3, GeneralTabImage);

            SpecificTabImage          = new UIImage(ImageSpecificTab);
            SpecificTabImage.Position = new Microsoft.Xna.Framework.Vector2(useSmall ? 563 : 787, 0);
            this.AddAt(3, SpecificTabImage);

            OwnerPriceBack = script.Create <UIImage>("OwnerPriceBack");
            this.AddAt(3, OwnerPriceBack);

            BuyerPriceBack = script.Create <UIImage>("BuyerPriceBack");
            this.AddAt(3, BuyerPriceBack);

            OwnerPriceBack.X = ForSalePrice.X;
            BuyerPriceBack.X = ForSalePrice.X;
            ForSalePrice.Y  += 2;
            ForSalePrice.SetSize(OwnerPriceBack.Width, ForSalePrice.Height);

            Thumbnail          = new UIImage();
            Thumbnail.Position = new Vector2(24, 11);
            Thumbnail.SetSize(90, 90);
            this.Add(Thumbnail);

            DescriptionText.CurrentText = "No Object Selected"; //user should not see this.
            DescriptionSlider.AttachButtons(DescriptionScrollUpButton, DescriptionScrollDownButton, 1);
            DescriptionText.AttachSlider(DescriptionSlider);

            MotivesText.CurrentText = "";
            MotivesSlider.AttachButtons(MotivesScrollUpButton, MotivesScrollDownButton, 1);
            MotivesText.AttachSlider(MotivesSlider);

            GeneralTabButton.OnButtonClick  += new ButtonClickDelegate(GeneralTabButton_OnButtonClick);
            SpecificTabButton.OnButtonClick += new ButtonClickDelegate(SpecificTabButton_OnButtonClick);
            SellBackButton.OnButtonClick    += new ButtonClickDelegate(SellBackButton_OnButtonClick);

            AsyncBuyButton.OnButtonClick        += (btn) => { OnAsyncBuyClicked?.Invoke(btn); };
            AsyncSaleButton.OnButtonClick       += (btn) => { OnAsyncSaleClicked?.Invoke(btn); };
            AsyncEditPriceButton.OnButtonClick  += (btn) => { OnAsyncPriceClicked?.Invoke(btn); };
            AsyncCancelSaleButton.OnButtonClick += (btn) => { OnAsyncSaleCancelClicked?.Invoke(btn); };

            InventoryButton.OnButtonClick += InventoryButton_OnButtonClick;

            WearProgressBar.CaptionStyle        = TextStyle.DefaultLabel.Clone();
            WearProgressBar.CaptionStyle.Shadow = true;

            var btnBg = GetTexture(0x8A700000001); //buybuild_query_generalbuy_sellasyncback = 0x8A700000001

            SpecificBtnBGs = new List <UIImage>();
            SpecificBtnBGs.Add(AddButtonBackground(SellBackButton, btnBg));
            SpecificBtnBGs.Add(AddButtonBackground(InventoryButton, btnBg));
            SpecificBtnBGs.Add(AddButtonBackground(AsyncSaleButton, btnBg));
            AsyncCancelSaleButtonBG = AddButtonBackground(AsyncCancelSaleButton, btnBg);

            var progressBG = new UIImage(ImageWearBack);

            progressBG.Position = WearProgressBar.Position - new Vector2(3, 2);
            AddAt(3, progressBG);
            SpecificBtnBGs.Add(progressBG);

            Mode = 1;
            Tab  = 0;
        }
Example #5
0
        public UICitySelector(List <ShardStatusItem> shards)
            : base(UIDialogStyle.Standard, true)
        {
            Opacity = 0.9f;


            CityListBoxBackground = new UIImage(UITextBox.StandardBackground);
            Add(CityListBoxBackground);
            CityDescriptionBackground = new UIImage(UITextBox.StandardBackground);
            Add(CityDescriptionBackground);

            var script = RenderScript("cityselector.uis");

            DialogSize = (Point)script.GetControlProperty("DialogSize");

            var cityThumbBG = new UIImage(thumbnailBackgroundImage)
            {
                Position = (Vector2)script.GetControlProperty("CityThumbnailBackgroundPosition")
            };

            Add(cityThumbBG);
            CityThumb = new UIImage
            {
                Position = (Vector2)script.GetControlProperty("CityThumbnailPosition")
            };
            Add(CityThumb);

            CityDescriptionSlider.AttachButtons(CityDescriptionScrollUpButton, CityDescriptionDownButton, 1);
            DescriptionText.AttachSlider(CityDescriptionSlider);

            OkButton.Disabled           = true;
            OkButton.OnButtonClick     += new ButtonClickDelegate(OkButton_OnButtonClick);
            CancelButton.OnButtonClick += new ButtonClickDelegate(CancelButton_OnButtonClick);

            Caption = (string)script["TitleString"];


            /** Parse the list styles **/
            var listStyleNormal   = script.Create <UIListBoxTextStyle>("CityListBoxColors", CityListBox.FontStyle);
            var listStyleBusy     = script.Create <UIListBoxTextStyle>("CityListBoxColorsBusy", CityListBox.FontStyle);
            var listStyleFull     = script.Create <UIListBoxTextStyle>("CityListBoxColorsFull", CityListBox.FontStyle);
            var listStyleReserved = script.Create <UIListBoxTextStyle>("CityListBoxColorsReserved", CityListBox.FontStyle);

            var statusToStyle = new Dictionary <ShardStatus, UIListBoxTextStyle>();

            statusToStyle.Add(ShardStatus.Up, listStyleNormal);
            statusToStyle.Add(ShardStatus.Busy, listStyleBusy);
            statusToStyle.Add(ShardStatus.Full, listStyleFull);
            statusToStyle.Add(ShardStatus.Down, listStyleFull);
            statusToStyle.Add(ShardStatus.Closed, listStyleFull);
            statusToStyle.Add(ShardStatus.Frontier, listStyleReserved);

            var statusToLabel = new Dictionary <ShardStatus, string>();

            statusToLabel.Add(ShardStatus.Up, StatusOk);
            statusToLabel.Add(ShardStatus.Busy, StatusBusy);
            statusToLabel.Add(ShardStatus.Full, StatusFull);
            statusToLabel.Add(ShardStatus.Down, StatusFull);
            statusToLabel.Add(ShardStatus.Closed, StatusFull);
            statusToLabel.Add(ShardStatus.Frontier, StatusOk);


            CityListSlider.AttachButtons(CityListScrollUpButton, CityScrollDownButton, 1);

            CityListBox.TextStyle = listStyleNormal;
            CityListBox.AttachSlider(CityListSlider);
            CityListBox.OnChange += new ChangeDelegate(CityListBox_OnChange);


            CityListBox.Items = shards.Select(x => new UIListBoxItem(x, CityIconImage, x.Name, x.Status == ShardStatus.Up ? OnlineStatusUp : OnlineStatusDown, statusToLabel[x.Status])
            {
                CustomStyle = statusToStyle[x.Status]
            }).ToList();

            if (shards.Count > 0)
            {
                CityListBox.SelectedIndex = 0;
            }

            GameThread.NextUpdate(x =>
            {
                FSOFacade.Hints.TriggerHint("screen:sascity");
            });
        }
Example #6
0
        public UINeighPage()
        {
            Add(BackgroundImage = new UIImage());

            Add(InfoTabBackgroundImage = new UIImage());
            Add(InfoTabImage           = new UIImage());

            Add(TopSTab2BackgroundImage = new UIImage());
            Add(TopSTab3BackgroundImage = new UIImage());
            Add(TopSTabImage            = new UIImage());

            Add(TopSTabTab1BackgroundImage = new UIImage());
            Add(TopSTabTab2BackgroundImage = new UIImage());
            Add(TopSTabTab3BackgroundImage = new UIImage());
            Add(TopSTabTab4BackgroundImage = new UIImage());

            Add(TopSTabTab1SeatImage = new UIImage());
            Add(TopSTabTab2SeatImage = new UIImage());
            Add(TopSTabTab3SeatImage = new UIImage());
            Add(TopSTabTab4SeatImage = new UIImage());

            Add(MayorTabBackgroundImage = new UIImage());
            Add(MayorTabImage           = new UIImage());
            Add(MayorTabRateImage       = new UIImage());

            MayorBanner = new UINeighBanner()
            {
                ScaleX  = 0.3333f, ScaleY = 0.3333f,
                Caption = GameFacade.Strings.GetString("f115", "72")
            };
            TermBanner = new UINeighBanner()
            {
                ScaleX  = 0.3333f, ScaleY = 0.3333f,
                Caption = GameFacade.Strings.GetString("f115", "83", new string[] { GetOrdinal(1) })
            };
            TownNameBanner = new UINeighBanner()
            {
                ScaleX  = 0.3333f,
                ScaleY  = 0.3333f,
                Caption = GameFacade.Strings.GetString("f115", "14")
            };

            MayorRatingBox1 = new UIRatingSummaryPanel();
            MayorRatingBox2 = new UIRatingSummaryPanel();

            RatingStars           = new UIRatingDisplay(false);
            RatingStars.HalfStars = 7;

            var script = RenderScript("fsoneighpage.uis");

            DescriptionText.OnChange      += DescriptionText_OnChange;
            HouseNameButton.OnButtonClick += RenameAdmin;
            InfoButton.OnButtonClick      += (btn) => SetTab(UINeighPageTab.Description);
            HouseButton.OnButtonClick     += (btn) => SetTab(UINeighPageTab.Lots);
            PersonButton.OnButtonClick    += (btn) => SetTab(UINeighPageTab.People);
            MayorButton.OnButtonClick     += (btn) => SetTab(UINeighPageTab.Mayor);

            TopTab1Button.OnButtonClick += (btn) => SetSubTab(0);
            TopTab2Button.OnButtonClick += (btn) => SetSubTab(1);
            TopTab3Button.OnButtonClick += (btn) => SetSubTab(2);
            TopTab4Button.OnButtonClick += (btn) => SetSubTab(3);

            RateButton.OnButtonClick += RateSwitch;

            UIUtils.MakeDraggable(BackgroundImage, this, true);

            DescriptionSlider.AttachButtons(DescriptionScrollUpButton, DescriptionScrollDownButton, 1);
            DescriptionText.AttachSlider(DescriptionSlider);

            RateButton.Width = 60;
            LotThumbnail     = script.Create <UILotThumbButton>("HouseThumbSetup");
            LotThumbnail.Init(RoommateThumbButtonImage, VisitorThumbButtonImage);
            DefaultThumb = TextureUtils.TextureFromFile(GameFacade.GraphicsDevice, GameFacade.GameFilePath("userdata/houses/defaulthouse.bmp"));
            TextureUtils.ManualTextureMask(ref DefaultThumb, new uint[] { 0xFF000000 });
            LotThumbnail.SetThumbnail(DefaultThumb, 0);
            LotThumbnail.OnLotClick += (btn) => {
                FindController <CoreGameScreenController>()?.ShowLotPage(CurrentNeigh.Value?.Neighborhood_TownHallXY ?? 0);
            };
            Add(LotThumbnail);

            MayorPersonButton = script.Create <UIBigPersonButton>("MayorPersonButton");
            Add(MayorPersonButton);

            Add(RatingStars);
            Add(MayorBanner);
            Add(TermBanner);
            TermBanner.Flip = true;
            Add(TownNameBanner);
            Add(MayorRatingBox1);
            Add(MayorRatingBox2);

            CurrentNeigh = new Binding <Neighborhood>()
                           .WithBinding(HouseNameButton, "Caption", "Neighborhood_Name")
                           .WithBinding(ResidentCountLabel, "Caption", "Neighborhood_AvatarCount", (object ava) =>
            {
                return(GameFacade.Strings.GetString("f115", "15", new string[] { ava.ToString() }));
            })
                           .WithBinding(PropertyCountLabel, "Caption", "Neighborhood_LotCount", (object lot) =>
            {
                return(GameFacade.Strings.GetString("f115", "16", new string[] { lot.ToString() }));
            })
                           .WithBinding(ActivityRatingLabel, "Caption", "Neighborhood_ActivityRating", (object rate) =>
            {
                return(GameFacade.Strings.GetString("f115", "13", new string[] { rate.ToString() }));
            })
                           .WithBinding(TermBanner, "Caption", "Neighborhood_ElectedDate", (object rate) =>
            {
                return(GameFacade.Strings.GetString("f115", "83", new string[] { GetOrdinal(GetTermsSince((uint)rate)) }));
            })
                           .WithBinding(this, "MayorID", "Neighborhood_MayorID")
                           .WithBinding(this, "TownHallID", "Neighborhood_TownHallXY")
                           .WithBinding(StatusLabel, "Caption", "Neighborhood_Flag", (object flago) =>
            {
                var flag          = (uint)flago;
                var availableText = "11";
                if ((flag & 1) > 0)
                {
                    availableText = "12";
                }
                return(GameFacade.Strings.GetString("f115", availableText));
            })
                           .WithMultiBinding((changes) => Redraw(), "Neighborhood_Description", "Neighborhood_TownHallXY", "Neighborhood_MayorID",
                                             "Neighborhood_TopLotCategory", "Neighborhood_TopLotOverall", "Neighborhood_TopAvatarActivity", "Neighborhood_TopAvatarFamous",
                                             "Neighborhood_TopAvatarInfamous");

            CurrentMayor = new Binding <Avatar>()
                           .WithBinding(RatingStars, "DisplayStars", "Avatar_MayorRatingHundredth", (object hundredths) =>
            {
                return(((uint)hundredths) / 100f);
            })
                           .WithBinding(this, "Ratings", "Avatar_ReviewIDs");

            CurrentTownHall = new Binding <Lot>()
                              .WithBinding(TownNameBanner, "Caption", "Lot_Name", (object name) =>
            {
                if ((string)name == "Retrieving...")
                {
                    return(GameFacade.Strings.GetString("f115", "14"));
                }
                else
                {
                    return((string)name);
                }
            });

            CenterButton.OnButtonClick += (btn) =>
            {
                (UIScreen.Current as CoreGameScreen).CityRenderer.NeighGeom.CenterNHood((int)(CurrentNeigh.Value?.Id ?? 0));
            };

            BulletinButton.OnButtonClick += (btn) =>
            {
                var id = CurrentNeigh?.Value?.Id ?? 0;
                if (id != 0 && !UIBulletinDialog.Present)
                {
                    var dialog = new UIBulletinDialog(id);
                    dialog.CloseButton.OnButtonClick += (btn2) =>
                    {
                        UIScreen.RemoveDialog(dialog);
                    };
                    UIScreen.GlobalShowDialog(dialog, false);
                }
            };

            CloseButton.OnButtonClick += (btn) =>
            {
                FindController <NeighPageController>().Close();
            };

            //mayor action buttons:
            MayorActionMod.OnButtonClick    += (btn) => { CurrentMayorTab = UINeighMayorTabMode.ModActions; Redraw(); };
            MayorActionReturn.OnButtonClick += (btn) => { CurrentMayorTab = UINeighMayorTabMode.Rate; Redraw(); };
            MayorActionMoveTH.OnButtonClick += (btn) => { MoveTownHall(true); };
            MayorActionNewTH.OnButtonClick  += (btn) => { MoveTownHall(false); };
            ModActionSetMayor.OnButtonClick += ModSetMayor;

            ModActionReturn.OnButtonClick        += (btn) => { CurrentMayorTab = UINeighMayorTabMode.Actions; Redraw(); };
            ModActionManageRatings.OnButtonClick += (btn) => {
                var ratingList = new UIRatingList(CurrentMayor.Value?.Avatar_Id ?? 0);
                UIScreen.GlobalShowAlert(new UIAlertOptions()
                {
                    Title           = GameFacade.Strings.GetString("f118", "23", new string[] { "Retrieving..." }),
                    Message         = GameFacade.Strings.GetString("f118", "24", new string[] { "Retrieving..." }),
                    GenericAddition = ratingList,
                    Width           = 530
                }, true);
            };

            foreach (var elem in Children)
            {
                var label = elem as UILabel;
                if (label != null)
                {
                    label.CaptionStyle        = label.CaptionStyle.Clone();
                    label.CaptionStyle.Shadow = true;
                }
            }

            Pedestals   = new List <UITop10Pedestal>();
            Top10Labels = new List <UILabel>();
            var top10style = TextStyle.DefaultLabel.Clone();

            top10style.Shadow = true;
            top10style.Size   = 8;
            for (int i = 0; i < 10; i++)
            {
                var alt = i % 2 == 1;
                var ped = new UITop10Pedestal()
                {
                    AltColor = alt
                };
                Pedestals.Add(ped);

                var label = new UILabel()
                {
                    CaptionStyle = top10style,
                    Alignment    = TextAlignment.Center | TextAlignment.Middle,
                    Size         = new Vector2(1, 1)
                };
                Top10Labels.Add(label);
                Add(label);
            }
            for (int i = 0; i < 10; i += 2)
            {
                Add(Pedestals[i]);                             //backmost
            }
            for (int i = 1; i < 10; i += 2)
            {
                Add(Pedestals[i]);                             //frontmost
            }
            SetPedestalPosition(false, true);

            Redraw();
        }