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