misc: apply canonical field name transformation

This commit is contained in:
Brendan Hagan
2022-06-21 23:15:39 -04:00
parent 6e077b0899
commit be2635f778
2 changed files with 6 additions and 1 deletions
+1
View File
@@ -10,6 +10,7 @@ Features:
* Add Button to Center the loaded image in the Image Slice Window.
* Add "Created At", "Last Modified At" columns to card list.
* Add filter box to Game and Stylesheet selection.
* Add extra_card("field name") script function for accessing Extra Card Fields.
------------------------------------------------------------------------------
HEAD: new items added as changes are made
+5 -1
View File
@@ -391,8 +391,12 @@ SCRIPT_FUNCTION(extra_data) {
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 == input) {
if (valueP->fieldP->name == canonical_field_name) {
SCRIPT_RETURN(valueP);
}
}