Skip to content

Cache background URLs for instant background on game switch - #896

Merged
neon-nyan merged 7 commits into
mainfrom
fix/bg-cache
Aug 1, 2026
Merged

Cache background URLs for instant background on game switch#896
neon-nyan merged 7 commits into
mainfrom
fix/bg-cache

Conversation

@shatyuka

@shatyuka shatyuka commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Main Goal

Cache background image URLs to config and preload background before region loading, so the cached or preset background appears instantly on game switch without waiting for API download.
If the background files are cached locally, the background is displayed immediately. If not cached, the game-specific preset placeholder is shown while the real background downloads in the background.

Games added via plugins have not yet been tested.

PR Status :

  • Overall Status : WIP
  • Commits : WIP
  • Synced to base (Collapse:main) : Yes
  • Build status : OK
  • Crashing : No
  • Bug found caused by PR : -

@shatyuka
shatyuka marked this pull request as ready for review July 22, 2026 16:01
Comment on lines +134 to +138
bool willDisplayStatic = !IsVideoMediaFileExtensionSupported(primaryBg ?? staticBgUrl!) ||
(!CurrentIsEnableCustomImage &&
!GlobalIsEnableCustomImage &&
!CurrentIsEnableBackgroundAutoPlay);
Uri accentPreviewUri = willDisplayStatic ? new Uri(localStatic) : new Uri(localBackground);

This comment was marked as outdated.

Comment on lines +379 to +383
Color syncColor = Task.Run(async () =>
await ColorPaletteUtility.GetMediaAccentColorFromAsync(fallbackSourceUri, false)
).GetAwaiter().GetResult();
ThemeRootElement.ChangeAccentColor(syncColor);
LauncherConfig.SetAndSaveConfigValue($"{cachedBgKey}-AccentColor",

This comment was marked as outdated.

ImageSource = new BitmapImage(new Uri(placeholderPath)),
Stretch = Stretch.UniformToFill
};
PresenterGrid.Children.Clear();

This comment was marked as outdated.

@neon-nyan
neon-nyan merged commit 4748c71 into main Aug 1, 2026
11 checks passed
@neon-nyan neon-nyan mentioned this pull request Aug 25, 2026
neon-nyan added a commit that referenced this pull request Aug 25, 2026
![UpdateIsAvailable-Campaign-Columbina](https://github.com/user-attachments/assets/e7043018-4d49-48f2-adf1-3c846fd3c3e4)
# Preview 1.84.5 (Codename: Columbina)

# What's Changed? - 1.84.5
- **[Imp]** [Optimize background image
load](#891), by
@shatyuka
- **[Imp]** [Cache background URLs for instant background on game
switch](#896), by
@shatyuka
- **[Imp]** [Fix drag mechanism in Plugin Management
Menu](#894), by
@Cryotechnic
- **[Misc]** [docs: fix broken links in Thai localized
README](#898), by
@latent-9
- **[Imp]** [Reconciling progress
state](5103e5d),
by @Cryotechnic
- **[Imp]** [Use Async API for Honkai Impact 3rd's Game
Repair](6cecd09)
- **[Fix]** #895 [Fix False "insufficient space" error on NTFS volume
mount
points](0d472e9),
by @shatyuka
- **[Imp]** [Skip cps value
validation](63f7d7c),
by @shatyuka
- **[Fix][Imp]** Bunch of Windows App SDK fixes and improvements, by
@shatyuka and @neon-nyan
- [Fix maximize disable not working after
AOT](2579160)
- [Fix trim in non-AOT
mode](5f6273f)
- [Fix NativeAOT Debug build
freeze](5d610db)
- [Enable Windows App SDK experimental
optimizations](46a8241),
[See Microsoft Documentation
here](https://github.com/sundaramramaswamy/microsoft-ui-xaml/blob/069fbc9683b3b07df5549961e00251439a6916cd/specs/XamlOptionalChanges/XamlOptionalChanges-Spec.md#xamlchangeid-enum)
for more info.
- [Fix crash due to unnecessary assertion in generated
code](6474dd8)
- **[Fix]** [Fix preload package
detection](d1d9f70),
by @neon-nyan
- **[Fix]** [Fix Sophon force redirect
logic](92f49be),
by @neon-nyan
- **[Imp]** Upgrade FFmpeg to 8.x + Includes in-house, LGPLv2.1
compliance library with the build, by @neon-nyan
- **[Imp]** CI/CD Workflows and Pipelines, by @bagusnl 

**Full Changelog**:
CL-v1.84.4-pre...CL-v1.84.5-pre
	
# Code Signing Policy
> Free code signing provided by [SignPath.io], certificate by [SignPath
Foundation]
- This program will not transfer any information to other networked
systems.
- Read our full [**Privacy
Policy**](https://github.com/CollapseLauncher/Collapse/blob/main/PRIVACY.md)
- Also read our [**Third Party
Notices**](https://github.com/CollapseLauncher/Collapse/blob/main/THIRD_PARTY_NOTICES.md)
for license used by third party libraries that we use.

[SignPath Foundation]:https://signpath.org
[SignPath.io]:https://signpath.io
@neon-nyan neon-nyan mentioned this pull request Aug 25, 2026
neon-nyan added a commit that referenced this pull request Aug 25, 2026
![UpdateIsAvailable-Campaign-Columbina](https://github.com/user-attachments/assets/e7043018-4d49-48f2-adf1-3c846fd3c3e4)
# Preview 1.84.5 (Codename: Columbina)

# What's Changed? - 1.84.5
- **[Imp]** [Optimize background image
load](#891), by
@shatyuka
- **[Imp]** [Cache background URLs for instant background on game
switch](#896), by
@shatyuka
- **[Imp]** [Fix drag mechanism in Plugin Management
Menu](#894), by
@Cryotechnic
- **[Misc]** [docs: fix broken links in Thai localized
README](#898), by
@latent-9
- **[Imp]** [Reconciling progress
state](5103e5d),
by @Cryotechnic
- **[Imp]** [Use Async API for Honkai Impact 3rd's Game
Repair](6cecd09)
- **[Fix]** #895 [Fix False "insufficient space" error on NTFS volume
mount
points](0d472e9),
by @shatyuka
- **[Imp]** [Skip cps value
validation](63f7d7c),
by @shatyuka
- **[Fix][Imp]** Bunch of Windows App SDK fixes and improvements, by
@shatyuka and @neon-nyan
- [Fix maximize disable not working after
AOT](2579160)
- [Fix trim in non-AOT
mode](5f6273f)
- [Fix NativeAOT Debug build
freeze](5d610db)
- [Enable Windows App SDK experimental
optimizations](46a8241),
[See Microsoft Documentation
here](https://github.com/sundaramramaswamy/microsoft-ui-xaml/blob/069fbc9683b3b07df5549961e00251439a6916cd/specs/XamlOptionalChanges/XamlOptionalChanges-Spec.md#xamlchangeid-enum)
for more info.
- [Fix crash due to unnecessary assertion in generated
code](6474dd8)
- **[Fix]** [Fix preload package
detection](d1d9f70),
by @neon-nyan
- **[Fix]** [Fix Sophon force redirect
logic](92f49be),
by @neon-nyan
- **[Imp]** Upgrade FFmpeg to 8.x + Includes in-house, LGPLv2.1
compliance library with the build, by @neon-nyan
- **[Imp]** CI/CD Workflows and Pipelines, by @bagusnl 

**Full Changelog**:
CL-v1.84.4-pre...CL-v1.84.5-pre
	
# Code Signing Policy
> Free code signing provided by [SignPath.io], certificate by [SignPath
Foundation]
- This program will not transfer any information to other networked
systems.
- Read our full [**Privacy
Policy**](https://github.com/CollapseLauncher/Collapse/blob/main/PRIVACY.md)
- Also read our [**Third Party
Notices**](https://github.com/CollapseLauncher/Collapse/blob/main/THIRD_PARTY_NOTICES.md)
for license used by third party libraries that we use.

[SignPath Foundation]:https://signpath.org
[SignPath.io]:https://signpath.io
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants