Exemple #1
0
        public UIGizmoTop100(UIScript script, UIGizmo parent)
        {
            Background = script.Create<UIImage>("BackgroundImageTop100Lists");
            this.Add(Background);

            script.LinkMembers(this, true);

            Top100Slider.AttachButtons(Top100ListScrollUpButton, Top100ListScrollDownButton, 1);
            Top100ResultList.AttachSlider(Top100Slider);

            populateWithXMLHouses();

            Top100ResultList.OnDoubleClick += Top100ItemSelect;
            UpdateCooldown = 100;
        }
        public UIGizmoPropertyFilters(UIScript script, UIGizmo parent)
        {
            Background = script.Create<UIImage>("BackgroundImageFilters");
            this.Add(Background);

            var filterChildren = parent.GetChildren().Where(x => x.ID != null && x.ID.StartsWith("PropertyFilterButton_")).ToList();
            foreach (var child in filterChildren)
            {
                child.Parent.Remove(child);
                this.Add(child);
            }
        }
Exemple #3
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;

            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();
            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);
            Background  = 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
             */
            HIT.HITVM.Get().PlaySoundEvent(UIMusic.CAS);

            SimBox            = new UISim();
            SimBox.Position   = new Vector2(offset.X + 70, offset.Y + 88);
            SimBox.Size       = new Vector2(140, 200);
            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);
        }
Exemple #4
0
        public UIGizmoSearch(UIScript script, UIGizmo parent)
        {
            Background = script.Create<UIImage>("BackgroundImageSearch");
            this.Add(Background);

            script.LinkMembers(this, true);

            SearchText.CurrentText = "127.0.0.1";
            NarrowSearchButton.OnButtonClick += JoinServerLot;
        }
Exemple #5
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);
        }
Exemple #6
0
        public PersonSelection(LoginRegulator loginRegulator, ICache cache) : base()
        {
            //Arrange UI
            this.LoginRegulator = loginRegulator;
            this.Cache          = cache;
            Api = new ApiClient(ApiClient.CDNUrl ?? GlobalSettings.Default.GameEntryUrl);

            UIScript ui = null;

            ui = this.RenderScript("personselection1024.uis");

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

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

            var numSlots = 3;

            m_PersonSlots = new List <PersonSlot>();

            FamilyButton.Visible   = false;
            CreditsButton.Disabled = true;

            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 < loginRegulator.Avatars.Count)
                {
                    var avatar = loginRegulator.Avatars[i];
                    personSlot.DisplayAvatar(avatar);
                }
            }

            /** 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);
            Background  = bg;

            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
             */

            HITVM.Get().PlaySoundEvent(UIMusic.SAS);

            GameThread.NextUpdate(x =>
            {
                FSOFacade.Hints.TriggerHint("screen:sas");
            });
        }
Exemple #7
0
        private void PlayerRosterHandler(string evt, string msg)
        {
            Lobby.UpdatePlayers(evt, msg);

            // make the 8 gameplay player images but don't add them to UI
            Player1 = Script.Create <UIImage>("Player1");
            Player2 = Script.Create <UIImage>("Player2");
            Player3 = Script.Create <UIImage>("Player3");
            Player4 = Script.Create <UIImage>("Player4");
            Player5 = Script.Create <UIImage>("Player5");
            Player6 = Script.Create <UIImage>("Player6");
            Player7 = Script.Create <UIImage>("Player7");
            Player8 = Script.Create <UIImage>("Player8");

            var players      = new UIImage[] { Player1, Player2, Player3, Player4, Player5, Player6, Player7, Player8 };
            int playerNumber = 0;

            for (int index = 0; index < 8; index += 2)
            {
                var lobbyPlayerButton = Lobby.GetPlayerButton(playerNumber);

                if (lobbyPlayerButton == null)
                {
                    if (Players[index] != null)
                    {
                        Remove(Players[index]);
                    }
                    if (Players[index + 1] != null)
                    {
                        Remove(Players[index + 1]);
                    }
                    Players[index]     = null;
                    Players[index + 1] = null;
                }
                else if (Players[index] == null || !Players[index].Equals(lobbyPlayerButton))
                {
                    if (Players[index] != null)
                    {
                        Remove(Players[index]);
                    }
                    if (Players[index + 1] != null)
                    {
                        Remove(Players[index + 1]);
                    }
                    // Make Person buttons for all players
                    Players[index]          = new UIVMPersonButton(lobbyPlayerButton.Avatar, lobbyPlayerButton.vm, true);
                    Players[index].Position = players[index].Position;
                    Add(Players[index]);
                    Players[index + 1]          = new UIVMPersonButton(lobbyPlayerButton.Avatar, lobbyPlayerButton.vm, true);
                    Players[index + 1].Position = players[index + 1].Position;
                    Add(Players[index + 1]);
                    playerNumber++;
                }
            }
            // goto lobby
            if (ButtonBack != null)
            {
                GotoWaitForPlayerPhase();
            }
        }
Exemple #8
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;
        }
        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 = this.RenderScript("personselectionedit1024.uis");

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

            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);
        }
Exemple #10
0
        }                                                 // sell out

        public UIBandEOD(UIEODController controller) : base(controller)
        {
            // render script
            Script = RenderScript("jobobjband.uis");
            SetTip(GameFacade.Strings["UIText", "253", "19"]);

            Remove(DOH);
            Remove(RE);
            Remove(MI);
            Remove(FA);
            Remove(SO);
            Remove(LA);
            Remove(TI);
            Remove(DOH2);
            Remove(BUZZ);
            Remove(CONTINUE);
            Remove(CASHOUT);

            SequenceNoteTimer          = new Timer(VMEODBandPlugin.MILLISECONDS_PER_NOTE_IN_SEQUENCE);
            SequenceNoteTimer.Elapsed += NextNoteHandler;
            SyncTimer          = new Timer(VMEODBandPlugin.MILLISECONDS_PER_NOTE_IN_SEQUENCE);
            SyncTimer.Elapsed += SyncTimerElapsedHandler;

            // get the buttons and put into array in order to recover their references when the client connects
            NoteButtonArray = new UIButton[] { BUZZ, DOH, RE, MI, FA, SO, LA, TI, DOH2 }; // matches order of VMEODBandPlugin.VMEODBandNoteTypes
            MiscButtonArray = new UIButton[] { CASHOUT, CONTINUE };

            // make the waiting for players images
            WaitPlayer1         = Script.Create <UIImage>("WaitPlayer1");
            WaitPlayer1.Texture = PlayerImage;
            Add(WaitPlayer1);
            WaitPlayer2         = Script.Create <UIImage>("WaitPlayer2");
            WaitPlayer2.Texture = PlayerImage;
            Add(WaitPlayer2);
            WaitPlayer3         = Script.Create <UIImage>("WaitPlayer3");
            WaitPlayer3.Texture = PlayerImage;
            Add(WaitPlayer3);
            WaitPlayer4         = Script.Create <UIImage>("WaitPlayer4");
            WaitPlayer4.Texture = PlayerImage;
            Add(WaitPlayer4);

            WaitPlayers = new UIImage[] { WaitPlayer1, WaitPlayer2, WaitPlayer3, WaitPlayer4 };

            Player1Wait.Alignment = TextAlignment.Left;
            Player2Wait.Alignment = TextAlignment.Left;
            Player3Wait.Alignment = TextAlignment.Left;
            Player4Wait.Alignment = TextAlignment.Left;

            // add lobby
            Lobby = new UIEODLobby(this, 4)
                    .WithPlayerUI(new UIEODLobbyPlayer(0, WaitPlayer1, Player1Wait))
                    .WithPlayerUI(new UIEODLobbyPlayer(1, WaitPlayer2, Player2Wait))
                    .WithPlayerUI(new UIEODLobbyPlayer(2, WaitPlayer3, Player3Wait))
                    .WithPlayerUI(new UIEODLobbyPlayer(3, WaitPlayer4, Player4Wait))
                    .WithCaptionProvider((player, avatar) => {
                switch (player.Slot)
                {
                case (int)VMEODBandInstrumentTypes.Trumpet:
                    {
                        if (avatar != null)
                        {
                            return(GameFacade.Strings["UIText", "253", "25"].Replace("%d.%02d",
                                                                                     avatar.GetPersonData(SimAntics.Model.VMPersonDataVariable.CharismaSkill) / 100m + ""));
                        }
                        else
                        {
                            return(GameFacade.Strings["UIText", "253", "21"]);
                        }
                    }

                case (int)VMEODBandInstrumentTypes.Drums:
                    {
                        if (avatar != null)
                        {
                            return(GameFacade.Strings["UIText", "253", "26"].Replace("%d.%02d",
                                                                                     avatar.GetPersonData(SimAntics.Model.VMPersonDataVariable.BodySkill) / 100m + ""));
                        }
                        else
                        {
                            return(GameFacade.Strings["UIText", "253", "22"]);
                        }
                    }

                case (int)VMEODBandInstrumentTypes.Keyboard:
                    {
                        if (avatar != null)
                        {
                            return(GameFacade.Strings["UIText", "253", "27"].Replace("%d.%02d",
                                                                                     avatar.GetPersonData(SimAntics.Model.VMPersonDataVariable.CreativitySkill) / 100m + ""));
                        }
                        else
                        {
                            return(GameFacade.Strings["UIText", "253", "23"]);
                        }
                    }

                case (int)VMEODBandInstrumentTypes.Guitar:
                    {
                        if (avatar != null)
                        {
                            return(GameFacade.Strings["UIText", "253", "28"].Replace("%d.%02d",
                                                                                     avatar.GetPersonData(SimAntics.Model.VMPersonDataVariable.CreativitySkill) / 100m + ""));
                        }
                        else
                        {
                            return(GameFacade.Strings["UIText", "253", "24"]);
                        }
                    }
                }
                return("");
            });
            Add(Lobby);

            // listeners
            BinaryHandlers["Band_Sequence"]                = SequenceHandler;
            BinaryHandlers["Band_UI_Init"]                 = UIInitHandler;
            BinaryHandlers["Band_Note_Sync"]               = NoteSyncHandler;
            PlaintextHandlers["Band_Buzz"]                 = BuzzNoteHandler;
            PlaintextHandlers["Band_Fail"]                 = NoteFailHandler;
            PlaintextHandlers["Band_Game_Reset"]           = ResetHandler;
            PlaintextHandlers["Band_Intermission"]         = IntermissionHandler;
            PlaintextHandlers["Band_Performance"]          = InitPerformanceHandler;
            PlaintextHandlers["Band_Continue_Performance"] = PerformanceHandler;
            PlaintextHandlers["Band_Players"]              = PlayerRosterHandler;
            PlaintextHandlers["Band_RockOn"]               = ForceRockOnHandler;
            PlaintextHandlers["Band_Show"]                 = ShowGameHandler;
            PlaintextHandlers["Band_Timer"]                = TimerHandler;
            PlaintextHandlers["Band_Timeout"]              = TimeoutHandler;
            PlaintextHandlers["Band_Win"] = DisplayWinHandler;
        }
        private void ShowCharismaPlayerHandler(string evt, byte[] data)
        {
            Script = RenderScript("twopersonjobobjectmazecharisma.uis");
            // background images
            UIPlayBackground = Script.Create <UIImage>("UIPlayBackground");
            AddAt(0, UIPlayBackground);

            // all walls
            NorthWall          = Script.Create <UIImage>("HWall");
            NorthWall.Position = UIPlayBackground.Position;
            NorthWall.X       += 13;
            NorthWall.Y       += 11;
            Add(NorthWall);
            SouthWall          = Script.Create <UIImage>("HWall");
            SouthWall.Position = UIPlayBackground.Position;
            SouthWall.X       += 13;
            SouthWall.Y       += 61;
            Add(SouthWall);
            WestWall          = Script.Create <UIImage>("VWall");
            WestWall.Position = UIPlayBackground.Position;
            WestWall.X       += 9;
            WestWall.Y       += 14;
            Add(WestWall);
            EastWall          = Script.Create <UIImage>("VWall");
            EastWall.Position = UIPlayBackground.Position;
            EastWall.X       += 59;
            EastWall.Y       += 14;
            Add(EastWall);

            // create boxes
            // uigraphics / eods / twopersonjobobjectmaze / EOD_2PJobObj_Blue.bmp, Green.bmp, Red.bmp, Yellow.bmp
            var boxOffset = new Vector2(16, 18);

            ColoredBoxes = new UIImage[] { new UIImage(GetTexture(0x000007FD00000001)), new UIImage(GetTexture(0x000007FE00000001)),
                                           new UIImage(GetTexture(0x0000080100000001)), new UIImage(GetTexture(0x0000080400000001)), new UIImage(GetTexture(0x0000080300000001)) };

            for (int index = 0; index < ColoredBoxes.Length; index++)
            {
                var box = ColoredBoxes[index];
                box.UseTooltip();
                box.ScaleX   = box.ScaleY = 5.0f;
                box.Position = UIPlayBackground.Position + boxOffset;
                box.Visible  = false;
                box.Tooltip  = GameFacade.Strings.GetString("f112", (index + BLUE_STRING_INDEX) + "");
                Add(box);
            }
            // the tooltip for the exit icon should be "Blue"
            ColoredBoxes[4].Tooltip = GameFacade.Strings.GetString("f112", "" + BLUE_STRING_INDEX);

            if (Waiting != null)
            {
                Remove(Waiting);
            }
            if (HWall != null)
            {
                Remove(HWall);
            }
            if (VWall != null)
            {
                Remove(VWall);
            }

            // labels: since they're useless in FreeSO's maze—as payouts are not happening—I've decided to make them help colorblind players
            if (PayoutCaption != null)
            {
                PayoutCaption.Alignment = TextAlignment.Left;
                PayoutCaption.Caption   = SquareColorCaption;
            }
            if (PayoutField != null)
            {
                PayoutField.Alignment = TextAlignment.Left;

                // "Waiting for Logic Player"
                ShowWaitingMessageHandler(evt, data); // disables buttons, sets time to 0
            }

            // add listeners to buttons, sscale them
            var offsetFat    = North.Size.X * 0.5f;
            var offsetSkinny = North.Size.Y * 0.5f;

            North.OnButtonClick += (btn) => { Send("TSOMaze_Button_Click", new byte[] { (byte)AbstractMazeCellCardinalDirections.North }); };
            North.ScaleX         = North.ScaleY = 1.5f;
            North.X              = North.X - offsetFat + 12;
            North.Y              = North.Y - offsetSkinny + 2;
            West.OnButtonClick  += (btn) => { Send("TSOMaze_Button_Click", new byte[] { (byte)AbstractMazeCellCardinalDirections.West }); };
            West.ScaleX          = West.ScaleY = 1.5f;
            West.X              -= offsetSkinny;
            West.Y               = West.Y - offsetFat + 9;
            East.OnButtonClick  += (btn) => { Send("TSOMaze_Button_Click", new byte[] { (byte)AbstractMazeCellCardinalDirections.East }); };
            East.ScaleX          = East.ScaleY = 1.5f;
            East.X              += 2;
            East.Y               = East.Y - offsetFat + 9;
            South.OnButtonClick += (btn) => { Send("TSOMaze_Button_Click", new byte[] { (byte)AbstractMazeCellCardinalDirections.South }); };
            South.ScaleX         = South.ScaleY = 1.5f;
            South.X              = South.X - offsetFat + 12;
            South.Y              = South.Y - offsetSkinny + 6;
            UIPlayBackground.Y  += 2;

            // show EOD
            Controller.ShowEODMode(new EODLiveModeOpt
            {
                Buttons    = 0,
                Height     = EODHeight.Tall,
                Length     = EODLength.Full,
                Tips       = EODTextTips.None,
                Timer      = EODTimer.Normal,
                Expandable = false,
                Expanded   = false
            });
        }
Exemple #12
0
        private void InitHandler(string evt, string data)
        {
            var   split = data.Split('%');
            short avatarID;

            // place player Avatar into Players
            if (Int16.TryParse(split[0], out avatarID))
            {
                var avatar = (VMAvatar)EODController.Lot.vm.GetObjectById(avatarID);
                if (split[1].Equals("blue"))
                {
                    Players[0]          = new UIVMPersonButton((VMAvatar)avatar, EODController.Lot.vm, false);
                    Players[0].Position = BluePlayerPos.Position;
                    PlayerIsBlue        = true;
                    Add(Players[0]);
                }
                else
                {
                    Players[1]          = new UIVMPersonButton((VMAvatar)avatar, EODController.Lot.vm, false);
                    Players[1].Position = RedPlayerPos.Position;
                    Add(Players[1]);
                }
            }
            // draw progressbar
            RemainingBluePieces = 5;
            RemainingRedPieces  = 5;
            DrawProgressBar(RemainingBluePieces, RemainingRedPieces);

            // add the buttons as children to this, creating a new one if need be
            ArtilleryButton = Script.Create <UIButton>("ArtilleryButton");
            if (Children.Contains(ArtilleryButton))
            {
                Remove(ArtilleryButton);
            }
            Add(ArtilleryButton);
            CavalryButton = Script.Create <UIButton>("CavalryButton");
            if (Children.Contains(CavalryButton))
            {
                Remove(CavalryButton);
            }
            Add(CavalryButton);
            CommandButton = Script.Create <UIButton>("CommandButton");
            if (Children.Contains(CommandButton))
            {
                Remove(CommandButton);
            }
            Add(CommandButton);
            InfantryButton = Script.Create <UIButton>("InfantryButton");
            if (Children.Contains(InfantryButton))
            {
                Remove(InfantryButton);
            }
            Add(InfantryButton);
            IntelButton = Script.Create <UIButton>("IntelButton");
            if (Children.Contains(IntelButton))
            {
                Remove(IntelButton);
            }
            Add(IntelButton);

            // add defeated images beneath each button
            DefeatArtilleryPos = Script.Create <UIImage>("DefeatArtilleryPos");
            AddBefore(DefeatArtilleryPos, ArtilleryButton);
            DefeatArtilleryPos.Visible = false;
            DefeatCavalryPos           = Script.Create <UIImage>("DefeatCavalryPos");
            AddBefore(DefeatCavalryPos, CavalryButton);
            DefeatCavalryPos.Visible = false;
            DefeatCommandPos         = Script.Create <UIImage>("DefeatCommandPos");
            AddBefore(DefeatCommandPos, CommandButton);
            DefeatCommandPos.Visible = false;
            DefeatInfantryPos        = Script.Create <UIImage>("DefeatInfantryPos");
            AddBefore(DefeatInfantryPos, InfantryButton);
            DefeatInfantryPos.Visible = false;
            DefeatIntelPos            = Script.Create <UIImage>("DefeatIntelPos");
            AddBefore(DefeatIntelPos, IntelButton);
            DefeatIntelPos.Visible = false;

            EODController.ShowEODMode(new EODLiveModeOpt
            {
                Buttons = 0,
                Height  = EODHeight.Tall,
                Length  = EODLength.Full,
                Tips    = EODTextTips.None,
                Timer   = EODTimer.None,
            });
        }
Exemple #13
0
        protected virtual void InitUI()
        {
            Small800 = (GlobalSettings.Default.GraphicsWidth < 1024) || Common.FSOEnvironment.UIZoomFactor > 1f;
            Script   = this.RenderScript("securetradingeod" + ((Small800)?"":"1024") + ".uis");

            Catalog = new UICatalog(Small800 ? 18 : 28);
            Script.ApplyControlProperties(Catalog, "InventoryCatalogSecureTrading");
            Catalog.X -= 2;
            Add(Catalog);

            OfferCatalog          = new UICatalog(10); //only uses top row
            OfferCatalog.Position = Catalog.Position + new Vector2(41, 116);
            Add(OfferCatalog);

            OtherOfferCatalog          = new UICatalog(10); //only uses top row
            OtherOfferCatalog.Position = Catalog.Position + new Vector2(41, 166);
            Add(OtherOfferCatalog);

            OurAvatarMoneySymbol.CurrentText   = "$";
            OtherAvatarMoneySymbol.CurrentText = "$";
            AmountEntry.Alignment       = Framework.TextAlignment.Center;
            OtherAvatarAmount.Alignment = Framework.TextAlignment.Center;

            AmountEntry.OnChange += AmountEntry_OnChange;

            AcceptButton.OnButtonClick    += AcceptClicked;
            OtherAcceptedButton.Disabled   = true;
            OtherAcceptedButton.ForceState = 0;

            LockoutTimerLabel           = new UILabel();
            LockoutTimerLabel.Size      = AmountEntry.Size;
            LockoutTimerLabel.Alignment = TextAlignment.Center;
            LockoutTimerLabel.Position  = (AmountEntry.Position + OtherAvatarAmount.Position) / 2;
            Add(LockoutTimerLabel);

            SetMyPerson(LotController.vm.MyUID);

            Add(QueryPanel);

            InventoryCatalogRoommateImage = Script.Create <UIImage>("InventoryCatalogRoommateImage");
            Add(InventoryCatalogRoommateImage);

            Catalog.OnSelectionChange           += Catalog_OnSelectionChange;
            OfferCatalog.OnSelectionChange      += OfferCatalog_OnSelectionChange;
            OtherOfferCatalog.OnSelectionChange += OtherOfferCatalog_OnSelectionChange;

            InventoryCatalogSecureTradingSlider.AttachButtons(InventoryCatalogSecureTradingPreviousPageButton, InventoryCatalogSecureTradingNextPageButton, 1f);
            InventoryCatalogSecureTradingSlider.OnChange += (el) => { SetPage((int)InventoryCatalogSecureTradingSlider.Value); };

            BuildInventory();

            FindController <SecureTradeController>().GetOurLotsName((name, owner) =>
            {
                MyLotName  = name;
                OwnerOfLot = owner;
                if (MyLotName != null)
                {
                    BuildInventory();
                }
            });
        }
Exemple #14
0
        public UIGizmoSearch(UIScript script, UIGizmo parent)
        {
            Background = script.Create<UIImage>("BackgroundImageSearch");
            this.Add(Background);

            script.LinkMembers(this, true);
        }
Exemple #15
0
        public UILiveMode(UILotControl lotController)
        {
            Small800 = (GlobalSettings.Default.GraphicsWidth < 1024) || FSOEnvironment.UIZoomFactor > 1f;
            var script = this.RenderScript("livepanel" + (Small800?"":"1024") + ".uis");

            EODLayout     = new UIEODLayout(script);
            Script        = script;
            LotController = lotController;

            DefaultBGImage = GetTexture(Small800 ? (ulong)0x000000D800000002 : (ulong)0x0000018300000002);
            Background     = new UIImage(DefaultBGImage);
            Background.Y   = 35;
            this.AddAt(0, Background);

            EODCloseButton.OnButtonClick += EODCloseButton_OnButtonClick;

            MotivesLabel.CaptionStyle        = MotivesLabel.CaptionStyle.Clone();
            MotivesLabel.CaptionStyle.Shadow = true;
            MotivesLabel.Alignment           = TextAlignment.Left;
            MotivesLabel.Position           -= new Vector2(0, 5);

            PeopleListBg          = new UIImage(PeopleListBackgroundImg);
            PeopleListBg.Position = new Microsoft.Xna.Framework.Vector2(375, 38);
            this.AddAt(1, PeopleListBg);

            Divider          = new UIImage(DividerImg);
            Divider.Position = new Microsoft.Xna.Framework.Vector2(140, 49);
            this.AddAt(1, Divider);

            MoodPanelButton = new UIButton();

            MoodPanelButton.Texture     = GetTexture((ulong)GameContent.FileIDs.UIFileIDs.lpanel_moodpanelbtn);
            MoodPanelButton.ImageStates = 4;
            MoodPanelButton.Position    = new Vector2(31, 63);
            this.Add(MoodPanelButton);

            MotiveDisplay          = new UIMotiveDisplay();
            MotiveDisplay.Position = new Vector2(165, 56);
            this.Add(MotiveDisplay);
            DynamicOverlay.Add(MotiveDisplay);

            PersonGrid = new UIPersonGrid(LotController.vm);
            Add(PersonGrid);
            PersonGrid.Position = new Vector2(409, 51);
            if (Small800)
            {
                PersonGrid.Columns = 4;
                PersonGrid.DrawPage();
            }

            EODPanel           = new UIImage(EODPanelImg);
            EODPanelTall       = new UIImage(EODPanelTallImg);
            EODDoublePanelTall = new UIImage(EODDoublePanelTallImg);

            Size = new Vector2(Background.Size.X, EODPanelTall.Size.Y);

            AddAt(0, EODDoublePanelTall);
            AddAt(0, EODPanel);
            AddAt(0, EODPanelTall);


            EODButtonLayout = new UIImage();
            EODSub          = new UIImage();
            EODExpandBack   = Script.Create <UIImage>("EODExpandBack");

            Add(EODButtonLayout);
            Add(EODSub);
            Add(EODExpandBack);

            EODTopSub          = new UIImage();
            EODTopButtonLayout = new UIImage();
            Add(EODTopButtonLayout);
            Add(EODTopSub);


            StatusBarMsgWinStraight = script.Create <UIImage>("StatusBarMsgWinStraight");
            StatusBarTimerStraight  = script.Create <UIImage>("StatusBarTimerStraight");
            StatusBarTimerBreakIcon = script.Create <UIImage>("StatusBarTimerBreakIcon");
            StatusBarTimerWorkIcon  = script.Create <UIImage>("StatusBarTimerWorkIcon");

            StatusBarTimerStraight.X  -= 1;
            StatusBarTimerStraight.Y  += 2;
            StatusBarTimerBreakIcon.Y += 2;
            StatusBarTimerWorkIcon.Y  += 2;
            StatusBarTimerTextEntry.Y += 2;
            StatusBarTimerTextEntry.X += 3;
            StatusBarMsgWinStraight.Y += 2;

            AddAt(0, StatusBarTimerBreakIcon);
            AddAt(0, StatusBarTimerWorkIcon);
            AddAt(0, StatusBarTimerStraight);
            AddAt(0, StatusBarMsgWinStraight);

            StatusBarMsgWinStraight.Visible  = false;
            StatusBarTimerStraight.Visible   = false;
            StatusBarTimerBreakIcon.Visible  = false;
            StatusBarTimerWorkIcon.Visible   = false;
            StatusBarTimerTextEntry.Visible  = false;
            StatusBarMsgWinTextEntry.Visible = false;

            EODMsgWin = new UIImage();
            EODTimer  = script.Create <UIImage>("EODTimer");

            AddAt(0, EODTimer);
            AddAt(0, EODMsgWin);

            EODButton = new UIButton(EODButtonImg);
            Add(EODButton);
            EODButton.OnButtonClick += EODToggle;
            EODImage = script.Create <UIImage>("EODButtonImageSize");
            Add(EODImage);

            Add(EODExpandButton);
            Add(EODContractButton);

            EODExpandButton.OnButtonClick   += EODExpandToggle;
            EODContractButton.OnButtonClick += EODExpandToggle;

            NextPageButton.OnButtonClick     += (UIElement btn) => { PersonGrid.NextPage(); };
            DefaultNextPagePos                = NextPageButton.Position;
            PreviousPageButton.OnButtonClick += (UIElement btn) => { PersonGrid.PreviousPage(); };

            MsgWinTextEntry.Items.Add(new UIListBoxItem("", ""));

            SetInEOD(null, null);
        }
Exemple #16
0
        public UIImage Background; //public so we can disable visibility when not selected... workaround to stop background mouse blocking still happening when panel is hidden

        #endregion Fields

        #region Constructors

        public UIGizmoTop100(UIScript script, UIGizmo parent)
        {
            Background = script.Create<UIImage>("BackgroundImageTop100Lists");
            this.Add(Background);

            script.LinkMembers(this, true);
        }
Exemple #17
0
        private void PlayerInitHandler(string evt, byte[] args)
        {
            Controller.ShowEODMode(new EODLiveModeOpt
            {
                Buttons    = 1,
                Height     = EODHeight.TallTall,
                Length     = EODLength.Full,
                Tips       = EODTextTips.Short,
                Timer      = EODTimer.None,
                Expandable = true,
                Expanded   = true
            });

            SetTip(GameFacade.Strings["UIText", "259", "6"]);

            // hide owner UI elements
            Loading.Visible       = false;
            OddsSlider.Visible    = false;
            OnOffButton.Visible   = false;
            CashOutButton.Visible = false;
            Odds.Visible          = false;
            House.Visible         = false;
            Player.Visible        = false;
            OnOff.Visible         = false;
            CashText.Visible      = false;

            // create player UI iamges
            Wheelsback = Script.Create <UIImage>("WheelsBack");
            AddAt(0, Wheelsback);
            LightsFrame1 = Script.Create <UIImage>("LightsFrame1");
            AddAt(1, LightsFrame1);
            LightsFrame2 = Script.Create <UIImage>("LightsFrame2");
            AddAt(2, LightsFrame2);
            BetIndents = Script.Create <UIImage>("BetIndents");
            AddAt(3, BetIndents);
            Chips   = new UISlotsImage(MoneyChipsImage);
            Chips.X = 110;
            Chips.Y = 285;
            Add(Chips);

            // Customize and place payout table
            PayoutTableColumn1Row1   = new UISlotsImage(Wheel1LegendImage).TripleTextureDraw(0, 0, 15, 21, 0, 0, 15, 21, 0, 0, 15, 21, true, false);
            PayoutTableColumn1Row1.X = 125;
            PayoutTableColumn1Row1.Y = 120;
            Add(PayoutTableColumn1Row1);
            PayoutTableColumn1Row2    = new UISlotsImage(Wheel1LegendImage).TripleTextureDraw(15, 0, 15, 21, 15, 0, 15, 21, 15, 0, 15, 21, true, false);
            PayoutTableColumn1Row2.X  = 125;
            PayoutTableColumn1Row2.Y  = 120;
            PayoutTableColumn1Row2.Y += 21;
            Add(PayoutTableColumn1Row2);
            PayoutTableColumn1Row3    = new UISlotsImage(Wheel1LegendImage).TripleTextureDraw(30, 0, 15, 21, 30, 0, 15, 21, 30, 0, 15, 21, true, false);
            PayoutTableColumn1Row3.X  = 125;
            PayoutTableColumn1Row3.Y  = 120;
            PayoutTableColumn1Row3.Y += 42;
            Add(PayoutTableColumn1Row3);
            PayoutTableColumn1Row4    = new UISlotsImage(Wheel1LegendImage).TripleTextureDraw(45, 0, 15, 21, 45, 0, 15, 21, 45, 0, 15, 21, true, false);
            PayoutTableColumn1Row4.X  = 125;
            PayoutTableColumn1Row4.Y  = 120;
            PayoutTableColumn1Row4.Y += 63;
            Add(PayoutTableColumn1Row4);
            PayoutTableColumn2Row1   = new UISlotsImage(Wheel1LegendImage).TripleTextureDraw(60, 0, 15, 21, 60, 0, 15, 21, 60, 0, 15, 21, true, false);
            PayoutTableColumn2Row1.X = 275;
            PayoutTableColumn2Row1.Y = 120;
            Add(PayoutTableColumn2Row1);
            PayoutTableColumn2Row2    = new UISlotsImage(Wheel1LegendImage).TripleTextureDraw(45, 0, 15, 21, 60, 0, 15, 21, 75, 0, 15, 21, true, false);
            PayoutTableColumn2Row2.X  = 275;
            PayoutTableColumn2Row2.Y  = 120;
            PayoutTableColumn2Row2.Y += 21;
            Add(PayoutTableColumn2Row2);
            PayoutTableColumn2Row3    = new UISlotsImage(Wheel1LegendImage).DoubleTextureDraw(75, 0, 15, 21, 75, 0, 15, 21, true, false);
            PayoutTableColumn2Row3.X  = 275;
            PayoutTableColumn2Row3.Y  = 120;
            PayoutTableColumn2Row3.Y += 42;
            Add(PayoutTableColumn2Row3);
            PayoutTableColumn2Row4   = new UISlotsImage(Wheel1LegendImage);
            PayoutTableColumn2Row4.X = 275;
            PayoutTableColumn2Row4.Y = 120;
            PayoutTableColumn2Row4.SetBounds(75, 0, 15, 21);
            PayoutTableColumn2Row4.Y += 63;
            Add(PayoutTableColumn2Row4);

            // initialize payout textfields, which are currently ubiquitous across all slot machines
            PayoutText1.Y           = PayoutTableColumn1Row1.Y - 1;
            PayoutText1.X           = PayoutTableColumn1Row1.X + 55;
            PayoutText1.CurrentText = GameFacade.Strings["UIText", "259", "36"];
            PayoutText1.CurrentText = PayoutText1.CurrentText.Replace("%i", "" + VMEODSlotsPlugin.SIX_SIX_SIX_PAYOUT_MULTIPLIER);
            PayoutText1.Mode        = UITextEditMode.ReadOnly;
            Add(PayoutText1);

            PayoutText2.Y           = PayoutTableColumn1Row2.Y - 1;
            PayoutText2.X           = PayoutTableColumn1Row2.X + 55;
            PayoutText2.CurrentText = GameFacade.Strings["UIText", "259", "36"];
            PayoutText2.CurrentText = PayoutText2.CurrentText.Replace("%i", "" + VMEODSlotsPlugin.FIVE_FIVE_FIVE_PAYOUT_MULTIPLIER);
            PayoutText2.Mode        = UITextEditMode.ReadOnly;
            Add(PayoutText2);

            PayoutText3.Y           = PayoutTableColumn1Row3.Y - 1;
            PayoutText3.X           = PayoutTableColumn1Row3.X + 55;
            PayoutText3.CurrentText = GameFacade.Strings["UIText", "259", "36"];
            PayoutText3.CurrentText = PayoutText3.CurrentText.Replace("%i", "" + VMEODSlotsPlugin.FOUR_FOUR_FOUR_PAYOUT_MULTIPLIER);
            PayoutText3.Mode        = UITextEditMode.ReadOnly;
            Add(PayoutText3);

            PayoutText4.Y           = PayoutTableColumn1Row4.Y - 1;
            PayoutText4.X           = PayoutTableColumn1Row4.X + 55;
            PayoutText4.CurrentText = GameFacade.Strings["UIText", "259", "36"];
            PayoutText4.CurrentText = PayoutText4.CurrentText.Replace("%i", "" + VMEODSlotsPlugin.THREE_THREE_THREE_PAYOUT_MULTIPLIER);
            PayoutText4.Mode        = UITextEditMode.ReadOnly;
            Add(PayoutText4);

            PayoutText5.Y           = PayoutTableColumn2Row1.Y - 1;
            PayoutText5.X           = PayoutTableColumn2Row1.X + 55;
            PayoutText5.CurrentText = GameFacade.Strings["UIText", "259", "36"];
            PayoutText5.CurrentText = PayoutText5.CurrentText.Replace("%i", "" + VMEODSlotsPlugin.TWO_TWO_TWO_PAYOUT_MULTIPLIER);
            PayoutText5.Mode        = UITextEditMode.ReadOnly;
            Add(PayoutText5);

            PayoutText6.Y           = PayoutTableColumn2Row2.Y - 1;
            PayoutText6.X           = PayoutTableColumn2Row2.X + 55;
            PayoutText6.CurrentText = GameFacade.Strings["UIText", "259", "36"];
            PayoutText6.CurrentText = PayoutText6.CurrentText.Replace("%i", "" + VMEODSlotsPlugin.THREE_TWO_ONE_PAYOUT_MULTIPLIER);
            PayoutText6.Mode        = UITextEditMode.ReadOnly;
            Add(PayoutText6);

            PayoutText7.Y           = PayoutTableColumn2Row3.Y - 1;
            PayoutText7.X           = PayoutTableColumn2Row3.X + 55;
            PayoutText7.CurrentText = GameFacade.Strings["UIText", "259", "36"];
            PayoutText7.CurrentText = PayoutText7.CurrentText.Replace("%i", "" + VMEODSlotsPlugin.ONE_ONE_ANY_PAYOUT_MULTIPLIER);
            PayoutText7.Mode        = UITextEditMode.ReadOnly;
            Add(PayoutText7);

            PayoutText8.Y           = PayoutTableColumn2Row4.Y - 1;
            PayoutText8.X           = PayoutTableColumn2Row4.X + 55;
            PayoutText8.CurrentText = GameFacade.Strings["UIText", "259", "36"];
            PayoutText8.CurrentText = PayoutText8.CurrentText.Replace("%i", "" + VMEODSlotsPlugin.ONE_ANY_ANY_PAYOUT_MULTIPLIER);
            PayoutText8.Mode        = UITextEditMode.ReadOnly;
            Add(PayoutText8);

            // create the wheel lists for the spinning
            WheelListOne   = new WheelStopsList();
            WheelListTwo   = new WheelStopsList();
            WheelListThree = new WheelStopsList();

            // the wheel textures are customised at a later time, but draw the initial pre-gameplay stops (sixth sixth sixth)
            Wheel1 = new UISlotsImage(Wheel1LegendImage).DoubleTextureDraw(0, WheelListOne.Current.MyStartingY, WHEEL_TEXTURE_WIDTH_AND_HEIGHT,
                                                                           WHEEL_TEXTURE_HALF_DRAW_HEIGHT, 0, WheelListOne.Current.MyStartingY + WHEEL_TEXTURE_HALF_DRAW_HEIGHT,
                                                                           WHEEL_TEXTURE_WIDTH_AND_HEIGHT, WHEEL_TEXTURE_HALF_DRAW_HEIGHT, false, true);
            Wheel1.X = 167;
            Wheel1.Y = 265;
            Wheel2   = new UISlotsImage(Wheel1LegendImage).DoubleTextureDraw(0, WheelListTwo.Current.MyStartingY, WHEEL_TEXTURE_WIDTH_AND_HEIGHT,
                                                                             WHEEL_TEXTURE_HALF_DRAW_HEIGHT, 0, WheelListTwo.Current.MyStartingY + WHEEL_TEXTURE_HALF_DRAW_HEIGHT,
                                                                             WHEEL_TEXTURE_WIDTH_AND_HEIGHT, WHEEL_TEXTURE_HALF_DRAW_HEIGHT, false, true);
            Wheel2.X = 236;
            Wheel2.Y = 265;
            Wheel3   = new UISlotsImage(Wheel1LegendImage).DoubleTextureDraw(0, WheelListThree.Current.MyStartingY, WHEEL_TEXTURE_WIDTH_AND_HEIGHT,
                                                                             WHEEL_TEXTURE_HALF_DRAW_HEIGHT, 0, WheelListThree.Current.MyStartingY + WHEEL_TEXTURE_HALF_DRAW_HEIGHT,
                                                                             WHEEL_TEXTURE_WIDTH_AND_HEIGHT, WHEEL_TEXTURE_HALF_DRAW_HEIGHT, false, true);
            Wheel3.X = 305;
            Wheel3.Y = 265;

            Add(Wheel1);
            Add(Wheel2);
            Add(Wheel3);
            WinningLine = Script.Create <UIImage>("WinningLine");
            Add(WinningLine);

            if ((args != null) && (args.Length > 1))
            {
                MachineTypeInit(args[1]);
            }
            else
            {
                MachineTypeInit(0);
            }

            // create a timer to animate the lights, milliseconds
            LightsTimer          = new Timer(666 + (2 / 3));
            LightsTimer.Elapsed += new ElapsedEventHandler(LightsHandler);

            // create a timer to change offline messages
            OfflineMessageTimer          = new Timer(3000);
            OfflineMessageTimer.Elapsed += new ElapsedEventHandler(OfflineMessageHandler);

            // create a timer to handle the spinning of the wheels
            WheelsSpinTimer          = new Timer(25);
            WheelsSpinTimer.Elapsed += new ElapsedEventHandler(AnimateWheelsHandler);
        }