Пример #1
0
        public override void OnKeyboardDown(SdlDotNet.Input.KeyboardEventArgs e)
        {
            base.OnKeyboardDown(e);
            switch (e.Key)
            {
            case SdlDotNet.Input.Key.LeftArrow: {
                if (page > 0)
                {
                    page--;
                    LoadHelpPage(page);
                    Music.Music.AudioPlayer.PlaySoundEffect("beep1.wav");
                }
            }
            break;

            case SdlDotNet.Input.Key.RightArrow: {
                if (System.IO.File.Exists(IO.Paths.StartupPath + "Help/" + helpFolder + "/" + "page" + (page + 1).ToString() + ".png"))
                {
                    page++;
                    LoadHelpPage(page);
                    Music.Music.AudioPlayer.PlaySoundEffect("beep1.wav");
                }
            }
            break;

            case SdlDotNet.Input.Key.Backspace: {
                // Show the otherackspace key is pressed
                MenuSwitcher.ShowHelpMenu();
                Music.Music.AudioPlayer.PlaySoundEffect("beep3.wav");
            }
            break;
            }
        }
Пример #2
0
        private void SelectItem(int itemNum)
        {
            switch (itemNum)
            {
            case 0: {
                Messenger.SendPacket(TcpPacket.CreatePacket("overwritemove", "0"));
            }
            break;

            case 1: {
                Messenger.SendPacket(TcpPacket.CreatePacket("overwritemove", "1"));
            }
            break;

            case 2: {
                Messenger.SendPacket(TcpPacket.CreatePacket("overwritemove", "2"));
            }
            break;

            case 3: {
                Messenger.SendPacket(TcpPacket.CreatePacket("overwritemove", "3"));
            }
            break;
            }
            MenuSwitcher.CloseAllMenus();
        }
Пример #3
0
        public override void OnKeyboardDown(SdlDotNet.Input.KeyboardEventArgs e)
        {
            if (!loaded)
            {
                return;
            }
            base.OnKeyboardDown(e);
            switch (e.Key)
            {
            case SdlDotNet.Input.Key.Backspace:
            {
                // Show the others menu when the backspace key is pressed
                MenuSwitcher.ShowOthersMenu();
                Music.Music.AudioPlayer.PlaySoundEffect("beep3.wav");
            }
            break;

            case SdlDotNet.Input.Key.LeftArrow:
            {
                // change pages
                SwitchToPage((page + 5) % 3);
                Music.Music.AudioPlayer.PlaySoundEffect("beep4.wav");
            }
            break;

            case SdlDotNet.Input.Key.RightArrow:
            {
                // change pages
                SwitchToPage((page + 1) % 3);
                Music.Music.AudioPlayer.PlaySoundEffect("beep4.wav");
            }
            break;
            }
        }
Пример #4
0
        private void SelectItem(int selectedItem)
        {
            switch (selectedItem)
            {
            case 0:
            {         // Join tournament / Spectate
                if (mode == Enums.TournamentListingMode.Join)
                {
                    Messenger.SendJoinTournament(selectedListing.TournamentID);
                }
                else if (mode == Enums.TournamentListingMode.Spectate)
                {
                    Messenger.SendSpectateTournament(selectedListing.TournamentID);
                }
                MenuSwitcher.CloseAllMenus();
            }
            break;

            case 1:
            {         // View tournament rules
                Messenger.SendViewTournamentRules(selectedListing.TournamentID);
                MenuSwitcher.CloseAllMenus();
            }
            break;
            }
        }
Пример #5
0
        private void SelectItem(int selectedItem)
        {
            switch (selectedItem)
            {
            case 0:
            {         // buy/sell item
                if (itemNum > 0)
                {
                    if (transaction == Enums.InvMenuType.Buy)
                    {
                        if (Items.ItemHelper.Items[itemNum].StackCap > 0 || Items.ItemHelper.Items[itemNum].Type == Enums.ItemType.Currency)
                        {
                            if (nudAmount.Value > 0)
                            {
                                Messenger.TradeRequest(nudAmount.Value, itemSlot);
                            }
                            else
                            {
                                //say you must buy a number of items greater than 0.
                                Music.Music.AudioPlayer.PlaySoundEffect("beep3.wav");
                            }
                        }
                        else
                        {
                            Messenger.TradeRequest(0, itemSlot);
                        }
                    }
                    else if (transaction == Enums.InvMenuType.Sell)
                    {
                        if (Items.ItemHelper.Items[itemNum].StackCap > 0 || Items.ItemHelper.Items[itemNum].Type == Enums.ItemType.Currency)
                        {
                            if (nudAmount.Value > 0)
                            {
                                Messenger.SellItem(nudAmount.Value, itemNum);
                            }
                            else
                            {
                                //say you must sell a number of items greater than 0.
                                Music.Music.AudioPlayer.PlaySoundEffect("beep3.wav");
                            }
                        }
                        else
                        {
                            Messenger.SellItem(0, itemNum);
                        }
                    }
                }
                CloseMenu();
            }
            break;

            case 1:
            {         // View item summary
                MenuSwitcher.ShowItemSummary(itemNum, itemSlot, transaction);
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;
            }
        }
Пример #6
0
        private void SelectItem(int selectedItem)
        {
            switch (selectedItem)
            {
            case 0:
            {         // deposit/withdraw item
                if (itemNum > 0)
                {
                    if (transaction == Enums.InvMenuType.Store)
                    {
                        if (Items.ItemHelper.Items[itemNum].StackCap > 0 || Items.ItemHelper.Items[itemNum].Type == Enums.ItemType.Currency)
                        {
                            if (nudAmount.Value > 0)
                            {
                                Messenger.BankDeposit(itemSlot, nudAmount.Value);
                            }
                            else
                            {
                                //say you must store a number of items greater than 0.
                                Music.Music.AudioPlayer.PlaySoundEffect("beep3.wav");
                            }
                        }
                        else
                        {
                            Messenger.BankDeposit(itemSlot, 0);
                        }
                    }
                    else if (transaction == Enums.InvMenuType.Take)
                    {
                        if (Items.ItemHelper.Items[itemNum].StackCap > 0 || Items.ItemHelper.Items[itemNum].Type == Enums.ItemType.Currency)
                        {
                            if (nudAmount.Value > 0)
                            {
                                Messenger.BankWithdraw(itemSlot + 1, nudAmount.Value);
                            }
                            else
                            {
                                //say you must take a number of items greater than 0.
                                Music.Music.AudioPlayer.PlaySoundEffect("beep3.wav");
                            }
                        }
                        else
                        {
                            Messenger.BankWithdraw(itemSlot + 1, 0);
                        }
                    }
                }
                CloseMenu();
            }
            break;

            case 1:
            {         // View item summary
                MenuSwitcher.ShowItemSummary(itemNum, itemSlot, transaction);
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;
            }
        }
Пример #7
0
 void btnShowHelp_Click(object sender, MouseButtonEventArgs e)
 {
     if (lstHelpTopics.SelectedItems.Count > 0)
     {
         MenuSwitcher.ShowHelpPage(((ListBoxTextItem)lstHelpTopics.SelectedItems[0]).Text, 0);
         Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
     }
 }
Пример #8
0
        void btnAccept_Click(object sender, MouseButtonEventArgs e)
        {
            String sound = "";

            if (lstSound.SelectedItems.Count > 0)
            {
                sound = ((ListBoxTextItem)lstSound.SelectedItems[0]).Text;
            }
            Messenger.SendAddSoundRequest(sound);
            MenuSwitcher.CloseAllMenus();
            Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
        }
Пример #9
0
 public override void OnKeyboardDown(SdlDotNet.Input.KeyboardEventArgs e)
 {
     base.OnKeyboardDown(e);
     switch (e.Key)
     {
     case SdlDotNet.Input.Key.Backspace: {
         // Show the others menu when the backspace key is pressed
         MenuSwitcher.ShowOthersMenu();
         Music.Music.AudioPlayer.PlaySoundEffect("beep3.wav");
     }
     break;
     }
 }
Пример #10
0
        private void SelectItem(int itemNum, int jobSlot)
        {
            if (Players.PlayerManager.MyPlayer.JobList.Jobs[jobSlot].Accepted == Enums.JobStatus.Finished ||
                Players.PlayerManager.MyPlayer.JobList.Jobs[jobSlot].Accepted == Enums.JobStatus.Failed)
            {
                itemNum++;
            }
            switch (itemNum)
            {
            case 0:
            {         // Accept
                if (Players.PlayerManager.MyPlayer.JobList.Jobs[jobSlot].Accepted == Enums.JobStatus.Obtained ||
                    Players.PlayerManager.MyPlayer.JobList.Jobs[jobSlot].Accepted == Enums.JobStatus.Suspended)
                {
                    Messenger.SendStartMission(jobSlot);
                }
                else if (Players.PlayerManager.MyPlayer.JobList.Jobs[jobSlot].Accepted == Enums.JobStatus.Taken)
                {
                    Messenger.SendCancelJob(jobSlot);
                }
                MenuSwitcher.ShowJobListMenu();
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;

            case 1:
            {         // Description
                MenuSwitcher.ShowJobSummary(Players.PlayerManager.MyPlayer.JobList.Jobs[jobSlot]);
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;

            case 2:
            {         // Delete
                Messenger.SendDeleteJob(jobSlot);
                CloseMenu();
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;

            case 3:
            {         // Send
                Messenger.SendSendMission(jobSlot, txtSend.Text);
                CloseMenu();
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;
            }
        }
Пример #11
0
        public override void OnKeyboardDown(SdlDotNet.Input.KeyboardEventArgs e)
        {
            base.OnKeyboardDown(e);
            switch (e.Key)
            {
            case SdlDotNet.Input.Key.DownArrow:
            {
                if (itemPicker.SelectedItem == MAX_ITEMS)
                {
                    ChangeSelected(0);
                }
                else
                {
                    ChangeSelected(itemPicker.SelectedItem + 1);
                }
                Music.Music.AudioPlayer.PlaySoundEffect("beep1.wav");
            }
            break;

            case SdlDotNet.Input.Key.UpArrow:
            {
                if (itemPicker.SelectedItem == 0)
                {
                    ChangeSelected(MAX_ITEMS);
                }
                else
                {
                    ChangeSelected(itemPicker.SelectedItem - 1);
                }
                Music.Music.AudioPlayer.PlaySoundEffect("beep1.wav");
            }
            break;

            case SdlDotNet.Input.Key.Return:
            {
                SelectItem(itemPicker.SelectedItem);
            }
            break;

            case SdlDotNet.Input.Key.Backspace:
            {
                // Show the main menu when the backspace key is pressed
                MenuSwitcher.ShowMainMenu();
                Music.Music.AudioPlayer.PlaySoundEffect("beep3.wav");
            }
            break;
            }
        }
Пример #12
0
        private void MenuBack()
        {
            switch (originalMenu)
            {
            case Enums.InvMenuType.Use:
            {
                MenuSwitcher.ShowInventoryMenu(itemSlot);
                Music.Music.AudioPlayer.PlaySoundEffect("beep3.wav");
            }
            break;

            case Enums.InvMenuType.Store:
            {
                MenuSwitcher.ShowBankDepositMenu(itemSlot);
                Music.Music.AudioPlayer.PlaySoundEffect("beep3.wav");
            }
            break;

            case Enums.InvMenuType.Take:
            {
                MenuSwitcher.ShowBankWithdrawMenu(itemSlot);
                Music.Music.AudioPlayer.PlaySoundEffect("beep3.wav");
            }
            break;

            case Enums.InvMenuType.Sell:
            {
                MenuSwitcher.ShowShopSellMenu(itemSlot);
                Music.Music.AudioPlayer.PlaySoundEffect("beep3.wav");
            }

            break;

            case Enums.InvMenuType.Buy:
            {
                MenuSwitcher.ShowShopBuyMenu(itemSlot);
                Music.Music.AudioPlayer.PlaySoundEffect("beep3.wav");
            }

            break;

            case Enums.InvMenuType.Recycle:
            {
            }

            break;
            }
        }
Пример #13
0
        void btnAccept_Click(object sender, MouseButtonEventArgs e)
        {
            int weather = lstSound.SelectedIndex;

            if (weather == -1)
            {
                return;
            }
            weather++;
            if (weather > 5)
            {
                weather++;
            }
            Messenger.SendWeatherRequest(weather);
            MenuSwitcher.CloseAllMenus();
            Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
        }
Пример #14
0
        private void SelectItem(int itemNum)
        {
            switch (itemNum)
            {
            case 0: {
                MenuSwitcher.ShowShopBuyMenu(0);
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;

            case 1: {
                MenuSwitcher.ShowShopSellMenu(1);
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;
            }
        }
Пример #15
0
        private void SelectItem(int itemNum)
        {
            switch (itemNum)
            {
            case 0:
            {
                MenuSwitcher.ShowMovesMenu();
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;

            case 1:
            {
                MenuSwitcher.ShowInventoryMenu(1);
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;

            case 2:
            {
                MenuSwitcher.ShowTeamMenu();
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;

            //case 3: {
            //        MenuSwitcher.ShowGuildMenu();
            //        Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            //    }
            //    break;
            case 3:
            {
                MenuSwitcher.ShowJobListMenu();
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;

            case 4:
            {
                MenuSwitcher.ShowOthersMenu();
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;
            }
        }
Пример #16
0
        private void SelectItem(int itemNum)
        {
            switch (itemNum)
            {
            case 0:
            {
                MenuSwitcher.ShowBankDepositMenu(1);
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;

            case 1:
            {
                MenuSwitcher.ShowBankWithdrawMenu(0);
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;
            }
        }
Пример #17
0
        private void SelectItem(int itemNum)
        {
            switch (itemNum)
            {
            case 0:
            {
                Windows.WindowSwitcher.GameWindow.MenuManager.CloseOpenMenus();
                Windows.WindowSwitcher.GameWindow.MenuManager.AddMenu(new Menus.mnuOptions("mnuOptions"));
                Windows.WindowSwitcher.GameWindow.MenuManager.SetActiveMenu("mnuOptions");
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;

            case 1:
            {
                MenuSwitcher.ShowMenu(new Menus.mnuOnlineList("mnuOnlineList"));
                Network.Messenger.SendOnlineListRequest();
            }
            break;

            case 2:
            {
                Menus.MenuSwitcher.ShowMenu(new Menus.mnuBattleLog("mnuBattleLog"));
            }
            break;

            case 3:
            {
                MenuSwitcher.ShowMenu(new Menus.mnuAdventureLog("mnuAdventureLog"));
                Network.Messenger.SendAdventureLogRequest();
            }
            break;

            case 4:
            {         // Help menu
                MenuSwitcher.ShowHelpMenu();
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;
            }
        }
Пример #18
0
        private void SelectItem(int itemNum)
        {
            if (itemNum == 3)
            {
                if (tempAutoSaveSpeed < 10)
                {
                    tempAutoSaveSpeed++;
                    ShowOption(3);
                }
            }
            else if (itemNum < 12)
            {
                tempOptions[itemNum] = !tempOptions[itemNum];
                ShowOption(itemNum);
            }
            else
            {
                //Save method goes here
                IO.Options.PlayerName   = tempOptions[0];
                IO.Options.PlayerDamage = tempOptions[1];
                IO.Options.PlayerBar    = tempOptions[2];

                IO.Options.AutoSaveSpeed = tempAutoSaveSpeed;

                IO.Options.NpcName       = tempOptions[4];
                IO.Options.NpcDamage     = tempOptions[5];
                IO.Options.NpcBar        = tempOptions[6];
                IO.Options.Music         = tempOptions[7];
                IO.Options.Sound         = tempOptions[8];
                IO.Options.SpeechBubbles = tempOptions[9];
                IO.Options.Timestamps    = tempOptions[10];
                IO.Options.AutoScroll    = tempOptions[11];
                ExpKit.Modules.kitChat chat = (ExpKit.Modules.kitChat)Windows.WindowSwitcher.ExpKit.KitContainer.ModuleSwitcher.FindKitModule(Enums.ExpKitModules.Chat);
                chat.SetAutoScroll(IO.Options.AutoScroll);

                IO.Options.SaveXml();
                IO.Options.UpdateActiveOptions();

                MenuSwitcher.ShowMainMenu();
            }
        }
Пример #19
0
 void btnAccept_Click(object sender, MouseButtonEventArgs e)
 {
     Messenger.SendAddSignRequest(txtHouse1.Text, txtHouse2.Text, txtHouse3.Text);
     MenuSwitcher.CloseAllMenus();
     Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
 }
Пример #20
0
 void btnCancel_Click(object sender, MouseButtonEventArgs e)
 {
     MenuSwitcher.CloseAllMenus();
     Music.Music.AudioPlayer.PlaySoundEffect("beep3.wav");
 }
Пример #21
0
 void btnOK_Click(object sender, SdlDotNet.Widgets.MouseButtonEventArgs e)
 {
     Messenger.MakeGuild(txtName.Text);
     MenuSwitcher.CloseAllMenus();
 }
Пример #22
0
 void btnCancel_Click(object sender, SdlDotNet.Widgets.MouseButtonEventArgs e)
 {
     MenuSwitcher.CloseAllMenus();
 }
Пример #23
0
 void btnStepDown_Click(object sender, SdlDotNet.Widgets.MouseButtonEventArgs e)
 {
     Messenger.GuildStepDown();
     MenuSwitcher.CloseAllMenus();
 }
Пример #24
0
        private void SelectItem(int itemNum, int menuType, int recruitSlot)
        {
            if (menuType == 0)
            {
                menuType = 2;
            }
            else if (menuType > 0 && menuType < 4)
            {
                menuType = 1;
            }
            else
            {
                menuType = 0;
            }

            if (menuType == 1 && itemNum == 0)
            {
                //Make Leader
                Network.Messenger.SendSwitchLeader(activeTeamStatus);
                CloseMenu();
            }
            else if (menuType == 1 && itemNum == 1)
            {
                //standby
                Network.Messenger.SendStandbyFromTeam(activeTeamStatus);
                CloseMenu();
            }
            else if (menuType == 0 && itemNum == 0)
            {
                //join team
                int freeSlot = -1;
                for (int i = 1; i < 4; i++)
                {
                    if (Players.PlayerManager.MyPlayer.Team[i] == null || Players.PlayerManager.MyPlayer.Team[i].Loaded == false)
                    {
                        freeSlot = i;
                        break;
                    }
                }
                if (freeSlot == -1)
                {
                    //tell it's not possible
                }
                else
                {
                    Network.Messenger.SendAddToTeam(freeSlot, recruitSlot);
                }
                CloseMenu();
            }
            else if (menuType == 0 && itemNum == 1)
            {
                //farewell
                Network.Messenger.SendReleaseRecruit(recruitSlot);
                CloseMenu();
                MenuSwitcher.CloseAllMenus();
            }
            else if (menuType == 2 || itemNum == 2)
            {
                //rename
                //if (txtRename.Text != "") {
                Network.Messenger.SendChangeRecruitName(activeTeamStatus, txtRename.Text);
                //}
                CloseMenu();
            }
            Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");

            /*
             * switch (itemNum)
             * {
             *  case 0:
             *      { // Use move
             *          Players.PlayerManager.MyPlayer.UseMove(moveSlot);
             *          CloseMenu();
             *      }
             *      break;
             *  case 1:
             *      { // Shift Up
             *          if (moveSlot > 0)
             *          {
             *              Players.PlayerManager.MyPlayer.ShiftMove(moveSlot, true);
             *              CloseMenu();
             *          }
             *      }
             *      break;
             *  case 2:
             *      { // Shift Down
             *          if (moveSlot < 3)
             *          {
             *              Players.PlayerManager.MyPlayer.ShiftMove(moveSlot, false);
             *              CloseMenu();
             *          }
             *      }
             *      break;
             *  case 3:
             *      { // Forget move
             *          Players.PlayerManager.MyPlayer.ForgetMove(moveSlot);
             *          CloseMenu();
             *      }
             *      break;
             * }
             */
        }
Пример #25
0
        private void SelectItem(int itemNum)
        {
            if (!useable && itemNum != 0)
            {
                itemNum++;
            }


            switch (itemNum)
            {
            case 0:    //Hold/remove Item
            {
                if (Players.PlayerManager.MyPlayer.GetActiveRecruit().HeldItemSlot == itemSlot)
                {
                    Messenger.SendRemoveItem(itemSlot);
                }
                else
                {
                    Messenger.SendHoldItem(itemSlot);
                }
            }
            break;

            case 1:
            {         // Use item
                if (Players.PlayerManager.MyPlayer.GetInvItemNum(itemSlot) > 0)
                {
                    Messenger.SendUseItem(itemSlot);
                    switch (Items.ItemHelper.Items[Players.PlayerManager.MyPlayer.GetInvItemNum(itemSlot)].Type)
                    {
                    case Enums.ItemType.Key:
                        CloseMenu();
                        break;
                    }
                }
            }
            break;

            case 2:
            {         // Throw
                if (Players.PlayerManager.MyPlayer.GetInvItemNum(itemSlot) > 0)
                {
                    Messenger.SendThrowItem(itemSlot);
                }
            }
            break;

            case 3:
            {         // View item summary
                MenuSwitcher.ShowItemSummary(Players.PlayerManager.MyPlayer.GetInvItemNum(itemSlot), itemSlot, Enums.InvMenuType.Use);
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;

            case 4:
            {         // Drop item
                if (Items.ItemHelper.Items[Players.PlayerManager.MyPlayer.GetInvItemNum(itemSlot)].Type == Enums.ItemType.Currency || Items.ItemHelper.Items[Players.PlayerManager.MyPlayer.GetInvItemNum(itemSlot)].StackCap > 0)
                {
                    Messenger.SendDropItem(itemSlot, nudAmount.Value);
                }
                else
                {
                    Messenger.SendDropItem(itemSlot, 0);
                }
            }
            break;
            }
            Windows.WindowSwitcher.GameWindow.MenuManager.RemoveMenu(this);
            Windows.WindowSwitcher.GameWindow.MenuManager.SetActiveMenu("mnuInventory");
        }
Пример #26
0
 void btnCancel_Click(object sender, MouseButtonEventArgs e)
 {
     Network.Messenger.SendPacket(PMDCP.Sockets.TcpPacket.CreatePacket("endplayertrade"));
     MenuSwitcher.CloseAllMenus();
     Music.Music.AudioPlayer.PlaySoundEffect("beep3.wav");
 }
Пример #27
0
 void btnAccept_Click(object sender, MouseButtonEventArgs e)
 {
     Messenger.SendAddShopRequest(nudAmount.Value);
     MenuSwitcher.CloseAllMenus();
     Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
 }
Пример #28
0
        public override void OnKeyboardDown(SdlDotNet.Input.KeyboardEventArgs e)
        {
            if (RecallMoves.Count == 0)
            {
                return;
            }
            if (loaded)
            {
                base.OnKeyboardDown(e);
                switch (e.Key)
                {
                case SdlDotNet.Input.Key.DownArrow:
                {
                    if (itemPicker.SelectedItem >= 9 || currentTen * 10 + itemPicker.SelectedItem >= RecallMoves.Count - 1)
                    {
                        ChangeSelected(0);
                        //DisplayItems(1);
                    }
                    else
                    {
                        ChangeSelected(itemPicker.SelectedItem + 1);
                    }
                    Music.Music.AudioPlayer.PlaySoundEffect("beep1.wav");
                }
                break;

                case SdlDotNet.Input.Key.UpArrow:
                {
                    if (itemPicker.SelectedItem <= 0)
                    {
                        ChangeSelected(9);
                    }
                    else
                    {
                        ChangeSelected(itemPicker.SelectedItem - 1);
                    }
                    if (currentTen * 10 + itemPicker.SelectedItem > RecallMoves.Count)
                    {
                        ChangeSelected(RecallMoves.Count - currentTen * 10 - 1);
                    }
                    Music.Music.AudioPlayer.PlaySoundEffect("beep1.wav");
                }
                break;

                case SdlDotNet.Input.Key.LeftArrow:
                {
                    //int itemSlot = (currentTen + 1) - 10;//System.Math.Max(1, GetSelectedItemSlot() - (11 - itemPicker.SelectedItem));
                    if (currentTen <= 0)
                    {
                        currentTen = ((RecallMoves.Count - 1) / 10);
                    }
                    else
                    {
                        currentTen--;
                    }
                    if (currentTen * 10 + itemPicker.SelectedItem >= RecallMoves.Count)
                    {
                        ChangeSelected(RecallMoves.Count - currentTen * 10 - 1);
                    }
                    DisplayItems(currentTen * 10);
                    lblItemNum.Text = (currentTen + 1) + "/" + ((RecallMoves.Count - 1) / 10 + 1);
                    Music.Music.AudioPlayer.PlaySoundEffect("beep4.wav");
                }
                break;

                case SdlDotNet.Input.Key.RightArrow:
                {
                    //int itemSlot = currentTen + 1 + 10;
                    if (currentTen >= ((RecallMoves.Count - 1) / 10))
                    {
                        currentTen = 0;
                    }
                    else
                    {
                        currentTen++;
                    }
                    if (currentTen * 10 + itemPicker.SelectedItem >= RecallMoves.Count)
                    {
                        ChangeSelected(RecallMoves.Count - currentTen * 10 - 1);
                    }
                    DisplayItems(currentTen * 10);
                    lblItemNum.Text = (currentTen + 1) + "/" + ((RecallMoves.Count - 1) / 10 + 1);
                    Music.Music.AudioPlayer.PlaySoundEffect("beep4.wav");
                }
                break;

                case SdlDotNet.Input.Key.Return:
                {
                    if (GetSelectedItemSlot() > -1 && GetSelectedItemSlot() < RecallMoves.Count && RecallMoves[GetSelectedItemSlot()] > -1)
                    {
                        //Windows.WindowSwitcher.GameWindow.MenuManager.AddMenu(new Menus.mnuRecallMoveSelected("mnuRecallMoveSelected", GetSelectedItemSlot()));
                        //Windows.WindowSwitcher.GameWindow.MenuManager.SetActiveMenu("mnuRecallMoveSelected");

                        Network.Messenger.SendRecallMove(RecallMoves[GetSelectedItemSlot()]);
                        MenuSwitcher.CloseAllMenus();
                    }
                }
                break;
                }
            }
        }
Пример #29
0
 void btnMyHouse_Click(object sender, MouseButtonEventArgs e)
 {
     Messenger.SendHouseVisitRequest(Players.PlayerManager.MyPlayer.Name);
     MenuSwitcher.CloseAllMenus();
     Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
 }
Пример #30
0
        public override void OnKeyboardDown(SdlDotNet.Input.KeyboardEventArgs e)
        {
            base.OnKeyboardDown(e);
            switch (e.Key)
            {
            case SdlDotNet.Input.Key.DownArrow: {
                if (itemPicker.SelectedItem == MAX_ITEMS)
                {
                    ChangeSelected(0);
                }
                else
                {
                    ChangeSelected(itemPicker.SelectedItem + 1);
                }
                Music.Music.AudioPlayer.PlaySoundEffect("beep1.wav");
            }
            break;

            case SdlDotNet.Input.Key.UpArrow: {
                if (itemPicker.SelectedItem == 0)
                {
                    ChangeSelected(MAX_ITEMS);
                }
                else
                {
                    ChangeSelected(itemPicker.SelectedItem - 1);
                }
                Music.Music.AudioPlayer.PlaySoundEffect("beep1.wav");
            }
            break;

            case SdlDotNet.Input.Key.LeftArrow: {
                if (itemPicker.SelectedItem == 3)
                {
                    if (tempAutoSaveSpeed > 0)
                    {
                        tempAutoSaveSpeed--;
                        ShowOption(3);
                    }
                }
                else if (itemPicker.SelectedItem != 12)
                {
                    SelectItem(itemPicker.SelectedItem);
                }
                Music.Music.AudioPlayer.PlaySoundEffect("beep4.wav");
            }
            break;

            case SdlDotNet.Input.Key.RightArrow: {
                if (itemPicker.SelectedItem == 3)
                {
                    if (tempAutoSaveSpeed < 10)
                    {
                        tempAutoSaveSpeed++;
                        ShowOption(3);
                    }
                }
                else if (itemPicker.SelectedItem != 12)
                {
                    SelectItem(itemPicker.SelectedItem);
                }
                Music.Music.AudioPlayer.PlaySoundEffect("beep4.wav");
            }
            break;

            case SdlDotNet.Input.Key.Return: {
                SelectItem(itemPicker.SelectedItem);
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;

            case SdlDotNet.Input.Key.Backspace: {
                // goes to the main menu; should it?
                MenuSwitcher.ShowOthersMenu();
                Music.Music.AudioPlayer.PlaySoundEffect("beep3.wav");
            }
            break;
            }
        }