mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-19 16:15:45 -04:00
System: Generate hash serials when running PS-EXE
Allows for per-game settings.
This commit is contained in:
@ -1347,12 +1347,16 @@ void MainWindow::onViewGamePropertiesActionTriggered()
|
||||
if (!s_system_valid)
|
||||
return;
|
||||
|
||||
const std::string& path = System::GetDiscPath();
|
||||
const std::string& serial = System::GetGameSerial();
|
||||
if (path.empty() || serial.empty())
|
||||
return;
|
||||
Host::RunOnCPUThread([]() {
|
||||
const std::string& path = System::GetDiscPath();
|
||||
const std::string& serial = System::GetGameSerial();
|
||||
if (path.empty() || serial.empty())
|
||||
return;
|
||||
|
||||
SettingsWindow::openGamePropertiesDialog(path, serial, System::GetDiscRegion());
|
||||
QtHost::RunOnUIThread([path = path, serial = serial]() {
|
||||
SettingsWindow::openGamePropertiesDialog(path, System::GetGameTitle(), serial, System::GetDiscRegion());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
void MainWindow::onGitHubRepositoryActionTriggered()
|
||||
@ -1448,8 +1452,9 @@ void MainWindow::onGameListEntryContextMenuRequested(const QPoint& point)
|
||||
{
|
||||
if (!entry->IsDiscSet())
|
||||
{
|
||||
connect(menu.addAction(tr("Properties...")), &QAction::triggered,
|
||||
[entry]() { SettingsWindow::openGamePropertiesDialog(entry->path, entry->serial, entry->region); });
|
||||
connect(menu.addAction(tr("Properties...")), &QAction::triggered, [entry]() {
|
||||
SettingsWindow::openGamePropertiesDialog(entry->path, entry->title, entry->serial, entry->region);
|
||||
});
|
||||
|
||||
connect(menu.addAction(tr("Open Containing Directory...")), &QAction::triggered, [this, entry]() {
|
||||
const QFileInfo fi(QString::fromStdString(entry->path));
|
||||
@ -1516,7 +1521,10 @@ void MainWindow::onGameListEntryContextMenuRequested(const QPoint& point)
|
||||
auto lock = GameList::GetLock();
|
||||
const GameList::Entry* first_disc = GameList::GetFirstDiscSetMember(disc_set_name);
|
||||
if (first_disc)
|
||||
SettingsWindow::openGamePropertiesDialog(first_disc->path, first_disc->serial, first_disc->region);
|
||||
{
|
||||
SettingsWindow::openGamePropertiesDialog(first_disc->path, first_disc->title, first_disc->serial,
|
||||
first_disc->region);
|
||||
}
|
||||
});
|
||||
|
||||
connect(menu.addAction(tr("Set Cover Image...")), &QAction::triggered,
|
||||
|
@ -611,7 +611,8 @@ void SettingsWindow::saveAndReloadGameSettings()
|
||||
g_emu_thread->reloadGameSettings(false);
|
||||
}
|
||||
|
||||
void SettingsWindow::openGamePropertiesDialog(const std::string& path, const std::string& serial, DiscRegion region)
|
||||
void SettingsWindow::openGamePropertiesDialog(const std::string& path, const std::string& title,
|
||||
const std::string& serial, DiscRegion region)
|
||||
{
|
||||
const GameDatabase::Entry* dentry = nullptr;
|
||||
if (!System::IsExeFileName(path) && !System::IsPsfFileName(path))
|
||||
@ -652,9 +653,8 @@ void SettingsWindow::openGamePropertiesDialog(const std::string& path, const std
|
||||
if (FileSystem::FileExists(sif->GetFileName().c_str()))
|
||||
sif->Load();
|
||||
|
||||
const QString window_title(tr("%1 [%2]")
|
||||
.arg(dentry ? QtUtils::StringViewToQString(dentry->title) : QStringLiteral("<UNKNOWN>"))
|
||||
.arg(QtUtils::StringViewToQString(real_serial)));
|
||||
const QString window_title(
|
||||
tr("%1 [%2]").arg(QString::fromStdString(dentry ? dentry->title : title)).arg(QString::fromStdString(real_serial)));
|
||||
|
||||
SettingsWindow* dialog = new SettingsWindow(path, real_serial, region, dentry, std::move(sif));
|
||||
dialog->setWindowTitle(window_title);
|
||||
|
@ -44,7 +44,8 @@ public:
|
||||
const GameDatabase::Entry* entry, std::unique_ptr<INISettingsInterface> sif);
|
||||
~SettingsWindow();
|
||||
|
||||
static void openGamePropertiesDialog(const std::string& path, const std::string& serial, DiscRegion region);
|
||||
static void openGamePropertiesDialog(const std::string& path, const std::string& title, const std::string& serial,
|
||||
DiscRegion region);
|
||||
static void closeGamePropertiesDialogs();
|
||||
|
||||
// Helper for externally setting fields in game settings ini.
|
||||
|
Reference in New Issue
Block a user