-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
116 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Globalization; | ||
|
||
namespace WinterspringLauncher; | ||
|
||
public static class LocaleDefaults | ||
{ | ||
public static bool ShouldUseAsiaPreferences { get; set; } = CultureInfo.CurrentCulture.Name.StartsWith("zh", StringComparison.InvariantCultureIgnoreCase); | ||
|
||
public static string GetBestWoWConfigLocale() | ||
{ | ||
return ShouldUseAsiaPreferences ? "zhCN" : "enUS"; | ||
} | ||
|
||
public static string? GetBestGitHubMirror() | ||
{ | ||
return ShouldUseAsiaPreferences ? "https://asia.cdn.everlook-wow.net/github-mirror/api/" : null; | ||
} | ||
|
||
public static string GetBestServerName() | ||
{ | ||
return ShouldUseAsiaPreferences ? "Everlook (Asia)" : "Everlook (Europe)"; | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using System.IO; | ||
|
||
namespace WinterspringLauncher.Utils; | ||
|
||
public static class DirectoryCopy | ||
{ | ||
public static void Copy(string sourceDirectory, string targetDirectory) | ||
{ | ||
DirectoryInfo diSource = new DirectoryInfo(sourceDirectory); | ||
DirectoryInfo diTarget = new DirectoryInfo(targetDirectory); | ||
|
||
CopyAll(diSource, diTarget); | ||
} | ||
|
||
public static void CopyAll(DirectoryInfo source, DirectoryInfo target) | ||
{ | ||
Directory.CreateDirectory(target.FullName); | ||
|
||
// Copy each file into the new directory. | ||
foreach (FileInfo fi in source.GetFiles()) | ||
{ | ||
Console.WriteLine(@"Copying {0}\{1}", target.FullName, fi.Name); | ||
fi.CopyTo(Path.Combine(target.FullName, fi.Name), true); | ||
} | ||
|
||
// Copy each subdirectory using recursion. | ||
foreach (DirectoryInfo diSourceSubDir in source.GetDirectories()) | ||
{ | ||
DirectoryInfo nextTargetSubDir = | ||
target.CreateSubdirectory(diSourceSubDir.Name); | ||
CopyAll(diSourceSubDir, nextTargetSubDir); | ||
} | ||
} | ||
} |
This file contains 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