Skip to content

feat(): Epic Offline Mode for offline launches#1467

Open
phobos665 wants to merge 5 commits into
utkarshdalal:masterfrom
phobos665:feat/offline-launch-epic
Open

feat(): Epic Offline Mode for offline launches#1467
phobos665 wants to merge 5 commits into
utkarshdalal:masterfrom
phobos665:feat/offline-launch-epic

Conversation

@phobos665
Copy link
Copy Markdown
Contributor

@phobos665 phobos665 commented May 23, 2026

Description

Added a new option in the Container settings for launching games offline when using Epic.

Now correctly launches games offline if the device or the setting has been enabled.

Also added translations.

Fixes games such as Tomb Raider 1-3 Remastered where the game can only launch in offline mode.

Recording

Recording of Offline mode for Epic games:
https://github.com/user-attachments/assets/639704e0-f41f-4d53-9b6f-0833edda3729

Type of Change

  • Bug fix
  • Performance / stability improvement
  • Compatibility improvements
  • Other (requires prior approval)

Checklist

  • If I have access to #code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.
  • This change aligns with the current project scope (core functionality, stability, or performance). If not, it has been explicitly approved beforehand.
  • I have attached a recording of the change.
  • I have read and agree to the contribution guidelines in CONTRIBUTING.md.

Summary by cubic

Add Epic Offline Mode for Epic game launches. Games can now launch without authentication when the device is offline or the setting is enabled, with per‑container persistence and localized UI.

  • New Features
    • Added “Epic Offline Mode” switch in Container settings (General tab), persisted via PrefManager.epicOfflineMode, ContainerData.epicOfflineMode, and Container getters/setters.
    • Wired offline state through XServerScreen to Epic launches; EpicGameLauncher now skips token fetch when offline.
    • Added translations for the new labels across supported locales.

Written for commit 1062f4b. Summary will update on new commits. Review in cubic

Summary by CodeRabbit

  • New Features
    • Added Epic offline mode option to application settings. Users can now enable offline launching for Epic Games titles when internet connectivity is unavailable. Localized support for 15+ languages.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 23, 2026

📝 Walkthrough

Walkthrough

This PR adds Epic Games offline mode support by introducing a new user-configurable preference that flows through the container configuration system to the launch path. The feature persists offline mode state across app sessions and passes it to the Epic game launcher.

Changes

Epic Offline Mode Implementation

Layer / File(s) Summary
Container persistence layer for offline mode
com/winlator/container/Container.java
epicOfflineMode field added with JSON serialization in saveData() and loadData(), plus public accessors isEpicOfflineMode() and setEpicOfflineMode(boolean).
Configuration data model extension
com/winlator/container/ContainerData.kt
New epicOfflineMode property (default false) added to data class with serialization support in Saver companion for both save and restore paths.
Preference and configuration lifecycle
app/gamenative/PrefManager.kt, app/gamenative/utils/ContainerUtils.kt
PrefManager.epicOfflineMode preference added; ContainerUtils now threads the value through getDefaultContainerData(), setDefaultContainerData(), toContainerData(), applyBestConfigMapToContainerData(), applyToContainer(), and createNewContainer() to persist and synchronize across config operations.
Settings UI configuration switch
app/gamenative/ui/component/dialog/GeneralTab.kt
New SettingsSwitch added for config.epicOfflineMode with wiring to update state; unused local_saves_only switch block removed.
Launch path offline flag threading
app/gamenative/ui/screen/xserver/XServerScreen.kt, app/gamenative/service/epic/EpicGameLauncher.kt
isOffline flag passed to setupXEnvironment(...) and threaded to getWineStartCommand(...); Epic launch parameters computed as offlineLaunch = offline || container.isEpicOfflineMode; EpicGameLauncher.buildLaunchParameters() simplified to always return successful offline parameters when offline is true.
Localized UI strings
app/src/main/res/values*/strings.xml (14 locales)
epic_offline_mode and epic_offline_mode_description string resources added in Danish, German, Spanish, French, Italian, Korean, Polish, Portuguese-BR, Romanian, Russian, Ukrainian, Simplified Chinese, Traditional Chinese, and English default.

Sequence Diagram

sequenceDiagram
  participant User as User
  participant Settings as GeneralTab
  participant Prefs as PrefManager
  participant Utils as ContainerUtils
  participant Container as Container
  participant XServer as XServerScreen
  participant Epic as EpicGameLauncher
  User->>Settings: Toggle epicOfflineMode
  Settings->>Prefs: epicOfflineMode = true
  Prefs->>Utils: setDefaultContainerData()
  Utils->>Container: setEpicOfflineMode(true)
  User->>XServer: Launch game with offline flag
  XServer->>Container: isEpicOfflineMode() check
  XServer->>Epic: buildLaunchParameters(offline=true)
  Epic->>Epic: Return offline launch success
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • utkarshdalal/GameNative#1139: Overlaps on modifications to GeneralTabContent in GeneralTab.kt with removal of the local_saves_only settings switch.

Poem

🐰 A rabbit's ode to offline play:
An Epic mode for offline days,
Through Container streams and Pref displays,
From UI switch to launch's deep ways,
Now games run free, no internet delays!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.76% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main feature added: Epic Offline Mode support for offline launches. It is specific, relevant, and directly summarizes the primary change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description covers all required sections from the template: a clear description of changes, an attached recording, type of change selected, and all checklist items completed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@phobos665 phobos665 marked this pull request as ready for review May 23, 2026 21:22
@phobos665 phobos665 requested a review from utkarshdalal as a code owner May 23, 2026 21:22
Comment on lines 1980 to +3001
@@ -2992,16 +2992,13 @@ private fun setupXEnvironment(
bootToContainer: Boolean,
testGraphics: Boolean,
xServerState: MutableState<XServerState>,
// xServerViewModel: XServerViewModel,
envVars: EnvVars,
// generateWinePrefix: Boolean,
container: Container?,
appLaunchInfo: LaunchInfo?,
// shortcut: Shortcut?,
xServer: XServer,
containerVariantChanged: Boolean,
onGameLaunchError: ((String) -> Unit)? = null,
navigateBack: () -> Unit,
offline: Boolean = false
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed some old params, and removed navigateBack as it wasn't used.

Added in "offline" from the XServerScreen constructor to do a similar check as Steam.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 21 files

Re-trigger cubic

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.

1 participant