From 5f98c091d59a40fd4c99c64a107e9117fcdf6501 Mon Sep 17 00:00:00 2001 From: Twinki Date: Mon, 20 May 2024 10:28:54 -0400 Subject: [PATCH] Use `lootGameName()` and `displayGameName()` in initial places # Motivations - https://github.com/ModOrganizer2/modorganizer-game_ttw/pull/36#discussion_r1605285526 Surfaced desires to change the Fallout TTW plugin's gameName to something more obvious, from TTW to Tale of Two Wastelands, but that would cause existing profiles to break, `displayGameName()` added in https://github.com/ModOrganizer2/modorganizer-uibase/pull/141 gives us the option to change the way the game plugin is displayed, but leaves the existing integral `gameName()` alone - Similarly https://github.com/ModOrganizer2/modorganizer-game_ttw/pull/36 attempted to fix the sort button LOOT cli argument by changing the `gameShortName()`, as 'TTW' isn't a valid option for LOOT, but that comes with some pretty concerning possible issues # Modifications - Use `displayGameName()` in create instance dialogs & the main window, this doesn't cover all places `gameName()` was being used for purely display reasons, but it covers the bulk - Use `lootGameName()` instead of `gameShortName()` for LOOT cli initiation --- src/createinstancedialogpages.cpp | 24 +-- src/loot.cpp | 2 +- src/mainwindow.cpp | 2 +- src/organizer_en.ts | 260 +++++++++++++++--------------- 4 files changed, 144 insertions(+), 144 deletions(-) diff --git a/src/createinstancedialogpages.cpp b/src/createinstancedialogpages.cpp index 27bd40625..42df9af84 100644 --- a/src/createinstancedialogpages.cpp +++ b/src/createinstancedialogpages.cpp @@ -296,7 +296,7 @@ void GamePage::select(IPluginGame* game, const QString& dir) // ask the user const auto path = QFileDialog::getExistingDirectory( - &m_dlg, QObject::tr("Find game installation for %1").arg(game->gameName())); + &m_dlg, QObject::tr("Find game installation for %1").arg(game->displayGameName())); if (path.isEmpty()) { // cancelled @@ -388,7 +388,7 @@ void GamePage::warnUnrecognized(const QString& path) // put the list of supported games in the details textbox QString supportedGames; for (auto* game : sortedGamePlugins()) { - supportedGames += game->gameName() + "\n"; + supportedGames += game->displayGameName() + "\n"; } QMessageBox dlg(&m_dlg); @@ -417,7 +417,7 @@ std::vector GamePage::sortedGamePlugins() const // natsort std::sort(v.begin(), v.end(), [](auto* a, auto* b) { - return (naturalCompare(a->gameName(), b->gameName()) < 0); + return (naturalCompare(a->displayGameName(), b->displayGameName()) < 0); }); return v; @@ -469,7 +469,7 @@ void GamePage::updateButton(Game* g) return; } - g->button->setText(g->game->gameName().replace("&", "&&")); + g->button->setText(g->game->displayGameName().replace("&", "&&")); g->button->setIcon(g->game->gameIcon()); if (g->installed) { @@ -570,7 +570,7 @@ void GamePage::fillList() continue; } - if (!m_filter.matches(g->game->gameName())) { + if (!m_filter.matches(g->game->gameName()) && !m_filter.matches(g->game->displayGameName())) { // filtered out continue; } @@ -667,7 +667,7 @@ bool GamePage::confirmMicrosoftStore(const QString& path, IPluginGame* game) "Organizer" " and will not work properly.") .arg(path)) - .button({game ? QObject::tr("Use this folder for %1").arg(game->gameName()) + .button({game ? QObject::tr("Use this folder for %1").arg(game->displayGameName()) : QObject::tr("Use this folder"), QObject::tr("I know what I'm doing"), QMessageBox::Ignore}) .button({QObject::tr("Cancel"), QMessageBox::Cancel}) @@ -688,8 +688,8 @@ bool GamePage::confirmUnknown(const QString& path, IPluginGame* game) "bold;\">%2 or " "for any other game Mod Organizer can manage.") .arg(path) - .arg(game->gameName())) - .button({QObject::tr("Use this folder for %1").arg(game->gameName()), + .arg(game->displayGameName())) + .button({QObject::tr("Use this folder for %1").arg(game->displayGameName()), QObject::tr("I know what I'm doing"), QMessageBox::Ignore}) .button({QObject::tr("Cancel"), QMessageBox::Cancel}) .exec(); @@ -711,11 +711,11 @@ IPluginGame* GamePage::confirmOtherGame(const QString& path, IPluginGame* select "not " "%3.") .arg(path) - .arg(guessedGame->gameName()) - .arg(selectedGame->gameName())) - .button({QObject::tr("Manage %1 instead").arg(guessedGame->gameName()), + .arg(guessedGame->displayGameName()) + .arg(selectedGame->displayGameName())) + .button({QObject::tr("Manage %1 instead").arg(guessedGame->displayGameName()), QMessageBox::Ok}) - .button({QObject::tr("Use this folder for %1").arg(selectedGame->gameName()), + .button({QObject::tr("Use this folder for %1").arg(selectedGame->displayGameName()), QObject::tr("I know what I'm doing"), QMessageBox::Ignore}) .button({QObject::tr("Cancel"), QMessageBox::Cancel}) .exec(); diff --git a/src/loot.cpp b/src/loot.cpp index 5ff569874..2c52aaa11 100644 --- a/src/loot.cpp +++ b/src/loot.cpp @@ -462,7 +462,7 @@ bool Loot::spawnLootcli(QWidget* parent, bool didUpdateMasterList, const auto logLevel = m_core.settings().diagnostics().lootLogLevel(); QStringList parameters; - parameters << "--game" << m_core.managedGame()->gameShortName() + parameters << "--game" << m_core.managedGame()->lootGameName() << "--gamePath" << QString("\"%1\"").arg( diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2c62e7319..ca738c788 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -647,7 +647,7 @@ void MainWindow::updateWindowTitle(const APIUserAccount& user) { //"\xe2\x80\x93" is an "em dash", a longer "-" QString title = QString("%1 \xe2\x80\x93 Mod Organizer v%2") - .arg(m_OrganizerCore.managedGame()->gameName(), + .arg(m_OrganizerCore.managedGame()->displayGameName(), m_OrganizerCore.getVersion().displayString(3)); if (!user.name().isEmpty()) { diff --git a/src/organizer_en.ts b/src/organizer_en.ts index 992aa96fd..db94d4268 100644 --- a/src/organizer_en.ts +++ b/src/organizer_en.ts @@ -311,22 +311,22 @@ p, li { white-space: pre-wrap; } - + Error %1: Request to Nexus failed: %2 - + Add - + Remove - + Remove Nexus Mapping(s) @@ -3222,7 +3222,7 @@ Hide: never show separators - + Sort the plugins using LOOT. @@ -3660,7 +3660,7 @@ Hide: never show separators - + Endorse Mod Organizer @@ -3759,7 +3759,7 @@ Hide: never show separators - + There is no supported sort mechanism for this game. You will probably have to use a third-party tool. @@ -4082,156 +4082,156 @@ As a final option, you can disable Nexus category mapping altogether, which can - + Update available - + Do you want to endorse Mod Organizer on %1 now? - + Abstain from Endorsing Mod Organizer - + Are you sure you want to abstain from endorsing Mod Organizer 2? You will have to visit the mod page on the %1 Nexus site to change your mind. - + Thank you for endorsing MO2! :) - + Please reconsider endorsing MO2 on Nexus! - + None of your %1 mods appear to have had recent file updates. - + All of your mods have been checked recently. We restrict update checks to help preserve your available API requests. - + Thank you! - + Thank you for your endorsement! - + Mod ID %1 no longer seems to be available on Nexus. - + Error %1: Request to Nexus failed: %2 - - + + failed to read %1: %2 - + Error - + failed to extract %1 (errorcode %2) - + Extract BSA - + This archive contains invalid hashes. Some files may be broken. - + Extract... - + Remove '%1' from the toolbar - + Backup of load order created - + Choose backup to restore - + No Backups - + There are no backups to restore - - + + Restore failed - - + + Failed to restore the backup. Errorcode: %1 - + Backup of mod list created - + A file with the same name has already been downloaded. What would you like to do? - + Overwrite - + Rename new file - + Ignore file @@ -5075,7 +5075,7 @@ p, li { white-space: pre-wrap; } - + Open in Explorer @@ -5113,25 +5113,25 @@ p, li { white-space: pre-wrap; } - + Ignore missing data - + Mark as converted/working - + Visit on Nexus - + Visit on %1 @@ -5212,22 +5212,22 @@ p, li { white-space: pre-wrap; } - + Remap Category (From Nexus) - + Start tracking - + Stop tracking - + Tracked state unknown @@ -5404,7 +5404,7 @@ Please enter the name: - + Create Mod... @@ -5416,7 +5416,7 @@ Please enter a name: - + A mod with this name already exists @@ -5448,14 +5448,14 @@ Please enter a name: - - + + Confirm - + You are not currently authenticated with Nexus. Please do so under Settings -> Nexus. @@ -5470,247 +5470,247 @@ Please enter a name: - + Export to csv - + CSV (Comma Separated Values) is a format that can be imported in programs like Excel to create a spreadsheet. You can also use online editors and converters instead. - + Select what mods you want export: - + All installed mods - + Only active (checked) mods from your current profile - + All currently visible mods in the mod list - + Choose what Columns to export: - + Mod_Priority - + Mod_Name - + Notes_column - + Mod_Status - + Primary_Category - + Nexus_ID - + Mod_Nexus_URL - + Mod_Version - + Install_Date - + Download_File_Name - + export failed: %1 - + Failed to display overwrite dialog: %1 - + Set Priority - + Set the priority of the selected mods - + failed to rename mod: %1 - + Remove the following mods?<br><ul>%1</ul> - + failed to remove mod: %1 - + Continue? - + The versioning scheme decides which version is considered newer than another. This function will guess the versioning scheme under the assumption that the installed version is outdated. - + Sorry - + I don't know a versioning scheme where %1 is newer than %2. - + Opening Nexus Links - + You are trying to open %1 links to Nexus Mods. Are you sure you want to do this? - - + + Opening Web Pages - - + + You are trying to open %1 Web Pages. Are you sure you want to do this? - - - + + + Failed - + Installation file no longer exists - + Mods installed with old versions of MO can't be reinstalled in this way. - + Failed to create backup. - + Restore all hidden files in the following mods?<br><ul>%1</ul> - - + + Are you sure? - + About to restore all hidden files in: - + Endorsing multiple mods will take a while. Please wait... - + Overwrite? - + This will replace the existing mod "%1". Continue? - + failed to remove mod "%1" - + failed to rename "%1" to "%2" - + Move successful. - + This will move all files from overwrite into a new, regular mod. Please enter a name: - + About to recursively delete: @@ -6322,97 +6322,97 @@ Continue? - + Origin - + This plugin can't be disabled or moved (enforced by the game). - + This plugin can't be disabled (enforced by the game). - + Author - + Description - + Missing Masters - + Enabled Masters - + Loads Archives - + There are Archives connected to this plugin. Their assets will be added to your game, overwriting in case of conflicts following the plugin order. Loose files will always overwrite assets from Archives. (This flag only checks for Archives from the same mod as the plugin) - + Loads INI settings - + There is an ini file connected to this plugin. Its settings will be added to your game settings, overwriting in case of conflicts. - + This %1 is flagged as an ESL. It will adhere to the %1 load order but the records will be loaded in ESL space. - + This is a dummy plugin. It contains no records and is typically used to load a paired archive file. - + This game does not currently permit custom plugin loading. There may be manual workarounds. - + Incompatible with %1 - + Depends on missing %1 - + Warning - + Error - + failed to restore load order for %1 @@ -7614,7 +7614,7 @@ Destination: - + <Manage...> @@ -8295,7 +8295,7 @@ You can restart Mod Organizer as administrator and try launching the program aga - + Some of your plugins have invalid names! These plugins can not be loaded by the game. Please see mo_interface.log for a list of affected plugins and rename them. @@ -8310,17 +8310,17 @@ You can restart Mod Organizer as administrator and try launching the program aga - wrong file format - expected %1 got %2 + - + failed to query registry path (preflight): %1 - + failed to query registry path (read): %1