mirror of
https://github.com/N64Recomp/N64ModernRuntime.git
synced 2025-10-30 08:02:29 +00:00
parse/validate button config type
This commit is contained in:
parent
33d3367761
commit
4d376e5e0c
1 changed files with 16 additions and 0 deletions
|
|
@ -73,6 +73,22 @@ void register_config_option(
|
|||
config_registry.key_ref_map[this_key] = { config_group, json_path };
|
||||
|
||||
switch (type) {
|
||||
case ConfigOptionType::Button: {
|
||||
if (j.find("callback") != j.end()) {
|
||||
if (!j["callback"].is_string()) {
|
||||
TODO_PARSE_ERROR(this_key + "/callback" , "string");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (j.find("variant") != j.end()) {
|
||||
if (!j["variant"].is_string()) {
|
||||
TODO_PARSE_ERROR(this_key + "/variant" , "string");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case ConfigOptionType::TextField: {
|
||||
std::string default_val = "";
|
||||
if (j.find("default") != j.end()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue