mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
misc: apply canonical field name transformation
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user