Skip to content

Commit

Permalink
Merge #4057 Fix outdated client message when up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Mar 14, 2024
2 parents eaee4fd + cf0858d commit 98b76fb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ All notable changes to this project will be documented in this file.
- [GUI] Sort mods satisfying the same recommendation by download count (#4007 by: HebaruSan)
- [Multiple] Alternate game command lines and Steam refactor (#4010, #4013, #4028 by: HebaruSan)
- [Multiple] Recommendations usability improvements (#4025 by: HebaruSan)
- [Multiple] Prompt for client upgrade when newer spec is found (#4026 by: HebaruSan)
- [Multiple] Prompt for client upgrade when newer spec is found (#4026, #4057 by: HebaruSan)
- [GUI] Ability to clear auto-installed flag from changeset tab (#4033 by: HebaruSan)
- [Multiple] New Crowdin updates (#4019 by: Olympic1, vinix38; reviewed: HebaruSan)
- [Core] Support Windows KSP1 instances on Linux (#4044 by: HebaruSan)
Expand Down
5 changes: 4 additions & 1 deletion Core/Repositories/RepositoryData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,10 @@ private static ArchiveList AggregateArchiveEntries(ParallelQuery<ArchiveEntry> e
subtotal.Item2 ?? item.Item2,
subtotal.Item3 ?? item.Item3,
subtotal.Item4 ?? item.Item4,
subtotal.Item5 || item.Item1 == null),
subtotal.Item5 || (item.Item1 == null
&& item.Item2 == null
&& item.Item3 == null
&& item.Item4 == null)),
(total, subtotal)
=> new ArchiveList(total.Item1.Concat(subtotal.Item1).ToList(),
total.Item2 ?? subtotal.Item2,
Expand Down
27 changes: 11 additions & 16 deletions GUI/Main/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -418,33 +418,28 @@ private void CurrentInstanceUpdated()
configuration?.Save();
configuration = GUIConfigForInstance(Manager.SteamLibrary, CurrentInstance);

AutoUpdatePrompts(ServiceLocator.Container
.Resolve<IConfiguration>(),
configuration);

bool autoUpdating = configuration.CheckForUpdatesOnLaunch
&& CheckForCKANUpdate();
if (autoUpdating)
{
UpdateCKAN();
}

var pluginsPath = Path.Combine(CurrentInstance.CkanDir(), "Plugins");
if (!Directory.Exists(pluginsPath))
{
Directory.CreateDirectory(pluginsPath);
}

pluginController = new PluginController(pluginsPath, true);

CurrentInstance.game.RebuildSubdirectories(CurrentInstance.GameDir());

ManageMods.InstanceUpdated();
bool repoUpdateNeeded = configuration.RefreshOnStartup;
if (!autoUpdating)

AutoUpdatePrompts(ServiceLocator.Container
.Resolve<IConfiguration>(),
configuration);

if (configuration.CheckForUpdatesOnLaunch && CheckForCKANUpdate())
{
UpdateCKAN();
}
else
{
// If not allowing, don't do anything
if (repoUpdateNeeded)
if (configuration.RefreshOnStartup)
{
UpdateRepo(refreshWithoutChanges: true);
}
Expand Down
2 changes: 1 addition & 1 deletion GUI/Main/MainAutoUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void UpdateCKAN()
var mainConfig = ServiceLocator.Container.Resolve<IConfiguration>();
var update = updater.GetUpdate(mainConfig.DevBuilds ?? false);
Wait.SetDescription(string.Format(Properties.Resources.MainUpgradingTo,
update.Version));
update.Version));

log.Info("Starting CKAN update");
Wait.StartWaiting((sender, args) => updater.StartUpdateProcess(true, mainConfig.DevBuilds ?? false, currentUser),
Expand Down

0 comments on commit 98b76fb

Please sign in to comment.