mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-25 19:44:57 +00:00
more setting
This commit is contained in:
parent
5181ff36ff
commit
75f11b95a5
@ -41,7 +41,6 @@ static s32 gpuId = -1; // Vulkan physical device index. Set to negative for auto
|
|||||||
static std::string logFilter;
|
static std::string logFilter;
|
||||||
static std::string logType = "sync";
|
static std::string logType = "sync";
|
||||||
static std::string userName = "shadPS4";
|
static std::string userName = "shadPS4";
|
||||||
static std::string updateChannel;
|
|
||||||
static std::string chooseHomeTab;
|
static std::string chooseHomeTab;
|
||||||
static std::string backButtonBehavior = "left";
|
static std::string backButtonBehavior = "left";
|
||||||
static bool useSpecialPad = false;
|
static bool useSpecialPad = false;
|
||||||
@ -206,10 +205,6 @@ std::string getUserName() {
|
|||||||
return userName;
|
return userName;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string getUpdateChannel() {
|
|
||||||
return updateChannel;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string getChooseHomeTab() {
|
std::string getChooseHomeTab() {
|
||||||
return chooseHomeTab;
|
return chooseHomeTab;
|
||||||
}
|
}
|
||||||
@ -342,7 +337,6 @@ void setShowSplash(bool enable) {
|
|||||||
isShowSplash = enable;
|
isShowSplash = enable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void setSideTrophy(std::string side) {
|
void setSideTrophy(std::string side) {
|
||||||
isSideTrophy = side;
|
isSideTrophy = side;
|
||||||
}
|
}
|
||||||
@ -430,9 +424,6 @@ void setUserName(const std::string& type) {
|
|||||||
userName = type;
|
userName = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setUpdateChannel(const std::string& type) {
|
|
||||||
updateChannel = type;
|
|
||||||
}
|
|
||||||
void setChooseHomeTab(const std::string& type) {
|
void setChooseHomeTab(const std::string& type) {
|
||||||
chooseHomeTab = type;
|
chooseHomeTab = type;
|
||||||
}
|
}
|
||||||
@ -616,11 +607,6 @@ void load(const std::filesystem::path& path) {
|
|||||||
logFilter = toml::find_or<std::string>(general, "logFilter", "");
|
logFilter = toml::find_or<std::string>(general, "logFilter", "");
|
||||||
logType = toml::find_or<std::string>(general, "logType", "sync");
|
logType = toml::find_or<std::string>(general, "logType", "sync");
|
||||||
userName = toml::find_or<std::string>(general, "userName", "shadPS4");
|
userName = toml::find_or<std::string>(general, "userName", "shadPS4");
|
||||||
if (Common::g_is_release) {
|
|
||||||
updateChannel = toml::find_or<std::string>(general, "updateChannel", "Release");
|
|
||||||
} else {
|
|
||||||
updateChannel = toml::find_or<std::string>(general, "updateChannel", "Nightly");
|
|
||||||
}
|
|
||||||
isShowSplash = toml::find_or<bool>(general, "showSplash", true);
|
isShowSplash = toml::find_or<bool>(general, "showSplash", true);
|
||||||
isSideTrophy = toml::find_or<std::string>(general, "sideTrophy", "right");
|
isSideTrophy = toml::find_or<std::string>(general, "sideTrophy", "right");
|
||||||
compatibilityData = toml::find_or<bool>(general, "compatibilityEnabled", false);
|
compatibilityData = toml::find_or<bool>(general, "compatibilityEnabled", false);
|
||||||
@ -798,7 +784,6 @@ void save(const std::filesystem::path& path) {
|
|||||||
data["General"]["logFilter"] = logFilter;
|
data["General"]["logFilter"] = logFilter;
|
||||||
data["General"]["logType"] = logType;
|
data["General"]["logType"] = logType;
|
||||||
data["General"]["userName"] = userName;
|
data["General"]["userName"] = userName;
|
||||||
data["General"]["updateChannel"] = updateChannel;
|
|
||||||
data["General"]["chooseHomeTab"] = chooseHomeTab;
|
data["General"]["chooseHomeTab"] = chooseHomeTab;
|
||||||
data["General"]["showSplash"] = isShowSplash;
|
data["General"]["showSplash"] = isShowSplash;
|
||||||
data["General"]["sideTrophy"] = isSideTrophy;
|
data["General"]["sideTrophy"] = isSideTrophy;
|
||||||
@ -929,11 +914,7 @@ void setDefaultValues() {
|
|||||||
logFilter = "";
|
logFilter = "";
|
||||||
logType = "sync";
|
logType = "sync";
|
||||||
userName = "shadPS4";
|
userName = "shadPS4";
|
||||||
if (Common::g_is_release) {
|
|
||||||
updateChannel = "Release";
|
|
||||||
} else {
|
|
||||||
updateChannel = "Nightly";
|
|
||||||
}
|
|
||||||
chooseHomeTab = "General";
|
chooseHomeTab = "General";
|
||||||
cursorState = HideCursorState::Idle;
|
cursorState = HideCursorState::Idle;
|
||||||
cursorHideTimeout = 5;
|
cursorHideTimeout = 5;
|
||||||
|
@ -38,7 +38,6 @@ bool getPSNSignedIn();
|
|||||||
std::string getLogFilter();
|
std::string getLogFilter();
|
||||||
std::string getLogType();
|
std::string getLogType();
|
||||||
std::string getUserName();
|
std::string getUserName();
|
||||||
std::string getUpdateChannel();
|
|
||||||
std::string getChooseHomeTab();
|
std::string getChooseHomeTab();
|
||||||
|
|
||||||
s16 getCursorState();
|
s16 getCursorState();
|
||||||
@ -91,7 +90,6 @@ void setEnableDiscordRPC(bool enable);
|
|||||||
void setLanguage(u32 language);
|
void setLanguage(u32 language);
|
||||||
void setNeoMode(bool enable);
|
void setNeoMode(bool enable);
|
||||||
void setUserName(const std::string& type);
|
void setUserName(const std::string& type);
|
||||||
void setUpdateChannel(const std::string& type);
|
|
||||||
void setChooseHomeTab(const std::string& type);
|
void setChooseHomeTab(const std::string& type);
|
||||||
void setGameInstallDirs(const std::vector<std::filesystem::path>& dirs_config);
|
void setGameInstallDirs(const std::vector<std::filesystem::path>& dirs_config);
|
||||||
void setAllGameInstallDirs(const std::vector<GameInstallDir>& dirs_config);
|
void setAllGameInstallDirs(const std::vector<GameInstallDir>& dirs_config);
|
||||||
|
@ -45,7 +45,7 @@ void CheckUpdate::CheckForUpdates(const bool showMessage) {
|
|||||||
|
|
||||||
bool checkName = true;
|
bool checkName = true;
|
||||||
while (checkName) {
|
while (checkName) {
|
||||||
updateChannel = QString::fromStdString(Config::getUpdateChannel());
|
updateChannel = m_gui_settings->GetValue(gui::gen_updateChannel).toString();
|
||||||
if (updateChannel == "Nightly") {
|
if (updateChannel == "Nightly") {
|
||||||
url = QUrl("https://api.github.com/repos/shadps4-emu/shadPS4/releases");
|
url = QUrl("https://api.github.com/repos/shadps4-emu/shadPS4/releases");
|
||||||
checkName = false;
|
checkName = false;
|
||||||
@ -54,12 +54,10 @@ void CheckUpdate::CheckForUpdates(const bool showMessage) {
|
|||||||
checkName = false;
|
checkName = false;
|
||||||
} else {
|
} else {
|
||||||
if (Common::g_is_release) {
|
if (Common::g_is_release) {
|
||||||
Config::setUpdateChannel("Release");
|
m_gui_settings->SetValue(gui::gen_updateChannel, "Release");
|
||||||
} else {
|
} else {
|
||||||
Config::setUpdateChannel("Nightly");
|
m_gui_settings->SetValue(gui::gen_updateChannel, "Nightly");
|
||||||
}
|
}
|
||||||
const auto config_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
|
|
||||||
Config::save(config_dir / "config.toml");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,7 +198,7 @@ void CheckUpdate::setupUI(const QString& downloadUrl, const QString& latestDate,
|
|||||||
titleLayout->addWidget(titleLabel);
|
titleLayout->addWidget(titleLabel);
|
||||||
layout->addLayout(titleLayout);
|
layout->addLayout(titleLayout);
|
||||||
|
|
||||||
QString updateChannel = QString::fromStdString(Config::getUpdateChannel());
|
QString updateChannel = m_gui_settings->GetValue(gui::gen_updateChannel).toString();
|
||||||
|
|
||||||
QString updateText = QString("<p><b>" + tr("Update Channel") + ": </b>" + updateChannel +
|
QString updateText = QString("<p><b>" + tr("Update Channel") + ": </b>" + updateChannel +
|
||||||
"<br>"
|
"<br>"
|
||||||
|
@ -16,6 +16,7 @@ const QString game_grid = "game_grid";
|
|||||||
// general
|
// general
|
||||||
const gui_value gen_checkForUpdates = gui_value(general, "checkForUpdates", false);
|
const gui_value gen_checkForUpdates = gui_value(general, "checkForUpdates", false);
|
||||||
const gui_value gen_showChangeLog = gui_value(general, "showChangeLog", false);
|
const gui_value gen_showChangeLog = gui_value(general, "showChangeLog", false);
|
||||||
|
const gui_value gen_updateChannel = gui_value(general, "updateChannel", "Release");
|
||||||
|
|
||||||
// main window settings
|
// main window settings
|
||||||
const gui_value mw_geometry = gui_value(main_window, "geometry", QByteArray());
|
const gui_value mw_geometry = gui_value(main_window, "geometry", QByteArray());
|
||||||
|
@ -181,7 +181,8 @@ SettingsDialog::SettingsDialog(std::shared_ptr<gui_settings> gui_settings,
|
|||||||
m_gui_settings->SetValue(gui::gen_checkForUpdates, state == Qt::Checked);
|
m_gui_settings->SetValue(gui::gen_checkForUpdates, state == Qt::Checked);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(ui->changelogCheckBox, &QCheckBox::stateChanged, this, [this](int state) { m_gui_settings->SetValue(gui::gen_showChangeLog,state == Qt::Checked);
|
connect(ui->changelogCheckBox, &QCheckBox::stateChanged, this, [this](int state) {
|
||||||
|
m_gui_settings->SetValue(gui::gen_showChangeLog, state == Qt::Checked);
|
||||||
});
|
});
|
||||||
#else
|
#else
|
||||||
connect(ui->updateCheckBox, &QCheckBox::checkStateChanged, this,
|
connect(ui->updateCheckBox, &QCheckBox::checkStateChanged, this,
|
||||||
@ -198,7 +199,7 @@ SettingsDialog::SettingsDialog(std::shared_ptr<gui_settings> gui_settings,
|
|||||||
connect(ui->updateComboBox, &QComboBox::currentTextChanged, this,
|
connect(ui->updateComboBox, &QComboBox::currentTextChanged, this,
|
||||||
[this](const QString& channel) {
|
[this](const QString& channel) {
|
||||||
if (channelMap.contains(channel)) {
|
if (channelMap.contains(channel)) {
|
||||||
Config::setUpdateChannel(channelMap.value(channel).toStdString());
|
m_gui_settings->SetValue(gui::gen_updateChannel, channelMap.value(channel));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -512,7 +513,7 @@ void SettingsDialog::LoadValuesFromConfig() {
|
|||||||
ui->changelogCheckBox->setChecked(
|
ui->changelogCheckBox->setChecked(
|
||||||
toml::find_or<bool>(data, "General", "alwaysShowChangelog", false));
|
toml::find_or<bool>(data, "General", "alwaysShowChangelog", false));
|
||||||
|
|
||||||
QString updateChannel = QString::fromStdString(Config::getUpdateChannel());
|
QString updateChannel = m_gui_settings->GetValue(gui::gen_updateChannel).toString();
|
||||||
ui->updateComboBox->setCurrentText(
|
ui->updateComboBox->setCurrentText(
|
||||||
channelMap.key(updateChannel != "Release" && updateChannel != "Nightly"
|
channelMap.key(updateChannel != "Release" && updateChannel != "Nightly"
|
||||||
? (Common::g_is_release ? "Release" : "Nightly")
|
? (Common::g_is_release ? "Release" : "Nightly")
|
||||||
@ -794,8 +795,9 @@ void SettingsDialog::UpdateSettings() {
|
|||||||
Config::setCollectShaderForDebug(ui->collectShaderCheckBox->isChecked());
|
Config::setCollectShaderForDebug(ui->collectShaderCheckBox->isChecked());
|
||||||
Config::setCopyGPUCmdBuffers(ui->copyGPUBuffersCheckBox->isChecked());
|
Config::setCopyGPUCmdBuffers(ui->copyGPUBuffersCheckBox->isChecked());
|
||||||
m_gui_settings->SetValue(gui::gen_checkForUpdates, ui->updateCheckBox->isChecked());
|
m_gui_settings->SetValue(gui::gen_checkForUpdates, ui->updateCheckBox->isChecked());
|
||||||
m_gui_settings->SetValue(gui::gen_showChangeLog,ui->changelogCheckBox->isChecked());
|
m_gui_settings->SetValue(gui::gen_showChangeLog, ui->changelogCheckBox->isChecked());
|
||||||
Config::setUpdateChannel(channelMap.value(ui->updateComboBox->currentText()).toStdString());
|
m_gui_settings->SetValue(gui::gen_updateChannel,
|
||||||
|
channelMap.value(ui->updateComboBox->currentText()));
|
||||||
Config::setChooseHomeTab(
|
Config::setChooseHomeTab(
|
||||||
chooseHomeTabMap.value(ui->chooseHomeTabComboBox->currentText()).toStdString());
|
chooseHomeTabMap.value(ui->chooseHomeTabComboBox->currentText()).toStdString());
|
||||||
Config::setCompatibilityEnabled(ui->enableCompatibilityCheckBox->isChecked());
|
Config::setCompatibilityEnabled(ui->enableCompatibilityCheckBox->isChecked());
|
||||||
@ -880,4 +882,9 @@ void SettingsDialog::setDefaultValues() {
|
|||||||
m_gui_settings->SetValue(gui::gl_backgroundMusicVolume, 50);
|
m_gui_settings->SetValue(gui::gl_backgroundMusicVolume, 50);
|
||||||
m_gui_settings->SetValue(gui::gen_checkForUpdates, false);
|
m_gui_settings->SetValue(gui::gen_checkForUpdates, false);
|
||||||
m_gui_settings->SetValue(gui::gen_showChangeLog, false);
|
m_gui_settings->SetValue(gui::gen_showChangeLog, false);
|
||||||
|
if (Common::g_is_release) {
|
||||||
|
m_gui_settings->SetValue(gui::gen_updateChannel, "Release");
|
||||||
|
} else {
|
||||||
|
m_gui_settings->SetValue(gui::gen_updateChannel, "Nightly");
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user