Наследование: FSO.Client.UI.Framework.UIContainer
Пример #1
0
        public UISignsEOD(UIEODController controller)
            : base(controller)
        {
            var script = this.RenderScript("signseod.uis");

            OwnerWriteTextSubpanel = script.Create<UIImage>("OwnerWriteTextSubpanel");
            AddAt(0, OwnerWriteTextSubpanel);
            WriteTextSubpanel = script.Create<UIImage>("WriteTextSubpanel");
            AddAt(0, WriteTextSubpanel);
            ReadTextSubpanel = script.Create<UIImage>("ReadTextSubpanel");
            AddAt(0, ReadTextSubpanel);
            OwnerPermissionsSubpanel = script.Create<UIImage>("OwnerPermissionsSubpanel");
            AddAt(0, OwnerPermissionsSubpanel);

            PlaintextHandlers["signs_init"] = P_Init;
            BinaryHandlers["signs_show"] = B_Show;

            OwnerPermissionsButton.OnButtonClick += OwnerPermissionsButton_OnButtonClick;
            OwnerWriteTextButton.OnButtonClick += OwnerWriteTextButton_OnButtonClick;

            RoommateReadCheckButton.OnButtonClick += TogglePermission;
            FriendReadCheckButton.OnButtonClick += TogglePermission;
            VisitorReadCheckButton.OnButtonClick += TogglePermission;

            RoommateWriteCheckButton.OnButtonClick += TogglePermission;
            FriendWriteCheckButton.OnButtonClick += TogglePermission;
            VisitorWriteCheckButton.OnButtonClick += TogglePermission;

            WriteTextSubpanel.Position = ReadTextSubpanel.Position; //it's wrong normally?
            WriteTextBox.Position = ReadTextBox.Position;

            OwnerWriteTextBox.InitDefaultSlider();
            WriteTextBox.InitDefaultSlider();
            ReadTextBox.InitDefaultSlider();
        }
Пример #2
0
        public UIPizzaMakerEOD(UIEODController controller)
            : base(controller)
        {
            var script = this.RenderScript("pizzamakereod.uis");
            Script = script;

            background = script.Create<UIImage>("background");
            AddAt(0, background);

            btnIngredient1.ButtonFrames = 3;
            btnIngredient2.ButtonFrames = 3;
            btnIngredient3.ButtonFrames = 3;

            btnIngredient1.Visible = false;
            btnIngredient2.Visible = false;
            btnIngredient3.Visible = false;

            btnIngredient1.OnButtonClick += (UIElement btn) => { SubmitIngredient(0); };
            btnIngredient2.OnButtonClick += (UIElement btn) => { SubmitIngredient(1); };
            btnIngredient3.OnButtonClick += (UIElement btn) => { SubmitIngredient(2); };

            PlaintextHandlers["pizza_show"] = P_Show;
            PlaintextHandlers["pizza_state"] = P_State;
            PlaintextHandlers["pizza_time"] = P_Time;
            PlaintextHandlers["pizza_result"] = P_Result;
            PlaintextHandlers["pizza_contrib"] = P_Contrib;
            PlaintextHandlers["pizza_hand"] = P_Hand;
            PlaintextHandlers["pizza_players"] = P_Players;

            PersonBG1 = script.Create<UIImage>("playerPos1");
            PersonBG2 = script.Create<UIImage>("playerPos2");
            PersonBG3 = script.Create<UIImage>("playerPos3");
            PersonBG4 = script.Create<UIImage>("playerPos4");
            PersonBG1.Texture = imagePlayer;
            PersonBG2.Texture = imagePlayer;
            PersonBG3.Texture = imagePlayer;
            PersonBG4.Texture = imagePlayer;
            Add(PersonBG1);
            Add(PersonBG2);
            Add(PersonBG3);
            Add(PersonBG4);

            labelStation1.Alignment = TextAlignment.Left;
            labelStation2.Alignment = TextAlignment.Left;
            labelStation3.Alignment = TextAlignment.Left;
            labelStation4.Alignment = TextAlignment.Left;

            EnterState(VMEODPizzaState.Lobby);
        }
Пример #3
0
        public UIDanceFloorEOD(UIEODController controller)
            : base(controller)
        {
            var script = this.RenderScript("danceflooreod.uis");

            UIBackground = script.Create<UIImage>("UIBackground");
            AddAt(0, UIBackground);

            Dance001Button.OnButtonClick += (UIElement e) => { Dance(1); };
            Dance002Button.OnButtonClick += (UIElement e) => { Dance(2); };
            Dance003Button.OnButtonClick += (UIElement e) => { Dance(3); };
            Dance004Button.OnButtonClick += (UIElement e) => { Dance(4); };
            Dance005Button.OnButtonClick += (UIElement e) => { Dance(5); };
            Dance006Button.OnButtonClick += (UIElement e) => { Dance(6); };
            Dance007Button.OnButtonClick += (UIElement e) => { Dance(7); };
            Dance008Button.OnButtonClick += (UIElement e) => { Dance(8); };
            Dance009Button.OnButtonClick += (UIElement e) => { Dance(9); };
            Dance010Button.OnButtonClick += (UIElement e) => { Dance(10); };
            Dance011Button.OnButtonClick += (UIElement e) => { Dance(11); };
            Dance012Button.OnButtonClick += (UIElement e) => { Dance(12); };
            Dance013Button.OnButtonClick += (UIElement e) => { Dance(13); };
            Dance014Button.OnButtonClick += (UIElement e) => { Dance(14); };
            Dance015Button.OnButtonClick += (UIElement e) => { Dance(15); };
            Dance016Button.OnButtonClick += (UIElement e) => { Dance(16); };
            Dance017Button.OnButtonClick += (UIElement e) => { Dance(17); };
            Dance018Button.OnButtonClick += (UIElement e) => { Dance(18); };
            Dance019Button.OnButtonClick += (UIElement e) => { Dance(19); };
            Dance020Button.OnButtonClick += (UIElement e) => { Dance(20); };
            Dance021Button.OnButtonClick += (UIElement e) => { Dance(21); };
            Dance022Button.OnButtonClick += (UIElement e) => { Dance(22); };
            Dance023Button.OnButtonClick += (UIElement e) => { Dance(23); };
            Dance024Button.OnButtonClick += (UIElement e) => { Dance(24); };
            DanceToMusicButton.OnButtonClick += (UIElement e) => { Dance(0); };

            PlaintextHandlers["dance_show"] = P_Show;
        }
Пример #4
0
 public UIPaperChaseEOD(UIEODController controller) : base(controller)
 {
     InitUI();
     InitEOD();
 }
Пример #5
0
 public UIDresserEOD(UIEODController controller) : base(controller)
 {
     InitUI();
     InitEOD();
 }
Пример #6
0
 public UIEOD(UIEODController controller)
 {
     PlaintextHandlers = new Dictionary <string, EODDirectPlaintextEventHandler>();
     BinaryHandlers    = new Dictionary <string, EODDirectBinaryEventHandler>();
     EODController     = controller;
 }
Пример #7
0
 public UIRackEOD(UIEODController controller) : base(controller, "rackeod.uis")
 {
 }
Пример #8
0
        /// <summary>
        /// Creates a new UILotControl instance.
        /// </summary>
        /// <param name="vm">A SimAntics VM instance.</param>
        /// <param name="World">A World instance.</param>
        public UILotControl(FSO.SimAntics.VM vm, LotView.World World)
        {
            this.vm = vm;
            this.World = World;

            ActiveEntity = vm.Entities.FirstOrDefault(x => x is VMAvatar);
            MouseEvt = this.ListenForMouse(new Microsoft.Xna.Framework.Rectangle(0, 0,
                GlobalSettings.Default.GraphicsWidth, GlobalSettings.Default.GraphicsHeight), OnMouse);

            Queue = new UIInteractionQueue(ActiveEntity, vm);
            this.Add(Queue);

            ObjectHolder = new UIObjectHolder(vm, World, this);
            QueryPanel = new UIQueryPanel(World);
            QueryPanel.OnSellBackClicked += ObjectHolder.SellBack;
            QueryPanel.X = 0;
            QueryPanel.Y = -114;
            //this.Add(QueryPanel);

            ChatPanel = new UIChatPanel(vm, this);
            this.Add(ChatPanel);

            RMBCursor = GetTexture(0x24B00000001); //exploreanchor.bmp

            vm.OnChatEvent += Vm_OnChatEvent;
            vm.OnDialog += vm_OnDialog;
            vm.OnBreakpoint += Vm_OnBreakpoint;

            Cheats = new UICheatHandler(this);
            EODs = new UIEODController(this);
        }
Пример #9
0
 public UINewspaperEOD(UIEODController controller) : base(controller, "newspaper", null)
 {
 }
Пример #10
0
 public UIRackOwnerEOD(UIEODController controller) : base(controller, "rackownereod.uis")
 {
 }
Пример #11
0
 public UIGameshowBuzzerEOD(UIEODController controller) : base(controller)
 {
     InvalidateTimer          = new Timer(1000);
     InvalidateTimer.Elapsed += new ElapsedEventHandler((obj, args) => { Parent.Invalidate(); });
     InvalidateTimer.Start();
 }
Пример #12
0
 public UITrunkEOD(UIEODController controller) : base(controller)
 {
     InitUI();
     AddListeners();
     PlaintextHandlers["trunk_fill_UI"] = FillUIHandler;
 }
Пример #13
0
 public UIEOD(UIEODController controller)
 {
     PlaintextHandlers = new Dictionary<string, EODDirectPlaintextEventHandler>();
     BinaryHandlers = new Dictionary<string, EODDirectBinaryEventHandler>();
     Controller = controller;
 }
Пример #14
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;
        }