Ejemplo n.º 1
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);
        }
        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);
        }
Ejemplo n.º 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");
            }

            m_ExitButton = (UIButton)ui["ExitButton"];

            var numSlots = 3;

            m_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.SetSlotAvailable(true);
                m_PersonSlots.Add(personSlot);

                if (i < NetworkFacade.Avatars.Count)
                {
                    personSlot.DisplayAvatar(NetworkFacade.Avatars[i]);
                    personSlot.AvatarButton.OnButtonClick += new ButtonClickDelegate(AvatarButton_OnButtonClick);

                    var SimBox = new UISim(NetworkFacade.Avatars[i].GUID);

                    SimBox.Avatar.Body       = NetworkFacade.Avatars[i].Body;
                    SimBox.Avatar.Head       = NetworkFacade.Avatars[i].Head;
                    SimBox.Avatar.Handgroup  = NetworkFacade.Avatars[i].Body;
                    SimBox.Avatar.Appearance = NetworkFacade.Avatars[i].Avatar.Appearance;

                    SimBox.Position = m_PersonSlots[i].AvatarButton.Position + new Vector2(70, (m_PersonSlots[i].AvatarButton.Size.Y - 35));
                    SimBox.Size     = m_PersonSlots[i].AvatarButton.Size;

                    SimBox.Name = NetworkFacade.Avatars[i].Name;

                    m_UISims.Add(SimBox);
                    this.Add(SimBox);
                }
            }

            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);
            m_ExitButton.OnButtonClick  += new ButtonClickDelegate(m_ExitButton_OnButtonClick);

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

            PlayBackgroundMusic(
                tracks
                );

            NetworkFacade.Controller.OnCityToken           += new OnCityTokenDelegate(Controller_OnCityToken);
            NetworkFacade.Controller.OnCharacterRetirement += new OnCharacterRetirementDelegate(Controller_OnCharacterRetirement);
        }
Ejemplo n.º 4
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");
            }

            m_ExitButton = (UIButton)ui["ExitButton"];

            var numSlots = 3;
            m_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.SetSlotAvailable(true);
                m_PersonSlots.Add(personSlot);

                lock (NetworkFacade.Avatars)
                {
                    if (i < NetworkFacade.Avatars.Count)
                    {
                        personSlot.DisplayAvatar(NetworkFacade.Avatars[i]);
                        personSlot.AvatarButton.OnButtonClick += new ButtonClickDelegate(AvatarButton_OnButtonClick);

                        var SimBox = new UISim(NetworkFacade.Avatars[i].GUID);

                        SimBox.Avatar.Body = NetworkFacade.Avatars[i].Body;
                        SimBox.Avatar.Head = NetworkFacade.Avatars[i].Head;
                        SimBox.Avatar.Handgroup = NetworkFacade.Avatars[i].Body;
                        SimBox.Avatar.Appearance = NetworkFacade.Avatars[i].Avatar.Appearance;

                        SimBox.Position = m_PersonSlots[i].AvatarButton.Position + new Vector2(70, (m_PersonSlots[i].AvatarButton.Size.Y - 35));
                        SimBox.Size = m_PersonSlots[i].AvatarButton.Size;

                        SimBox.Name = NetworkFacade.Avatars[i].Name;

                        m_UISims.Add(SimBox);
                        this.Add(SimBox);
                    }
                }
            }

            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);
            m_ExitButton.OnButtonClick += new ButtonClickDelegate(m_ExitButton_OnButtonClick);

            /**
             * Music
             */
            var tracks = new string[]{
                GlobalSettings.Default.StartupPath + "\\music\\modes\\select\\tsosas1_v2.mp3",
                GlobalSettings.Default.StartupPath + "\\music\\modes\\select\\tsosas2_v2.mp3",
                GlobalSettings.Default.StartupPath + "\\music\\modes\\select\\tsosas3.mp3",
                GlobalSettings.Default.StartupPath + "\\music\\modes\\select\\tsosas4.mp3",
                GlobalSettings.Default.StartupPath + "\\music\\modes\\select\\tsosas5.mp3"
            };
            PlayBackgroundMusic(
                tracks
            );

            NetworkFacade.Controller.OnCityToken += new OnCityTokenDelegate(Controller_OnCityToken);
            NetworkFacade.Controller.OnPlayerAlreadyOnline += new OnPlayerAlreadyOnlineDelegate(Controller_OnPlayerAlreadyOnline);
            NetworkFacade.Controller.OnCharacterRetirement += new OnCharacterRetirementDelegate(Controller_OnCharacterRetirement);
        }