Allow custom location for project drive data#299
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Enables specifying a custom location for the project drive by flowing workspace settings into the drive helper and updating path resolution logic.
- Propagate
WorkspaceSettingstoArma3ToolsHelperin both initialization and commit paths. - Update
CreateProjectDrivemethods to callGetProjectDrivePath(this)for custom base paths. - Extend
Arma3ToolsHelperto accept settings, read custom drive paths, and build process arguments dynamically.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| GameRealisticMap.Studio/Modules/Arma3Data/Arma3DataModule.cs | Set Arma3ToolsHelper.WorkspaceSettings = settings when committing and initializing settings. |
| GameRealisticMap.Arma3/IO/WorkspaceSettings.cs | Changed CreateProjectDrive and CreateProjectDriveStandalone to call GetProjectDrivePath(this). |
| GameRealisticMap.Arma3/Arma3ToolsHelper.cs | Added WorkspaceSettings property, overload of GetProjectDrivePath, and helper methods; refactored EnsureProjectDrive argument handling. |
Comments suppressed due to low confidence (3)
GameRealisticMap.Arma3/Arma3ToolsHelper.cs:33
- Process.Start does not have an overload that accepts a List for arguments; you should join the list into a single string (e.g.
string.Join(" ", args)) or useProcessStartInfoto pass the arguments correctly.
var processs = Process.Start(Path.Combine(path, @"WorkDrive\\WorkDrive.exe"), args);
GameRealisticMap.Arma3/Arma3ToolsHelper.cs:33
- [nitpick] The variable name
processshas an extra 's' and may cause confusion; consider renaming it toprocessorproc.
var processs = Process.Start(Path.Combine(path, @"WorkDrive\\WorkDrive.exe"), args);
GameRealisticMap.Arma3/Arma3ToolsHelper.cs:237
- New behavior in
GetProjectDrivePath,GetCustomProjectDriveMappedPath, andEnsureProjectDriveshould be covered by unit tests to ensure custom and default paths resolve as expected.
public static string GetProjectDrivePath(WorkspaceSettings? settings = null)
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces support for specifying a custom base path for the project drive across the UI and core logic.
- Adds a TextBox in the settings view for users to input a custom project drive location
- Updates the settings view-model to apply the custom path asynchronously
- Extends the data module and helper classes to persist and use the custom path, plus new tests for project-drive resolution
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Arma3DataSettingsView.xaml | Added TextBox for custom location and reorganized PBO options |
| Arma3DataSettingsViewModel.cs | Switched to ISettingsEditorAsync, bound ProjectDriveBasePath |
| IArma3DataModule.cs | Introduced SetProjectDriveBasePath async and ProjectDriveBasePath |
| Arma3DataModule.cs | Implemented async setter, updated settings commit and reload |
| Arma3DataModuleMock.cs | Added interface members but currently throw NotImplementedException |
| WorkspaceSettings.cs | Updated CreateProjectDrive calls to use helper path resolution |
| Arma3ToolsHelper.cs | Added WorkspaceSettings store, custom path logic, and EnsureProjectDrive args |
| Arma3ToolsHelperTest.cs | New tests covering custom and default path resolution |
Comments suppressed due to low confidence (1)
GameRealisticMap.Arma3.Test/Arma3ToolsHelperTest.cs:1
- Consider adding a test for the scenario where a "P:" drive exists (Directory.Exists("P:")) to validate that built-in drive detection behaves correctly when both local and custom paths are available.
// new tests for GetProjectDrivePath
GameRealisticMap.Studio/Modules/Arma3Data/Views/Arma3DataSettingsView.xaml
Show resolved
Hide resolved
GameRealisticMap.Studio/Modules/Arma3Data/ViewModels/Arma3DataSettingsViewModel.cs
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tasks: