Merge branch 'net5'

This commit is contained in:
goat 2022-04-25 20:05:51 +02:00
commit 1395e3a555
No known key found for this signature in database
GPG key ID: 7773BB5B43BA52E5
94 changed files with 2455 additions and 783 deletions

View file

@ -1,9 +1,10 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using Dalamud.Game.Text;
using Dalamud.Interface.GameFonts;
using Dalamud.Interface.Style;
using Newtonsoft.Json;
using Serilog;
@ -149,6 +150,11 @@ namespace Dalamud.Configuration.Internal
/// </summary>
public int FontResolutionLevel { get; set; } = 2;
/// <summary>
/// Gets or sets a value indicating whether to disable font fallback notice.
/// </summary>
public bool DisableFontFallbackNotice { get; set; } = false;
/// <summary>
/// Gets or sets a value indicating whether or not plugin UI should be hidden.
/// </summary>
@ -194,6 +200,11 @@ namespace Dalamud.Configuration.Internal
/// </summary>
public bool LogOpenAtStartup { get; set; }
/// <summary>
/// Gets or sets a value indicating whether or not the dev bar should open at startup.
/// </summary>
public bool DevBarOpenAtStartup { get; set; }
/// <summary>
/// Gets or sets a value indicating whether or not ImGui asserts should be enabled at startup.
/// </summary>
@ -301,6 +312,42 @@ namespace Dalamud.Configuration.Internal
/// </summary>
public bool IsMbCollect { get; set; } = true;
/// <summary>
/// Gets the ISO 639-1 two-letter code for the language of the effective Dalamud display language.
/// </summary>
public string EffectiveLanguage
{
get
{
var languages = Localization.ApplicableLangCodes.Prepend("en").ToArray();
try
{
if (string.IsNullOrEmpty(this.LanguageOverride))
{
var currentUiLang = CultureInfo.CurrentUICulture;
if (Localization.ApplicableLangCodes.Any(x => currentUiLang.TwoLetterISOLanguageName == x))
return currentUiLang.TwoLetterISOLanguageName;
else
return languages[0];
}
else
{
return this.LanguageOverride;
}
}
catch (Exception)
{
return languages[0];
}
}
}
/// <summary>
/// Gets or sets a value indicating whether or not to show info on dev bar.
/// </summary>
public bool ShowDevBarInfo { get; set; } = true;
/// <summary>
/// Load a configuration from the provided path.
/// </summary>

View file

@ -32,6 +32,11 @@ namespace Dalamud.Configuration.Internal
/// </summary>
public static bool DalamudWaitForDebugger { get; } = GetEnvironmentVariable("DALAMUD_WAIT_DEBUGGER");
/// <summary>
/// Gets a value indicating whether or not Dalamud context menus should be disabled.
/// </summary>
public static bool DalamudDoContextMenu { get; } = GetEnvironmentVariable("DALAMUD_ENABLE_CONTEXTMENU");
private static bool GetEnvironmentVariable(string name)
=> bool.Parse(Environment.GetEnvironmentVariable(name) ?? "false");
}