private string BrowseForServerExePath()
        {
            var selectedFile = FileOperationsHelper.BrowseForGta5Exe();

            if (!IsValidGtMpServerPath(selectedFile))
            {
                return(null);
            }

            _settings.ServerHostPath = selectedFile;
            _settingsProvider.SaveSettings(_settings);
            return(selectedFile);
        }
Пример #2
0
        private void BrowseGameFileClicked()
        {
            var selectedFile = FileOperationsHelper.BrowseForGta5Exe();

            if (!File.Exists(selectedFile))
            {
                NotificationService.ShowNotification("Invalid file selected.", true);
                return;
            }

            Settings.GamePath = selectedFile;
            RaisePropertyChanged(nameof(Settings));
        }
Пример #3
0
        private string BrowseForGta5ExePath()
        {
            var selectedFile = FileOperationsHelper.BrowseForGta5Exe();

            _logger.Write($"User manually selected {selectedFile} as GTA5.exe path.");

            var selectedFolder = string.IsNullOrEmpty(selectedFile) ? null : Path.GetDirectoryName(selectedFile);

            if (!IsValidGtaPath(selectedFolder))
            {
                return(null);
            }

            _settings.GamePath = selectedFolder;
            _settingsProvider.SaveSettings(_settings);
            return(selectedFile);
        }