Exemple #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // Set properties for controls (1/2)
            Topmost = Depot.AlwaysOnTop;
            if (!Depot.InUse)
            {
                if (Depot.StartX != double.MinValue && Depot.StartY != double.MinValue)
                {
                    Left = Depot.StartX;
                    Top  = Depot.StartY;
                }
            }
            Depot.CurrentMode = Depot.StartMode;
            // In use
#if DEBUG
            // Do not popup in use message in Debug
#else
            if (Depot.InUse)
            {
                MessageBox.Show(string.Format(Translate("{0}._{1}", true),
                                              Translate("ikas_has_started,_or_ikas_failed_to_exit_normally"),
                                              Translate("after_you_solve_the_problems_above,_if_this_error_message_continues_to_appear,_please_consider_submitting_the_issue.")
                                              ), "Ikas", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
#endif
            Depot.InUse = true;
            // Check cookie
            if (Depot.Cookie == null || Depot.Cookie == "")
            {
                MessageBox.Show(Translate("welcome_to_ikas!_to_use_ikas,_you_may_set_up_your_cookie_first.", true), "Ikas", MessageBoxButton.OK, MessageBoxImage.Information);
                MenuItemSettings_Click(null, null);
            }
            // Automatic schedule and shift, battle, and job update
            if ((Depot.Cookie != null && Depot.Cookie != "") || Depot.UseSplatoon2InkApi)
            {
                tmSchedule.Start();
                tmShift.Start();
            }
            if (Depot.Cookie != null && Depot.Cookie != "")
            {
                tmBattle.Start();
                tmJob.Start();
            }
            // Update schedule or shift
            switch (Depot.CurrentMode)
            {
            case Depot.Mode.regular_battle:
            case Depot.Mode.ranked_battle:
            case Depot.Mode.league_battle:
                Depot.ForceGetSchedule();
                break;

            case Depot.Mode.salmon_run:
                Depot.ForceGetShift();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemple #2
0
 private void CookieUpdated()
 {
     // Automatic schedule and battle update
     if ((Depot.Cookie != null && Depot.Cookie != "") || Depot.UseSplatoon2InkApi)
     {
         tmSchedule.Start();
         tmShift.Start();
     }
     if (Depot.Cookie != null && Depot.Cookie != "")
     {
         tmBattle.Start();
         tmJob.Start();
     }
     // Force update
     Depot.ForceGetSchedule();
     Depot.ForceGetShift();
 }
Exemple #3
0
        private void LbMode_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            switch (Depot.CurrentMode)
            {
            case Depot.Mode.regular_battle:
                Depot.CurrentMode = Depot.Mode.ranked_battle;
                // Update schedule
                Depot.ForceGetSchedule();
                ((Storyboard)FindResource("fade_out")).Begin(spJob);
                // Automatic schedule update
                tmSchedule.Start();
                break;

            case Depot.Mode.ranked_battle:
                Depot.CurrentMode = Depot.Mode.league_battle;
                // Update schedule
                Depot.ForceGetSchedule();
                ((Storyboard)FindResource("fade_out")).Begin(spJob);
                // Automatic schedule update
                tmSchedule.Start();
                break;

            case Depot.Mode.league_battle:
                Depot.CurrentMode = Depot.Mode.salmon_run;
                // Update shift
                Depot.ForceGetShift();
                ((Storyboard)FindResource("fade_out")).Begin(spBattle);
                // Automatic shift update
                tmShift.Start();
                break;

            case Depot.Mode.salmon_run:
                Depot.CurrentMode = Depot.Mode.regular_battle;
                // Update schedule
                Depot.ForceGetSchedule();
                ((Storyboard)FindResource("fade_out")).Begin(spJob);
                // Automatic schedule update
                tmSchedule.Start();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }