Skip to content

Commit

Permalink
Merge pull request #128 from Settlers4Modding/feature/open-mp-folder-…
Browse files Browse the repository at this point in the history
…and-savegame-folder

Added Open MP Folder and Savegame Folder
  • Loading branch information
Pumpline authored Feb 11, 2021
2 parents 133ffcd + e9d13bc commit 15aefdb
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/en-EN/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
### Main Window

* Added Tools group and regrouped some buttons
* Added Open Savegames and Multiplayer Map Folder Button
* Changelog button is working now
* About button is working now
* Disclaimer button is working now
Expand Down
18 changes: 18 additions & 0 deletions src/CommunityPatchLauncher/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/CommunityPatchLauncher/Properties/Resources.de-DE.resx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@
<data name="MainWindow_Maps" xml:space="preserve">
<value>Karten</value>
</data>
<data name="MainWindow_MPFolder" xml:space="preserve">
<value>MP Mapordner öffnen</value>
</data>
<data name="MainWindow_Multiplayer" xml:space="preserve">
<value>Mehrspieler</value>
</data>
Expand All @@ -201,6 +204,9 @@
<data name="MainWindow_ReportIssue" xml:space="preserve">
<value>Fehler melden</value>
</data>
<data name="MainWindow_SaveFolder" xml:space="preserve">
<value>Spielständeordner öffnen</value>
</data>
<data name="MainWindow_Settings" xml:space="preserve">
<value>Einstellungen</value>
</data>
Expand Down
6 changes: 6 additions & 0 deletions src/CommunityPatchLauncher/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@
<data name="MainWindow_Mods" xml:space="preserve">
<value>Mods</value>
</data>
<data name="MainWindow_MPFolder" xml:space="preserve">
<value>Open Multiplayer Mapfolder</value>
</data>
<data name="MainWindow_Multiplayer" xml:space="preserve">
<value>Multiplayer</value>
</data>
Expand All @@ -233,6 +236,9 @@
<data name="MainWindow_ReportIssue" xml:space="preserve">
<value>Report issue</value>
</data>
<data name="MainWindow_SaveFolder" xml:space="preserve">
<value>Open Savefolder</value>
</data>
<data name="MainWindow_Settings" xml:space="preserve">
<value>Settings</value>
</data>
Expand Down
13 changes: 13 additions & 0 deletions src/CommunityPatchLauncher/ViewModels/MainWindowModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ internal class MainWindowModel : BaseViewModel
/// Oopen the texture changer tool
/// </summary>
public ICommand OpenTextureChangerCommand { get; private set; }
/// <summary>
/// Opens the MP Map Folder
/// </summary>
public ICommand OpenMPMapFolderCommand { get; private set; }
/// <summary>
/// Opens the Save Game Folder
/// </summary>
public ICommand OpenSavesFolderCommand { get; private set; }

/// <summary>
/// Open the launcher license
Expand Down Expand Up @@ -146,6 +154,11 @@ public MainWindowModel(Window window) : base(window, true)
ReportIssueCommand = new OpenLinkCommand(wpfSettings.GetValue<string>("ReportIssueLink"));
OpenEditorCommand = new StartEditorCommand(settingManager);
OpenSettlersConfigurationCommand = new StartSettlersConfigCommand(settingManager);
OpenMPMapFolderCommand = new OpenFolderCommand(settingManager.GetValue<string>("GameFolder") + "/Map/User/");
OpenSavesFolderCommand = new OpenFolderCommand(Environment.GetFolderPath(
Environment.SpecialFolder.MyDocuments)
+ "/TheSettlers4/Save/"
);

string gameFolder = settingManager.GetValue<string>("GameFolder");
string textureChange = gameFolder + "Texturenwechsler.bat";
Expand Down
6 changes: 6 additions & 0 deletions src/CommunityPatchLauncher/Windows/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@
<TextBlock Style="{StaticResource SubCategoryString}" Text="{x:Static p:Resources.MainWindow_SettlersConfig}"></TextBlock>
</ItemsControl>
</Button>
<Button Style="{StaticResource CategoryButton}" Command="{Binding OpenSavesFolderCommand}">
<ItemsControl Style="{StaticResource SubCategoryGrid}">
<fa:FontAwesome Icon="FolderOpen" Style="{StaticResource SubCategoryFontAwesome}" />
<TextBlock Style="{StaticResource SubCategoryString}" Text="{x:Static p:Resources.MainWindow_SaveFolder}"></TextBlock>
</ItemsControl>
</Button>
</StackPanel>
<Button Style="{StaticResource CategoryButton}" Command="{Binding ChangeGroupVisiblity}" CommandParameter="Help_Group">
<ItemsControl Style="{StaticResource MainCategoryGrid}">
Expand Down

0 comments on commit 15aefdb

Please sign in to comment.