diff --git a/.editorconfig b/.editorconfig index 75fe3b237..a270f7998 100644 --- a/.editorconfig +++ b/.editorconfig @@ -34,6 +34,9 @@ end_of_line = lf indent_style = space indent_size = 2 +[*.desktop] +end_of_line = lf + [*.md] indent_style = space indent_size = 2 diff --git a/Packaging/nix/devilutionx-hellfire.desktop b/Packaging/nix/devilutionx-hellfire.desktop index 2327411fb..ac7695c50 100644 --- a/Packaging/nix/devilutionx-hellfire.desktop +++ b/Packaging/nix/devilutionx-hellfire.desktop @@ -5,7 +5,7 @@ Comment=Play Diablo: Hellfire on Linux Comment[da]=Spil Diablo: Hellfire på Linux Comment[hr]=Igrajte Diablo: Hellfire na Linuxu Comment[it]=Gioca a Diablo: Hellfire su Linux -Exec=devilutionx +Exec=devilutionx --hellfire Icon=devilutionx-hellfire Terminal=false Type=Application diff --git a/Source/appfat.cpp b/Source/appfat.cpp index f9d7da5e3..dd6fe297b 100644 --- a/Source/appfat.cpp +++ b/Source/appfat.cpp @@ -104,7 +104,7 @@ void ErrDlg(const char *title, const char *error, const char *logFilePath, int l app_fatal(nullptr); } -void InsertCDDlg() +void InsertCDDlg(const char *archiveName) { char text[1024]; @@ -112,9 +112,12 @@ void InsertCDDlg() text, sizeof(text), "%s", - _("Unable to open main data archive (diabdat.mpq or spawn.mpq).\n" - "\n" - "Make sure that it is in the game folder.")); + fmt::format( + _("Unable to open main data archive ({:s}).\n" + "\n" + "Make sure that it is in the game folder."), + archiveName) + .c_str()); UiErrorOkDialog(_("Data File Error"), text); app_fatal(nullptr); diff --git a/Source/appfat.h b/Source/appfat.h index 15387846b..8ad743eb3 100644 --- a/Source/appfat.h +++ b/Source/appfat.h @@ -54,7 +54,7 @@ void DrawDlg(const char *pszFmt, ...) DVL_PRINTF_ATTRIBUTE(1, 2); /** * @brief Terminates the game with an insert CD error dialog. */ -[[noreturn]] void InsertCDDlg(); +[[noreturn]] void InsertCDDlg(const char *archiveName); /** * @brief Terminates the game with a read-only directory error dialog. diff --git a/Source/diablo.cpp b/Source/diablo.cpp index d05fa873a..c57da5e51 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -788,12 +788,14 @@ void RunGameLoop(interface_mode uMsg) printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "-f", _("Display frames per second")); printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "-x", _("Run in windowed mode")); printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "--verbose", _("Enable verbose logging")); - printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "--spawn", _("Force spawn mode even if diabdat.mpq is found")); printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "--record <#>", _("Record a demo file")); printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "--demo <#>", _("Play a demo file")); printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "--timedemo", _("Disable all frame limiting during demo playback")); + printInConsole("%s", _(/* TRANSLATORS: Commandline Option */ "\nGame selection:\n")); + printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "--spawn", _("Force Shareware mode")); + printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "--diablo", _("Force Diablo mode")); + printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "--hellfire", _("Force Hellfire mode")); printInConsole("%s", _(/* TRANSLATORS: Commandline Option */ "\nHellfire options:\n")); - printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "--diablo", _("Force diablo mode even if hellfire.mpq is found")); printInConsole(" %-20s %-30s\n", /* TRANSLATORS: Commandline Option */ "--nestart", _("Use alternate nest palette")); #ifdef _DEBUG printInConsole("\nDebug options:\n"); @@ -842,6 +844,8 @@ void DiabloParseFlags(int argc, char **argv) forceSpawn = true; } else if (strcasecmp("--diablo", argv[i]) == 0) { forceDiablo = true; + } else if (strcasecmp("--hellfire", argv[i]) == 0) { + forceHellfire = true; } else if (strcasecmp("--nestart", argv[i]) == 0) { gbNestArt = true; } else if (strcasecmp("--vanilla", argv[i]) == 0) { @@ -911,6 +915,8 @@ void DiabloInit() gbIsSpawn = true; if (forceDiablo || sgOptions.Hellfire.startUpGameOption == StartUpGameOption::Diablo) gbIsHellfire = false; + if (forceHellfire) + gbIsHellfire = true; gbIsHellfireSaveGame = gbIsHellfire; @@ -935,7 +941,7 @@ void DiabloInit() ReadOnlyTest(); - if (gbIsHellfire && sgOptions.Hellfire.startUpGameOption == StartUpGameOption::None) { + if (gbIsHellfire && !forceHellfire && sgOptions.Hellfire.startUpGameOption == StartUpGameOption::None) { UiSelStartUpGameOption(); if (!gbIsHellfire) { // Reinitalize the UI Elements cause we changed the game diff --git a/Source/init.cpp b/Source/init.cpp index a218ce816..a1178f1f1 100644 --- a/Source/init.cpp +++ b/Source/init.cpp @@ -46,6 +46,8 @@ bool gbIsSpawn; bool gbIsHellfire; /** Indicate if we want vanilla savefiles */ bool gbVanilla; +/** Whether the Hellfire mode is required (forced). */ +bool forceHellfire; HANDLE hfmonk_mpq; HANDLE hfbard_mpq; HANDLE hfbarb_mpq; @@ -199,12 +201,15 @@ void init_archives() } SDL_RWops *handle = SFileOpenRw("ui_art\\title.pcx"); if (handle == nullptr) - InsertCDDlg(); + InsertCDDlg(_("diabdat.mpq or spawn.mpq")); SDL_RWclose(handle); hellfire_mpq = LoadMPQ(paths, "hellfire.mpq"); if (hellfire_mpq != nullptr) gbIsHellfire = true; + if (forceHellfire && hellfire_mpq == nullptr) + InsertCDDlg("hellfire.mpq"); + hfmonk_mpq = LoadMPQ(paths, "hfmonk.mpq"); hfbard_mpq = LoadMPQ(paths, "hfbard.mpq"); if (hfbard_mpq != nullptr) diff --git a/Source/init.h b/Source/init.h index cb600a654..7d20e6138 100644 --- a/Source/init.h +++ b/Source/init.h @@ -17,6 +17,7 @@ extern HANDLE diabdat_mpq; extern bool gbIsSpawn; extern bool gbIsHellfire; extern bool gbVanilla; +extern bool forceHellfire; extern HANDLE hfmonk_mpq; extern HANDLE hfbard_mpq; extern HANDLE hfbarb_mpq; diff --git a/Translations/bg.po b/Translations/bg.po index 041556ad4..8eae472cb 100644 --- a/Translations/bg.po +++ b/Translations/bg.po @@ -853,14 +853,17 @@ msgstr "" #: Source/appfat.cpp:115 msgid "" -"Unable to open main data archive (diabdat.mpq or spawn.mpq).\n" +"Unable to open main data archive ({:s}).\n" "\n" "Make sure that it is in the game folder." msgstr "" -"Неуспешно прочитане на водещ файлов архив (diabdat.mpq или spawn.mpq).\n" +"Неуспешно прочитане на водещ файлов архив ({:s}).\n" "\n" "Уверете се, че се съответният се намира в папката на играта." +msgid "diabdat.mpq or spawn.mpq" +msgstr "diabdat.mpq или spawn.mpq" + #: Source/appfat.cpp:119 msgid "Data File Error" msgstr "Грешка при прочитане на данни от файл" diff --git a/Translations/cs.po b/Translations/cs.po index 70b51f4d2..eeeafec2a 100644 --- a/Translations/cs.po +++ b/Translations/cs.po @@ -799,14 +799,17 @@ msgstr "" #: Source/appfat.cpp:115 msgid "" -"Unable to open main data archive (diabdat.mpq or spawn.mpq).\n" +"Unable to open main data archive ({:s}).\n" "\n" "Make sure that it is in the game folder." msgstr "" -"Nelze otevřít hlavní datový archiv (diabdat.mpq nebo spawn.mpq).\n" +"Nelze otevřít hlavní datový archiv ({:s}).\n" "\n" "Ujistěte se, že je výše uvedený soubor ve složce se hrou." +msgid "diabdat.mpq or spawn.mpq" +msgstr "diabdat.mpq nebo spawn.mpq" + #: Source/appfat.cpp:119 msgid "Data File Error" msgstr "Chyba Datového Souboru" diff --git a/Translations/da.po b/Translations/da.po index 8803cae10..45d63d1e5 100644 --- a/Translations/da.po +++ b/Translations/da.po @@ -855,7 +855,7 @@ msgstr "" #| "Make sure that it is in the game folder and that the file name is in all " #| "lowercase." msgid "" -"Unable to open main data archive (diabdat.mpq or spawn.mpq).\n" +"Unable to open main data archive ({:s}).\n" "\n" "Make sure that it is in the game folder." msgstr "" @@ -863,6 +863,9 @@ msgstr "" "\n" "Sørg for, at den findes i spilmappen, og at filnavnet er med små bogstaver." +msgid "diabdat.mpq or spawn.mpq" +msgstr "diabdat.mpq eller spawn.mpq" + #: Source/appfat.cpp:119 #, fuzzy msgid "Data File Error" diff --git a/Translations/de.po b/Translations/de.po index e1daa4eb5..eb42a6e9f 100644 --- a/Translations/de.po +++ b/Translations/de.po @@ -856,15 +856,18 @@ msgstr "" #: Source/appfat.cpp:115 msgid "" -"Unable to open main data archive (diabdat.mpq or spawn.mpq).\n" +"Unable to open main data archive ({:s}).\n" "\n" "Make sure that it is in the game folder." msgstr "" -"Das Hauptdatenarchiv (diabdat.mpq oder spawn.mpq) kann nicht geöffnet " +"Das Hauptdatenarchiv ({:s}) kann nicht geöffnet " "werden.\n" "\n" "Stelle sicher, dass es sich im Spielordner befindet." +msgid "diabdat.mpq or spawn.mpq" +msgstr "diabdat.mpq oder spawn.mpq" + #: Source/appfat.cpp:119 msgid "Data File Error" msgstr "Dateifehler" diff --git a/Translations/devilutionx.pot b/Translations/devilutionx.pot index 4d018bab4..fa72a8af6 100644 --- a/Translations/devilutionx.pot +++ b/Translations/devilutionx.pot @@ -776,7 +776,7 @@ msgstr "" #: Source/appfat.cpp:115 msgid "" -"Unable to open main data archive (diabdat.mpq or spawn.mpq).\n" +"Unable to open main data archive ({:s}).\n" "\n" "Make sure that it is in the game folder." msgstr "" diff --git a/Translations/es.po b/Translations/es.po index b429aedea..2dfd94a6a 100644 --- a/Translations/es.po +++ b/Translations/es.po @@ -830,14 +830,17 @@ msgstr "" #: Source/appfat.cpp:115 msgid "" -"Unable to open main data archive (diabdat.mpq or spawn.mpq).\n" +"Unable to open main data archive ({:s}).\n" "\n" "Make sure that it is in the game folder." msgstr "" -"No se puede abrir el archivo de datos principal (diabdat.mpq o spawn.mpq).\n" +"No se puede abrir el archivo de datos principal ({:s}).\n" "\n" "Asegúrese de que esté en la carpeta del juego." +msgid "diabdat.mpq or spawn.mpq" +msgstr "diabdat.mpq o spawn.mpq" + #: Source/appfat.cpp:119 msgid "Data File Error" msgstr "Error de Archivo de Datos" diff --git a/Translations/fr.po b/Translations/fr.po index 7ab3c61fe..b5dde7984 100644 --- a/Translations/fr.po +++ b/Translations/fr.po @@ -807,15 +807,17 @@ msgstr "" #: Source/appfat.cpp:115 msgid "" -"Unable to open main data archive (diabdat.mpq or spawn.mpq).\n" +"Unable to open main data archive ({:s}).\n" "\n" "Make sure that it is in the game folder." msgstr "" -"Impossible d'ouvrir l'archive de données principale (diabdat.mpq ou spawn." -"mpq).\n" +"Impossible d'ouvrir l'archive de données principale ({:s}).\n" "\n" "Assurez-vous qu'il se trouve dans le dossier du jeu." +msgid "diabdat.mpq or spawn.mpq" +msgstr "diabdat.mpq ou spawn.mpq" + #: Source/appfat.cpp:119 msgid "Data File Error" msgstr "Erreur de fichier de données" diff --git a/Translations/hr.po b/Translations/hr.po index 706d394ae..50f914bcd 100644 --- a/Translations/hr.po +++ b/Translations/hr.po @@ -859,7 +859,7 @@ msgstr "" #| "Make sure that it is in the game folder and that the file name is in all " #| "lowercase." msgid "" -"Unable to open main data archive (diabdat.mpq or spawn.mpq).\n" +"Unable to open main data archive ({:s}).\n" "\n" "Make sure that it is in the game folder." msgstr "" @@ -867,6 +867,9 @@ msgstr "" "\n" "Provjerite nalazi li se u mapi igre i je li naziv datoteke u malim slovima." +msgid "diabdat.mpq or spawn.mpq" +msgstr "diabdat.mpq ili spawn.mpq" + #: Source/appfat.cpp:119 #, fuzzy msgid "Data File Error" diff --git a/Translations/it.po b/Translations/it.po index ca4b521b6..8f330bab7 100644 --- a/Translations/it.po +++ b/Translations/it.po @@ -830,14 +830,17 @@ msgstr "" #: Source/appfat.cpp:115 msgid "" -"Unable to open main data archive (diabdat.mpq or spawn.mpq).\n" +"Unable to open main data archive ({:s}).\n" "\n" "Make sure that it is in the game folder." msgstr "" -"Impossibile aprire l'archivio dati principale (diabdat.mpq o spawn.mpq).\n" +"Impossibile aprire l'archivio dati principale ({:s}).\n" "\n" "Assicurati che sia nella cartella del gioco." +msgid "diabdat.mpq or spawn.mpq" +msgstr "diabdat.mpq o spawn.mpq" + #: Source/appfat.cpp:119 msgid "Data File Error" msgstr "Errore File Dati" diff --git a/Translations/ko_KR.po b/Translations/ko_KR.po index 5447ff9a2..bccc37813 100644 --- a/Translations/ko_KR.po +++ b/Translations/ko_KR.po @@ -792,14 +792,17 @@ msgstr "오류 발생: {:s} 줄 {:d}" #: Source/appfat.cpp:115 msgid "" -"Unable to open main data archive (diabdat.mpq or spawn.mpq).\n" +"Unable to open main data archive ({:s}).\n" "\n" "Make sure that it is in the game folder." msgstr "" -"메인 데이터 아카이브(diabdat.mpq 또는 spawn.mpq)\n" +"메인 데이터 아카이브({:s})\n" "\n" "게임 폴더 안에 있는지 확인해 주십시오." +msgid "diabdat.mpq or spawn.mpq" +msgstr "diabdat.mpq 또는 spawn.mpq" + #: Source/appfat.cpp:119 msgid "Data File Error" msgstr "데이터 파일 오류" diff --git a/Translations/pl.po b/Translations/pl.po index bcfe10082..b74794396 100644 --- a/Translations/pl.po +++ b/Translations/pl.po @@ -809,14 +809,17 @@ msgstr "" #: Source/appfat.cpp:115 msgid "" -"Unable to open main data archive (diabdat.mpq or spawn.mpq).\n" +"Unable to open main data archive ({:s}).\n" "\n" "Make sure that it is in the game folder." msgstr "" -"Otwarcie pliku diabdat.mpq lub spawn.mpq nie powiodło się.\n" +"Otwarcie pliku {:s} nie powiodło się.\n" "\n" "Upewnij się, że plik znajduje się w folderze." +msgid "diabdat.mpq or spawn.mpq" +msgstr "diabdat.mpq lub spawn.mpq" + #: Source/appfat.cpp:119 msgid "Data File Error" msgstr "Błąd Pliku z Danymi" diff --git a/Translations/pt_BR.po b/Translations/pt_BR.po index 4b091d218..32652d9fe 100644 --- a/Translations/pt_BR.po +++ b/Translations/pt_BR.po @@ -810,15 +810,17 @@ msgstr "" #: Source/appfat.cpp:115 msgid "" -"Unable to open main data archive (diabdat.mpq or spawn.mpq).\n" +"Unable to open main data archive ({:s}).\n" "\n" "Make sure that it is in the game folder." msgstr "" -"Não foi possível abrir o arquivo de dados principal (diabdat.mpq ou spawn." -"mpq).\n" +"Não foi possível abrir o arquivo de dados principal ({:s}).\n" "\n" "Certifique-se de que ele esteja na pasta do jogo." +msgid "diabdat.mpq or spawn.mpq" +msgstr "diabdat.mpq ou spawn.mpq" + #: Source/appfat.cpp:119 msgid "Data File Error" msgstr "Erro de arquivo de dados" diff --git a/Translations/ru.po b/Translations/ru.po index 5c5bc47f7..f23a49c07 100644 --- a/Translations/ru.po +++ b/Translations/ru.po @@ -828,14 +828,17 @@ msgstr "" #: Source/appfat.cpp:115 msgid "" -"Unable to open main data archive (diabdat.mpq or spawn.mpq).\n" +"Unable to open main data archive ({:s}).\n" "\n" "Make sure that it is in the game folder." msgstr "" -"Невозможно открыть основной архив (diabdat.mpq или spawn.mpq).\n" +"Невозможно открыть основной архив ({:s}).\n" "\n" "Убедитесь, что файлы находятся в папке игры." +msgid "diabdat.mpq or spawn.mpq" +msgstr "diabdat.mpq или spawn.mpq" + #: Source/appfat.cpp:119 msgid "Data File Error" msgstr "Ошибка файла данных" diff --git a/Translations/sv.po b/Translations/sv.po index 60007c229..ceba6b3e4 100644 --- a/Translations/sv.po +++ b/Translations/sv.po @@ -789,11 +789,14 @@ msgstr "" #: Source/appfat.cpp:115 msgid "" -"Unable to open main data archive (diabdat.mpq or spawn.mpq).\n" +"Unable to open main data archive ({:s}).\n" "\n" "Make sure that it is in the game folder." msgstr "" +msgid "diabdat.mpq or spawn.mpq" +msgstr "diabdat.mpq eller spawn.mpq" + #: Source/appfat.cpp:119 msgid "Data File Error" msgstr "" diff --git a/Translations/zh_CN.po b/Translations/zh_CN.po index 41746e89e..905024615 100644 --- a/Translations/zh_CN.po +++ b/Translations/zh_CN.po @@ -791,14 +791,17 @@ msgstr "" #: Source/appfat.cpp:115 msgid "" -"Unable to open main data archive (diabdat.mpq or spawn.mpq).\n" +"Unable to open main data archive ({:s}).\n" "\n" "Make sure that it is in the game folder." msgstr "" -"无法打开主数据存档(diabdat.mpq或spawn.mpq)。\n" +"无法打开主数据存档({:s})。\n" "\n" "确保它在游戏文件夹中,并且文件名都是小写的。" +msgid "diabdat.mpq or spawn.mpq" +msgstr "diabdat.mpq或spawn.mpq" + #: Source/appfat.cpp:119 msgid "Data File Error" msgstr "数据文件错误" diff --git a/Translations/zh_TW.po b/Translations/zh_TW.po index 58f23e1df..c022f5323 100644 --- a/Translations/zh_TW.po +++ b/Translations/zh_TW.po @@ -789,19 +789,22 @@ msgstr "" #: Source/appfat.cpp:115 #, fuzzy #| msgid "" -#| "Unable to open main data archive (diabdat.mpq or spawn.mpq).\n" +#| "Unable to open main data archive ({:s}).\n" #| "\n" #| "Make sure that it is in the game folder and that the file name is in all " #| "lowercase." msgid "" -"Unable to open main data archive (diabdat.mpq or spawn.mpq).\n" +"Unable to open main data archive ({:s}).\n" "\n" "Make sure that it is in the game folder." msgstr "" -"無法打開主數據存檔(diabdat.mpq或spawn.mpq)。\n" +"無法打開主數據存檔({:s})。\n" "\n" "確保它在遊戲資料夾中,並且檔名都是小寫的。" +msgid "diabdat.mpq or spawn.mpq" +msgstr "diabdat.mpq或spawn.mpq" + #: Source/appfat.cpp:119 msgid "Data File Error" msgstr "數據檔案錯誤" diff --git a/test/appfat_test.cpp b/test/appfat_test.cpp index 9df8782bb..f4fad54c9 100644 --- a/test/appfat_test.cpp +++ b/test/appfat_test.cpp @@ -17,7 +17,7 @@ TEST(Appfat, ErrDlg) TEST(Appfat, InsertCDDlg) { - EXPECT_EXIT(InsertCDDlg(), ::testing::ExitedWithCode(1), "diabdat.mpq"); + EXPECT_EXIT(InsertCDDlg("diabdat.mpq"), ::testing::ExitedWithCode(1), "diabdat.mpq"); } TEST(Appfat, DirErrorDlg)