mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2025-06-07 09:45:55 +02:00
wip: load action_set_layers in controller/layers
This commit is contained in:
parent
eaea45cabf
commit
026d00fba0
1 changed files with 58 additions and 52 deletions
|
@ -453,9 +453,8 @@ static void split_string(const std::string &s, char delim, Out result) {
|
|||
// folder "controller"
|
||||
static void load_gamecontroller_settings(Settings *settings)
|
||||
{
|
||||
std::string path = Local_Storage::get_game_settings_path() + "controller";
|
||||
auto process_paths = [&](std::string path, std::map<std::string, std::map<std::string, std::pair<std::set<std::string>, std::string>>> action_sets) {
|
||||
std::vector<std::string> paths = Local_Storage::get_filenames_path(path);
|
||||
|
||||
for (auto& p : paths) {
|
||||
size_t length = p.length();
|
||||
if (length < 4) continue;
|
||||
|
@ -495,7 +494,8 @@ static void load_gamecontroller_settings(Settings *settings)
|
|||
if (deliminator2 != std::string::npos && deliminator2 != line.size()) {
|
||||
button_name = line.substr(deliminator + 1, deliminator2 - (deliminator + 1));
|
||||
source_mode = line.substr(deliminator2 + 1);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
button_name = line.substr(deliminator + 1);
|
||||
source_mode = "";
|
||||
}
|
||||
|
@ -509,10 +509,16 @@ static void load_gamecontroller_settings(Settings *settings)
|
|||
PRINT_DEBUG("Added %s %s %s", action_name.c_str(), button_name.c_str(), source_mode.c_str());
|
||||
}
|
||||
|
||||
settings->controller_settings.action_sets[action_set_name] = button_pairs;
|
||||
action_sets[action_set_name] = button_pairs;
|
||||
PRINT_DEBUG("Added %zu action names to %s", button_pairs.size(), action_set_name.c_str());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
std::string path = Local_Storage::get_game_settings_path() + "controller";
|
||||
std::string layers_path = path + (PATH_SEPARATOR "layers" PATH_SEPARATOR);
|
||||
process_paths(path, settings->controller_settings.action_sets);
|
||||
process_paths(layers_path, settings->controller_settings.action_set_layers);
|
||||
|
||||
settings->glyphs_directory = path + (PATH_SEPARATOR "glyphs" PATH_SEPARATOR);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue