コード例 #1
0
        public SimModelBinding(ulong bindingID)
        {
            BindingID = bindingID;

            var binding = SimCatalog.GetBinding(bindingID);

            Mesh    = SimCatalog.GetOutfitMesh(binding.MeshAssetID);
            Texture = SimCatalog.GetOutfitTexture(binding.TextureAssetID);
        }
コード例 #2
0
        void RefreshSim()
        {
            var    selectedHead = (CollectionItem)((UIGridViewerItem)HeadSkinBrowser.SelectedItem).Data;
            Outfit TmpOutfit    = new Outfit(ContentManager.GetResourceFromLongID(
                                                 selectedHead.PurchasableOutfit.OutfitID));

            SimCatalog.LoadSim3D(Sim, TmpOutfit, AppearanceType);

            SimBox.Sim = Sim;
        }
コード例 #3
0
        public PersonSelection()
        {
            UIScript ui = null;

            if (GlobalSettings.Default.ScaleUI)
            {
                ui = this.RenderScript("personselection.uis");
                this.Scale800x600 = true;
            }
            else
            {
                ui = this.RenderScript("personselection" + (ScreenWidth == 1024 ? "1024" : "") + ".uis");
            }

            var numSlots = 3;

            PersonSlots = new List <PersonSlot>();

            for (var i = 0; i < numSlots; i++)
            {
                var index = (i + 1).ToString();

                /** Tab Background **/
                var tabBackground = ui.Create <UIImage>("TabBackgroundImage" + index);
                this.Add(tabBackground);

                var enterTabImage = ui.Create <UIImage>("EnterTabImage" + index);
                this.Add(enterTabImage);

                var descTabImage = ui.Create <UIImage>("DescriptionTabImage" + index);
                this.Add(descTabImage);

                var descTabBgImage = ui.Create <UIImage>("DescriptionTabBackgroundImage" + index);
                var enterIcons     = ui.Create <UIImage>("EnterTabBackgroundImage" + index);

                var personSlot = new PersonSlot(this)
                {
                    AvatarButton       = (UIButton)ui["AvatarButton" + index],
                    CityButton         = (UIButton)ui["CityButton" + index],
                    HouseButton        = (UIButton)ui["HouseButton" + index],
                    EnterTabButton     = (UIButton)ui["EnterTabButton" + index],
                    DescTabButton      = (UIButton)ui["DescriptionTabButton" + index],
                    NewAvatarButton    = (UIButton)ui["NewAvatarButton" + index],
                    DeleteAvatarButton = (UIButton)ui["DeleteAvatarButton" + index],
                    PersonNameText     = (UILabel)ui["PersonNameText" + index],
                    PersonDescriptionScrollUpButton   = (UIButton)ui["PersonDescriptionScrollUpButton" + index],
                    PersonDescriptionScrollDownButton = (UIButton)ui["PersonDescriptionScrollDownButton" + index],
                    PersonDescriptionSlider           = (UISlider)ui["PersonDescriptionSlider" + index],
                    CityNameText                  = (UILabel)ui["CityNameText" + index],
                    HouseNameText                 = (UILabel)ui["HouseNameText" + index],
                    PersonDescriptionText         = (UITextEdit)ui["PersonDescriptionText" + index],
                    DescriptionTabBackgroundImage = descTabBgImage,
                    EnterTabBackgroundImage       = enterIcons,

                    TabBackground      = tabBackground,
                    TabEnterBackground = enterTabImage,
                    TabDescBackground  = descTabImage
                };

                this.AddBefore(descTabBgImage, personSlot.PersonDescriptionText);
                this.AddBefore(enterIcons, personSlot.CityButton);

                personSlot.Init();
                personSlot.SetSlotAvaliable(true);
                PersonSlots.Add(personSlot);

                if (i < NetworkFacade.Avatars.Count)
                {
                    personSlot.DisplayAvatar(NetworkFacade.Avatars[i]);
                }
            }

            this.AddAt(0, new UIImage(BackgroundImage));
            if (BackgroundImageDialog != null)
            {
                this.AddAt(1, new UIImage(BackgroundImageDialog)
                {
                    X = 112,
                    Y = 84
                });
            }

            /**
             * Button plumbing
             */
            CreditsButton.OnButtonClick += new ButtonClickDelegate(CreditsButton_OnButtonClick);


            /**
             * Music
             */
            var tracks = new string[] {
                //"music\\modes\\select\\tsosas1_v2.mp3",
                "music\\modes\\select\\tsosas2_v2.mp3",
                //"music\\modes\\select\\tsosas3.mp3",
                //"music\\modes\\select\\tsosas4.mp3",
                //"music\\modes\\select\\tsosas5.mp3"
            };

            PlayBackgroundMusic(
                GameFacade.GameFilePath(tracks.RandomItem())
                );

            var simBox    = new UISim();
            var sim       = new Sim(Guid.NewGuid().ToString());
            var maleHeads = new Collection(ContentManager.GetResourceFromLongID((ulong)FileIDs.CollectionsFileIDs.ea_male_heads));

            SimCatalog.LoadSim3D(sim, SimCatalog.GetOutfit(4462471020557), AppearanceType.Light);

            simBox.Sim      = sim;
            simBox.Position = PersonSlots[0].AvatarButton.Position + new Vector2(70, 40);
            simBox.Size     = PersonSlots[0].AvatarButton.Size;

            this.Add(simBox);
        }
コード例 #4
0
        public UIGizmo()
        {
            var ui = this.RenderScript("gizmo.uis");

            BackgroundImageGizmo = ui.Create <UIImage>("BackgroundImageGizmo");
            this.AddAt(0, BackgroundImageGizmo);

            BackgroundImageGizmoPanel = ui.Create <UIImage>("BackgroundImageGizmoPanel");
            this.AddAt(0, BackgroundImageGizmoPanel);

            BackgroundImagePanel = ui.Create <UIImage>("BackgroundImagePanel");
            this.AddAt(0, BackgroundImagePanel);

            UIUtils.MakeDraggable(BackgroundImageGizmo, this);
            UIUtils.MakeDraggable(BackgroundImageGizmoPanel, this);
            UIUtils.MakeDraggable(BackgroundImagePanel, this);

            ButtonContainer = new UIContainer();
            this.Remove(ExpandButton);
            ButtonContainer.Add(ExpandButton);
            this.Remove(ContractButton);
            ButtonContainer.Add(ContractButton);
            this.Remove(FiltersButton);
            ButtonContainer.Add(FiltersButton);
            this.Remove(SearchButton);
            ButtonContainer.Add(SearchButton);
            this.Remove(Top100ListsButton);
            ButtonContainer.Add(Top100ListsButton);
            this.Add(ButtonContainer);

            FiltersProperty         = new UIGizmoPropertyFilters(ui, this);
            FiltersProperty.Visible = false;
            this.Add(FiltersProperty);

            Search         = new UIGizmoSearch(ui, this);
            Search.Visible = false;
            this.Add(Search);

            Top100         = new UIGizmoTop100(ui, this);
            Top100.Visible = false;
            this.Add(Top100);

            ExpandButton.OnButtonClick   += new ButtonClickDelegate(ExpandButton_OnButtonClick);
            ContractButton.OnButtonClick += new ButtonClickDelegate(ContractButton_OnButtonClick);

            PeopleTabButton.OnButtonClick += new ButtonClickDelegate(PeopleTabButton_OnButtonClick);
            HousesTabButton.OnButtonClick += new ButtonClickDelegate(HousesTabButton_OnButtonClick);

            FiltersButton.OnButtonClick     += new ButtonClickDelegate(FiltersButton_OnButtonClick);
            SearchButton.OnButtonClick      += new ButtonClickDelegate(SearchButton_OnButtonClick);
            Top100ListsButton.OnButtonClick += new ButtonClickDelegate(Top100ListsButton_OnButtonClick);

            SimBox = new UISim();
            var sim       = new Sim(Guid.NewGuid().ToString());
            var maleHeads = new Collection(ContentManager.GetResourceFromLongID((ulong)FileIDs.CollectionsFileIDs.ea_male_heads));

            SimCatalog.LoadSim3D(sim, SimCatalog.GetOutfit(4462471020557), AppearanceType.Light);

            SimBox.Sim      = sim;
            SimBox.SimScale = 0.4f;
            SimBox.Position = new Microsoft.Xna.Framework.Vector2(60, 60);

            this.Add(SimBox);

            SetOpen(false);
        }