private void ShowLogicPlayerHandler(string evt, byte[] data)
        {
            Script           = RenderScript("twopersonjobobjectmazelogic.uis");
            UIWaitBackground = Script.Create <UIImage>("UIWaitBackground");
            Add(UIWaitBackground);
            UIPlayBackground = Script.Create <UIImage>("UIPlayBackground");
            Add(UIPlayBackground);

            // get some offsets
            var red = Script.Create <UIImage>("RedIcon");

            NWCellOriginOffset = red.Position + UIPlayBackground.Position;
            var wall = Script.Create <UIImage>("HWall");

            NWWallOriginOffset = wall.Position + UIPlayBackground.Position;
            var green = Script.Create <UIImage>("GreenIcon");

            CellOffsetX = green.Position.X;
            CellOffsetY = green.Position.Y;

            SetTime(0);

            VWall = Script.Create <UIImage>("VWall");
            HWall = Script.Create <UIImage>("HWall");

            var gd = UIWaitBackground.Texture.GraphicsDevice;

            // try to get textures for Slot Machine #4 Slot stops
            try
            {
                AbstractTextureRef MazeXTrackTextureRef = new FileTextureRef("Content/Textures/EOD/mazextrack.bmp");
                MazeXTrackTexture = MazeXTrackTextureRef.Get(gd);
            }
            catch (Exception e)
            {
                var blue = Script.Create <UIImage>("BlueIcon");
                MazeXTrackTexture = blue.Texture;
            }

            // show EOD
            EODController.ShowEODMode(new EODLiveModeOpt
            {
                Buttons    = 0,
                Height     = EODHeight.Tall,
                Length     = EODLength.Full,
                Tips       = EODTextTips.None,
                Timer      = EODTimer.Normal,
                Expandable = false,
                Expanded   = false
            });
        }
Beispiel #2
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);
            PersonGrid.NextPageButton     = NextPageButton;
            PersonGrid.PreviousPageButton = PreviousPageButton;
            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);

            // get extra tall
            try
            {
                var gd = EODDoublePanelTallImg.GraphicsDevice;
                AbstractTextureRef extraTallRef = new FileTextureRef("Content/Textures/EOD/lpanel_eodpanelextratall.png");
                EODPanelExtraTallImg = extraTallRef.Get(gd);
                ExtraTallInitialized = true;
            }
            catch (Exception e)
            {
                EODPanelExtraTallImg = EODDoublePanelTallImg;
            }
            EODPanelExtraTall = new UIImage(EODPanelExtraTallImg);

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

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

            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);

            InitSpecial();
        }
        private void InitPlayerUI()
        {
            // custom textures
            var gd = GameFacade.GraphicsDevice;

            // try to get custom horizontal textures for lights
            try
            {
                AbstractTextureRef lightsframe1hRef = new FileTextureRef("Content/Textures/EOD/Buzzer/eod_lightsframe1.png");
                Lightsframe1Tex = lightsframe1hRef.Get(gd);
                AbstractTextureRef lightsframe2hRef = new FileTextureRef("Content/Textures/EOD/Buzzer/eod_lightsframe2.png");
                Lightsframe2Tex = lightsframe2hRef.Get(gd);
                AbstractTextureRef lightsframebackhRef = new FileTextureRef("Content/Textures/EOD/Buzzer/eod_lightsframeback.png");
                LightsframebackTex = lightsframebackhRef.Get(gd);
                AbstractTextureRef lightsframebluehRef = new FileTextureRef("Content/Textures/EOD/Buzzer/eod_lightsframeblue.png");
                LightsframeblueTex = lightsframebluehRef.Get(gd);
                AbstractTextureRef lightsframeredhRef = new FileTextureRef("Content/Textures/EOD/Buzzer/eod_lightsframered.png");
                LightsframeredTex = lightsframeredhRef.Get(gd);
            }
            catch (Exception e)
            {
                Lightsframe1Tex    = null;
                Lightsframe2Tex    = null;
                LightsframebackTex = null;
                LightsframeblueTex = null;
                LightsframeredTex  = null;
            }

            PlayerLightFrame = new ContestantLightsFrame(Lightsframe1Tex, Lightsframe2Tex, LightsframebackTex, LightsframeblueTex, LightsframeredTex)
            {
                X = 110,
                Y = 52
            };
            Add(PlayerLightFrame);

            // buzzer
            PlayerBuzzerBack = new UIImage(BuzzerbtnBackTexture)
            {
                X = 173,
                Y = 85
            };
            Add(PlayerBuzzerBack);
            PlayerBuzzer = new UIButton(BuzzerbtnTexture)
            {
                X = PlayerBuzzerBack.X + 1,
                Y = PlayerBuzzerBack.Y - 10
            };
            Add(PlayerBuzzer);
            PlayerBuzzer.OnButtonClick += PlayerBuzzerClickedHandler;

            // score - read only
            PlayerScoreBack = new UIImage(PlayerScoreBackTexture)
            {
                X       = 310,
                Y       = 88,
                Tooltip = GameFacade.Strings.GetString("f127", "2") // "Player Score"
            };
            PlayerScoreBack.UseTooltip();
            Add(PlayerScoreBack);

            PlayerScore = new UITextEdit()
            {
                Mode        = UITextEditMode.ReadOnly,
                Alignment   = TextAlignment.Center,
                Size        = new Vector2(80, 20),
                X           = PlayerScoreBack.X - 2,
                Y           = PlayerScoreBack.Y + 5,
                CurrentText = "0",
                Tooltip     = GameFacade.Strings.GetString("f127", "2") // "Player Score"
            };
            Add(PlayerScore);
        }