Exemple #1
0
        public override void NewMessage(int ctrlIndex, CWindow.WindowMessages message)
        {
            switch (ctrlIndex)
            {
            case (int)StarportButtons.TradeDepot:
            case (int)StarportButtons.Operations:
            case (int)StarportButtons.Bank:
            case (int)StarportButtons.Personnel:
            case (int)StarportButtons.DockingBay:
            case (int)StarportButtons.ObservationDeck:
            case (int)StarportButtons.Bar:
            case (int)StarportButtons.Casino:
            case (int)StarportButtons.OrbitPlanet:
                if (message == WindowMessages.LeftMouseButtonClicked)
                {
                    OuterSpace.theGameState.RemoveState(OuterSpace.GameStates.DockedAtStation);
                    OuterSpace.theGameState.AddState(OuterSpace.GameStates.Orbiting);
                    Close();
                }
                break;

            case (int)StarportButtons.Launch:
                if (message == WindowMessages.LeftMouseButtonClicked)
                {
                    OuterSpace.theGameState.RemoveState(OuterSpace.GameStates.DockedAtStation);
                    OuterSpace.theGameState.AddState(OuterSpace.GameStates.InSystem);
                    Close();
                }
                break;
            }
        }
Exemple #2
0
        public override void NewMessage(int ctrlIndex, CWindow.WindowMessages message)
        {
            switch (ctrlIndex)
            {
            case 1:
                //button 1
                if (iButtonsToDisplay < 3)
                {
                    OnOK();
                }
                else
                {
                    OnYes();
                }

                break;

            case 2:
                //button 2
                //Cancel or No
                if (iButtonsToDisplay == 2)
                {
                    OnCancel();
                }
                else
                {
                    OnNo();
                }

                break;

            case 3:
                //icon
                break;

            //nothing
            case 4:
                //text
                break;
                //nothing
            }
        }
        public override void NewMessage(int ctrlIndex, CWindow.WindowMessages message)
        {
            switch (ctrlIndex)
            {
            case NEWGAMEBTN:
                //new game
                if (message == WindowMessages.LeftMouseButtonClicked)
                {
                    OuterSpace.MainTitle.SetState(1);
                    OuterSpace.theGameState.AddState(OuterSpace.GameStates.Interstellar);
                    Close();
                }

                break;

            case LOADGAMEBTN:
                //load game
                break;

            case OPTIONSBTN:
                //options
                if (OuterSpace.theWindowMgr.FindWindow("Game Options") == -1)
                {
                    if (OuterSpace.theWindowMgr.LoadWindow("COptionsWindow", OuterSpace.ClientArea.Center.X - 256, OuterSpace.ClientArea.Center.Y - 256, 512, 512, Color.FromArgb(225, 255, 255, 255)) == true)
                    {
                        OuterSpace.theWindowMgr.DoModal(OuterSpace.theWindowMgr.FindWindow("Game Options"));
                    }
                }

                break;

            case QUITBTN:
                //quit
                if (message == WindowMessages.LeftMouseButtonClicked)
                {
                    OuterSpace.MainTitle.SetState(-1);
                    Close();
                }

                break;
            }
        }
        public override void NewMessage(int ctrlIndex, CWindow.WindowMessages message)
        {
            switch (ctrlIndex)
            {
            case RADBTN800:
                //CCheckbox (radio mode)
                if (message == WindowMessages.LeftMouseButtonClicked)
                {
                    OnRadioBtnClicked(ctrlIndex);
                }

                break;

            case RADBTN1024:
                //CCheckbox (radio mode)
                if (message == WindowMessages.LeftMouseButtonClicked)
                {
                    OnRadioBtnClicked(ctrlIndex);
                }

                break;

            case OKBTN:
                //ok button
                if (message == WindowMessages.LeftMouseButtonClicked)
                {
                    OnOK();
                }

                break;

            case CANCELBTN:
                //cancel button
                if (message == WindowMessages.LeftMouseButtonClicked)
                {
                    Close();
                }

                break;
            }
        }
        public override void NewMessage(int ctrlIndex, CWindow.WindowMessages message)
        {
            switch (ctrlIndex)
            {
            case -1:
                if (message == CWindow.WindowMessages.MessageBoxOK)
                {
                    OnOK();
                }
                break;

            case 1:
                //CStaticText (hyperlink)
                break;

            //nothing
            case 2:
                //CTextbox
                break;

            //nothing
            case 3:
                //CCheckbox
                break;

            //nothing
            case 4:
                //CCheckbox (radio mode)
                if (message == CWindow.WindowMessages.LeftMouseButtonClicked)
                {
                    OnRadioBtnClicked(ctrlIndex);
                }
                break;

            case 5:
                //CCheckbox (radio mode)
                if (message == CWindow.WindowMessages.LeftMouseButtonClicked)
                {
                    OnRadioBtnClicked(ctrlIndex);
                }
                break;

            case 6:
                //CListBox
                break;

            //nothing
            case 7:
                //CButton
                if (message == CWindow.WindowMessages.LeftMouseButtonClicked)
                {
                    CWindow          thisWindow = (CWindow)this;
                    CDropdownListBox aListbox   = (CDropdownListBox)controls[5];
                    OuterSpace.theWindowMgr.MessageBox("You Selected",
                                                       aListbox.GetItemText(aListbox.GetNextSelection(1)), 0, 1, -1, ref thisWindow);

                    //OuterSpace.theWindowMgr.MessageBox("Confirm OK", "Are you sure you want to close the PDA? " + _
                    //"If so, click Yes. If not, click No. Now for a bunch of gibberish to fill space and test things.", 0, 3, -1, Me)
                }

                break;
            }
        }