Esempio n. 1
0
 public PlayOptionsState(string s_Title)
     : base("pos")
 {
     sTitle = s_Title;
     tp = new Player ();
     MenuButton mbGo = new MenuButton ("Go");
     //mbGo.Selected += GoSelected;
     lButtons = new List<MenuButton> (){ mbGo };
 }
Esempio n. 2
0
        public PlayMenuState()
            : base("Play?")
        {
            ID = "playmenuoptions";
            MenuButton mbNew = new MenuButton ("New Game");
            MenuButton mbContinue = new MenuButton ("Continue");
            MenuButton mbLoad = new MenuButton ("Load");
            MenuButton mbBack = new MenuButton ("Back");

            mbNew.Selected += NewGameSelected;
            mbContinue.Selected += ContinueSelected;
            mbLoad.Selected += LoadSelected;
            mbBack.Selected += BackSelected;

            lButtons = new List<MenuButton> () { mbNew, mbContinue, mbLoad, mbBack };
        }
Esempio n. 3
0
        public EndLevelState(Player Player, List<Civilian>l_suspects)
            : base("EndLevel")
        {
            ID="endlevel";
            MenuButton mbContinue = new MenuButton ("Continue");
            mbContinue.Selected += ContinueSelected;
            lButtons = new List<MenuButton> () { mbContinue };

            lSuspects = new List<Civilian> (l_suspects);
            thePlayer = Player;

            lSuspects.ForEach (delegate(Civilian c) {
                if(c.GetType().Equals(typeof(Civilian)))
                    numCiv++;
                else if (c.GetType().Equals(typeof(Perp)))
                    numPerp++;
            });
Esempio n. 4
0
        public MainMenuState()
        {
            ID = "MainMenu";
            MenuButton mbPlay = new MenuButton ("Play");
            MenuButton mbOptions = new MenuButton ("Options");
            MenuButton mbExit = new MenuButton ("Exit");

            MenuButton mbCredits = new MenuButton("Credits");
            MenuButton mbHowToPlay = new MenuButton("HowToPlay");

            mbPlay.Selected += PlaySelected;
            mbOptions.Selected += OptionsSelected;
            mbExit.Selected += ExitSelected;

            mbCredits.Selected += CreditsSelected;
            mbHowToPlay.Selected += HowToPlaySelected;

            lButtons = new List<MenuButton> () { mbPlay, mbOptions, mbExit, mbCredits, mbHowToPlay };
        }
Esempio n. 5
0
        public OptionsMenuState()
        {
            ID = "Options";

            for (byte i=0; i<RIR.LWorkingRes.Count; i++) {
                if (RIR.IVirtualWidth.Equals (RIR.LWorkingRes [i].Item1) &&
                    RIR.IVirtualHeight.Equals (RIR.LWorkingRes [i].Item2))
                    currentRes = i;
            }
            MenuButton mbResolution = new MenuButton("Resolution");
            MenuButton mbFullScreen = new MenuButton("Fullscreen");
            MenuButton mbApply = new MenuButton("Apply");
            MenuButton mbBack = new MenuButton("Back");

            mbResolution.Selected += ResSelected;
            mbFullScreen.Selected += FSSelected;
            mbApply.Selected += ApplySelected;
            mbBack.Selected += BackSelected;

            lButtons = new List<MenuButton> (){ mbResolution, mbFullScreen, mbApply, mbBack };
Esempio n. 6
0
        void ExitSelected(object sender, EventArgs e)
        {
            MenuButton mbNo = new MenuButton("No");
             			MenuButton mbYes = new MenuButton("Yes");

            mbNo.Selected += CancelExit;
            mbYes.Selected += QuitSelected;

            List<MenuButton> menuexitbuttons = new List<MenuButton>() {mbNo, mbYes};

            menuexitbuttons[0].Tex2dButtonTexture = tex2ExitMenuButtons[0];
            menuexitbuttons[1].Tex2dButtonTexture = tex2ExitMenuButtons[1];

            PopUpState psSureExit = new PopUpState ("Sure you want to exit?", menuexitbuttons);
            psSureExit.ID = "MenuExit";
            psSureExit.Cancelled += CancelExit;
            bPause = true;
            GSM.Instance.AddState (psSureExit);
        }
Esempio n. 7
0
        public override void HandleInput()
        {
            InputController IC = InputController.Instance;
            if (IC.IsKey (Keys.Escape) || (IC.IsMouse (0, recUIPausePos))) {
                MenuButton mbResume = new MenuButton ("Resume");
                MenuButton mbQuit = new MenuButton ("Quit");

                mbResume.Selected += ResumeSelected;
                mbResume.Tex2dButtonTexture = tex2PauseMenuButtons [1];
                mbQuit.Selected += QuitSelected;
                mbQuit.Tex2dButtonTexture = tex2PauseMenuButtons [0];

                List<MenuButton> pauseButtons = new List<MenuButton> () {mbResume, mbQuit};
                //pauseButtons [0].Tex2dButtonTexture = new Texture2D[] {tex2PauseMenuButtons [0], tex2PauseMenuButtons [1]};
                //pauseButtons [1].Tex2dButtonTexture = new Texture2D[] {tex2PauseMenuButtons [2], tex2PauseMenuButtons [3]};
                PopUpState psPause = new PopUpState ("Would you like to quit?", pauseButtons);
                psPause.ID = "levelPause";
                psPause.Cancelled += pauseCancel;
                bPause = true;
                GSM.Instance.AddState (psPause);
            }

            MouseOverUI (IC, ref recUIPos [0], ref recUIPos [1], ref bBookOpen);
            MouseOverUI (IC, ref recUIPos [2], ref recUIPos [3], ref bRadioOpen);

            if (!bBookOpen && !bRadioOpen) {
                foreach (Civilian c in lCivilians) {
                    c.HandleInput ();
                    if (c.BSelected) {
                        //bad code but shouldnt effect game on this scale
                        lCivilians.ForEach (delegate(Civilian ci) {
                            if (ci != c)
                                ci.BSelected = false;
                        });

                        if (IC.IsKey (Keys.Enter)) {
                            if (oPlayer.Arrests > 0 && !c.Arrested) {
                                oPlayer.Arrests--;
                                if (c.Tracked){
                                    oPlayer.Trackers++;
                                    c.Tracked = false;
                                }
                                c.Arrested = true;
                                c.BSelected = false;
                                c.Sm.ChangeState (new ArrestedState (oPlayer));
                            }
                        }
                        if (IC.IsKey (Keys.Space) && !c.Arrested) {
                            if (oPlayer.Trackers > 0) {
                                if (!c.Tracked) { //not tracked
                                    oPlayer.Trackers--;
                                    c.Tracked = true;
                                } else { // tracked
                                    oPlayer.Trackers++;
                                    c.Tracked = false;
                                }
                            } else {
                                if (c.Tracked) {
                                    oPlayer.Trackers++;
                                    c.Tracked = false;
                                }
                            }
                        }
                    }
                }
            }
        }