Beispiel #1
0
 void SimplePressed()
 {
     var sg = new SelectGame();
     sg.gameid = "simple";
     ConnectionProxy.Connection.SendMessage(sg, (jdata) => {
         Debug.Log ("Parsed select game response");
         m_resp = new SelectGameResponse(jdata);
         m_shouldTransition = true;
     });
 }
Beispiel #2
0
        private void AddNewJet()
        {
            ZipForm.existingJetFile = "";
            string path = BrowseForFile("Browse for an existing .jet file", "jet", "Jet files (*.jet)|*.jet|All files (*.*)|*.*", "");

            if (Guard.IsStringValid(path) && path.Contains(".jet"))
            {
                SelectGame select = new SelectGame(path);
                select.Show();
            }
        }
Beispiel #3
0
 private void Main_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F5)
     {
         if (NKHook.CanUseNKH() && CurrentProjectVariables.UseNKHook == true)
         {
             CompileJet("launch nkh");
         }
         else
         {
             CompileJet("launch");
         }
     }
     if (e.Control && e.KeyCode == Keys.N)
     {
         SelectGame select = new SelectGame();
         select.Show();
     }
     if (e.Control && e.KeyCode == Keys.S)
     {
         CompileJet("output");
     }
 }
        public MainViewModel(INavigationService navigationService, IPageDialogService pageDialogService)
        {
            NavigationService = navigationService;
            PageDialogService = pageDialogService;

            BeginCommand = new DelegateCommand(async() =>
            {
                try
                {
                    Runtime.Environment.BattleTask.Add(new BattleTask {
                        Game = SelectGame, DeckID = SelectDeck.id, QuestID = SelectQuest.Id, QuestPhase = QuestPhase
                    });
                    await PageDialogService.DisplayAlertAsync("成功", "添加任务成功", "OK");
                }
                catch (Exception e)
                {
                    await PageDialogService.DisplayAlertAsync("错误", e.Message, "OK");
                }
            });
            BeginAllCommand = new DelegateCommand(async() =>
            {
                try
                {
                    var result = await PageDialogService.DisplayAlertAsync("提示", "是否添加到所有账号?", "是", "否");
                    if (result)
                    {
                        foreach (var game in Environment.Game)
                        {
                            Runtime.Environment.BattleTask.Add(new BattleTask {
                                Game = game, DeckID = game.Deck.First().id, QuestID = SelectQuest.Id, QuestPhase = QuestPhase
                            });
                        }

                        await PageDialogService.DisplayAlertAsync("成功", "添加任务成功", "OK");
                    }
                }
                catch (Exception e)
                {
                    await PageDialogService.DisplayAlertAsync("错误", e.Message, "OK");
                }
            });
            GachaCommand = new DelegateCommand(async() =>
            {
                try
                {
                    await SelectGame.fgo_gachadraw(1, 10);
                    MessagingCenter.Send(new LogMessage(SelectGame, "友情抽取成功."), "Log");
                }
                catch (Exception e)
                {
                    await PageDialogService.DisplayAlertAsync("错误", e.Message, "OK");
                }
            });
            APCommand = new DelegateCommand(async() =>
            {
                try
                {
                    await SelectGame.RecoverAP(SelectAPFunc);
                    await PageDialogService.DisplayAlertAsync("成功", "体力恢复成功", "OK");
                }
                catch (Exception e)
                {
                    await PageDialogService.DisplayAlertAsync("错误", e.Message, "OK");
                }
            });
            SellCommand = new DelegateCommand(async() =>
            {
                try
                {
                    await SelectGame.Sell();
                }
                catch (Exception e)
                {
                    await PageDialogService.DisplayAlertAsync("错误", e.Message, "OK");
                }
            });

            AddCommand   = new DelegateCommand(async() => { await NavigationService.NavigateAsync("Login"); });
            StartCommand = new DelegateCommand <Game>(async(game) =>
            {
                game.IsStart = true;
                await game.Login();
            });
            StopCommand = new DelegateCommand <Game>(async(game) =>
            {
                game.IsStart = false;
            });
            HomeCommand = new DelegateCommand <Game>(async(game) =>
            {
                await game.fgo_home();
                MessagingCenter.Send(new LogMessage(game, "刷新成功."), "Log");
            });

            LoadConfig();
        }
Beispiel #5
0
 public Task SelectGame(SelectGame command) => Send(command);