mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
auto format.
This commit is contained in:
parent
50f81cc889
commit
c1a9c798ae
1 changed files with 35 additions and 36 deletions
|
|
@ -19,7 +19,6 @@ using ChangedItemClick = Penumbra.Communication.ChangedItemClick;
|
|||
using ChangedItemHover = Penumbra.Communication.ChangedItemHover;
|
||||
using OtterGui.Tasks;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.Interop.Structs;
|
||||
using Penumbra.UI;
|
||||
using ResidentResourceManager = Penumbra.Interop.Services.ResidentResourceManager;
|
||||
|
||||
|
|
@ -74,8 +73,8 @@ public class Penumbra : IDalamudPlugin
|
|||
_tempCollections = _services.GetService<TempCollectionManager>();
|
||||
_redrawService = _services.GetService<RedrawService>();
|
||||
_communicatorService = _services.GetService<CommunicatorService>();
|
||||
_services.GetService<ResourceService>(); // Initialize because not required anywhere else.
|
||||
_services.GetService<ModCacheManager>(); // Initialize because not required anywhere else.
|
||||
_services.GetService<ResourceService>(); // Initialize because not required anywhere else.
|
||||
_services.GetService<ModCacheManager>(); // Initialize because not required anywhere else.
|
||||
_collectionManager.Caches.CreateNecessaryCaches();
|
||||
_services.GetService<PathResolver>();
|
||||
_services.GetService<ShaderReplacementFixer>();
|
||||
|
|
@ -245,38 +244,38 @@ public class Penumbra : IDalamudPlugin
|
|||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static string CollectLocaleEnvironmentVariables()
|
||||
{
|
||||
var variableNames = new List<string>();
|
||||
var variables = new Dictionary<string, string>(StringComparer.Ordinal);
|
||||
foreach (DictionaryEntry variable in Environment.GetEnvironmentVariables())
|
||||
{
|
||||
var key = (string)variable.Key;
|
||||
if (key.Equals("LANG", StringComparison.Ordinal) || key.StartsWith("LC_", StringComparison.Ordinal))
|
||||
{
|
||||
variableNames.Add(key);
|
||||
variables.Add(key, ((string?)variable.Value) ?? string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
variableNames.Sort();
|
||||
|
||||
var pos = variableNames.IndexOf("LC_ALL");
|
||||
if (pos > 0) // If it's == 0, we're going to do a no-op.
|
||||
{
|
||||
variableNames.RemoveAt(pos);
|
||||
variableNames.Insert(0, "LC_ALL");
|
||||
}
|
||||
|
||||
pos = variableNames.IndexOf("LANG");
|
||||
if (pos >= 0 && pos < variableNames.Count - 1)
|
||||
{
|
||||
variableNames.RemoveAt(pos);
|
||||
variableNames.Add("LANG");
|
||||
}
|
||||
|
||||
return variableNames.Count == 0
|
||||
? "None"
|
||||
: string.Join(", ", variableNames.Select(name => $"`{name}={variables[name]}`"));
|
||||
private static string CollectLocaleEnvironmentVariables()
|
||||
{
|
||||
var variableNames = new List<string>();
|
||||
var variables = new Dictionary<string, string>(StringComparer.Ordinal);
|
||||
foreach (DictionaryEntry variable in Environment.GetEnvironmentVariables())
|
||||
{
|
||||
var key = (string)variable.Key;
|
||||
if (key.Equals("LANG", StringComparison.Ordinal) || key.StartsWith("LC_", StringComparison.Ordinal))
|
||||
{
|
||||
variableNames.Add(key);
|
||||
variables.Add(key, (string?)variable.Value ?? string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
variableNames.Sort();
|
||||
|
||||
var pos = variableNames.IndexOf("LC_ALL");
|
||||
if (pos > 0) // If it's == 0, we're going to do a no-op.
|
||||
{
|
||||
variableNames.RemoveAt(pos);
|
||||
variableNames.Insert(0, "LC_ALL");
|
||||
}
|
||||
|
||||
pos = variableNames.IndexOf("LANG");
|
||||
if (pos >= 0 && pos < variableNames.Count - 1)
|
||||
{
|
||||
variableNames.RemoveAt(pos);
|
||||
variableNames.Add("LANG");
|
||||
}
|
||||
|
||||
return variableNames.Count == 0
|
||||
? "None"
|
||||
: string.Join(", ", variableNames.Select(name => $"`{name}={variables[name]}`"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue