Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions TarkovMonitor/App.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="TarkovMonitor.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
Expand Down Expand Up @@ -67,6 +67,9 @@
<setting name="customLogsPath" serializeAs="String">
<value />
</setting>
<setting name="customScreenShotPath" serializeAs="String">
<value />
</setting>
<setting name="customMap" serializeAs="String">
<value />
</setting>
Expand Down
46 changes: 46 additions & 0 deletions TarkovMonitor/Blazor/Pages/Settings/Settings.razor
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@
<div>
<MudSwitch @bind-Value="@AutomaticallyDeleteScreenshotsAfterRaid" Label="Automatically delete taken screenshots after raid" Color="Color.Info" />
</div>
<div>
<MudText Typo="Typo.h6" Class="d-flex align-center"><MudIcon Icon="@Icons.Material.Filled.Folder" Class="mr-2" />Screenshot Folder</MudText>
<MudTextField T="string" @bind-Value="@CustomScreenShotFolder" ReadOnly="true" Variant="Variant.Outlined" Margin="Margin.Dense" Adornment="Adornment.End" AdornmentIcon="@Icons.Material.Filled.FolderOpen" OnAdornmentClick="CustomScreenShotFolderClick"></MudTextField>
@if (Properties.Settings.Default.customScreenShotPath != null && Properties.Settings.Default.customScreenShotPath != "")
{
<div>
<MudButton @onclick="SetDefaultScreenShotFolder" VaLogFolderriant="Variant.Text">Reset to Default</MudButton>
</div>
}
</div>
<MudSelect @bind-Value="@MapOverrideSelect" T="string" Label="Offline Map" ShrinkLabel="true" HelperText="Map to use for offline raids" AnchorOrigin="Origin.BottomCenter" xs="3">
<MudSelectItem T="string" Value="@string.Empty">None</MudSelectItem>
@foreach (var map in TarkovDev.Maps)
Expand Down Expand Up @@ -659,6 +669,30 @@
}
}

public string CustomScreenShotFolder
{
get
{
if (Properties.Settings.Default.customScreenShotPath != null && Properties.Settings.Default.customScreenShotPath != "")
return Properties.Settings.Default.customScreenShotPath;
try
{
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Escape From Tarkov", "Screenshots");
}
catch (Exception ex)
{
messageLog.AddMessage($"Error getting default screenshot folder: {ex.Message}", "exception");
}

return "";
}
set
{
Properties.Settings.Default.customScreenShotPath = value;
Properties.Settings.Default.Save();
}
}

void CustomLogsFolderClick()
{
using CommonOpenFileDialog dialog = new CommonOpenFileDialog();
Expand All @@ -670,7 +704,19 @@
}
}

void CustomScreenShotFolderClick()
{
var dialog = new CommonOpenFileDialog();
dialog.InitialDirectory = CustomScreenShotFolder;
dialog.IsFolderPicker = true;
if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
CustomScreenShotFolder = dialog.FileName;
}

void SetDefaultLogFolder() {
CustomLogsFolder = "";
}

void SetDefaultScreenShotFolder()
=> CustomScreenShotFolder = "";
}
15 changes: 13 additions & 2 deletions TarkovMonitor/Properties/Settings.Designer.cs

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

3 changes: 3 additions & 0 deletions TarkovMonitor/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
<Setting Name="customLogsPath" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="customScreenShotPath" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="customMap" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
Expand Down