mirror of
https://github.com/N64Recomp/N64ModernRuntime.git
synced 2026-01-11 01:02:18 +00:00
parse/validate button config type
This commit is contained in:
parent
df02da1f6a
commit
499fa67b62
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