From 8182a10919593c24ede0bac4ee052124ed9cbf75 Mon Sep 17 00:00:00 2001 From: Satori Date: Wed, 25 Aug 2021 13:28:25 +0100 Subject: [PATCH] [App] Implement loading MultiChoiceSettingsItem from embedded xml --- src/xenia/app/settings/settings.h | 10 ++- src/xenia/app/settings/settings_loader.cc | 87 ++++++----------------- src/xenia/app/settings/settings_loader.h | 47 +++++++++++- 3 files changed, 78 insertions(+), 66 deletions(-) diff --git a/src/xenia/app/settings/settings.h b/src/xenia/app/settings/settings.h index 4963a01ab..2a30797ab 100644 --- a/src/xenia/app/settings/settings.h +++ b/src/xenia/app/settings/settings.h @@ -203,7 +203,7 @@ class IMultiChoiceSettingsItem : public ISettingsItem { : ISettingsItem(SettingsType::MultiChoice, title, description) {} virtual bool UpdateIndex(int index) = 0; - virtual const std::vector& option_names() const = 0; + virtual std::vector option_names() const = 0; }; template @@ -241,6 +241,14 @@ class MultiChoiceSettingsItem : public IMultiChoiceSettingsItem { return false; } + std::vector option_names() const override { + std::vector names; + std::transform(options_.begin(), options_.end(), + std::back_inserter(names), + [](const Option& opt) { return opt.title; }); + return names; + } + private: ConfigVar* cvar_; std::vector