mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
feat: add timezone check
This commit is contained in:
parent
0cd1c1b150
commit
a33aef5c45
4 changed files with 12 additions and 10 deletions
|
|
@ -290,7 +290,7 @@ namespace Dalamud.Configuration.Internal
|
|||
/// </summary>
|
||||
public bool ShowTsm { get; set; } = true;
|
||||
|
||||
public bool Fools22 { get; set; } = true;
|
||||
public bool? Fools22New { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Load a configuration from the provided path.
|
||||
|
|
|
|||
|
|
@ -275,6 +275,13 @@ namespace Dalamud
|
|||
try
|
||||
{
|
||||
Log.Information("Loading fools22");
|
||||
var timeZone = TimeZoneInfo.Local;
|
||||
var offset = timeZone.GetUtcOffset(DateTime.UtcNow);
|
||||
|
||||
var config = Service<DalamudConfiguration>.Get();
|
||||
config.Fools22New = offset.Hours < 1;
|
||||
config.Save();
|
||||
|
||||
this.fools22 = new Fools22();
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
|
|
@ -323,17 +323,12 @@ public class Fools22 : IDisposable
|
|||
{
|
||||
var config = Service<DalamudConfiguration>.Get();
|
||||
|
||||
if (!config.Fools22)
|
||||
if (!(config.Fools22New ?? true))
|
||||
return false;
|
||||
|
||||
if (!(DateTime.Now.Month == 4 && DateTime.Now.Day == 1))
|
||||
return false;
|
||||
|
||||
var timeZone = TimeZoneInfo.Local;
|
||||
var offset = timeZone.GetUtcOffset(DateTime.UtcNow);
|
||||
|
||||
Log.Information("Fools22: UTC offset: {0}", offset);
|
||||
|
||||
return this.assetsReady;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -106,8 +106,6 @@ namespace Dalamud.Interface.Internal.Windows
|
|||
this.doFocus = configuration.IsFocusManagementEnabled;
|
||||
this.doTsm = configuration.ShowTsm;
|
||||
|
||||
this.doFools22 = configuration.Fools22;
|
||||
|
||||
this.dtrSpacing = configuration.DtrSpacing;
|
||||
this.dtrSwapDirection = configuration.DtrSwapDirection;
|
||||
|
||||
|
|
@ -176,6 +174,8 @@ namespace Dalamud.Interface.Internal.Windows
|
|||
var configuration = Service<DalamudConfiguration>.Get();
|
||||
this.dtrOrder = configuration.DtrOrder;
|
||||
this.dtrIgnore = configuration.DtrIgnore;
|
||||
|
||||
this.doFools22 = configuration.Fools22New ?? true;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
@ -853,7 +853,7 @@ namespace Dalamud.Interface.Internal.Windows
|
|||
configuration.IsFocusManagementEnabled = this.doFocus;
|
||||
configuration.ShowTsm = this.doTsm;
|
||||
|
||||
configuration.Fools22 = this.doFools22;
|
||||
configuration.Fools22New = this.doFools22;
|
||||
|
||||
configuration.UseAxisFontsFromGame = this.doUseAxisFontsFromGame;
|
||||
configuration.FontGamma = this.fontGamma;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue