Exemplo n.º 1
0
        private bool LastRectCutNotable = false; //set if the last rect cut made a noticable change to the cuts array. If true refresh regardless of new cut effect.

        /// <summary>
        /// Creates a new UILotControl instance.
        /// </summary>
        /// <param name="vm">A SimAntics VM instance.</param>
        /// <param name="World">A World instance.</param>
        public UILotControl(FSO.SimAntics.VM vm, LotView.World World)
        {
            this.vm    = vm;
            this.World = World;

            ActiveEntity = vm.Entities.FirstOrDefault(x => x is VMAvatar);
            MouseEvt     = this.ListenForMouse(new Microsoft.Xna.Framework.Rectangle(0, 0,
                                                                                     GlobalSettings.Default.GraphicsWidth, GlobalSettings.Default.GraphicsHeight), OnMouse);

            Queue = new UIInteractionQueue(ActiveEntity, vm);
            this.Add(Queue);

            ObjectHolder = new UIObjectHolder(vm, World, this);
            Touch        = new UILotControlTouchHelper(this);
            Add(Touch);
            SetupQuery();

            ChatPanel = new UIChatPanel(vm, this);
            this.Add(ChatPanel);

            RMBCursor = GetTexture(0x24B00000001); //exploreanchor.bmp

            vm.OnChatEvent  += Vm_OnChatEvent;
            vm.OnDialog     += vm_OnDialog;
            vm.OnBreakpoint += Vm_OnBreakpoint;

            Cheats = new UICheatHandler(this);
            this.Add(Cheats);
            AvatarDS = new UIAvatarDataServiceUpdater(this);
            EODs     = new UIEODController(this);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new UILotControl instance.
        /// </summary>
        /// <param name="vm">A SimAntics VM instance.</param>
        /// <param name="World">A World instance.</param>
        public UILotControl(FSO.SimAntics.VM vm, LotView.World World)
        {
            this.vm    = vm;
            this.World = World;

            ActiveEntity = vm.Entities.FirstOrDefault(x => x is VMAvatar);
            MouseEvt     = this.ListenForMouse(new Microsoft.Xna.Framework.Rectangle(0, 0,
                                                                                     GlobalSettings.Default.GraphicsWidth, GlobalSettings.Default.GraphicsHeight), OnMouse);

            Queue = new UIInteractionQueue(ActiveEntity, vm);
            this.Add(Queue);

            ObjectHolder = new UIObjectHolder(vm, World, this);
            QueryPanel   = new UIQueryPanel(World);
            QueryPanel.OnSellBackClicked += ObjectHolder.SellBack;
            QueryPanel.X = 177;
            QueryPanel.Y = GlobalSettings.Default.GraphicsHeight - 228;
            this.Add(QueryPanel);

            ChatPanel = new UIChatPanel(vm, this);
            this.Add(ChatPanel);

            vm.OnChatEvent  += Vm_OnChatEvent;
            vm.OnDialog     += vm_OnDialog;
            vm.OnBreakpoint += Vm_OnBreakpoint;

            Cheats = new UICheatHandler(this);
            EODs   = new UIEODController(this);
        }
        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);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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;
        }
Exemplo n.º 6
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;
        }
Exemplo n.º 7
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;
        }
Exemplo n.º 8
0
        private bool Roommate = true; //if false, shows visitor inventory only.

        #endregion Fields

        #region Constructors

        public UIBuyMode(UILotControl lotController)
        {
            LotController = lotController;
            Holder = LotController.ObjectHolder;
            QueryPanel = LotController.QueryPanel;

            var useSmall = (FSOEnvironment.UIZoomFactor > 1f || GlobalSettings.Default.GraphicsWidth < 1024);
            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);

            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(useSmall ? 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;
            Add(QueryPanel);
        }
Exemplo n.º 9
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;
        }
Exemplo n.º 10
0
        /// <summary>
        /// Creates a new UILotControl instance.
        /// </summary>
        /// <param name="vm">A SimAntics VM instance.</param>
        /// <param name="World">A World instance.</param>
        public UILotControl(FSO.SimAntics.VM vm, LotView.World World)
        {
            this.vm = vm;
            this.World = World;

            ActiveEntity = vm.Entities.FirstOrDefault(x => x is VMAvatar);
            MouseEvt = this.ListenForMouse(new Microsoft.Xna.Framework.Rectangle(0, 0,
                GlobalSettings.Default.GraphicsWidth, GlobalSettings.Default.GraphicsHeight), OnMouse);

            Queue = new UIInteractionQueue(ActiveEntity, vm);
            this.Add(Queue);

            ObjectHolder = new UIObjectHolder(vm, World, this);
            QueryPanel = new UIQueryPanel(World);
            QueryPanel.OnSellBackClicked += ObjectHolder.SellBack;
            QueryPanel.X = 0;
            QueryPanel.Y = -114;
            //this.Add(QueryPanel);

            ChatPanel = new UIChatPanel(vm, this);
            this.Add(ChatPanel);

            RMBCursor = GetTexture(0x24B00000001); //exploreanchor.bmp

            vm.OnChatEvent += Vm_OnChatEvent;
            vm.OnDialog += vm_OnDialog;
            vm.OnBreakpoint += Vm_OnBreakpoint;

            Cheats = new UICheatHandler(this);
            EODs = new UIEODController(this);
        }
Exemplo n.º 11
0
        /// <summary>
        /// Creates a new UILotControl instance.
        /// </summary>
        /// <param name="vm">A SimAntics VM instance.</param>
        /// <param name="World">A World instance.</param>
        public UILotControl(FSO.SimAntics.VM vm, LotView.World World)
        {
            this.vm = vm;
            this.World = World;

            ActiveEntity = vm.Entities.FirstOrDefault(x => x is VMAvatar);
            MouseEvt = this.ListenForMouse(new Microsoft.Xna.Framework.Rectangle(0, 0,
                GlobalSettings.Default.GraphicsWidth, GlobalSettings.Default.GraphicsHeight), OnMouse);
            testimg = new UIImage();
            testimg.X = 20;
            testimg.Y = 20;
            this.Add(testimg);

            Queue = new UIInteractionQueue(ActiveEntity, vm);
            this.Add(Queue);

            ObjectHolder = new UIObjectHolder(vm, World, this);
            QueryPanel = new UIQueryPanel(World);
            QueryPanel.OnSellBackClicked += ObjectHolder.SellBack;
            QueryPanel.X = 177;
            QueryPanel.Y = GlobalSettings.Default.GraphicsHeight - 228;
            this.Add(QueryPanel);

            ChatPanel = new UIChatPanel(vm, this);
            this.Add(ChatPanel);

            vm.OnDialog += vm_OnDialog;
        }
Exemplo n.º 12
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, 28 },
                { 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;
        }