early-access version 3344
This commit is contained in:
@@ -182,12 +182,13 @@ QString ConfigureInputPlayer::ButtonToText(const Common::ParamPackage& param) {
|
||||
const QString toggle = QString::fromStdString(param.Get("toggle", false) ? "~" : "");
|
||||
const QString inverted = QString::fromStdString(param.Get("inverted", false) ? "!" : "");
|
||||
const QString invert = QString::fromStdString(param.Get("invert", "+") == "-" ? "-" : "");
|
||||
const QString turbo = QString::fromStdString(param.Get("turbo", false) ? "$" : "");
|
||||
const auto common_button_name = input_subsystem->GetButtonName(param);
|
||||
|
||||
// Retrieve the names from Qt
|
||||
if (param.Get("engine", "") == "keyboard") {
|
||||
const QString button_str = GetKeyName(param.Get("code", 0));
|
||||
return QObject::tr("%1%2%3").arg(toggle, inverted, button_str);
|
||||
return QObject::tr("%1%2%3%4").arg(turbo, toggle, inverted, button_str);
|
||||
}
|
||||
|
||||
if (common_button_name == Common::Input::ButtonNames::Invalid) {
|
||||
@@ -201,7 +202,7 @@ QString ConfigureInputPlayer::ButtonToText(const Common::ParamPackage& param) {
|
||||
if (common_button_name == Common::Input::ButtonNames::Value) {
|
||||
if (param.Has("hat")) {
|
||||
const QString hat = GetDirectionName(param.Get("direction", ""));
|
||||
return QObject::tr("%1%2Hat %3").arg(toggle, inverted, hat);
|
||||
return QObject::tr("%1%2%3Hat %4").arg(turbo, toggle, inverted, hat);
|
||||
}
|
||||
if (param.Has("axis")) {
|
||||
const QString axis = QString::fromStdString(param.Get("axis", ""));
|
||||
@@ -219,13 +220,13 @@ QString ConfigureInputPlayer::ButtonToText(const Common::ParamPackage& param) {
|
||||
}
|
||||
if (param.Has("button")) {
|
||||
const QString button = QString::fromStdString(param.Get("button", ""));
|
||||
return QObject::tr("%1%2Button %3").arg(toggle, inverted, button);
|
||||
return QObject::tr("%1%2%3Button %4").arg(turbo, toggle, inverted, button);
|
||||
}
|
||||
}
|
||||
|
||||
QString button_name = GetButtonName(common_button_name);
|
||||
if (param.Has("hat")) {
|
||||
return QObject::tr("%1%2Hat %3").arg(toggle, inverted, button_name);
|
||||
return QObject::tr("%1%2%3Hat %4").arg(turbo, toggle, inverted, button_name);
|
||||
}
|
||||
if (param.Has("axis")) {
|
||||
return QObject::tr("%1%2Axis %3").arg(toggle, inverted, button_name);
|
||||
@@ -234,7 +235,7 @@ QString ConfigureInputPlayer::ButtonToText(const Common::ParamPackage& param) {
|
||||
return QObject::tr("%1%2Axis %3").arg(toggle, inverted, button_name);
|
||||
}
|
||||
if (param.Has("button")) {
|
||||
return QObject::tr("%1%2Button %3").arg(toggle, inverted, button_name);
|
||||
return QObject::tr("%1%2%3Button %4").arg(turbo, toggle, inverted, button_name);
|
||||
}
|
||||
|
||||
return QObject::tr("[unknown]");
|
||||
@@ -395,6 +396,12 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
|
||||
button_map[button_id]->setText(ButtonToText(param));
|
||||
emulated_controller->SetButtonParam(button_id, param);
|
||||
});
|
||||
context_menu.addAction(tr("Turbo button"), [&] {
|
||||
const bool turbo_value = !param.Get("turbo", false);
|
||||
param.Set("turbo", turbo_value);
|
||||
button_map[button_id]->setText(ButtonToText(param));
|
||||
emulated_controller->SetButtonParam(button_id, param);
|
||||
});
|
||||
}
|
||||
if (param.Has("axis")) {
|
||||
context_menu.addAction(tr("Invert axis"), [&] {
|
||||
|
||||
@@ -58,13 +58,16 @@ std::vector<std::string> InputProfiles::GetInputProfileNames() {
|
||||
std::vector<std::string> profile_names;
|
||||
profile_names.reserve(map_profiles.size());
|
||||
|
||||
for (const auto& [profile_name, config] : map_profiles) {
|
||||
auto it = map_profiles.cbegin();
|
||||
while (it != map_profiles.cend()) {
|
||||
const auto& [profile_name, config] = *it;
|
||||
if (!ProfileExistsInFilesystem(profile_name)) {
|
||||
DeleteProfile(profile_name);
|
||||
it = map_profiles.erase(it);
|
||||
continue;
|
||||
}
|
||||
|
||||
profile_names.push_back(profile_name);
|
||||
++it;
|
||||
}
|
||||
|
||||
std::stable_sort(profile_names.begin(), profile_names.end());
|
||||
|
||||
Reference in New Issue
Block a user