Example #1
0
        /// <summary>
        /// Prompts to download Illusory mod unlocker or opens it if already installed
        /// </summary>
        public void PromptToPatch()
        {
            string displayName = "IllusoryUniversalModUnlocker";

            if (!RegistryHelper.IsSoftwareInstalled(displayName, Microsoft.Win32.RegistryHive.CurrentUser, Microsoft.Win32.RegistryView.Registry32))
            {
                ModUnlockerDownloadLink downloadInfo = UeModUnlocker.GetLatestDownloadLinkInfo();

                if (downloadInfo == null || string.IsNullOrEmpty(downloadInfo.Url))
                {
                    System.Windows.MessageBox.Show("Failed to get the latest download link. Check that you have internet and try again.", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }

                MessageBoxResult result = System.Windows.MessageBox.Show("This will open your browser to download the Illusory Universal Mod Unlocker.\n\nLaunch the unlocker installer after it downloads to patch Session.\n\nDo you want to continue?",
                                                                         "Notice!",
                                                                         MessageBoxButton.YesNo,
                                                                         MessageBoxImage.Warning,
                                                                         MessageBoxResult.Yes);

                if (result == MessageBoxResult.Yes)
                {
                    Process.Start(new ProcessStartInfo(downloadInfo.Url));
                }
            }
            else
            {
                string modUnlockerPath = RegistryHelper.GetExePathFromDisplayIcon(displayName, Microsoft.Win32.RegistryHive.CurrentUser, Microsoft.Win32.RegistryView.Registry32);
                Process.Start(modUnlockerPath);
            }
        }
Example #2
0
        private void LoadMapInBackgroundAndContinueWith(Action <Task> continuationTask)
        {
            if (SessionPath.IsSessionPathValid() == false)
            {
                System.Windows.MessageBox.Show("You have selected an incorrect path to Session. Make sure the directory you choose has the folders 'Engine' and 'SessionGame'.", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            if (UeModUnlocker.IsGamePatched() == false && UnpackUtils.IsSessionUnpacked() == false)
            {
                MessageBoxResult result = System.Windows.MessageBox.Show("Session has not been patched yet. Click 'Patch With Illusory Mod Unlocker' to patch the game.", "Notice!", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }



            if (UeModUnlocker.IsGamePatched() == false && UnpackUtils.IsSessionUnpacked())
            {
                if (ViewModel.IsOriginalMapFilesBackedUp() == false)
                {
                    System.Windows.MessageBox.Show("The original Session game map files have not been backed up yet. Click OK to backup the files then click 'Load Map' again.",
                                                   "Notice!",
                                                   MessageBoxButton.OK,
                                                   MessageBoxImage.Information);

                    ViewModel.BackupOriginalMapFiles();
                    return;
                }
            }

            if (lstMaps.SelectedItem == null)
            {
                System.Windows.MessageBox.Show("Select a map to load first!",
                                               "Notice!",
                                               MessageBoxButton.OK,
                                               MessageBoxImage.Information);
                return;
            }


            MapListItem selectedItem = lstMaps.SelectedItem as MapListItem;

            if (selectedItem.IsValid == false)
            {
                System.Windows.MessageBox.Show("This map is missing the required Game Mode Override 'PBP_InGameSessionGameMode'.\n\nAdd a Game Mode to your map in UE4: '/Content/Data/PBP_InGameSessionGameMode.uasset'.\nThen reload the list of available maps.",
                                               "Error!",
                                               MessageBoxButton.OK,
                                               MessageBoxImage.Error);
                return;
            }

            ViewModel.UserMessage          = $"Loading {selectedItem.MapName} ...";
            ViewModel.InputControlsEnabled = false;

            Task t = Task.Run(() => ViewModel.LoadSelectedMap(selectedItem));

            t.ContinueWith(continuationTask);
        }
Example #3
0
        private void BtnImportMap_Click(object sender, RoutedEventArgs e)
        {
            if (UeModUnlocker.IsGamePatched() == false)
            {
                MessageBoxResult result = System.Windows.MessageBox.Show("Session has not been patched yet. Click 'Patch With Illusory Mod Unlocker' to patch the game.", "Notice!", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            importContextMenu.IsOpen = true;
        }
        private void BtnApplySettings_Click(object sender, RoutedEventArgs e)
        {
            if (UeModUnlocker.IsGamePatched() == false)
            {
                MessageBox.Show("Session has not been patched yet. Click 'Patch With Illusory Mod Unlocker' to patch the game.", "Notice!", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            ViewModel.UpdateGameSettings();
        }
Example #5
0
        private void BtnApplySettings_Click(object sender, RoutedEventArgs e)
        {
            if (ViewModel.InputControlsEnabled == false)
            {
                return;
            }

            if (UeModUnlocker.IsGamePatched() == false && UnpackUtils.IsSessionUnpacked() == false)
            {
                MessageBoxResult result = System.Windows.MessageBox.Show("Session has not been patched yet. Click 'Patch With Illusory Mod Unlocker' to patch the game.", "Notice!", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            if (GameSettingsManager.DoesObjectPlacementFileExist() == false)
            {
                MessageBoxResult promptResult = System.Windows.MessageBox.Show("The required file is missing and must be extracted before object count can be modified.\n\nClick 'Yes' to extract the file (UnrealPak and crypto.json will be downloaded if it is not installed locally).",
                                                                               "Warning - Cannot Modify Object Count!",
                                                                               MessageBoxButton.YesNo,
                                                                               MessageBoxImage.Information,
                                                                               MessageBoxResult.Yes);

                if (promptResult == MessageBoxResult.Yes)
                {
                    ViewModel.StartPatching(skipPatching: true, skipUnpacking: false, unrealPathFromRegistry: RegistryHelper.GetPathToUnrealEngine());
                    return;
                }
            }


            bool didSet = ViewModel.UpdateGameSettings();


            if (didSet)
            {
                ViewModel.UserMessage = "Game settings updated!";

                if (SessionPath.IsSessionRunning())
                {
                    ViewModel.UserMessage += " Restart the game for changes to take effect.";
                }
            }
        }
Example #6
0
        private void BtnApplySettings_Click(object sender, RoutedEventArgs e)
        {
            if (ViewModel.InputControlsEnabled == false)
            {
                return;
            }

            if (UeModUnlocker.IsGamePatched() == false)
            {
                MessageBoxResult result = System.Windows.MessageBox.Show("Session has not been patched yet. Click 'Patch With Illusory Mod Unlocker' to patch the game.", "Notice!", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            bool didSet = ViewModel.UpdateGameSettings();

            if (didSet)
            {
                if (SessionPath.IsSessionRunning())
                {
                    ViewModel.UserMessage += " Restart the game for changes to take effect.";
                }
            }
        }