Exemple #1
0
        public PersonSelectionEdit() : base()
        {
            /**
             * Data
             */
            var content = Content.Content.Get();

            MaleHeads   = content.AvatarCollections.Get("ea_male_heads.col");
            MaleOutfits = content.AvatarCollections.Get("ea_male.col");

            FemaleHeads   = content.AvatarCollections.Get("ea_female_heads.col");
            FemaleOutfits = content.AvatarCollections.Get("ea_female.col");

            /**
             * UI
             */

            UIScript ui = this.RenderScript("personselectionedit1024.uis");

            Position = new Vector2((GlobalSettings.Default.GraphicsWidth - 1024) / 2, (GlobalSettings.Default.GraphicsHeight - 768) / 2) * FSOEnvironment.DPIScaleFactor;
            Console.WriteLine(Position.ToString());

            m_ExitButton = (UIButton)ui["ExitButton"];
            m_ExitButton.OnButtonClick += new ButtonClickDelegate(m_ExitButton_OnButtonClick);

            CancelButton = (UIButton)ui["CancelButton"];
            CancelButton.OnButtonClick += new ButtonClickDelegate(CancelButton_OnButtonClick);
            CancelButton.Disabled       = true;

            DescriptionTextEdit.CurrentText = ui.GetString("DefaultAvatarDescription");
            DescriptionSlider.AttachButtons(DescriptionScrollUpButton, DescriptionScrollDownButton, 1);
            DescriptionTextEdit.AttachSlider(DescriptionSlider);
            NameTextEdit.OnChange   += new ChangeDelegate(NameTextEdit_OnChange);
            NameTextEdit.CurrentText = GlobalSettings.Default.LastUser;

            AcceptButton.Disabled       = NameTextEdit.CurrentText.Length == 0;
            AcceptButton.OnButtonClick += new ButtonClickDelegate(AcceptButton_OnButtonClick);

            /** Appearance **/
            SkinLightButton.OnButtonClick  += new ButtonClickDelegate(SkinButton_OnButtonClick);
            SkinMediumButton.OnButtonClick += new ButtonClickDelegate(SkinButton_OnButtonClick);
            SkinDarkButton.OnButtonClick   += new ButtonClickDelegate(SkinButton_OnButtonClick);
            SelectedAppearanceButton        = SkinLightButton;

            m_HeadSkinBrowser           = ui.Create <UICollectionViewer>("HeadSkinBrowser");
            m_HeadSkinBrowser.OnChange += new ChangeDelegate(HeadSkinBrowser_OnChange);
            m_HeadSkinBrowser.Init();
            this.Add(m_HeadSkinBrowser);

            m_BodySkinBrowser           = ui.Create <UICollectionViewer>("BodySkinBrowser");
            m_BodySkinBrowser.OnChange += new ChangeDelegate(BodySkinBrowser_OnChange);
            m_BodySkinBrowser.Init();
            this.Add(m_BodySkinBrowser);

            FemaleButton.OnButtonClick += new ButtonClickDelegate(GenderButton_OnButtonClick);
            MaleButton.OnButtonClick   += new ButtonClickDelegate(GenderButton_OnButtonClick);

            /** Backgrounds **/
            var bg = new UIImage(BackgroundImage).With9Slice(128, 128, 84, 84);

            this.AddAt(0, bg);
            bg.SetSize(GlobalSettings.Default.GraphicsWidth, GlobalSettings.Default.GraphicsHeight);
            bg.Position = new Vector2((GlobalSettings.Default.GraphicsWidth - 1024) / -2, (GlobalSettings.Default.GraphicsHeight - 768) / -2);

            var offset = new Vector2(0, 0);

            if (BackgroundImageDialog != null)
            {
                offset = new Vector2(112, 84);

                this.AddAt(1, new UIImage(BackgroundImageDialog)
                {
                    X = 112,
                    Y = 84
                });
            }

            /**
             * Music
             */
            HIT.HITVM.Get().PlaySoundEvent(UIMusic.CAS);

            /*
             * PlayBackgroundMusic(
             *  new string[] { GlobalSettings.Default.StartupPath + "\\music\\modes\\create\\tsocas1_v2.mp3" }
             * );*/

            SimBox = new UISim(Guid.NewGuid().ToString());

            SimBox.SimScale = 0.5f;
            SimBox.Position = new Microsoft.Xna.Framework.Vector2(offset.X + 70, offset.Y + 88);

            SimBox.AutoRotate = true;
            this.Add(SimBox);

            /**
             * Init state
             */

            if (GlobalSettings.Default.DebugGender)
            {
                Gender = Gender.Male;
                MaleButton.Selected   = true;
                FemaleButton.Selected = false;
            }
            else
            {
                Gender = Gender.Female;
                MaleButton.Selected   = false;
                FemaleButton.Selected = true;
            }

            AppearanceType = (AppearanceType)GlobalSettings.Default.DebugSkin;

            SkinLightButton.Selected  = false;
            SkinMediumButton.Selected = false;
            SkinDarkButton.Selected   = false;

            switch (AppearanceType)
            {
            case AppearanceType.Light:
                SkinLightButton.Selected = true; break;

            case AppearanceType.Medium:
                SkinMediumButton.Selected = true; break;

            case AppearanceType.Dark:
                SkinDarkButton.Selected = true; break;
            }

            RefreshCollections();

            SearchCollectionForInitID(GlobalSettings.Default.DebugHead, GlobalSettings.Default.DebugBody);


            NetworkFacade.Controller.OnCharacterCreationProgress += new OnCharacterCreationProgressDelegate(Controller_OnCharacterCreationStatus);
        }
        public PersonSelectionEdit()
        {
            /**
             * Data
             */
            MaleHeads   = new Collection(ContentManager.GetResourceFromLongID((ulong)FileIDs.CollectionsFileIDs.ea_male_heads));
            MaleOutfits = new Collection(ContentManager.GetResourceFromLongID((ulong)FileIDs.CollectionsFileIDs.ea_male));

            FemaleHeads   = new Collection(ContentManager.GetResourceFromLongID((ulong)FileIDs.CollectionsFileIDs.ea_female_heads));
            FemaleOutfits = new Collection(ContentManager.GetResourceFromLongID((ulong)FileIDs.CollectionsFileIDs.ea_female));

            /**
             * UI
             */

            UIScript ui = null;

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

            m_ExitButton = (UIButton)ui["ExitButton"];
            m_ExitButton.OnButtonClick += new ButtonClickDelegate(m_ExitButton_OnButtonClick);

            DescriptionTextEdit.CurrentText = ui.GetString("DefaultAvatarDescription");
            DescriptionSlider.AttachButtons(DescriptionScrollUpButton, DescriptionScrollDownButton, 1);
            DescriptionTextEdit.AttachSlider(DescriptionSlider);
            NameTextEdit.OnChange += new ChangeDelegate(NameTextEdit_OnChange);

            AcceptButton.Disabled       = true;
            AcceptButton.OnButtonClick += new ButtonClickDelegate(AcceptButton_OnButtonClick);

            /** Appearance **/
            SkinLightButton.OnButtonClick  += new ButtonClickDelegate(SkinButton_OnButtonClick);
            SkinMediumButton.OnButtonClick += new ButtonClickDelegate(SkinButton_OnButtonClick);
            SkinDarkButton.OnButtonClick   += new ButtonClickDelegate(SkinButton_OnButtonClick);
            SelectedAppearanceButton        = SkinLightButton;
            SkinLightButton.Selected        = true;

            m_HeadSkinBrowser           = ui.Create <UICollectionViewer>("HeadSkinBrowser");
            m_HeadSkinBrowser.OnChange += new ChangeDelegate(HeadSkinBrowser_OnChange);
            m_HeadSkinBrowser.Init();
            this.Add(m_HeadSkinBrowser);

            m_BodySkinBrowser           = ui.Create <UICollectionViewer>("BodySkinBrowser");
            m_BodySkinBrowser.OnChange += new ChangeDelegate(BodySkinBrowser_OnChange);
            m_BodySkinBrowser.Init();
            this.Add(m_BodySkinBrowser);

            FemaleButton.OnButtonClick += new ButtonClickDelegate(GenderButton_OnButtonClick);
            MaleButton.OnButtonClick   += new ButtonClickDelegate(GenderButton_OnButtonClick);

            /** Backgrounds **/
            var bg = new UIImage(BackgroundImage);

            this.AddAt(0, bg);

            var offset = new Vector2(0, 0);

            if (BackgroundImageDialog != null)
            {
                offset = new Vector2(112, 84);

                this.AddAt(1, new UIImage(BackgroundImageDialog)
                {
                    X = 112,
                    Y = 84
                });
            }

            /**
             * Music
             */
            PlayBackgroundMusic(
                new string[] { GlobalSettings.Default.StartupPath + "\\music\\modes\\create\\tsocas1_v2.mp3" }
                );

            //GUID can be empty here, because when a character is created, the GUID is assigned by the server.
            SimBox = new UISim("");

            if (GlobalSettings.Default.ScaleUI)
            {
                SimBox.SimScale = 0.8f;
                SimBox.Position = new Microsoft.Xna.Framework.Vector2(offset.X + 140, offset.Y + 130);
            }
            else
            {
                SimBox.SimScale = 0.5f;
                SimBox.Position = new Microsoft.Xna.Framework.Vector2(offset.X + 140, offset.Y + 260);
            }

            SimBox.AutoRotate = true;
            this.Add(SimBox);

            /**
             * Init state
             */
            RefreshCollections();

            m_HeadSkinBrowser.SelectedIndex = 0;
            m_BodySkinBrowser.SelectedIndex = 0;
            FemaleButton.Selected           = true;

            NetworkFacade.Controller.OnCharacterCreationProgress += new OnCharacterCreationProgressDelegate(Controller_OnCharacterCreationStatus);
        }
Exemple #3
0
        public PersonSelectionEdit() : base()
        {
            /**
             * Data
             */
            var content = Content.GameContent.Get;

            MaleHeads   = content.AvatarCollections.Get("ea_male_heads.col");
            MaleOutfits = content.AvatarCollections.Get("ea_male.col");

            FemaleHeads   = content.AvatarCollections.Get("ea_female_heads.col");
            FemaleOutfits = content.AvatarCollections.Get("ea_female.col");

            /**
             * UI
             */

            UIScript ui = RenderScript("personselectionedit1024.uis");

            Position = new Vector2((GlobalSettings.Default.GraphicsWidth - 1024) / 2, (GlobalSettings.Default.GraphicsHeight - 768) / 2) * FSOEnvironment.DPIScaleFactor;

            m_ExitButton = (UIButton)ui["ExitButton"];
            m_ExitButton.OnButtonClick += new ButtonClickDelegate(m_ExitButton_OnButtonClick);

            CancelButton = (UIButton)ui["CancelButton"];
            CancelButton.OnButtonClick += new ButtonClickDelegate(CancelButton_OnButtonClick);
            //CancelButton.Disabled = true;

            DescriptionTextEdit.CurrentText = ui.GetString("DefaultAvatarDescription");
            DescriptionSlider.AttachButtons(DescriptionScrollUpButton, DescriptionScrollDownButton, 1);
            DescriptionTextEdit.AttachSlider(DescriptionSlider);
            DescriptionTextEdit.CurrentText = DefaultAvatarDescription;
            DescriptionTextEdit.OnChange   += DescriptionTextEdit_OnChange;

            NameTextEdit.OnChange   += new ChangeDelegate(NameTextEdit_OnChange);
            NameTextEdit.CurrentText = GlobalSettings.Default.LastUser;

            AcceptButton.Disabled       = NameTextEdit.CurrentText.Length == 0;
            AcceptButton.OnButtonClick += new ButtonClickDelegate(AcceptButton_OnButtonClick);

            /** Appearance **/
            SkinLightButton.OnButtonClick  += new ButtonClickDelegate(SkinButton_OnButtonClick);
            SkinMediumButton.OnButtonClick += new ButtonClickDelegate(SkinButton_OnButtonClick);
            SkinDarkButton.OnButtonClick   += new ButtonClickDelegate(SkinButton_OnButtonClick);
            SelectedAppearanceButton        = SkinLightButton;

            m_HeadSkinBrowser           = ui.Create <UICollectionViewer>("HeadSkinBrowser");
            m_HeadSkinBrowser.OnChange += new ChangeDelegate(HeadSkinBrowser_OnChange);
            m_HeadSkinBrowser.Init();
            Add(m_HeadSkinBrowser);

            m_BodySkinBrowser           = ui.Create <UICollectionViewer>("BodySkinBrowser");
            m_BodySkinBrowser.OnChange += new ChangeDelegate(BodySkinBrowser_OnChange);
            m_BodySkinBrowser.Init();
            Add(m_BodySkinBrowser);

            FemaleButton.OnButtonClick += new ButtonClickDelegate(GenderButton_OnButtonClick);
            MaleButton.OnButtonClick   += new ButtonClickDelegate(GenderButton_OnButtonClick);

            /** Backgrounds **/
            var bg = new UIImage(BackgroundImage).With9Slice(128, 128, 84, 84);

            AddAt(0, bg);
            bg.SetSize(GlobalSettings.Default.GraphicsWidth, GlobalSettings.Default.GraphicsHeight);
            bg.Position = new Vector2((GlobalSettings.Default.GraphicsWidth - 1024) / -2, (GlobalSettings.Default.GraphicsHeight - 768) / -2);
            Background  = bg;

            var offset = new Vector2(0, 0);

            if (BackgroundImageDialog != null)
            {
                offset = new Vector2(112, 84);

                AddAt(1, new UIImage(BackgroundImageDialog)
                {
                    X = 112,
                    Y = 84
                });
            }

            /**
             * Music
             */
            HIT.HITVM.Get.PlaySoundEvent(UIMusic.CAS);

            SimBox = new UISim
            {
                Position   = new Vector2(offset.X + 70, offset.Y + 88),
                Size       = new Vector2(140, 200),
                AutoRotate = true
            };
            Add(SimBox);

            /**
             * Init state
             */

            if (GlobalSettings.Default.DebugGender)
            {
                Gender = Gender.Male;
                MaleButton.Selected   = true;
                FemaleButton.Selected = false;
            }
            else
            {
                Gender = Gender.Female;
                MaleButton.Selected   = false;
                FemaleButton.Selected = true;
            }

            AppearanceType = (AppearanceType)GlobalSettings.Default.DebugSkin;

            SkinLightButton.Selected  = false;
            SkinMediumButton.Selected = false;
            SkinDarkButton.Selected   = false;

            switch (AppearanceType)
            {
            case AppearanceType.Light:
                SkinLightButton.Selected = true; break;

            case AppearanceType.Medium:
                SkinMediumButton.Selected = true; break;

            case AppearanceType.Dark:
                SkinDarkButton.Selected = true; break;
            }

            RefreshCollections();

            SearchCollectionForInitID(GlobalSettings.Default.DebugHead, GlobalSettings.Default.DebugBody);

            FSO.UI.Model.DiscordRpcEngine.SendFSOPresence("In Create A Sim");

            GameThread.NextUpdate(x =>
            {
                FSOFacade.Hints.TriggerHint("screen:cas");
            });
        }
Exemple #4
0
        public PersonSelectionEdit()
        {
            /**
             * Data
             */
            MaleHeads   = new Collection(ContentManager.GetResourceFromLongID((ulong)FileIDs.CollectionsFileIDs.ea_male_heads));
            MaleOutfits = new Collection(ContentManager.GetResourceFromLongID((ulong)FileIDs.CollectionsFileIDs.ea_male));

            FemaleHeads   = new Collection(ContentManager.GetResourceFromLongID((ulong)FileIDs.CollectionsFileIDs.ea_female_heads));
            FemaleOutfits = new Collection(ContentManager.GetResourceFromLongID((ulong)FileIDs.CollectionsFileIDs.ea_female));

            /**
             * UI
             */

            UIScript ui = null;

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

            DescriptionTextEdit.CurrentText = ui.GetString("DefaultAvatarDescription");
            DescriptionSlider.AttachButtons(DescriptionScrollUpButton, DescriptionScrollDownButton, 1);
            DescriptionTextEdit.AttachSlider(DescriptionSlider);
            NameTextEdit.OnChange += new ChangeDelegate(NameTextEdit_OnChange);

            AcceptButton.Disabled       = true;
            AcceptButton.OnButtonClick += new ButtonClickDelegate(AcceptButton_OnButtonClick);

            /** Appearance **/
            SkinLightButton.OnButtonClick  += new ButtonClickDelegate(SkinButton_OnButtonClick);
            SkinMediumButton.OnButtonClick += new ButtonClickDelegate(SkinButton_OnButtonClick);
            SkinDarkButton.OnButtonClick   += new ButtonClickDelegate(SkinButton_OnButtonClick);
            SelectedAppearanceButton        = SkinLightButton;
            SkinLightButton.Selected        = true;

            HeadSkinBrowser           = ui.Create <UICollectionViewer>("HeadSkinBrowser");
            HeadSkinBrowser.OnChange += new ChangeDelegate(HeadSkinBrowser_OnChange);
            HeadSkinBrowser.Init();
            this.Add(HeadSkinBrowser);

            BodySkinBrowser = ui.Create <UICollectionViewer>("BodySkinBrowser");
            BodySkinBrowser.Init();
            this.Add(BodySkinBrowser);

            FemaleButton.OnButtonClick += new ButtonClickDelegate(GenderButton_OnButtonClick);
            MaleButton.OnButtonClick   += new ButtonClickDelegate(GenderButton_OnButtonClick);

            /** Backgrounds **/
            var bg = new UIImage(BackgroundImage);

            this.AddAt(0, bg);

            var offset = new Vector2(0, 0);

            if (BackgroundImageDialog != null)
            {
                offset = new Vector2(112, 84);

                this.AddAt(1, new UIImage(BackgroundImageDialog)
                {
                    X = 112,
                    Y = 84
                });
            }

            /**
             * Music
             */
            PlayBackgroundMusic(
                GameFacade.GameFilePath("music\\modes\\create\\tsocas1_v2.mp3")
                );


            SimBox          = new UISim();
            SimBox.SimScale = 0.8f;
            SimBox.Position = new Microsoft.Xna.Framework.Vector2(offset.X + 140, offset.Y + 130);

            this.Add(SimBox);

            Sim = new Sim(new Guid().ToString());

            /**
             * Init state
             */
            RefreshCollections();

            HeadSkinBrowser.SelectedIndex = 0;
            BodySkinBrowser.SelectedIndex = 0;
            FemaleButton.Selected         = true;
        }