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

Use lootGameName() and displayGameName() in initial places #2030

Closed
Closed
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
32 changes: 18 additions & 14 deletions src/createinstancedialogpages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ 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
Expand Down Expand Up @@ -388,7 +389,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);
Expand Down Expand Up @@ -417,7 +418,7 @@ std::vector<IPluginGame*> 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;
Expand Down Expand Up @@ -469,7 +470,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) {
Expand Down Expand Up @@ -570,7 +571,8 @@ void GamePage::fillList()
continue;
}

if (!m_filter.matches(g->game->gameName())) {
if (!m_filter.matches(g->game->gameName()) &&
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure this should be kept - The gameName() is now internal only, so using it to filter for users could lead to unexpected behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This area is just the filter search when creating a profile, I don't think it'd hurt anything to continue using the gameName alongside the displayName

For tale of two wastelands for example I can search "TTW" or "Tale of Two wastelands"

!m_filter.matches(g->game->displayGameName())) {
// filtered out
continue;
}
Expand Down Expand Up @@ -667,9 +669,10 @@ 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())
: QObject::tr("Use this folder"),
QObject::tr("I know what I'm doing"), QMessageBox::Ignore})
.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})
.exec();

Expand All @@ -688,8 +691,8 @@ bool GamePage::confirmUnknown(const QString& path, IPluginGame* game)
"bold;\">%2</span> 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();
Expand All @@ -711,11 +714,12 @@ IPluginGame* GamePage::confirmOtherGame(const QString& path, IPluginGame* select
"not "
"<span style=\"white-space: nowrap; font-weight: bold;\">%3</span>.")
.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();
Expand Down
2 changes: 1 addition & 1 deletion src/loot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
Loading
Loading