summaryrefslogtreecommitdiffstats
path: root/src/yuzu_cmd/config.cpp
diff options
context:
space:
mode:
authorClément Gallet <clement.gallet@ens-lyon.org>2021-06-04 00:58:35 +0200
committerClément Gallet <clement.gallet@ens-lyon.org>2021-06-04 00:58:35 +0200
commit166f5d1612de718fc19a45541191b33eb56cd75b (patch)
treed8cb9990469b2ba9bace728e1c7b83bced84d4a7 /src/yuzu_cmd/config.cpp
parentMerge pull request #6402 from Kelebek1/UI (diff)
downloadyuzu-166f5d1612de718fc19a45541191b33eb56cd75b.tar
yuzu-166f5d1612de718fc19a45541191b33eb56cd75b.tar.gz
yuzu-166f5d1612de718fc19a45541191b33eb56cd75b.tar.bz2
yuzu-166f5d1612de718fc19a45541191b33eb56cd75b.tar.lz
yuzu-166f5d1612de718fc19a45541191b33eb56cd75b.tar.xz
yuzu-166f5d1612de718fc19a45541191b33eb56cd75b.tar.zst
yuzu-166f5d1612de718fc19a45541191b33eb56cd75b.zip
Diffstat (limited to '')
-rw-r--r--src/yuzu_cmd/config.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp
index a2ab69cdd..63f368fe5 100644
--- a/src/yuzu_cmd/config.cpp
+++ b/src/yuzu_cmd/config.cpp
@@ -317,6 +317,43 @@ void Config::ReadValues() {
sdl2_config->GetInteger("ControlsGeneral", "touch_diameter_x", 15);
Settings::values.touchscreen.diameter_y =
sdl2_config->GetInteger("ControlsGeneral", "touch_diameter_y", 15);
+
+ int num_touch_from_button_maps =
+ sdl2_config->GetInteger("ControlsGeneral", "touch_from_button_map", 0);
+ if (num_touch_from_button_maps > 0) {
+ for (int i = 0; i < num_touch_from_button_maps; ++i) {
+ Settings::TouchFromButtonMap map;
+ map.name = sdl2_config->Get("ControlsGeneral",
+ std::string("touch_from_button_maps_") + std::to_string(i) +
+ std::string("_name"),
+ "default");
+ const int num_touch_maps = sdl2_config->GetInteger(
+ "ControlsGeneral",
+ std::string("touch_from_button_maps_") + std::to_string(i) + std::string("_count"),
+ 0);
+ map.buttons.reserve(num_touch_maps);
+
+ for (int j = 0; j < num_touch_maps; ++j) {
+ std::string touch_mapping =
+ sdl2_config->Get("ControlsGeneral",
+ std::string("touch_from_button_maps_") + std::to_string(i) +
+ std::string("_bind_") + std::to_string(j),
+ "");
+ map.buttons.emplace_back(std::move(touch_mapping));
+ }
+
+ Settings::values.touch_from_button_maps.emplace_back(std::move(map));
+ }
+ } else {
+ Settings::values.touch_from_button_maps.emplace_back(
+ Settings::TouchFromButtonMap{"default", {}});
+ num_touch_from_button_maps = 1;
+ }
+ Settings::values.use_touch_from_button =
+ sdl2_config->GetBoolean("ControlsGeneral", "use_touch_from_button", false);
+ Settings::values.touch_from_button_map_index =
+ std::clamp(Settings::values.touch_from_button_map_index, 0, num_touch_from_button_maps - 1);
+
Settings::values.udp_input_servers =
sdl2_config->Get("Controls", "udp_input_address", InputCommon::CemuhookUDP::DEFAULT_SRV);