mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 13:14:17 +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>
|
/// </summary>
|
||||||
public bool ShowTsm { get; set; } = true;
|
public bool ShowTsm { get; set; } = true;
|
||||||
|
|
||||||
public bool Fools22 { get; set; } = true;
|
public bool? Fools22New { get; set; } = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Load a configuration from the provided path.
|
/// Load a configuration from the provided path.
|
||||||
|
|
|
||||||
|
|
@ -275,6 +275,13 @@ namespace Dalamud
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.Information("Loading fools22");
|
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();
|
this.fools22 = new Fools22();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
|
||||||
|
|
@ -323,17 +323,12 @@ public class Fools22 : IDisposable
|
||||||
{
|
{
|
||||||
var config = Service<DalamudConfiguration>.Get();
|
var config = Service<DalamudConfiguration>.Get();
|
||||||
|
|
||||||
if (!config.Fools22)
|
if (!(config.Fools22New ?? true))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!(DateTime.Now.Month == 4 && DateTime.Now.Day == 1))
|
if (!(DateTime.Now.Month == 4 && DateTime.Now.Day == 1))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var timeZone = TimeZoneInfo.Local;
|
|
||||||
var offset = timeZone.GetUtcOffset(DateTime.UtcNow);
|
|
||||||
|
|
||||||
Log.Information("Fools22: UTC offset: {0}", offset);
|
|
||||||
|
|
||||||
return this.assetsReady;
|
return this.assetsReady;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,8 +106,6 @@ namespace Dalamud.Interface.Internal.Windows
|
||||||
this.doFocus = configuration.IsFocusManagementEnabled;
|
this.doFocus = configuration.IsFocusManagementEnabled;
|
||||||
this.doTsm = configuration.ShowTsm;
|
this.doTsm = configuration.ShowTsm;
|
||||||
|
|
||||||
this.doFools22 = configuration.Fools22;
|
|
||||||
|
|
||||||
this.dtrSpacing = configuration.DtrSpacing;
|
this.dtrSpacing = configuration.DtrSpacing;
|
||||||
this.dtrSwapDirection = configuration.DtrSwapDirection;
|
this.dtrSwapDirection = configuration.DtrSwapDirection;
|
||||||
|
|
||||||
|
|
@ -176,6 +174,8 @@ namespace Dalamud.Interface.Internal.Windows
|
||||||
var configuration = Service<DalamudConfiguration>.Get();
|
var configuration = Service<DalamudConfiguration>.Get();
|
||||||
this.dtrOrder = configuration.DtrOrder;
|
this.dtrOrder = configuration.DtrOrder;
|
||||||
this.dtrIgnore = configuration.DtrIgnore;
|
this.dtrIgnore = configuration.DtrIgnore;
|
||||||
|
|
||||||
|
this.doFools22 = configuration.Fools22New ?? true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|
@ -853,7 +853,7 @@ namespace Dalamud.Interface.Internal.Windows
|
||||||
configuration.IsFocusManagementEnabled = this.doFocus;
|
configuration.IsFocusManagementEnabled = this.doFocus;
|
||||||
configuration.ShowTsm = this.doTsm;
|
configuration.ShowTsm = this.doTsm;
|
||||||
|
|
||||||
configuration.Fools22 = this.doFools22;
|
configuration.Fools22New = this.doFools22;
|
||||||
|
|
||||||
configuration.UseAxisFontsFromGame = this.doUseAxisFontsFromGame;
|
configuration.UseAxisFontsFromGame = this.doUseAxisFontsFromGame;
|
||||||
configuration.FontGamma = this.fontGamma;
|
configuration.FontGamma = this.fontGamma;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue