Service Menu: afegides opcions per als mandos
This commit is contained in:
@@ -176,6 +176,9 @@ void ServiceMenu::updateMenu() {
|
||||
}
|
||||
|
||||
void ServiceMenu::applySettings() {
|
||||
if (current_settings_group_ == SettingsGroup::CONTROLS) {
|
||||
applyControlsSettings();
|
||||
}
|
||||
if (current_settings_group_ == SettingsGroup::VIDEO) {
|
||||
applyVideoSettings();
|
||||
}
|
||||
@@ -190,6 +193,8 @@ void ServiceMenu::applySettings() {
|
||||
updateOptionPairs();
|
||||
}
|
||||
|
||||
void ServiceMenu::applyControlsSettings() {}
|
||||
|
||||
void ServiceMenu::applyVideoSettings() {
|
||||
Screen::get()->applySettings();
|
||||
setHiddenOptions();
|
||||
@@ -216,6 +221,7 @@ auto ServiceMenu::getOptionByCaption(const std::string &caption) const -> MenuOp
|
||||
|
||||
auto ServiceMenu::getCurrentGroupAlignment() const -> ServiceMenu::GroupAlignment {
|
||||
switch (current_settings_group_) {
|
||||
case SettingsGroup::CONTROLS:
|
||||
case SettingsGroup::VIDEO:
|
||||
case SettingsGroup::AUDIO:
|
||||
case SettingsGroup::SETTINGS:
|
||||
@@ -239,6 +245,43 @@ auto ServiceMenu::countOptionsInGroup(SettingsGroup group) const -> size_t {
|
||||
void ServiceMenu::initializeOptions() {
|
||||
options_.clear();
|
||||
|
||||
// CONTROLS
|
||||
options_.push_back(std::make_unique<ListOption>(
|
||||
"Mando Jugador 1",
|
||||
SettingsGroup::CONTROLS,
|
||||
Input::get()->getControllerNames(),
|
||||
[]() {
|
||||
return Options::gamepad_manager.getGamepad(Player::Id::PLAYER1).name;
|
||||
},
|
||||
[](const std::string &val) {
|
||||
Options::gamepad_manager.assignGamepadToPlayer(Player::Id::PLAYER1, Input::get()->getGamepadByName(val), val);
|
||||
}));
|
||||
|
||||
options_.push_back(std::make_unique<ListOption>(
|
||||
"Mando Jugador 2",
|
||||
SettingsGroup::CONTROLS,
|
||||
Input::get()->getControllerNames(),
|
||||
[]() {
|
||||
return Options::gamepad_manager.getGamepad(Player::Id::PLAYER2).name;
|
||||
},
|
||||
[](const std::string &val) {
|
||||
Options::gamepad_manager.assignGamepadToPlayer(Player::Id::PLAYER2, Input::get()->getGamepadByName(val), val);
|
||||
}));
|
||||
|
||||
options_.push_back(std::make_unique<ListOption>(
|
||||
"Teclat",
|
||||
SettingsGroup::CONTROLS,
|
||||
std::vector<std::string>{
|
||||
"Jugador 1",
|
||||
"Jugador 2"},
|
||||
[]() {
|
||||
return Lang::getNameFromCode(Options::pending_changes.new_language);
|
||||
},
|
||||
[](const std::string &val) {
|
||||
Options::pending_changes.new_language = Lang::getCodeFromName(val);
|
||||
Options::checkPendingChanges();
|
||||
}));
|
||||
|
||||
// VIDEO
|
||||
options_.push_back(std::make_unique<BoolOption>(
|
||||
Lang::getText("[SERVICE_MENU] FULLSCREEN"),
|
||||
@@ -366,6 +409,11 @@ void ServiceMenu::initializeOptions() {
|
||||
!Options::settings.shutdown_enabled));
|
||||
|
||||
// MAIN MENU
|
||||
options_.push_back(std::make_unique<FolderOption>(
|
||||
"Controls",
|
||||
SettingsGroup::MAIN,
|
||||
SettingsGroup::CONTROLS));
|
||||
|
||||
options_.push_back(std::make_unique<FolderOption>(
|
||||
Lang::getText("[SERVICE_MENU] VIDEO"),
|
||||
SettingsGroup::MAIN,
|
||||
@@ -410,8 +458,10 @@ auto ServiceMenu::settingsGroupToString(SettingsGroup group) -> std::string {
|
||||
switch (group) {
|
||||
case SettingsGroup::MAIN:
|
||||
return Lang::getText("[SERVICE_MENU] TITLE");
|
||||
case SettingsGroup::CONTROLS:
|
||||
return Lang::getText("[SERVICE_MENU] TITLE");
|
||||
case SettingsGroup::VIDEO:
|
||||
return Lang::getText("[SERVICE_MENU] VIDEO");
|
||||
return "Controls";
|
||||
case SettingsGroup::AUDIO:
|
||||
return Lang::getText("[SERVICE_MENU] AUDIO");
|
||||
case SettingsGroup::SETTINGS:
|
||||
|
||||
Reference in New Issue
Block a user