Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[General] Offline mode only toggleable if allowed #970

Merged
merged 4 commits into from
Feb 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions electron/legendary/games.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ Categories=Game;
let envVars = ''
let gameMode: string
const gameSettings = await this.getSettings()
const gameInfo = await this.getGameInfo()

const {
winePrefix,
Expand All @@ -546,9 +547,26 @@ Categories=Game;

const { discordRPC } = await GlobalConfig.get().getSettings()
const DiscordRPC = discordRPC ? makeClient('852942976564723722') : null
const runOffline = isOffline || offlineMode ? '--offline' : ''

let runOffline = ''
if (isOffline || offlineMode) {
if (gameInfo.canRunOffline) {
runOffline = '--offline'
} else {
return dialog.showErrorBox(
i18next.t(
'box.error.no-offline-mode.title',
'Offline mode not supported.'
),
i18next.t(
'box.error.no-offline-mode.message',
'Launch aborted! The game requires a internet connection to run it.'
)
)
}
}

const exe = targetExe ? `--override-exe ${targetExe}` : ''
const gameInfo = await this.getGameInfo()
const isMacNative = gameInfo.is_mac_native
const mangohud = showMangohud ? 'mangohud --dlsym' : ''

Expand Down
4 changes: 4 additions & 0 deletions public/locales/bg/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Неизвестна грешка"
},
"launch": "Грешка при пускането на играта. Проверете журнала!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Грешка",
"wine-not-found": {
"message": "No Wine Version Selected. Check Game Settings!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/ca/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
"message": "Hi ha hagut un error desconegut",
"title": "Error desconegut"
},
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"launch": "Error en iniciar el joc, comprova el registre.",
"title": "Error",
"wine-not-found": {
Expand Down
4 changes: 4 additions & 0 deletions public/locales/cs/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Neočekávaná chyba"
},
"launch": "Chyba při spouštění hry, zkontrolujte záznamy!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Error",
"wine-not-found": {
"message": "No Wine Version Selected. Check Game Settings!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Unbekannter Fehler"
},
"launch": "Fehler beim Starten des Spiels, prüfen Sie die Logs!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Error",
"wine-not-found": {
"message": "Keine Wine Version ausgewählt. Überprüfen Sie die Spieleinstellungen!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/el/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Άγνωστο σφάλμα"
},
"launch": "Σφάλμα στην εκκίνηση του παιχνιδιού, ελέγξτε τα αρχεία καταγραφής!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Σφάλμα",
"wine-not-found": {
"message": "No Wine Version Selected. Check Game Settings!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Unknown Error"
},
"launch": "Error when launching the game, check the logs!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Error",
"wine-not-found": {
"message": "No Wine Version Selected. Check Game Settings!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Error desconocido"
},
"launch": "Error al iniciar el juego, ¡revisa los registros!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Error",
"wine-not-found": {
"message": "No se ha seleccionado la versión de Wine. ¡Comprueba la configuración del juego!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/et/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Tundmatu viga"
},
"launch": "Viga mängu käivitamisel, kontrollige logisid!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Viga",
"wine-not-found": {
"message": "Wine-i versiooni pole valitud. Kontrolli mängu seadeid!",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/fa/gamepage.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"title": "توقف نصب"
},
"uninstall": {
"checkbox": "آیا می‌خواهید مسیر را هم پاک کنید؟ این کار بازگشت پذیر نیست.",
"checkbox": "آیا می\u200cخواهید مسیر را هم پاک کنید؟ این کار بازگشت پذیر نیست.",
"checkbox_prefix": "Prefix",
"message": "آیا میخواهید این بازی را حذف کنید؟",
"title": "حذف"
Expand Down
16 changes: 10 additions & 6 deletions public/locales/fa/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@
"title": "خطای ناشناخته"
},
"launch": "خطا در هنگام اجرای بازی، لاگها را چک کنید!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "خطا",
"wine-not-found": {
"message": "نسخه‌ای از Wine انتخاب نشده است. تنظیمات بازی را چک کنید!",
"message": "نسخه\u200cای از Wine انتخاب نشده است. تنظیمات بازی را چک کنید!",
"title": "Wine یافت نشد"
}
},
Expand Down Expand Up @@ -74,9 +78,9 @@
},
"warning": {
"epic": {
"import": "سرورهای اپیک در حال حاضر قطعی عمده دارند، بازی نمی‌تواند اضافه شود!",
"install": "سرورهای اپیک در حال حاضر قطعی عمده دارند، بازی نمی‌تواند نصب شود!",
"update": "سرورهای اپیک در حال حاضر قطعی عمده دارند، بازی نمی‌تواند به‌روزرسانی شود!"
"import": "سرورهای اپیک در حال حاضر قطعی عمده دارند، بازی نمی\u200cتواند اضافه شود!",
"install": "سرورهای اپیک در حال حاضر قطعی عمده دارند، بازی نمی\u200cتواند نصب شود!",
"update": "سرورهای اپیک در حال حاضر قطعی عمده دارند، بازی نمی\u200cتواند به\u200cروزرسانی شود!"
},
"title": "هشدار"
},
Expand Down Expand Up @@ -313,8 +317,8 @@
"wiki": "ویکی",
"wine": {
"manager": {
"error": "نمی‌توان در این زمان نسخه‌های Wine/Proton را به دست آورد.",
"link": "مدیریت Wine",
"error": "نمی\u200cتوان در این زمان نسخه\u200cهای Wine/Proton را به دست آورد.",
"link": "مدیریت Wine\u202e",
"title": "مدیریت Wine (آزمایشی)",
"unzipping": "در حال خارج کردن از حالت فشرده"
}
Expand Down
4 changes: 4 additions & 0 deletions public/locales/fi/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Tuntematon Virhe"
},
"launch": "Virhe pelin käynnistyksessä, tarkista pelin lokitiedostot!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Virhe",
"wine-not-found": {
"message": "No Wine Version Selected. Check Game Settings!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Erreur inconnue"
},
"launch": "Erreur lors du lancement du jeu, consultez les fichiers de journalisation !",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Erreur",
"wine-not-found": {
"message": "No Wine Version Selected. Check Game Settings!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/gl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Erro descoñecido"
},
"launch": "Produciuse un erro ao iniciar o xogo, revisa os rexistros!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Erro",
"wine-not-found": {
"message": "No Wine Version Selected. Check Game Settings!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/hr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Nepoznata greška"
},
"launch": "Greška kod pokretanja igrice, provjerite dnevnik!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Greška",
"wine-not-found": {
"message": "Wine nije odabran. Provjerite postavke igre!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/hu/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Ismeretlen hiba"
},
"launch": "Hiba a játék indításakor, ellenőrizd a naplófájlokat!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Hiba",
"wine-not-found": {
"message": "Nincs kiválasztott Wine verzió. Ellenőrizd a játék beállításait!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/id/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Error Tak Dikenal"
},
"launch": "Error ketika meluncurkan permainan, periksa log!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Error",
"wine-not-found": {
"message": "No Wine Version Selected. Check Game Settings!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/it/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Errore sconosciuto"
},
"launch": "Errore durante l'avvio del gioco, controlla i logs!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Errore",
"wine-not-found": {
"message": "Nessuna versione di Wine selezionata. Controlla le impostazioni del gioco!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/ja/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "不明なエラー"
},
"launch": "ゲームの起動時にエラーが発生しました、ログを確認してください!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "エラー",
"wine-not-found": {
"message": "No Wine Version Selected. Check Game Settings!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/ko/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "알 수 없는 오류"
},
"launch": "게임을 실행할 때 오류가 발생했습니다, 로그를 확인 해주세요!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "오류",
"wine-not-found": {
"message": "No Wine Version Selected. Check Game Settings!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/ml/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "കുഴപ്പമുണ്ടല്ലോ"
},
"launch": "കളി ഓടിക്കുന്നതിനിടക്ക് എന്തോ കുഴപ്പം പറ്റിയട്ടുണ്ട്, കുറികള് നോക്കൂ!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "കുഴപ്പം",
"wine-not-found": {
"message": "No Wine Version Selected. Check Game Settings!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/nl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Onbekende fout"
},
"launch": "Een probleem tijdens het lanceren van het spel, check de logs!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Error",
"wine-not-found": {
"message": "No Wine Version Selected. Check Game Settings!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/pl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Nieznany błąd"
},
"launch": "Błąd przy uruchamianiu gry, sprawdź logi!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Error",
"wine-not-found": {
"message": "Nie Wybrano Wersji Wine . Sprawdź Ustawienia Gry!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Erro Desconhecido"
},
"launch": "Houve um erro ao rodar o jogo, veja os Logs para ver o que aconteceu!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Error",
"wine-not-found": {
"message": "No Wine Version Selected. Check Game Settings!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/pt_BR/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Erro Desconhecido"
},
"launch": "Erro ao iniciar o jogo, confira os logs!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Erro",
"wine-not-found": {
"message": "Nenhuma Versão do wine selecionada. Cheque as configurações do jogo!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/ru/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
"message": "Произошла неизвестная ошибка",
"title": "Неизвестная ошибка"
},
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"launch": "Ошибка при запуске игры, проверьте журнал!",
"title": "Ошибка",
"wine-not-found": {
Expand Down
4 changes: 4 additions & 0 deletions public/locales/sv/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Okänt fel"
},
"launch": "Fel vid uppstar av spelet, kontrollera loggarna!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Error",
"wine-not-found": {
"message": "No Wine Version Selected. Check Game Settings!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/ta/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "அறியப்படாத பிழை"
},
"launch": "விளையாட்டை துவக்கும்போது பிழை, பதிவுகளை பார்க்கவும்!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "பிழை",
"wine-not-found": {
"message": "No Wine Version Selected. Check Game Settings!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/tr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "Bilinmeyen hata"
},
"launch": "Oyun başlatılırken hata oluştu, günlük kayıtlarına bakın!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "Hata",
"wine-not-found": {
"message": "Wine Sürümü Seçilmedi. Oyun Ayarlarını Denetleyin!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/zh_Hans/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "未知错误"
},
"launch": "启动游戏时出现错误,请检查日志!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "错误",
"wine-not-found": {
"message": "没有选中 Wine 版本。检查游戏设置!",
Expand Down
4 changes: 4 additions & 0 deletions public/locales/zh_Hant/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"title": "未知錯誤"
},
"launch": "啟動遊戲時出現錯誤,請檢查日誌!",
"no-offline-mode": {
"message": "Launch aborted! The game requires a internet connection to run it.",
"title": "Offline mode not supported."
},
"title": "錯誤",
"wine-not-found": {
"message": "No Wine Version Selected. Check Game Settings!",
Expand Down
Loading