Beispiel #1
0
        public UIUpgradeList(UILotControl parent)
        {
            LotParent = parent;
            var ui = Content.Content.Get().CustomUI;
            var gd = GameFacade.GraphicsDevice;

            Background   = new UIImage(ui.Get("up_background.png").Get(gd)).With9Slice(0, 0, 40, 90);
            Background.X = 191;
            Background.BlockInput();
            Add(Background);

            TitleLabel              = new UILabel();
            TitleLabel.Caption      = "Congratulations! This object is fully upgraded.";
            TitleLabel.CaptionStyle = TextStyle.Create(Color.White, 12, true);
            TitleLabel.Position     = new Vector2(557, 16);
            TitleLabel.Size         = new Vector2(1, 1);
            TitleLabel.Alignment    = TextAlignment.Right | TextAlignment.Top;
            Add(TitleLabel);

            Thermometer                 = new UIUpgradeThermo();
            Thermometer.Position        = new Vector2(549, -73);
            Thermometer.OnHoveredLevel += Hover;
            Thermometer.OnClickedLevel += Click;
            Add(Thermometer);

            BackgroundHeight = 110;
            HidePct          = 1;
        }
Beispiel #2
0
        public UIOptions()
        {
            var script = RenderScript("optionspanel.uis");

            Background = new UIImage(GetTexture((FSOEnvironment.UIZoomFactor > 1f || GlobalSettings.Default.GraphicsWidth < 1024) ? (ulong)0x000000D800000002 : (ulong)0x0000018300000002));
            AddAt(0, Background);
            Background.BlockInput();
            Size = Background.Size.ToVector2();

            Divider = new UIImage(DividerImage)
            {
                X = 227,
                Y = 17
            };
            Add(Divider);

            ExitButton.OnButtonClick      += new ButtonClickDelegate(ExitButton_OnButtonClick);
            SelectSimButton.OnButtonClick += new ButtonClickDelegate(SelectSimButton_OnButtonClick);

            GraphicsButton.OnButtonClick  += new ButtonClickDelegate(GraphicsButton_OnButtonClick);
            ProfanityButton.OnButtonClick += new ButtonClickDelegate(ProfanityButton_OnButtonClick);
            SoundButton.OnButtonClick     += new ButtonClickDelegate(SoundButton_OnButtonClick);

            CurrentPanel = -1;
        }
        public UIOptions()
        {
            var script = this.RenderScript("optionspanel.uis");

            /*var bgimage = new TSOClient.Code.UI.Framework.Parser.UINode();
             * var imageAtts = new Dictionary<string,string>();
             * imageAtts.Add("assetID", (GlobalSettings.Default.GraphicsWidth < 1024)?"0x000000D800000002":"0x0000018300000002");
             * bgimage.ID = "BackgroundGameImage";
             *
             * bgimage.AddAtts(imageAtts);
             * script.DefineImage(bgimage);*/

            //we really need to figure out how graphics reset works to see what and how we need to reload things

            Background = new UIImage(GetTexture((GlobalSettings.Default.GraphicsWidth < 1024) ? (ulong)0x000000D800000002 : (ulong)0x0000018300000002));
            this.AddAt(0, Background);
            Background.BlockInput();

            Divider   = new UIImage(DividerImage);
            Divider.X = 227;
            Divider.Y = 17;
            this.Add(Divider);

            ExitButton.OnButtonClick      += new ButtonClickDelegate(ExitButton_OnButtonClick);
            SelectSimButton.OnButtonClick += new ButtonClickDelegate(SelectSimButton_OnButtonClick);

            GraphicsButton.OnButtonClick  += new ButtonClickDelegate(GraphicsButton_OnButtonClick);
            ProfanityButton.OnButtonClick += new ButtonClickDelegate(ProfanityButton_OnButtonClick);
            SoundButton.OnButtonClick     += new ButtonClickDelegate(SoundButton_OnButtonClick);

            CurrentPanel = -1;
        }
Beispiel #4
0
        public UIUCP(UIScreen owner)
        {
            this.RenderScript("ucp.uis");

            Game = (CoreGameScreen)owner;

            Background = new UIImage(BackgroundGameImage);
            this.AddAt(0, Background);
            Background.BlockInput();


            BackgroundMatchmaker   = new UIImage(BackgroundMatchmakerImage);
            BackgroundMatchmaker.Y = 81;
            this.AddAt(0, BackgroundMatchmaker);
            BackgroundMatchmaker.BlockInput();

            TimeText.Caption              = "12:00 am";
            TimeText.CaptionStyle         = TimeText.CaptionStyle.Clone();
            TimeText.CaptionStyle.Shadow  = true;
            MoneyText.Caption             = "§0";
            MoneyText.CaptionStyle        = TimeText.CaptionStyle.Clone();
            MoneyText.CaptionStyle.Shadow = true;

            CurrentPanel = -1;

            OptionsModeButton.OnButtonClick += new ButtonClickDelegate(OptionsModeButton_OnButtonClick);
            LiveModeButton.OnButtonClick    += new ButtonClickDelegate(LiveModeButton_OnButtonClick);
            BuyModeButton.OnButtonClick     += new ButtonClickDelegate(BuyModeButton_OnButtonClick);
            BuildModeButton.OnButtonClick   += BuildModeButton_OnButtonClick;

            ZoomOutButton.OnButtonClick += new ButtonClickDelegate(ZoomControl);
            ZoomInButton.OnButtonClick  += new ButtonClickDelegate(ZoomControl);
            PhoneButton.OnButtonClick   += new ButtonClickDelegate(PhoneButton_OnButtonClick);

            CloseZoomButton.OnButtonClick    += new ButtonClickDelegate(SetCityZoom);
            MediumZoomButton.OnButtonClick   += new ButtonClickDelegate(SetCityZoom);
            FarZoomButton.OnButtonClick      += new ButtonClickDelegate(SetCityZoom);
            NeighborhoodButton.OnButtonClick += new ButtonClickDelegate(SetCityZoom);
            WorldButton.OnButtonClick        += new ButtonClickDelegate(SetCityZoom);

            HouseViewSelectButton.OnButtonClick += new ButtonClickDelegate(WallsViewPopup);
            WallsDownButton.OnButtonClick       += new ButtonClickDelegate(WallsViewPopup);
            WallsUpButton.OnButtonClick         += new ButtonClickDelegate(WallsViewPopup);
            WallsCutawayButton.OnButtonClick    += new ButtonClickDelegate(WallsViewPopup);
            RoofButton.OnButtonClick            += new ButtonClickDelegate(WallsViewPopup);

            RotateClockwiseButton.OnButtonClick        += new ButtonClickDelegate(RotateClockwise);
            RotateCounterClockwiseButton.OnButtonClick += new ButtonClickDelegate(RotateCounterClockwise);

            FirstFloorButton.OnButtonClick  += FirstFloor;
            SecondFloorButton.OnButtonClick += SecondFloor;

            SecondFloorButton.Selected = (Game.Level == Game.Stories);
            FirstFloorButton.Selected  = (Game.Level == 1);

            MoneyText.CaptionStyle = MoneyText.CaptionStyle.Clone();

            SetInLot(false);
            SetMode(UCPMode.CityMode);
        }
Beispiel #5
0
        public UIUCP()
        {
            this.RenderScript("ucp.uis");

            Background = new UIImage(BackgroundGameImage);
            this.AddAt(0, Background);
            Background.BlockInput();


            BackgroundMatchmaker   = new UIImage(BackgroundMatchmakerImage);
            BackgroundMatchmaker.Y = 81;
            this.AddAt(0, BackgroundMatchmaker);
            BackgroundMatchmaker.BlockInput();

            TimeText.Caption  = "12:00 am";
            MoneyText.Caption = "§0";

            CurrentPanel = -1;

            OptionsModeButton.OnButtonClick += new ButtonClickDelegate(OptionsModeButton_OnButtonClick);

            ZoomOutButton.OnButtonClick      += new ButtonClickDelegate(ZoomControl);
            ZoomInButton.OnButtonClick       += new ButtonClickDelegate(ZoomControl);
            NeighborhoodButton.OnButtonClick += new ButtonClickDelegate(SetCityZoom);
            WorldButton.OnButtonClick        += new ButtonClickDelegate(SetCityZoom);
            PhoneButton.OnButtonClick        += new ButtonClickDelegate(PhoneButton_OnButtonClick);

            SetInLot(false);
            SetMode(UCPMode.CityMode);
        }
Beispiel #6
0
        public UIGameTitle()
        {
            Background = new UIImage(GetTexture((ulong)0x000001A700000002));
            Background.With9Slice(40, 40, 0, 0);
            this.AddAt(0, Background);
            Background.BlockInput();

            Label = new UILabel();
            Label.CaptionStyle      = TextStyle.DefaultLabel.Clone();
            Label.CaptionStyle.Size = 11;
            Label.Alignment         = TextAlignment.Middle;
            this.Add(Label);

            var ui     = Content.Content.Get().CustomUI;
            var btnTex = ui.Get("chat_cat.png").Get(GameFacade.GraphicsDevice);

            var btnCaption = TextStyle.DefaultLabel.Clone();

            btnCaption.Size   = 8;
            btnCaption.Shadow = true;

            CancelButton                = new UIButton(btnTex);
            CancelButton.Caption        = GameFacade.Strings.GetString("f115", "48");
            CancelButton.CaptionStyle   = btnCaption;
            CancelButton.OnButtonClick += CancelOverride;
            CancelButton.Width          = 64;
            CancelButton.Y              = 2;
            Add(CancelButton);

            SetTitle("Not Blazing Falls");
        }
        public void PopulateScreen(ushort mode)
        {
            var childClone = new List <UIElement>(Children);
            var config     = Neighborhoods[mode - 1];

            foreach (var child in childClone)
            {
                Remove(child);
            }

            var bg = new UIImage(((ITextureRef)Provider.Get(config.Graphic)).Get(GameFacade.GraphicsDevice));

            Add(bg);
            bg.BlockInput();
            var locationIff = Content.Content.Get().Neighborhood.LotLocations;
            var locations   = locationIff.Get <STR>(mode);

            if (locations == null)
            {
                return;
            }

            var buttons = new List <UINeighborhoodHouseButton>();

            for (int i = 0; i < locations.Length; i++)
            {
                var loc    = locations.GetString(i).Split(',');
                var button = new UINeighborhoodHouseButton(int.Parse(loc[0].TrimStart()), SelectHouse, config.Scale);
                button.Position = new Vector2(int.Parse(loc[1].TrimStart()), int.Parse(loc[2].TrimStart()));
                buttons.Add(button);
            }

            var ordered = buttons.OrderBy(x => x.Y);

            foreach (var btn in ordered)
            {
                Add(btn);
            }

            foreach (var layer in config.FullImageAnimations)
            {
                var lelem = new UINeighborhoodAnimationLayer(layer, config.Pulsate, config.FrameDuration);
                lelem.Position = layer.Position;
                Add(lelem);
            }

            BgSound?.RemoveOwner(-25);
            if (config.Music != null)
            {
                HIT.HITVM.Get().PlaySoundEvent(config.Music);
            }
            if (config.BGSound != null)
            {
                BgSound = HITVM.Get().PlaySoundEvent(config.BGSound);
                BgSound.AddOwner(-25);
            }
        }
Beispiel #8
0
        public UIGameTitle()
        {
            Background = new UIImage(GetTexture((ulong)0x000001A700000002));
            Background.With9Slice(40, 40, 0, 0);
            this.AddAt(0, Background);
            Background.BlockInput();

            Label = new UILabel();
            Label.CaptionStyle      = TextStyle.DefaultLabel.Clone();
            Label.CaptionStyle.Size = 11;
            Label.Alignment         = TextAlignment.Middle;
            this.Add(Label);

            SetTitle("Not Blazing Falls");
        }
        public UIAbstractCatalogPanel(string mode, UILotControl lotController)
        {
            LotController = lotController;
            Holder        = LotController.ObjectHolder;

            var useSmall = (FSOEnvironment.UIZoomFactor > 1f || GlobalSettings.Default.GraphicsWidth < 1024);

            UseSmall = useSmall;
            var script = this.RenderScript(mode + (useSmall ? "" : "1024") + ".uis");

            Script = script;

            Background   = new UIImage(GetTexture(useSmall ? (ulong)0x000000D800000002 : (ulong)0x0000018300000002));
            Background.Y = 0;
            Background.BlockInput();
            this.AddAt(0, Background);
            Size = Background.Size.ToVector2();

            Catalog                    = new UICatalog((mode == "buildpanel") ? (useSmall ? 10 : 20) : (useSmall ? 14 : 24));
            Catalog.LotControl         = lotController;
            Catalog.OnSelectionChange += new CatalogSelectionChangeDelegate(Catalog_OnSelectionChange);

            this.Add(Catalog);

            //prepare catalog map
            InitCategoryMap();
            foreach (UIButton btn in CategoryMap.Keys)
            {
                btn.OnButtonClick += ChangeCategory;
            }

            Holder.OnPickup      += HolderPickup;
            Holder.OnDelete      += HolderDelete;
            Holder.OnPutDown     += HolderPutDown;
            Holder.BeforeRelease += HolderBeforeRelease;
            DynamicOverlay.Add(QueryPanel);

            ObjLimitLabel = new UILabel();
            ObjLimitLabel.CaptionStyle        = ObjLimitLabel.CaptionStyle.Clone();
            ObjLimitLabel.CaptionStyle.Shadow = true;
            ObjLimitLabel.CaptionStyle.Color  = Microsoft.Xna.Framework.Color.White;
            ObjLimitLabel.Caption             = "127/250 Objects";
            ObjLimitLabel.Y         = -20;
            ObjLimitLabel.X         = Background.Width / 2 - 100;
            ObjLimitLabel.Size      = new Microsoft.Xna.Framework.Vector2(200, 0);
            ObjLimitLabel.Alignment = TextAlignment.Center;
            DynamicOverlay.Add(ObjLimitLabel);
        }
Beispiel #10
0
        public UIHouseMode(UILotControl lotController)
        {
            var useSmall = true;  //(FSOEnvironment.UIZoomFactor > 1f || GlobalSettings.Default.GraphicsWidth < 1024);
            var script   = RenderScript("housepanel.uis");

            Background = new UIImage(GetTexture(useSmall ? (ulong)0x000000D800000002 : (ulong)0x0000018300000002))
            {
                Y = 9
            };
            Background.BlockInput();
            AddAt(0, Background);

            Size = Background.Size.ToVector2() + new Vector2(0, 9);

            Divider         = script.Create <UIImage>("Divider");
            Divider.Texture = DividerImage;
            Add(Divider);

            BtnToMode = new Dictionary <UIButton, int>()
            {
                { HouseInfoButton, 0 },
                { StatisticsButton, 1 },
                { RoommatesButton, 2 },
                { LogButton, 3 },
                { AdmitBanButton, 4 },
                { EnvironmentButton, 5 },
                { BillsButton, 6 },
                { LotResizeButton, 7 }
            };

            StatisticsButton.Disabled = true;
            BillsButton.Disabled      = true;
            LogButton.Disabled        = true;

            foreach (var btn in BtnToMode.Keys)
            {
                btn.OnButtonClick += SetMode;
            }

            CurrentPanel = -1;
            LotControl   = lotController;
        }
Beispiel #11
0
        public UIOptions()
        {
            var script = this.RenderScript("optionspanel.uis");

            Background = new UIImage(GetTexture((GlobalSettings.Default.GraphicsWidth < 1024) ? (ulong)0x000000D800000002 : (ulong)0x0000018300000002));
            this.AddAt(0, Background);
            Background.BlockInput();

            Divider   = new UIImage(DividerImage);
            Divider.X = 227;
            Divider.Y = 17;
            this.Add(Divider);

            ExitButton.OnButtonClick      += new ButtonClickDelegate(ExitButton_OnButtonClick);
            SelectSimButton.OnButtonClick += new ButtonClickDelegate(SelectSimButton_OnButtonClick);

            GraphicsButton.OnButtonClick  += new ButtonClickDelegate(GraphicsButton_OnButtonClick);
            ProfanityButton.OnButtonClick += new ButtonClickDelegate(ProfanityButton_OnButtonClick);
            SoundButton.OnButtonClick     += new ButtonClickDelegate(SoundButton_OnButtonClick);

            CurrentPanel = -1;
        }
Beispiel #12
0
        public UIBuyMode(UILotControl lotController)
        {
            LotController = lotController;
            Holder        = LotController.ObjectHolder;

            var useSmall = (FSOEnvironment.UIZoomFactor > 1f || GlobalSettings.Default.GraphicsWidth < 1024);

            UseSmall = useSmall;
            var script = this.RenderScript("buypanel" + (useSmall?"":"1024") + ".uis");

            Background   = new UIImage(GetTexture(useSmall ? (ulong)0x000000D800000002 : (ulong)0x0000018300000002));
            Background.Y = 0;
            Background.BlockInput();
            this.AddAt(0, Background);
            Size = Background.Size.ToVector2();

            InventoryButtonBackgroundImage = script.Create <UIImage>("InventoryButtonBackgroundImage");
            this.AddAt(1, InventoryButtonBackgroundImage);

            CatBg = script.Create <UIImage>("ProductCatalogImage");
            this.AddAt(2, CatBg);

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

            NonRMInventoryCatBg = script.Create <UIImage>("InventoryCatalogVisitorImage");
            this.AddAt(4, NonRMInventoryCatBg);

            InventoryCatalogVisitorIcon = script.Create <UIImage>("InventoryCatalogVisitorIcon");
            this.AddAt(5, InventoryCatalogVisitorIcon);

            Catalog                    = new UICatalog(useSmall ? 14 : 24);
            Catalog.LotControl         = lotController;
            Catalog.OnSelectionChange += new CatalogSelectionChangeDelegate(Catalog_OnSelectionChange);
            Catalog.Position           = new Microsoft.Xna.Framework.Vector2(275, 7);
            this.Add(Catalog);

            CategoryMap = new Dictionary <UIButton, int>
            {
                { SeatingButton, 12 },
                { SurfacesButton, 13 },
                { AppliancesButton, 14 },
                { ElectronicsButton, 15 },
                { SkillButton, 16 },
                { DecorativeButton, 17 },
                { MiscButton, 18 },
                { LightingButton, 19 },
                { PetsButton, 20 },
            };

            SeatingButton.OnButtonClick         += ChangeCategory;
            SurfacesButton.OnButtonClick        += ChangeCategory;
            DecorativeButton.OnButtonClick      += ChangeCategory;
            ElectronicsButton.OnButtonClick     += ChangeCategory;
            AppliancesButton.OnButtonClick      += ChangeCategory;
            SkillButton.OnButtonClick           += ChangeCategory;
            LightingButton.OnButtonClick        += ChangeCategory;
            MiscButton.OnButtonClick            += ChangeCategory;
            PetsButton.OnButtonClick            += ChangeCategory;
            MapBuildingModeButton.OnButtonClick += ChangeCategory;
            InventoryButton.OnButtonClick       += ChangeCategory;

            ProductCatalogPreviousPageButton.OnButtonClick           += PreviousPage;
            InventoryCatalogRoommatePreviousPageButton.OnButtonClick += PreviousPage;
            InventoryCatalogVisitorPreviousPageButton.OnButtonClick  += PreviousPage;

            ProductCatalogNextPageButton.OnButtonClick           += NextPage;
            InventoryCatalogRoommateNextPageButton.OnButtonClick += NextPage;
            InventoryCatalogVisitorNextPageButton.OnButtonClick  += NextPage;

            ProductCatalogSlider.MinValue           = 0;
            InventoryCatalogRoommateSlider.MinValue = 0;
            InventoryCatalogVisitorSlider.MinValue  = 0;

            ProductCatalogSlider.OnChange           += PageSlider;
            InventoryCatalogRoommateSlider.OnChange += PageSlider;
            InventoryCatalogVisitorSlider.OnChange  += PageSlider;

            SetMode(0);
            SetRoomCategories(false);

            Holder.OnPickup  += HolderPickup;
            Holder.OnDelete  += HolderDelete;
            Holder.OnPutDown += HolderPutDown;
            DynamicOverlay.Add(QueryPanel);

            ObjLimitLabel = new UILabel();
            ObjLimitLabel.CaptionStyle        = ObjLimitLabel.CaptionStyle.Clone();
            ObjLimitLabel.CaptionStyle.Shadow = true;
            ObjLimitLabel.CaptionStyle.Color  = Microsoft.Xna.Framework.Color.White;
            ObjLimitLabel.Caption             = "127/250 Objects";
            ObjLimitLabel.Y         = -20;
            ObjLimitLabel.X         = Background.Width / 2 - 100;
            ObjLimitLabel.Size      = new Microsoft.Xna.Framework.Vector2(200, 0);
            ObjLimitLabel.Alignment = TextAlignment.Center;
            DynamicOverlay.Add(ObjLimitLabel);
        }
Beispiel #13
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);

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

            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 = 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;
        }
Beispiel #14
0
        public UIBuyMode(UILotControl lotController)
        {
            LotController = lotController;
            Holder        = LotController.ObjectHolder;
            QueryPanel    = LotController.QueryPanel;

            var script = this.RenderScript("buypanel" + ((GlobalSettings.Default.GraphicsWidth < 1024)?"":"1024") + ".uis");

            Background   = new UIImage(GetTexture((GlobalSettings.Default.GraphicsWidth < 1024) ? (ulong)0x000000D800000002 : (ulong)0x0000018300000002));
            Background.Y = 0;
            Background.BlockInput();
            this.AddAt(0, Background);

            CatBg          = new UIImage(catalogBackground);
            CatBg.Position = new Microsoft.Xna.Framework.Vector2(250, 5);
            this.AddAt(1, CatBg);

            InventoryCatBg          = new UIImage(inventoryRoommateBackground);
            InventoryCatBg.Position = new Microsoft.Xna.Framework.Vector2(250, 5);
            this.AddAt(2, InventoryCatBg);

            NonRMInventoryCatBg          = new UIImage(inventoryVisitorBackground);
            NonRMInventoryCatBg.Position = new Microsoft.Xna.Framework.Vector2(68, 5);
            this.AddAt(3, InventoryCatBg);

            Catalog = new UICatalog((GlobalSettings.Default.GraphicsWidth < 1024) ? 14 : 24);
            Catalog.OnSelectionChange += new CatalogSelectionChangeDelegate(Catalog_OnSelectionChange);
            Catalog.Position           = new Microsoft.Xna.Framework.Vector2(275, 7);
            this.Add(Catalog);

            CategoryMap = new Dictionary <UIButton, int>
            {
                { SeatingButton, 12 },
                { SurfacesButton, 13 },
                { AppliancesButton, 14 },
                { ElectronicsButton, 15 },
                { SkillButton, 16 },
                { DecorativeButton, 17 },
                { MiscButton, 18 },
                { LightingButton, 19 },
                { PetsButton, 20 },
            };

            SeatingButton.OnButtonClick         += ChangeCategory;
            SurfacesButton.OnButtonClick        += ChangeCategory;
            DecorativeButton.OnButtonClick      += ChangeCategory;
            ElectronicsButton.OnButtonClick     += ChangeCategory;
            AppliancesButton.OnButtonClick      += ChangeCategory;
            SkillButton.OnButtonClick           += ChangeCategory;
            LightingButton.OnButtonClick        += ChangeCategory;
            MiscButton.OnButtonClick            += ChangeCategory;
            PetsButton.OnButtonClick            += ChangeCategory;
            MapBuildingModeButton.OnButtonClick += ChangeCategory;

            ProductCatalogPreviousPageButton.OnButtonClick           += PreviousPage;
            InventoryCatalogRoommatePreviousPageButton.OnButtonClick += PreviousPage;
            InventoryCatalogVisitorPreviousPageButton.OnButtonClick  += PreviousPage;

            ProductCatalogNextPageButton.OnButtonClick           += NextPage;
            InventoryCatalogRoommateNextPageButton.OnButtonClick += NextPage;
            InventoryCatalogVisitorNextPageButton.OnButtonClick  += NextPage;

            ProductCatalogSlider.MinValue           = 0;
            InventoryCatalogRoommateSlider.MinValue = 0;
            InventoryCatalogVisitorSlider.MinValue  = 0;

            ProductCatalogSlider.OnChange           += PageSlider;
            InventoryCatalogRoommateSlider.OnChange += PageSlider;
            InventoryCatalogVisitorSlider.OnChange  += PageSlider;

            SetMode(0);
            SetRoomCategories(false);

            Holder.OnPickup  += HolderPickup;
            Holder.OnDelete  += HolderDelete;
            Holder.OnPutDown += HolderPutDown;
        }
Beispiel #15
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;
        }
Beispiel #16
0
        public UIUCP(UIScreen owner)
        {
            this.RenderScript("ucp.uis");

            Game = (IGameScreen)owner;

            Background = new UIImage(BackgroundGameImage);
            this.AddAt(0, Background);
            Background.BlockInput();
            Size = new Vector2(Background.Width, Background.Height); //for caching


            BackgroundMatchmaker   = new UIImage(BackgroundMatchmakerImage);
            BackgroundMatchmaker.Y = 81;
            this.AddAt(0, BackgroundMatchmaker);
            BackgroundMatchmaker.BlockInput();

            TimeText.Caption              = "12:00 am";
            TimeText.CaptionStyle         = TimeText.CaptionStyle.Clone();
            TimeText.CaptionStyle.Shadow  = true;
            MoneyText.Caption             = "§0";
            MoneyText.CaptionStyle        = TimeText.CaptionStyle.Clone();
            MoneyText.CaptionStyle.Shadow = true;

            CurrentPanel = -1;

            OptionsModeButton.OnButtonClick += new ButtonClickDelegate(OptionsModeButton_OnButtonClick);
            LiveModeButton.OnButtonClick    += new ButtonClickDelegate(LiveModeButton_OnButtonClick);
            BuyModeButton.OnButtonClick     += new ButtonClickDelegate(BuyModeButton_OnButtonClick);
            BuildModeButton.OnButtonClick   += BuildModeButton_OnButtonClick;
            HouseModeButton.OnButtonClick   += (btn) => { SetPanel(4); };

            ZoomOutButton.OnButtonClick += new ButtonClickDelegate(ZoomControl);
            ZoomInButton.OnButtonClick  += new ButtonClickDelegate(ZoomControl);
            PhoneButton.OnButtonClick   += new ButtonClickDelegate(PhoneButton_OnButtonClick);
            HelpButton.OnButtonClick    += HelpButton_OnButtonClick;

            CloseZoomButton.OnButtonClick    += new ButtonClickDelegate(SetCityZoom);
            MediumZoomButton.OnButtonClick   += new ButtonClickDelegate(SetCityZoom);
            FarZoomButton.OnButtonClick      += new ButtonClickDelegate(SetCityZoom);
            NeighborhoodButton.OnButtonClick += new ButtonClickDelegate(SetCityZoom);
            WorldButton.OnButtonClick        += new ButtonClickDelegate(SetCityZoom);

            HouseViewSelectButton.OnButtonClick += new ButtonClickDelegate(WallsViewPopup);
            WallsDownButton.OnButtonClick       += new ButtonClickDelegate(WallsViewPopup);
            WallsUpButton.OnButtonClick         += new ButtonClickDelegate(WallsViewPopup);
            WallsCutawayButton.OnButtonClick    += new ButtonClickDelegate(WallsViewPopup);
            RoofButton.OnButtonClick            += new ButtonClickDelegate(WallsViewPopup);

            RotateClockwiseButton.OnButtonClick        += new ButtonClickDelegate(RotateClockwise);
            RotateCounterClockwiseButton.OnButtonClick += new ButtonClickDelegate(RotateCounterClockwise);

            FirstFloorButton.OnButtonClick  += FirstFloor;
            SecondFloorButton.OnButtonClick += SecondFloor;

            BookmarkButton.OnButtonClick      += BookmarkButton_OnButtonClick;
            FriendshipWebButton.OnButtonClick += FriendshipWebButton_OnButtonClick;

            SecondFloorButton.Selected = (Game.Level == Game.Stories);
            FirstFloorButton.Selected  = (Game.Level == 1);

            MoneyText.CaptionStyle = MoneyText.CaptionStyle.Clone();

            var temp = new UILabel();

            temp.X                   = SecondFloorButton.X + 7;
            temp.Y                   = SecondFloorButton.Y - 14;
            temp.Caption             = "1";
            temp.CaptionStyle        = temp.CaptionStyle.Clone();
            temp.CaptionStyle.Size   = 7;
            temp.CaptionStyle.Shadow = true;
            Add(temp);
            FloorNumLabel = temp;

            SetInLot(false);
            SetMode(UCPMode.CityMode);
            Focus = UCPFocusMode.UCP;
            SetFocus(UCPFocusMode.Game);
        }
Beispiel #17
0
        public UIBuildMode(UILotControl lotController)
        {
            LotController = lotController;
            Holder        = LotController.ObjectHolder;

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

            Background   = new UIImage(GetTexture(useSmall ? (ulong)0x000000D800000002 : (ulong)0x0000018300000002));
            Background.Y = 0;
            Background.BlockInput();
            this.AddAt(0, Background);

            Size = Background.Size.ToVector2();

            Divider          = new UIImage(dividerImage);
            Divider.Position = new Vector2(337, 14);
            this.AddAt(1, Divider);

            SubToolBg          = new UIImage(subtoolsBackground);
            SubToolBg.Position = new Vector2(336, 5);
            this.AddAt(2, SubToolBg);

            Catalog                    = new UICatalog(useSmall ? 10 : 20);
            Catalog.ActiveVM           = lotController.vm;
            Catalog.OnSelectionChange += new CatalogSelectionChangeDelegate(Catalog_OnSelectionChange);
            Catalog.Position           = new Vector2(364, 7);
            this.Add(Catalog);

            CategoryMap = new Dictionary <UIButton, int>
            {
                { TerrainButton, 29 },
                { WaterButton, 5 },
                { WallButton, 7 },
                { WallpaperButton, 8 },
                { StairButton, 2 },
                { FireplaceButton, 4 },

                { PlantButton, 3 },
                { FloorButton, 9 },
                { DoorButton, 0 },
                { WindowButton, 1 },
                { RoofButton, 6 },
                { HandButton, 28 },
            };

            TerrainButton.Disabled         = (LotController?.ActiveEntity?.TSOState as VMTSOAvatarState)?.Permissions < VMTSOAvatarPermissions.Admin;
            TerrainButton.OnButtonClick   += ChangeCategory;
            WaterButton.OnButtonClick     += ChangeCategory;
            WallButton.OnButtonClick      += ChangeCategory;
            WallpaperButton.OnButtonClick += ChangeCategory;
            StairButton.OnButtonClick     += ChangeCategory;
            FireplaceButton.OnButtonClick += ChangeCategory;

            PlantButton.OnButtonClick  += ChangeCategory;
            FloorButton.OnButtonClick  += ChangeCategory;
            DoorButton.OnButtonClick   += ChangeCategory;
            WindowButton.OnButtonClick += ChangeCategory;
            RoofButton.OnButtonClick   += ChangeCategory;
            HandButton.OnButtonClick   += ChangeCategory;

            PreviousPageButton.OnButtonClick += PreviousPage;
            NextPageButton.OnButtonClick     += NextPage;
            SubtoolsSlider.MinValue           = 0;
            SubtoolsSlider.OnChange          += PageSlider;

            Holder.OnPickup  += HolderPickup;
            Holder.OnDelete  += HolderDelete;
            Holder.OnPutDown += HolderPutDown;
            DynamicOverlay.Add(QueryPanel);

            LotController.ObjectHolder.Roommate = true;
            LotController.QueryPanel.Roommate   = true;

            ObjLimitLabel = new UILabel();
            ObjLimitLabel.CaptionStyle        = ObjLimitLabel.CaptionStyle.Clone();
            ObjLimitLabel.CaptionStyle.Shadow = true;
            ObjLimitLabel.CaptionStyle.Color  = Microsoft.Xna.Framework.Color.White;
            ObjLimitLabel.Caption             = "127/250 Objects";
            ObjLimitLabel.Y         = -20;
            ObjLimitLabel.X         = Background.Width / 2 - 100;
            ObjLimitLabel.Size      = new Microsoft.Xna.Framework.Vector2(200, 0);
            ObjLimitLabel.Alignment = TextAlignment.Center;
            DynamicOverlay.Add(ObjLimitLabel);

            RoofSteepBtn   = new UIButton(GetTexture(0x4C200000001));
            RoofSteepBtn.X = 46;
            RoofSteepBtn.Y = 6;
            Add(RoofSteepBtn);
            RoofShallowBtn   = new UIButton(GetTexture(0x4C700000001));
            RoofShallowBtn.X = 46;
            RoofShallowBtn.Y = 92;
            Add(RoofShallowBtn);


            RoofSlider               = new UISlider();
            RoofSlider.Orientation   = 1;
            RoofSlider.Texture       = GetTexture(0x4AB00000001);
            RoofSlider.MinValue      = 0f;
            RoofSlider.MaxValue      = 1.25f;
            RoofSlider.AllowDecimals = true;
            RoofSlider.AttachButtons(RoofSteepBtn, RoofShallowBtn, 0.25f);
            RoofSlider.X         = 48;
            RoofSlider.Y         = 24;
            RoofSlider.OnChange += (elem) =>
            {
                if (RoofSlider.Value != (1.25f - LotController.vm.Context.Architecture.RoofPitch))
                {
                    LotController.vm.Context.Blueprint.RoofComp.SetStylePitch(
                        LotController.vm.Context.Architecture.RoofStyle,
                        (1.25f - RoofSlider.Value)
                        );
                    SendRoofValue = true;
                }
            };
            RoofSlider.SetSize(0, 64f);
            Add(RoofSlider);

            RoofSteepBtn.Visible   = false;
            RoofShallowBtn.Visible = false;
            RoofSlider.Visible     = false;
        }
Beispiel #18
0
        public void SetInEOD(EODLiveModeOpt options, UIEOD eod)
        {
            Invalidate(); //i mean, duh
            bool eodPresent = (options != null);
            bool inEOD      = eodPresent && !HideEOD;

            if (ActiveEOD != null)
            {
                DynamicOverlay.Remove(ActiveEOD);
            }

            if (!ExtraTallInitialized && options?.Height == EODHeight.ExtraTall)
            {
                options.Height = EODHeight.TallTall;
            }

            LastEODConfig = options;
            ActiveEOD     = eod;


            /**
             * Useful values
             */

            bool isTall       = inEOD && (options.Height == EODHeight.Tall || options.Height == EODHeight.TallTall);
            bool isDoubleTall = inEOD && options.Height == EODHeight.TallTall;
            bool isExtraTall  = inEOD && options.Height == EODHeight.ExtraTall;
            bool isTrade      = inEOD && options.Height == EODHeight.Trade;


            /**
             * Reset / hide standard and eod UI
             */
            MoodPanelButton.Position = (eodPresent) ? EODLayout.Baseline + new Vector2(20, 7) : new Vector2(31, 63);
            EODButtonLayout.Visible  = inEOD && !isExtraTall;
            EODSub.Visible           = inEOD && !isExtraTall;
            EODMsgWin.Visible        = inEOD && options.Tips != EODTextTips.None;

            EODHelpButton.Visible     = inEOD;
            EODCloseButton.Visible    = inEOD;
            EODExpandButton.Visible   = inEOD && options.Expandable && !options.Expanded;
            EODContractButton.Visible = inEOD && options.Expandable && options.Expanded;
            EODExpandBack.Visible     = inEOD && options.Expandable;
            EODButton.Visible         = eodPresent;

            EODTopSub.Visible          = inEOD && options.Expandable && options.Expanded;
            EODTopButtonLayout.Visible = inEOD && options.Expandable && options.Expanded;

            EODPanel.Visible           = inEOD && !isTall && !isTrade && !isExtraTall;
            EODPanelTall.Visible       = inEOD && isTall;
            EODDoublePanelTall.Visible = inEOD && isDoubleTall && options.Expanded;
            EODPanelExtraTall.Visible  = inEOD && isExtraTall;

            EODTimer.Visible        = inEOD && options.Timer == EODs.EODTimer.Normal;
            MsgWinTextEntry.Visible = inEOD && options.Tips != EODTextTips.None;
            TimerTextEntry.Visible  = inEOD && options.Timer != EODs.EODTimer.None;

            //Cleanup
            if (EODImage.Texture != null)
            {
                EODImage.Texture.Dispose();
            }
            EODImage.Texture = null;

            //EOD Button
            EODButton.Selected = inEOD;
            EODButton.Position = EODLayout.EODButtonPosition;

            /**
             * Attach new EOD UI
             */
            if (inEOD)
            {
                DynamicOverlay.Add(ActiveEOD);
            }

            /**
             * Position / style EOD specific UI
             */
            if (eodPresent)
            {
                EODButtonLayout.Reset();
                EODSub.Reset();
                EODMsgWin.Reset();

                var buttons      = new string[] { "None", "One", "Two", "Three" }; // three doesn't work, but at least for now it won't be out of bounds array
                var buttonLayout = buttons[options.Buttons];
                if (options.Buttons == 3 && options.Height.Equals(EODHeight.Tall))
                {
                    Script.ApplyControlProperties(EODButtonLayout, "EODButtonLayout" + "Two" + EODLayout.GetHeightSuffix(options.Height, true));
                    EODButtonLayout.Texture = GetTexture(0xCBF00000001); // lpanel_eodlayoutthreetall
                }
                else
                {
                    Script.ApplyControlProperties(EODButtonLayout, "EODButtonLayout" + buttonLayout + EODLayout.GetHeightSuffix(options.Height, true));
                }
                Script.ApplyControlProperties(EODSub, "EODSub" + options.Length + "Length" + EODLayout.GetHeightSuffix(options.Height, true));
                if (options.Length == EODLength.None)
                {
                    EODSub.Visible = false;
                }
                EODButtonLayout.Visible = EODSub.Visible;

                if (options.Tips != EODTextTips.None)
                {
                    Script.ApplyControlProperties(EODMsgWin, "EODMsgWin" + options.Tips.ToString());
                }

                var topLeft = EODLayout.GetTopLeft(options.Height);

                //EOD position
                ActiveEOD.Position = topLeft + (Vector2)Script.GetControlProperty(isTrade?"EODTradePosition":"EODPosition");

                //Close button
                EODCloseButton.Position = EODLayout.GetChromePosition("EODCloseButton", options.Height);
                // todo extratall

                //Help button
                EODHelpButton.Position = EODLayout.HelpButtonPosition;

                if (isTrade && !Small800)
                {
                    //place the close/help button at 1024x768 position
                    EODCloseButton.X += 224;
                    EODHelpButton.X  += 224;
                }

                //Chrome
                var chromeOffset = EODLayout.GetChromeOffset(options.Height);
                EODButtonLayout.Position += chromeOffset;
                EODSub.Position          += chromeOffset;

                //Message
                EODMsgWin.Position = EODLayout.GetMessageWindowPosition(options.Height, options.Tips, options.Expanded);
                EODMsgWin.BlockInput();
                MsgWinTextEntry.Position = EODLayout.GetMessageWindowTextPosition(options.Height, options.Expanded);

                //Timer
                EODTimer.Position = EODLayout.GetTimerPosition(options.Height, options.Expanded);
                EODTimer.BlockInput();
                EODTimer.Texture        = GetTexture(0x0000011300000002); // regular .\uigraphics\ucp\livepanel\eod_timerback.tga, changed for TallTall below
                TimerTextEntry.Position = EODLayout.GetTimerTextPosition(options.Height, options.Expanded);

                //Expand / contract
                EODExpandButton.Position   = EODLayout.GetExpandButtonPosition(options.Height);
                EODContractButton.Position = EODLayout.GetContractButtonPosition(options.Height);
                EODExpandBack.Position     = EODLayout.GetExpandBackPosition(options.Height);

                //backgrounds
                EODPanel.Position = EODLayout.GetPanelPosition(EODHeight.Normal);
                EODPanel.BlockInput();
                EODPanelTall.Position = EODLayout.GetPanelPosition(EODHeight.Tall);
                EODPanelTall.BlockInput();
                EODDoublePanelTall.Position = EODLayout.GetPanelPosition(EODHeight.TallTall);
                EODDoublePanelTall.BlockInput();
                EODPanelExtraTall.Position = EODLayout.GetPanelPosition(EODHeight.ExtraTall);
                EODPanelExtraTall.BlockInput();

                if (isTrade)
                {
                    Size = new Vector2(BackgroundEODTradeImg.Width, BackgroundEODTradeImg.Height);
                }
                else
                {
                    Size = new Vector2(Background.Size.X, ((options.Height == EODHeight.TallTall && options.Expanded) ? (EODDoublePanelTall.Size.Y + (EODDoublePanelTall.Y - EODMsgWin.Y)) : EODPanelTall.Size.Y) - (int)EODMsgWin.Position.Y);
                }
                BackOffset = new Point(isTrade ? 22 : 0, -(int)EODMsgWin.Position.Y);


                //Double tall panel chrome
                if (options.Height == EODHeight.TallTall || options.Height == EODHeight.ExtraTall)
                {
                    //BackOffset = new Point(0, -(int)EODDoublePanelTall.Y);
                    EODTopSub.Reset();
                    EODTopButtonLayout.Reset();

                    var topButtonLayout = buttons[options.TopPanelButtons];
                    Script.ApplyControlProperties(EODTopButtonLayout, "EODButtonLayout" + topButtonLayout + EODLayout.GetHeightSuffix(EODHeight.Tall));
                    Script.ApplyControlProperties(EODTopSub, "EODSub" + options.Length + "Length" + EODLayout.GetHeightSuffix(EODHeight.Tall));

                    EODTopButtonLayout.Position -= new Vector2(0, 155);
                    EODTopSub.Position          -= new Vector2(0, 155);

                    if (EODTimer.Visible == true && options.Expanded) // needs to be eod_timerback_straight.tga for TallTall
                    {
                        EODTimer.Texture = GetTexture(0x000001BF00000002);
                    }
                }



                var ava = SelectedAvatar;
                if (ava != null)
                {
                    var eodConnection = ava.Thread.EODConnection;
                    if (eodConnection != null)
                    {
                        var entity = LotController.vm.GetObjectById(eodConnection.ObjectID);
                        if (entity is VMGameObject)
                        {
                            var objects = entity.MultitileGroup.Objects;
                            ObjectComponent[] objComps = new ObjectComponent[objects.Count];
                            for (int i = 0; i < objects.Count; i++)
                            {
                                objComps[i] = (ObjectComponent)objects[i].WorldUI;
                            }
                            var thumb = LotController.World.GetObjectThumb(objComps, entity.MultitileGroup.GetBasePositions(), GameFacade.GraphicsDevice);

                            EODImage.Texture = thumb;
                        }
                    }
                }
                if (EODImage.Texture != null)
                {
                    var imgScale = 22f / Math.Max(EODImage.Texture.Width, EODImage.Texture.Height);
                    EODImage.SetSize(EODImage.Texture.Width * imgScale, EODImage.Texture.Height * imgScale);

                    EODImage.Position = EODButton.Position + new Vector2((EODButton.Texture.Width / 4 - EODImage.Width) / 2, (EODButton.Texture.Height - EODImage.Height) / 2);
                }
            }
            else
            {
                BackOffset = new Point(0, 0);
                Size       = new Vector2(DefaultBGImage.Width, EODPanelTall.Size.Y);
            }

            //this.Y = (inEOD && options.Height == EODHeight.Tall) ? 41: 61;

            Divider.Visible            = !inEOD;
            MotiveDisplay.Visible      = !inEOD;
            PersonGrid.Visible         = !inEOD;
            MotivesLabel.Visible       = !inEOD;
            PeopleListBg.Visible       = !inEOD;
            PreviousPageButton.Visible = !inEOD;
            NextPageButton.Visible     = !inEOD;
            Background.Visible         = !inEOD || isTrade;

            PersonGrid.Columns = (eodPresent || Small800) ?4:9;
            PersonGrid.DrawPage();
            PeopleListBg.Texture = (eodPresent && PeopleListEODBackgroundImg != null) ? PeopleListEODBackgroundImg : PeopleListBackgroundImg;
            PeopleListBg.SetSize(PeopleListBg.Texture.Width, PeopleListBg.Texture.Height);

            NextPageButton.Position = (eodPresent && !Small800) ? (Vector2)Script.GetControlProperty("NextPageEODButton") : DefaultNextPagePos;
            Background.Texture      = (eodPresent) ? (isTrade? BackgroundEODTradeImg : BackgroundEODImg) : DefaultBGImage;
            Background.Position     = (isTrade) ? new Vector2(-22, -79) : new Vector2(0, 35);
            Background.SetSize(Background.Texture.Width, Background.Texture.Height);

            var changeJobY = StatusBarMsgWinStraight.Y != (inEOD ? -18 : 2);
            var changeJobX = StatusBarMsgWinStraight.X != (eodPresent ? 159 : 383);

            if (Small800)
            {
                changeJobX = false;
            }
            if (changeJobX || changeJobY)
            {
                //there don't seem to be any UIScript cues for this.
                var offset = new Vector2(Small800 ? 0 : (800 - 1024), -20);
                if (!changeJobX)
                {
                    offset.X = 0;
                }
                if (!changeJobY)
                {
                    offset.Y = 0;
                }
                if (!inEOD)
                {
                    offset.Y *= -1;
                }
                if (!eodPresent)
                {
                    offset.X *= -1;
                }
                StatusBarMsgWinStraight.Position  += offset;
                StatusBarMsgWinTextEntry.Position += offset;
                StatusBarTimerBreakIcon.Position  += offset;
                StatusBarTimerWorkIcon.Position   += offset;
                StatusBarTimerStraight.Position   += offset;
                StatusBarTimerTextEntry.Position  += offset;
            }

            UpdateThumbPosition();
            Common.Utils.GameThread.NextUpdate(x =>
            {
                Invalidate();
            });
        }
Beispiel #19
0
        public UIBuildMode(UILotControl lotController)
        {
            LotController = lotController;
            Holder        = LotController.ObjectHolder;
            QueryPanel    = LotController.QueryPanel;

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

            Background   = new UIImage(GetTexture(useSmall ? (ulong)0x000000D800000002 : (ulong)0x0000018300000002));
            Background.Y = 0;
            Background.BlockInput();
            this.AddAt(0, Background);

            Divider          = new UIImage(dividerImage);
            Divider.Position = new Vector2(337, 14);
            this.AddAt(1, Divider);

            SubToolBg          = new UIImage(subtoolsBackground);
            SubToolBg.Position = new Vector2(336, 5);
            this.AddAt(2, SubToolBg);

            Catalog = new UICatalog(useSmall ? 10 : 20);
            Catalog.OnSelectionChange += new CatalogSelectionChangeDelegate(Catalog_OnSelectionChange);
            Catalog.Position           = new Vector2(364, 7);
            this.Add(Catalog);

            CategoryMap = new Dictionary <UIButton, int>
            {
                { TerrainButton, 10 },
                { WaterButton, 5 },
                { WallButton, 7 },
                { WallpaperButton, 8 },
                { StairButton, 2 },
                { FireplaceButton, 4 },

                { PlantButton, 3 },
                { FloorButton, 9 },
                { DoorButton, 0 },
                { WindowButton, 1 },
                { RoofButton, 6 },
                { HandButton, 28 },
            };

            TerrainButton.OnButtonClick   += ChangeCategory;
            WaterButton.OnButtonClick     += ChangeCategory;
            WallButton.OnButtonClick      += ChangeCategory;
            WallpaperButton.OnButtonClick += ChangeCategory;
            StairButton.OnButtonClick     += ChangeCategory;
            FireplaceButton.OnButtonClick += ChangeCategory;

            PlantButton.OnButtonClick  += ChangeCategory;
            FloorButton.OnButtonClick  += ChangeCategory;
            DoorButton.OnButtonClick   += ChangeCategory;
            WindowButton.OnButtonClick += ChangeCategory;
            RoofButton.OnButtonClick   += ChangeCategory;
            HandButton.OnButtonClick   += ChangeCategory;

            PreviousPageButton.OnButtonClick += PreviousPage;
            NextPageButton.OnButtonClick     += NextPage;
            SubtoolsSlider.MinValue           = 0;
            SubtoolsSlider.OnChange          += PageSlider;

            Holder.OnPickup  += HolderPickup;
            Holder.OnDelete  += HolderDelete;
            Holder.OnPutDown += HolderPutDown;
            Add(QueryPanel);

            RoofSteepBtn   = new UIButton(GetTexture(0x4C200000001));
            RoofSteepBtn.X = 46;
            RoofSteepBtn.Y = 6;
            Add(RoofSteepBtn);
            RoofShallowBtn   = new UIButton(GetTexture(0x4C700000001));
            RoofShallowBtn.X = 46;
            RoofShallowBtn.Y = 92;
            Add(RoofShallowBtn);


            RoofSlider               = new UISlider();
            RoofSlider.Orientation   = 1;
            RoofSlider.Texture       = GetTexture(0x4AB00000001);
            RoofSlider.MinValue      = 0f;
            RoofSlider.MaxValue      = 1.25f;
            RoofSlider.AllowDecimals = true;
            RoofSlider.AttachButtons(RoofSteepBtn, RoofShallowBtn, 1);
            RoofSlider.X         = 48;
            RoofSlider.Y         = 24;
            RoofSlider.OnChange += (elem) =>
            {
                if (RoofSlider.Value != (1.25f - LotController.vm.Context.Architecture.RoofPitch))
                {
                    LotController.vm.Context.Blueprint.RoofComp.SetStylePitch(
                        LotController.vm.Context.Architecture.RoofStyle,
                        (1.25f - RoofSlider.Value)
                        );
                    SendRoofValue = true;
                }
            };
            RoofSlider.SetSize(0, 64f);
            Add(RoofSlider);

            RoofSteepBtn.Visible   = false;
            RoofShallowBtn.Visible = false;
            RoofSlider.Visible     = false;
        }
Beispiel #20
0
        public UIBuildMode(UILotControl lotController)
        {
            LotController = lotController;
            Holder        = LotController.ObjectHolder;
            QueryPanel    = LotController.QueryPanel;

            var script = this.RenderScript("buildpanel" + ((GlobalSettings.Default.GraphicsWidth < 1024) ? "" : "1024") + ".uis");

            Background   = new UIImage(GetTexture((GlobalSettings.Default.GraphicsWidth < 1024) ? (ulong)0x000000D800000002 : (ulong)0x0000018300000002));
            Background.Y = 0;
            Background.BlockInput();
            this.AddAt(0, Background);

            Divider          = new UIImage(dividerImage);
            Divider.Position = new Vector2(337, 14);
            this.AddAt(1, Divider);

            SubToolBg          = new UIImage(subtoolsBackground);
            SubToolBg.Position = new Vector2(336, 5);
            this.AddAt(2, SubToolBg);

            Catalog = new UICatalog((GlobalSettings.Default.GraphicsWidth < 1024) ? 10 : 20);
            Catalog.OnSelectionChange += new CatalogSelectionChangeDelegate(Catalog_OnSelectionChange);
            Catalog.Position           = new Vector2(364, 7);
            this.Add(Catalog);

            CategoryMap = new Dictionary <UIButton, int>
            {
                { TerrainButton, 29 },
                { WaterButton, 5 },
                { WallButton, 7 },
                { WallpaperButton, 8 },
                { StairButton, 2 },
                { FireplaceButton, 4 },

                { PlantButton, 3 },
                { FloorButton, 9 },
                { DoorButton, 0 },
                { WindowButton, 1 },
                { RoofButton, 28 },
                { HandButton, 28 },
            };

            TerrainButton.OnButtonClick   += ChangeCategory;
            WaterButton.OnButtonClick     += ChangeCategory;
            WallButton.OnButtonClick      += ChangeCategory;
            WallpaperButton.OnButtonClick += ChangeCategory;
            StairButton.OnButtonClick     += ChangeCategory;
            FireplaceButton.OnButtonClick += ChangeCategory;

            PlantButton.OnButtonClick  += ChangeCategory;
            FloorButton.OnButtonClick  += ChangeCategory;
            DoorButton.OnButtonClick   += ChangeCategory;
            WindowButton.OnButtonClick += ChangeCategory;
            RoofButton.OnButtonClick   += ChangeCategory;
            HandButton.OnButtonClick   += ChangeCategory;

            PreviousPageButton.OnButtonClick += PreviousPage;
            NextPageButton.OnButtonClick     += NextPage;
            SubtoolsSlider.MinValue           = 0;
            SubtoolsSlider.OnChange          += PageSlider;

            Holder.OnPickup  += HolderPickup;
            Holder.OnDelete  += HolderDelete;
            Holder.OnPutDown += HolderPutDown;
        }