Skip to content

Commit

Permalink
Strip mod directory if pointing data directory to \mod
Browse files Browse the repository at this point in the history
  • Loading branch information
bcssov committed Nov 8, 2022
1 parent c9ad305 commit bdf31b8
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 05-30-2020
//
// Last Modified By : Mario
// Last Modified On : 11-02-2022
// Last Modified On : 11-08-2022
// ***********************************************************************
// <copyright file="OptionsControlViewModel.cs" company="Mario">
// Mario
Expand All @@ -13,6 +13,7 @@
// ***********************************************************************
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reactive;
using System.Reactive.Disposables;
Expand Down Expand Up @@ -774,6 +775,15 @@ async Task showPrompt()
IsOpen = true;
if (!string.IsNullOrWhiteSpace(result))
{
result = result.StandardizeDirectorySeparator();
if (result.EndsWith(Path.DirectorySeparatorChar + Shared.Constants.ModDirectory))
{
result = result.TrimEnd(Path.DirectorySeparatorChar + Shared.Constants.ModDirectory);
}
else if (result.EndsWith(Path.DirectorySeparatorChar + Shared.Constants.JsonModDirectory))
{
result = result.TrimEnd(Path.DirectorySeparatorChar + Shared.Constants.JsonModDirectory);
}
Game.UserDirectory = result;
SaveGame();
}
Expand Down

0 comments on commit bdf31b8

Please sign in to comment.