misc: remove extra_data function

This commit is contained in:
Brendan Hagan
2022-07-14 17:33:22 -04:00
parent 4f7fa585f7
commit 52a918be39
3 changed files with 2 additions and 51 deletions
+1 -22
View File
@@ -382,26 +382,6 @@ SCRIPT_FUNCTION(count_chosen) {
SCRIPT_RETURN(count);
}
}
}
// ----------------------------------------------------------------------------- : Extra Card Fields
SCRIPT_FUNCTION(extra_data) {
SCRIPT_PARAM_C(String, input);
SCRIPT_PARAM_C(CardP, card);
SCRIPT_PARAM_C(StyleSheetP, stylesheet);
// Transform input to standard field name syntax.
// Other functions are doing lookups for ValuePs, which I assume is doing some of this automatically.
String canonical_field_name = canonical_name_form(input);
FOR_EACH(valueP, card->extraDataFor(*stylesheet)) {
if (valueP->fieldP->name == canonical_field_name) {
SCRIPT_RETURN(valueP);
}
}
return delay_error(ScriptErrorNoMember("extra_data()", input));
}
// ----------------------------------------------------------------------------- : Init
@@ -415,6 +395,5 @@ void init_script_editor_functions(Context& ctx) {
ctx.setVariable(_("require_choice"), script_require_choice);
ctx.setVariable(_("exclusive_choice"), script_exclusive_choice);
ctx.setVariable(_("require_exclusive_choice"), script_require_exclusive_choice);
ctx.setVariable(_("remove_choice"), script_remove_choice);
ctx.setVariable(_("extra_data"), script_extra_data);
ctx.setVariable(_("remove_choice"), script_remove_choice);
}