Пример #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var form = new GameDialog();

            var gameState = RequestHandler.StartProgram();

            form.DisplayGameState(gameState);

            form.NewGameClicked += () =>
            {
                var newGameState = RequestHandler.StartNewGame();
                form.DisplayGameState(newGameState);
            };

            form.CellClicked += coordinates =>
            {
                var nextGameState = RequestHandler.PlayTurn(coordinates);
                form.DisplayGameState(nextGameState);
            };

            Application.Run(form);
        }
Пример #2
0
 public void UpdateGameDialog(GameDialogSettings settings)
 {
     if (InvokeRequired)
     {
         Invoke(UpdateDialog, new object[] { settings });
     }
     else
     {
         GameDialog.Settings = settings;
         GameDialog.LoadSettings();
     }
 }
Пример #3
0
    public void StartStep(TutorialScript ts, Player player)
    {
        this.ts = ts;
        player.InputController.EnableMoveInput     = false;
        player.InputController.EnableTurningAround = false;
        player.InputController.EnableShootingInput = false;
        player.InputController.CameraRotation      = Vector2.zero;
        guis.EnableTutorialOKButton(true);
        GameDialog dialog = GameUIScript.GetGameUIScript().GetDialog();

        dialog.SetText("\nCONGRATS! YOU'VE COMPLETED THE CALL OF MINI BOOTCAMP! READY TO GO INTO BATTLE?");
        dialog.Show();
    }
Пример #4
0
    public void StartStep(TutorialScript ts, Player player)
    {
        this.ts = ts;
        player.InputController.EnableMoveInput     = false;
        player.InputController.EnableTurningAround = false;
        player.InputController.EnableShootingInput = false;
        player.InputController.CameraRotation      = Vector2.zero;
        guis.EnableTutorialOKButton(true);

        GameDialog dialog = GameUIScript.GetGameUIScript().GetDialog();

        dialog.SetText("\nTAP AND SLIDE ON THE SCREEN TO ADJUST YOUR LINE OF SIGHT, THEN AIM AT THE BOX IN FRONT OF YOU.");
        dialog.Show();
    }
Пример #5
0
    public void StartStep(TutorialScript ts, Player player)
    {
        this.ts = ts;
        player.InputController.EnableMoveInput     = false;
        player.InputController.EnableTurningAround = false;
        player.InputController.EnableShootingInput = false;
        player.InputController.CameraRotation      = Vector2.zero;
        guis.EnableTutorialOKButton(true);

        GameDialog dialog = GameUIScript.GetGameUIScript().GetDialog();

        dialog.SetText("\nOK, NOW YOU'RE READY TO TRY USING YOUR WEAPON. USE THE RIGHT JOYSTICK TO AIM AT AND SHOOT THE BOX IN FRONT OF YOU.");
        dialog.Show();
    }
Пример #6
0
    public void StartStep(TutorialScript ts, Player player)
    {
        this.ts = ts;
        player.InputController.EnableMoveInput     = false;
        player.InputController.EnableTurningAround = false;
        player.InputController.EnableShootingInput = false;
        player.InputController.CameraRotation      = Vector2.zero;
        guis.EnableTutorialOKButton(true);

        GameDialog dialog = GameUIScript.GetGameUIScript().GetDialog();

        dialog.SetText("\nALRIGHT, NOW THAT YOU'VE GOT DOWN THE BASICS, TRY SHOOTING THE ZOMBIE IN FRONT OF YOU.");
        dialog.Show();
    }
Пример #7
0
    public void StartStep(TutorialScript ts, Player player)
    {
        this.ts = ts;
        player.InputController.EnableMoveInput     = false;
        player.InputController.EnableTurningAround = false;
        player.InputController.EnableShootingInput = false;
        player.InputController.CameraRotation      = Vector2.zero;


        GameObject halo = GameObject.Instantiate(GameApp.GetInstance().GetResourceConfig().halo, player.GetTransform().TransformPoint(Vector3.forward * 15.0f), Quaternion.Euler(90, 0, 0)) as GameObject;

        halo.name = "Halo";

        GameDialog dialog = GameUIScript.GetGameUIScript().GetDialog();

        dialog.SetText("\nUSE THE LEFT JOYSTICK TO WALK AROUND. GO AHEAD AND WALK INTO THE CIRCLE OF PULSATING LIGHT.");
        dialog.Show();

        //dialogText.Rect = uiPos.DesignerText;
    }
Пример #8
0
    void Awake()
    {
        if (GameObject.Find("ResourceConfig") == null)
        {
            GameObject resourceConfig = Object.Instantiate(Resources.Load("ResourceConfig")) as GameObject;
            resourceConfig.name = "ResourceConfig";
            DontDestroyOnLoad(resourceConfig);
        }


        UIResourceMgr.GetInstance().LoadAllGameUIMaterials();
        gameuiMaterial = UIResourceMgr.GetInstance().GetMaterial("GameUI");

        if (Application.loadedLevelName == SceneName.SCENE_TUTORIAL)
        {
            dialog = new GameDialog(UIDialog.DialogMode.TAP_TO_DISMISS);
            dialog.SetText(ConstData.FONT_NAME2, "", ColorName.fontColor_darkorange);
            dialog.SetDialogEventHandler(this);
        }
    }
Пример #9
0
        public void dialog(string text, string title)
        {
            float w = menuScreen.Width;
            float h = menuScreen.Height;
            UniRectangle bounds = new UniRectangle(w * 0.35f, h * 0.4f, w * 0.4f, h * 0.3f);

            if (gameDialog != null && gameDialog.IsOpen)
                gameDialog.Close();

            gameDialog = new GameDialog(text, title, bounds);
            baseGame.dialogOpen = true;
            gameDialog.proceedButton.Pressed += new EventHandler(proceedButton_Pressed);
            if (baseGame.menuOpen)
            {
                menuScreen.Desktop.Children.Add(gameDialog);
            }
            else if (baseGame.createOpen)
            {
                createScreen.Desktop.Children.Add(gameDialog);
            }
            else if (baseGame.startOpen)
            {
                startScreen.Desktop.Children.Add(gameDialog);
            }
            else
            {
                gameScreen.Desktop.Children.Add(gameDialog);
            }
        }
Пример #10
0
    // Use this for initialization
    void Start()
    {
        ResolutionConstant.R = ((float)Screen.width) / 960f;
        UIResourceMgr.GetInstance().LoadStartMenuUIMaterials();    //! 加载开始菜单需要的材质


        uiPos = new StartMenuUIPosition();
        //texPos = new StartMenuTexturePosition();

        //! UIManager
        m_UIManager = gameObject.AddComponent <UIManager>() as UIManager;
        m_UIManager.SetParameter(8, 1, false);
        m_UIManager.SetUIHandler(this);                     //! HandleEvent
        m_UIManager.CLEAR = true;

        startMenuMaterial = UIResourceMgr.GetInstance().GetMaterial("StartMenu");      //! StartMenu 材质
        //startMenu2Material = UIResourceMgr.GetInstance().GetMaterial("StartMenu2");
        Material buttonsMaterial = UIResourceMgr.GetInstance().GetMaterial("Buttons"); //! Button材质

        background = new UIImage();
        background.SetTexture(startMenuMaterial, StartMenuTexturePosition.Background, AutoRect.AutoSize(StartMenuTexturePosition.Background));
        background.Rect = AutoRect.AutoPos(uiPos.Background);


        startButton = new UITextButton();
        startButton.SetTexture(UIButtonBase.State.Normal, buttonsMaterial,

                               ButtonsTexturePosition.ButtonNormal, AutoRect.AutoSize(ButtonsTexturePosition.MiddleSizeButton));
        startButton.SetTexture(UIButtonBase.State.Pressed, buttonsMaterial,

                               ButtonsTexturePosition.ButtonPressed, AutoRect.AutoSize(ButtonsTexturePosition.MiddleSizeButton));

        startButton.Rect = AutoRect.AutoPos(uiPos.StartButton);
        startButton.SetText(ConstData.FONT_NAME1, " NEW GAME", ColorName.fontColor_orange);

        continueButton = new UITextButton();
        continueButton.SetTexture(UIButtonBase.State.Normal, buttonsMaterial,

                                  ButtonsTexturePosition.ButtonNormal, AutoRect.AutoSize(ButtonsTexturePosition.MiddleSizeButton));
        continueButton.SetTexture(UIButtonBase.State.Pressed, buttonsMaterial,

                                  ButtonsTexturePosition.ButtonPressed, AutoRect.AutoSize(ButtonsTexturePosition.MiddleSizeButton));

        continueButton.Rect = AutoRect.AutoPos(uiPos.ContinueButton);

        continueButton.SetText(ConstData.FONT_NAME1, " CONTINUE", ColorName.fontColor_orange);



        gameDialog = new GameDialog(UIDialog.DialogMode.YES_OR_NO);
        gameDialog.SetText(ConstData.FONT_NAME2, "\n\nAre You Sure You Want To Erase Your Progress And Start A New Game?", ColorName.fontColor_darkorange);
        gameDialog.SetDialogEventHandler(this);


        m_UIManager.Add(background);
        m_UIManager.Add(startButton);
        m_UIManager.Add(continueButton);

        m_UIManager.Add(gameDialog);

        GameApp.GetInstance().Init();
        GameCenterInterface.Login();

        string path = Application.dataPath + "/../../Documents/";

        if (File.Exists(path + "MySavedGame.game"))
        {
        }
        else
        {
            continueButton.Visible = false;
            continueButton.Enable  = false;
        }

        FlurryTAd.ShowTAd(true);
    }
Пример #11
0
        public MainWindow()
        {
            Owner = null;

            var app = Application.Current;

            if (app != null)
            {
                app.MainWindow = this;
            }

            _cancelled = false;

            if (_testGameDialog != null)
            {
                Logging.Write("Testing mode");
                var ui = new GameDialog();
                ui.ShowDialogAsync().Forget();
                ((IGameUi)ui).OnResult(JsonConvert.DeserializeObject <Game.Result>(FileUtils.ReadAllText(_testGameDialog)), null);
                _cancelled = true;
            }

            if (_cancelled)
            {
                Close();
                return;
            }

            InitializeSubGroups();

            var downloadsNavigateCommand = new NavigateCommand(this, new Uri("/Pages/Miscellaneous/DownloadsList.xaml", UriKind.Relative));

            DataContext = new ViewModel();
            InputBindings.AddRange(new[] {
                new InputBinding(new NavigateCommand(this, "drive"), new KeyGesture(Key.F1)),
                new InputBinding(new NavigateCommand(this, "lapTimes"), new KeyGesture(Key.F2)),
                new InputBinding(new NavigateCommand(this, "stats"), new KeyGesture(Key.F3)),
                new InputBinding(new NavigateCommand(this, "media"), new KeyGesture(Key.F4)),

                // Second group, Ctrl+F…
                new InputBinding(new NavigateCommand(this, new Uri("/Pages/Lists/CarsListPage.xaml", UriKind.Relative)),
                                 new KeyGesture(Key.F1, ModifierKeys.Control)),
                InternalUtils.IsAllRight ? new InputBinding(new NavigateCommand(this, new Uri("/Pages/Lists/ServerPresetsListPage.xaml", UriKind.Relative)),
                                                            new KeyGesture(Key.F2, ModifierKeys.Control)) : null,

                // Downloads hotkey
                new InputBinding(new DelegateCommand(() => {
                    if (AppAppearanceManager.Instance.DownloadsInSeparatePage)
                    {
                        downloadsNavigateCommand.Execute();
                    }
                    else
                    {
                        this.RequireChild <Popup>("DownloadsPopup").IsOpen = true;
                    }
                }), new KeyGesture(Key.J, ModifierKeys.Control)),

                // Settings, Alt+F…
                new InputBinding(new NavigateCommand(this, new Uri("/Pages/Settings/SettingsPage.xaml", UriKind.Relative)),
                                 new KeyGesture(Key.F1, ModifierKeys.Alt)),
                new InputBinding(new NavigateCommand(this, new Uri("/Pages/AcSettings/AcSettingsPage.xaml", UriKind.Relative)),
                                 new KeyGesture(Key.F2, ModifierKeys.Alt)),
                new InputBinding(new NavigateCommand(this, new Uri("/Pages/Settings/PythonAppsSettings.xaml", UriKind.Relative)),
                                 new KeyGesture(Key.F3, ModifierKeys.Alt)),
            }.NonNull().ToList());

            InitializeComponent();
            ModsWebBrowser.Instance.RebuildLinksNow();
            ArgumentsHandler.HandlePasteEvent(this);

            if (SteamStarter.IsInitialized)
            {
                OverlayContentCell.Children.Add((FrameworkElement)FindResource(@"SteamOverlayFix"));
            }

            LinkNavigator.Commands.Add(new Uri("cmd://enterKey"), Model.EnterKeyCommand);
            InternalUtils.Launch(this);

            foreach (var result in MenuLinkGroups.OfType <LinkGroupFilterable>()
                     .Where(x => x.Source.OriginalString.Contains(@"/online.xaml", StringComparison.OrdinalIgnoreCase)))
            {
                result.LinkChanged += OnlineLinkChanged;
            }

            foreach (var result in MenuLinkGroups.OfType <LinkGroupFilterable>()
                     .Where(x => x.Source.OriginalString.Contains(@"/laptimes_table.xaml", StringComparison.OrdinalIgnoreCase)))
            {
                result.LinkChanged += LapTimesLinkChanged;
            }

            foreach (var result in MenuLinkGroups.OfType <LinkGroupFilterable>()
                     .Where(x => x.GroupKey == "media" || x.GroupKey == "content"))
            {
                result.LinkChanged += ContentLinkChanged;
            }

            UpdateLiveTabs();
            SettingsHolder.Live.PropertyChanged += OnLiveSettingsPropertyChanged;

            UpdateTitleLinks();
            AppAppearanceManager.Instance.PropertyChanged += OnAppAppearancePropertyChanged;

            UpdateMinoratingLink();
            SettingsHolder.Online.PropertyChanged += OnOnlineSettingsPropertyChanged;

            _defaultOnlineGroupCount = OnlineGroup.FixedLinks.Count;

            if (FileBasedOnlineSources.IsInitialized())
            {
                UpdateOnlineSourcesLinks();
            }

            FileBasedOnlineSources.Instance.Update += OnOnlineSourcesUpdate;

            Activated += OnActivated;

            if (SettingsHolder.Drive.SelectedStarterType != SettingsHolder.DriveSettings.SteamStarterType)
            {
                TitleLinks.Remove(OriginalLauncher);
            }
            else
            {
                LinkNavigator.Commands.Add(new Uri("cmd://originalLauncher"), new DelegateCommand(SteamStarter.StartOriginalLauncher));
            }

            ContentInstallationManager.Instance.TaskAdded += OnContentInstallationTaskAdded;
            UpdateDiscordRichPresence();

#if DEBUG
            LapTimesGrid.Source = new Uri("/Pages/Miscellaneous/LapTimes_Grid.xaml", UriKind.Relative);
#else
            // MenuLinkGroups.Remove(BrowserLinkGroup);
#endif
        }
Пример #12
0
        public MainWindow()
        {
            var app = Application.Current;

            if (app != null)
            {
                app.MainWindow = this;
            }

            _cancelled = false;

            if (AppArguments.Values.Any())
            {
                ProcessArguments();
            }

            if (_testGameDialog != null)
            {
                Logging.Write("Testing mode");
                var ui = new GameDialog();
                ui.ShowDialogWithoutBlocking();
                ((IGameUi)ui).OnResult(JsonConvert.DeserializeObject <Game.Result>(FileUtils.ReadAllText(_testGameDialog)), null);
                _cancelled = true;
            }

            if (_cancelled)
            {
                Close();
                return;
            }

            DataContext = new ViewModel();
            InputBindings.AddRange(new[] {
                new InputBinding(new NavigateCommand(this, "about"), new KeyGesture(Key.F1, ModifierKeys.Alt)),
                new InputBinding(new NavigateCommand(this, "settings"), new KeyGesture(Key.F1, ModifierKeys.Control)),
                new InputBinding(new NavigateCommand(this, "drive"), new KeyGesture(Key.F1)),
                new InputBinding(new NavigateCommand(this, "lapTimes"), new KeyGesture(Key.F2)),
                new InputBinding(new NavigateCommand(this, "stats"), new KeyGesture(Key.F3)),
                new InputBinding(new NavigateCommand(this, "media"), new KeyGesture(Key.F4))
            });
            InitializeComponent();

            LinkNavigator.Commands.Add(new Uri("cmd://enterkey"), Model.EnterKeyCommand);
            AppKeyHolder.ProceedMainWindow(this);

            foreach (var result in MenuLinkGroups.OfType <LinkGroupFilterable>()
                     .Where(x => x.Source.OriginalString.Contains(@"/online.xaml", StringComparison.OrdinalIgnoreCase)))
            {
                result.LinkChanged += OnlineLinkChanged;
            }

            foreach (var result in MenuLinkGroups.OfType <LinkGroupFilterable>()
                     .Where(x => x.GroupKey == "content"))
            {
                result.LinkChanged += ContentLinkChanged;
            }

            UpdateLiveTabs();
            SettingsHolder.Live.PropertyChanged += Live_PropertyChanged;

            UpdateServerTab();
            UpdateMinoratingLink();
            SettingsHolder.Online.PropertyChanged += Online_PropertyChanged;

            if (!OfficialStarterNotification() && PluginsManager.Instance.HasAnyNew())
            {
                Toast.Show("Don’t forget to install plugins!", ""); // TODO?
            }

            EntryPoint.HandleSecondInstanceMessages(this, HandleMessagesAsync);

            _defaultOnlineGroupCount = OnlineGroup.FixedLinks.Count;

            if (FileBasedOnlineSources.IsInitialized())
            {
                UpdateOnlineSourcesLinks();
            }
            FileBasedOnlineSources.Instance.Update += OnOnlineSourcesUpdate;

            Activated += OnActivated;

#if DEBUG
            LapTimesGrid.Source = new Uri("/Pages/Miscellaneous/LapTimes_Grid.xaml", UriKind.Relative);
#endif
        }
Пример #13
0
        public void Initialize()
        {
            //load in skin
            //Nuclex.UserInterface.Visuals.Flat.FlatGuiVisualizer.FromResource(

            //retrieve viewport
            viewport = game.GraphicsDevice.Viewport;

            gameScreen = new Screen(viewport.Width, viewport.Height);

            menuScreen = new Screen(viewport.Width, viewport.Height);

            speciesDialog = new SpeciesDialog();
            //set clear button listener
            speciesDialog.clearButton.Pressed += new EventHandler(clearButton_Pressed);
            gameScreen.Desktop.Children.Add(speciesDialog);

            //Dialog test
            GameDialog gameDialog = new GameDialog();
            gameScreen.Desktop.Children.Add(gameDialog);

            //GameUI gameUI = new GameUI(gameScreen, baseGame.spriteSheet);
            gui.Screen = gameScreen;

            //listeners
            mouse.MouseMoved += new Nuclex.Input.Devices.MouseMoveDelegate(mouse_MouseMoved);
            mouse.MouseButtonReleased += new Nuclex.Input.Devices.MouseButtonDelegate(mouse_MouseButtonReleased);
            mouse.MouseWheelRotated += new Nuclex.Input.Devices.MouseWheelDelegate(mouse_MouseWheelRotated);

            keyboard.KeyReleased += new Nuclex.Input.Devices.KeyDelegate(keyboard_KeyReleased);

            keyboard.KeyPressed += new Nuclex.Input.Devices.KeyDelegate(keyboard_KeyPressed);
        }
Пример #14
0
        /// <summary>
        /// Чтение и загрузка ресурсов игры
        /// </summary>
        /// <param name="Folder_game">Путь к папке с игрой</param>
        public void Load(string Folder_game)
        {
            this.Folder_game = Folder_game;
            // Считываем файл локализации
            ArrayList arrSTFiles = GetStringTableFiles();

            // Проверить каждый файл на существование
            foreach (string patch in arrSTFiles)
            {
                if (File.Exists(Folder_game + TEXT_RUS + patch))
                {
                    XmlDocument xDoc = new XmlDocument();
                    xDoc.Load(Folder_game + TEXT_RUS + patch);
                    XmlNode     xStringTable = xDoc.DocumentElement;
                    XmlNodeList xStringList  = xStringTable.SelectNodes("string");
                    foreach (XmlNode xString in xStringList)
                    {
                        Strings.Add(new GameText(xString, Folder_game + TEXT_RUS + patch));
                    }
                }
                else
                {
                    // Вывод в консоль
                }
            }
            // Считываем файлы поршней
            if (Directory.Exists(Folder_game + GAMEDATA))
            {
                // Получили список файлов с поршнями
                ArrayList arrInfoFiles = GetInfoportionsFiles();
                // Проверить каждый файл на существование
                foreach (string patch in arrInfoFiles)
                {
                    if (File.Exists(Folder_game + GAMEPLAY + patch))
                    {
                        // Открыть файл
                        XmlDocument xDoc = new XmlDocument();
                        try
                        {
                            xDoc.Load(Folder_game + GAMEPLAY + patch);
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine($"Ошибка {ex.Message} в файле: {patch}");
                            continue;
                        }
                        finally
                        {
                            XmlNode xRoot = xDoc.DocumentElement;
                            if (xRoot != null)
                            {
                                // Ищем XML диалога
                                XmlNodeList xInfos = xRoot.SelectNodes("info_portion");
                                // Передаём в конструктор диалога строку с XML
                                foreach (XmlNode n in xInfos)
                                {
                                    Infoportion Inf = new Infoportion(n, Folder_game + GAMEPLAY + patch);
                                    //string dlgid = n.Attributes.GetNamedItem("id").Value;
                                    Infoportions.Add(Inf);
                                }
                            }
                        }
                    }
                    else
                    {
                        //Вывод в лог
                    }
                }
                // Получили список файлов с диалогами
                ArrayList arrDialogFiles = GetDialogFiles();
                // Проверить каждый файл на существование
                foreach (string patch in arrDialogFiles)
                {
                    if (File.Exists(Folder_game + GAMEPLAY + patch))
                    {
                        // Открыть файл
                        XmlDocument xDoc = new XmlDocument();
                        xDoc.Load(Folder_game + GAMEPLAY + patch);
                        XmlNode xRoot = xDoc.DocumentElement;
                        // Ищем XML диалога
                        XmlNodeList xDialogs = xRoot.SelectNodes("dialog");
                        // Передаём в конструктор диалога строку с XML
                        foreach (XmlNode n in xDialogs)
                        {
                            GameDialog Dlg = new GameDialog(n, Folder_game + GAMEPLAY + patch);
                            //string dlgid = n.Attributes.GetNamedItem("id").Value;
                            Dialogs.Add(Dlg);
                        }
                    }
                    else
                    {
                        //Вывод в лог
                    }
                }
            }
            else
            {
                throw new Exception("В папке с игрой не найдена папка 'gamedata' \n распакуйте *.db архивы и перезапустите программу.");
                //MessageBox.Show(
                //    "В папке с игрой не найдена папка 'gamedata' \n распакуйте *.db архивы и перезапустите программу.",
                //    "Ошибка",
                //    MessageBoxButton.OK,
                //    MessageBoxImage.Information,
                //    MessageBoxResult.OK,
                //    MessageBoxOptions.DefaultDesktopOnly);
            }
        }
Пример #15
0
        public MainWindow()
        {
            var app = Application.Current;

            if (app != null)
            {
                app.MainWindow = this;
            }

            _cancelled = false;

            if (_testGameDialog != null)
            {
                Logging.Write("Testing mode");
                var ui = new GameDialog();
                ui.ShowDialogWithoutBlocking();
                ((IGameUi)ui).OnResult(JsonConvert.DeserializeObject <Game.Result>(FileUtils.ReadAllText(_testGameDialog)), null);
                _cancelled = true;
            }

            if (_cancelled)
            {
                Close();
                return;
            }

            InitializeSubGroups();
            DataContext = new ViewModel();
            InputBindings.AddRange(new[] {
                new InputBinding(new NavigateCommand(this, "content"), new KeyGesture(Key.F1, ModifierKeys.Control)),
                new InputBinding(new NavigateCommand(this, "server"), new KeyGesture(Key.F2, ModifierKeys.Control)),
                new InputBinding(new NavigateCommand(this, "settings"), new KeyGesture(Key.F3, ModifierKeys.Control)),
                new InputBinding(new NavigateCommand(this, "about"), new KeyGesture(Key.F4, ModifierKeys.Control)),
                new InputBinding(new NavigateCommand(this, "drive"), new KeyGesture(Key.F1)),
                new InputBinding(new NavigateCommand(this, "lapTimes"), new KeyGesture(Key.F2)),
                new InputBinding(new NavigateCommand(this, "stats"), new KeyGesture(Key.F3)),
                new InputBinding(new NavigateCommand(this, "media"), new KeyGesture(Key.F4)),
                new InputBinding(new DelegateCommand(() => {
                    if (Keyboard.FocusedElement is TextBoxBase || Keyboard.FocusedElement is CheckBox)
                    {
                        return;
                    }

                    try {
                        if (Clipboard.ContainsData(DataFormats.FileDrop))
                        {
                            var data = Clipboard.GetFileDropList().OfType <string>().ToList();
                            Dispatcher.InvokeAsync(() => {
                                ProcessDroppedFiles(data);
                            });
                        }
                        else if (Clipboard.ContainsData(DataFormats.UnicodeText))
                        {
                            var list = Clipboard.GetText().SplitLines();
                            Dispatcher.InvokeAsync(() => {
                                ProcessDroppedFiles(list);
                            });
                        }
                    } catch (Exception e) {
                        Logging.Warning(e);
                    }
                }), new KeyGesture(Key.V, ModifierKeys.Control)),
            });
            InitializeComponent();

            LinkNavigator.Commands.Add(new Uri("cmd://enterkey"), Model.EnterKeyCommand);
            AppKeyHolder.ProceedMainWindow(this);

            foreach (var result in MenuLinkGroups.OfType <LinkGroupFilterable>()
                     .Where(x => x.Source.OriginalString.Contains(@"/online.xaml", StringComparison.OrdinalIgnoreCase)))
            {
                result.LinkChanged += OnlineLinkChanged;
            }

            foreach (var result in MenuLinkGroups.OfType <LinkGroupFilterable>()
                     .Where(x => x.Source.OriginalString.Contains(@"/laptimes_table.xaml", StringComparison.OrdinalIgnoreCase)))
            {
                result.LinkChanged += LapTimesLinkChanged;
            }

            foreach (var result in MenuLinkGroups.OfType <LinkGroupFilterable>()
                     .Where(x => x.GroupKey == "media" || x.GroupKey == "content"))
            {
                result.LinkChanged += ContentLinkChanged;
            }

            UpdateLiveTabs();
            SettingsHolder.Live.PropertyChanged += OnLiveSettingsPropertyChanged;

            UpdateServerTab();
            UpdateMinoratingLink();
            SettingsHolder.Online.PropertyChanged += OnOnlineSettingsPropertyChanged;

            if (!OfficialStarterNotification() && PluginsManager.Instance.HasAnyNew())
            {
                Toast.Show("Don’t forget to install plugins!", ""); // TODO?
            }

            _defaultOnlineGroupCount = OnlineGroup.FixedLinks.Count;

            if (FileBasedOnlineSources.IsInitialized())
            {
                UpdateOnlineSourcesLinks();
            }

            FileBasedOnlineSources.Instance.Update += OnOnlineSourcesUpdate;

            Activated += OnActivated;

            if (SettingsHolder.Drive.SelectedStarterType != SettingsHolder.DriveSettings.SteamStarterType)
            {
                TitleLinks.Remove(OriginalLauncher);
            }
            else
            {
                LinkNavigator.Commands.Add(new Uri("cmd://originalLauncher"), new DelegateCommand(SteamStarter.StartOriginalLauncher));
            }

            ContentInstallationManager.PluginsNavigator = this;

#if DEBUG
            LapTimesGrid.Source = new Uri("/Pages/Miscellaneous/LapTimes_Grid.xaml", UriKind.Relative);
#endif
        }