diff --git a/src/XIVLauncher.Core/Components/UpdateWarnPage.cs b/src/XIVLauncher.Core/Components/UpdateWarnPage.cs deleted file mode 100644 index 62303df8..00000000 --- a/src/XIVLauncher.Core/Components/UpdateWarnPage.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.Numerics; - -using ImGuiNET; - -namespace XIVLauncher.Core.Components; - -public class UpdateWarnPage : Page -{ - private readonly TextureWrap updateWarnTexture; - - public UpdateWarnPage(LauncherApp app) - : base(app) - { - this.updateWarnTexture = TextureWrap.Load(AppUtil.GetEmbeddedResourceBytes("xlcore_updatewarn.png")); - } - - public override void Draw() - { - ImGui.SetCursorPos(new Vector2(0)); - - ImGui.Image(this.updateWarnTexture.ImGuiHandle, new Vector2(1280, 800)); - - ImGui.PushStyleColor(ImGuiCol.Button, Vector4.Zero); - ImGui.PushStyleColor(ImGuiCol.ButtonHovered, Vector4.Zero); - ImGui.PushStyleColor(ImGuiCol.ButtonActive, Vector4.Zero); - - ImGui.SetCursorPos(new Vector2(316, 481)); - - if (ImGui.Button("###openGuideButton", new Vector2(649, 101))) - { - Environment.Exit(0); - } - - ImGui.SetCursorPos(new Vector2(316, 598)); - - if (ImGui.Button("###finishFtsButton", new Vector2(649, 101))) - { - App.FinishFromUpdateWarn(); - } - - ImGui.PopStyleColor(3); - - base.Draw(); - } -} diff --git a/src/XIVLauncher.Core/CoreEnvironmentSettings.cs b/src/XIVLauncher.Core/CoreEnvironmentSettings.cs index 51c89987..0c08f6b4 100644 --- a/src/XIVLauncher.Core/CoreEnvironmentSettings.cs +++ b/src/XIVLauncher.Core/CoreEnvironmentSettings.cs @@ -7,7 +7,6 @@ public static class CoreEnvironmentSettings public static bool? IsDeck => CheckEnvBoolOrNull("XL_DECK"); public static bool? IsDeckGameMode => CheckEnvBoolOrNull("XL_GAMEMODE"); public static bool? IsDeckFirstRun => CheckEnvBoolOrNull("XL_FIRSTRUN"); - public static bool IsUpgrade => CheckEnvBool("XL_SHOW_UPGRADE"); public static bool ClearSettings => CheckEnvBool("XL_CLEAR_SETTINGS"); public static bool ClearPrefix => CheckEnvBool("XL_CLEAR_PREFIX"); public static bool ClearPlugins => CheckEnvBool("XL_CLEAR_PLUGINS"); @@ -16,19 +15,19 @@ public static class CoreEnvironmentSettings public static bool ClearAll => CheckEnvBool("XL_CLEAR_ALL"); public static bool? UseSteam => CheckEnvBoolOrNull("XL_USE_STEAM"); // Fix for Steam Deck users who lock themselves out public static bool IsSteamCompatTool => CheckEnvBool("XL_SCT"); - public static uint SteamAppId => GetAppId(System.Environment.GetEnvironmentVariable("SteamAppId")); - public static uint AltAppID => GetAppId(System.Environment.GetEnvironmentVariable("XL_APPID")); + public static uint SteamAppId => GetAppId(Environment.GetEnvironmentVariable("SteamAppId")); + public static uint AltAppID => GetAppId(Environment.GetEnvironmentVariable("XL_APPID")); private static bool CheckEnvBool(string key) { - string val = (System.Environment.GetEnvironmentVariable(key) ?? string.Empty).ToLower(); + string val = (Environment.GetEnvironmentVariable(key) ?? string.Empty).ToLower(); if (val == "1" || val == "true" || val == "yes" || val == "y" || val == "on") return true; return false; } private static bool? CheckEnvBoolOrNull(string key) { - string val = (System.Environment.GetEnvironmentVariable(key) ?? string.Empty).ToLower(); + string val = (Environment.GetEnvironmentVariable(key) ?? string.Empty).ToLower(); if (val == "1" || val == "true" || val == "yes" || val == "y" || val == "on") return true; if (val == "0" || val == "false" || val == "no" || val == "n" || val == "off") return false; return null; @@ -44,14 +43,14 @@ public static string GetCleanEnvironmentVariable(string envvar, string badstring public static uint GetAppId(string? appid) { uint.TryParse(appid, out var result); - + // Will return 0 if appid is invalid (or zero). return result; } public static string GetCType() { - if (System.OperatingSystem.IsWindows()) + if (OperatingSystem.IsWindows()) return ""; var psi = new ProcessStartInfo("sh"); psi.Arguments = "-c \"locale -a 2>/dev/null | grep -i utf\""; diff --git a/src/XIVLauncher.Core/LauncherApp.cs b/src/XIVLauncher.Core/LauncherApp.cs index 2d09ed2f..279bc2e7 100644 --- a/src/XIVLauncher.Core/LauncherApp.cs +++ b/src/XIVLauncher.Core/LauncherApp.cs @@ -41,7 +41,6 @@ public enum LauncherState Loading, OtpEntry, Fts, - UpdateWarn, SteamDeckPrompt, } @@ -82,10 +81,6 @@ public LauncherState State this.ftsPage.OnShow(); break; - case LauncherState.UpdateWarn: - this.updateWarnPage.OnShow(); - break; - case LauncherState.SteamDeckPrompt: this.steamDeckPromptPage.OnShow(); break; @@ -103,7 +98,6 @@ public LauncherState State LauncherState.Loading => this.LoadingPage, LauncherState.OtpEntry => this.otpEntryPage, LauncherState.Fts => this.ftsPage, - LauncherState.UpdateWarn => this.updateWarnPage, LauncherState.SteamDeckPrompt => this.steamDeckPromptPage, _ => throw new ArgumentOutOfRangeException(nameof(this.state), this.state, null) }; @@ -122,12 +116,11 @@ public LauncherState State private readonly SettingsPage setPage; private readonly OtpEntryPage otpEntryPage; private readonly FtsPage ftsPage; - private readonly UpdateWarnPage updateWarnPage; private readonly SteamDeckPromptPage steamDeckPromptPage; private readonly Background background = new(); - public LauncherApp(Storage storage, bool needsUpdateWarning, string frontierUrl, string? cutOffBootver) + public LauncherApp(Storage storage, string frontierUrl, string? cutOffBootver) { this.Storage = storage; @@ -140,7 +133,6 @@ public LauncherApp(Storage storage, bool needsUpdateWarning, string frontierUrl, this.otpEntryPage = new OtpEntryPage(this); this.LoadingPage = new LoadingPage(this); this.ftsPage = new FtsPage(this); - this.updateWarnPage = new UpdateWarnPage(this); this.steamDeckPromptPage = new SteamDeckPromptPage(this); if (!EnvironmentSettings.IsNoKillswitch && !string.IsNullOrEmpty(cutOffBootver)) @@ -158,14 +150,7 @@ public LauncherApp(Storage storage, bool needsUpdateWarning, string frontierUrl, } } - if (needsUpdateWarning) - { - this.State = LauncherState.UpdateWarn; - } - else - { - this.RunStartupTasks(); - } + this.RunStartupTasks(); #if DEBUG IsDebug = true; diff --git a/src/XIVLauncher.Core/LauncherClientConfig.cs b/src/XIVLauncher.Core/LauncherClientConfig.cs index 8d8f3120..154622a2 100644 --- a/src/XIVLauncher.Core/LauncherClientConfig.cs +++ b/src/XIVLauncher.Core/LauncherClientConfig.cs @@ -12,7 +12,7 @@ namespace XIVLauncher.Core; public readonly struct LauncherClientConfig { private const string LAUNCHER_CONFIG_URL = "https://kamori.goats.dev/Launcher/GetLauncherClientConfig"; - private const string FRONTIER_FALLBACK = "https://launcher.finalfantasyxiv.com/v650/index.html?rc_lang={0}&time={1}"; + private const string FRONTIER_FALLBACK = "https://launcher.finalfantasyxiv.com/v710/index.html?rc_lang={0}&time={1}"; public string frontierUrl { get; init; } public string? cutOffBootver { get; init; } diff --git a/src/XIVLauncher.Core/Program.cs b/src/XIVLauncher.Core/Program.cs index 2b6d6b12..7259b646 100644 --- a/src/XIVLauncher.Core/Program.cs +++ b/src/XIVLauncher.Core/Program.cs @@ -201,7 +201,7 @@ private static void Main(string[] args) Loc.SetupWithFallbacks(); Dictionary apps = new Dictionary(); - uint[] ignoredIds = { 0, STEAM_APP_ID, STEAM_APP_ID_FT}; + uint[] ignoredIds = { 0, STEAM_APP_ID, STEAM_APP_ID_FT }; if (!ignoredIds.Contains(CoreEnvironmentSettings.SteamAppId)) { apps.Add(CoreEnvironmentSettings.SteamAppId, "XLM"); @@ -294,22 +294,8 @@ private static void Main(string[] args) StyleModelV1.DalamudStandard.Apply(); ImGui.GetIO().FontGlobalScale = Config.GlobalScale ?? 1.0f; - var needUpdate = false; - -#if FLATPAK - if (Config.DoVersionCheck ?? false) - { - var versionCheckResult = UpdateCheck.CheckForUpdate().GetAwaiter().GetResult(); - - if (versionCheckResult.Success) - needUpdate = versionCheckResult.NeedUpdate; - } -#endif - - needUpdate = CoreEnvironmentSettings.IsUpgrade ? true : needUpdate; - var launcherClientConfig = LauncherClientConfig.GetAsync().GetAwaiter().GetResult(); - launcherApp = new LauncherApp(storage, needUpdate, launcherClientConfig.frontierUrl, launcherClientConfig.cutOffBootver); + launcherApp = new LauncherApp(storage, launcherClientConfig.frontierUrl, launcherClientConfig.cutOffBootver); Invalidate(20); @@ -370,7 +356,7 @@ private static void Main(string[] args) if (Patcher is not null) { Patcher.CancelAllDownloads(); - Task.Run(async() => + Task.Run(async () => { await PatchManager.UnInitializeAcquisition().ConfigureAwait(false); Environment.Exit(0); diff --git a/src/XIVLauncher.Core/Resources/xlcore_updatewarn.png b/src/XIVLauncher.Core/Resources/xlcore_updatewarn.png deleted file mode 100644 index 5489a482..00000000 Binary files a/src/XIVLauncher.Core/Resources/xlcore_updatewarn.png and /dev/null differ diff --git a/src/XIVLauncher.Core/UpdateCheck.cs b/src/XIVLauncher.Core/UpdateCheck.cs deleted file mode 100644 index cd682821..00000000 --- a/src/XIVLauncher.Core/UpdateCheck.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Serilog; - -namespace XIVLauncher.Core; - -public static class UpdateCheck -{ - private const string UPDATE_URL = "https://raw.githubusercontent.com/goatcorp/xlcore-distrib/main/version.txt"; - - public static async Task CheckForUpdate() - { - try - { - var response = await Program.HttpClient.GetStringAsync(UPDATE_URL).ConfigureAwait(false); - var remoteVersion = Version.Parse(response); - - var localVersion = Version.Parse(AppUtil.GetAssemblyVersion()); - - return new VersionCheckResult - { - Success = true, - WantVersion = response, - NeedUpdate = remoteVersion > localVersion, - }; - } - catch (Exception ex) - { - Log.Error(ex, "Could not check version"); - - return new VersionCheckResult - { - Success = false, - }; - } - } - - public class VersionCheckResult - { - public bool Success { get; set; } - public bool NeedUpdate { get; init; } - public string? WantVersion { get; init; } - } -} diff --git a/src/XIVLauncher.Core/XIVLauncher.Core.csproj b/src/XIVLauncher.Core/XIVLauncher.Core.csproj index 539183be..8321f348 100644 --- a/src/XIVLauncher.Core/XIVLauncher.Core.csproj +++ b/src/XIVLauncher.Core/XIVLauncher.Core.csproj @@ -1,165 +1,167 @@ - - Exe - net8.0 - enable - enable - true - latest - Resources\dalamud_icon.ico - - 1.1.1.0 - $(Version) - $(Version) - - win-x64;linux-x64;osx-x64 - true - true - - - true - - true - - true - - - - - $(DefineConstants);$(ExtraDefineConstants) - - - - $(DefineConstants);WIN32 - - - $(DefineConstants);OSX - - - $(DefineConstants);LINUX - - - - $(MSBuildProjectDirectory)\ - $(AppOutputBase)=C:\goatsoft\xl\XIVLauncher.Core\ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - - - - - - - $(IntermediateOutputPath)gitver + Exe + net8.0 + enable + enable + true + latest + Resources\dalamud_icon.ico + + 1.1.1.0 + $(Version) + $(Version) + + win-x64;linux-x64;osx-x64 + true + true + + + true + + true + + true - - - - - - - + - @(GitVersion) + + $(DefineConstants);$(ExtraDefineConstants) - - - - - $(IntermediateOutputPath)CustomAssemblyInfo.cs + + + $(DefineConstants);WIN32 + + + $(DefineConstants);OSX + + + $(DefineConstants);LINUX + + + + $(MSBuildProjectDirectory)\ + $(AppOutputBase)=C:\goatsoft\xl\XIVLauncher.Core\ - + + + + + + + + - + - + + - - <_Parameter1>GitHash - <_Parameter2>$(BuildHash) - - - - <_Parameter1>BuildOrigin - <_Parameter2>$(GITHUB_REPOSITORY) - + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + + + + + + $(IntermediateOutputPath)gitver + + + + + + + + + + @(GitVersion) + + + + + + $(IntermediateOutputPath)CustomAssemblyInfo.cs + + + + + + + + + <_Parameter1>GitHash + <_Parameter2>$(BuildHash) + + + + <_Parameter1>BuildOrigin + <_Parameter2>$(GITHUB_REPOSITORY) + + + + + \ No newline at end of file