mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Cleaned up the reflection code a bit
* Renamed 'tag' variable to 'handler' * Removed addAlias stuff, instead check for matching names with if statements * Added after_reading function that is called by Reader after reading a complete object. This generalizes Packaged::validate, which is now also called via this mechanism. * Removed some backwards compatibility with <0.3.0 for templates
This commit is contained in:
+6
-3
@@ -47,7 +47,6 @@ IMPLEMENT_REFLECTION(Field) {
|
||||
REFLECT(type);
|
||||
}
|
||||
REFLECT(name);
|
||||
REFLECT_IF_READING name = canonical_name_form(name);
|
||||
REFLECT(caption);
|
||||
REFLECT(description);
|
||||
REFLECT_N("icon", icon_filename);
|
||||
@@ -63,8 +62,12 @@ IMPLEMENT_REFLECTION(Field) {
|
||||
REFLECT(card_list_name);
|
||||
REFLECT(sort_script);
|
||||
REFLECT_N("card_list_alignment", card_list_align);
|
||||
REFLECT_IF_READING if(caption.empty()) caption = name_to_caption(name);
|
||||
REFLECT_IF_READING if(card_list_name.empty()) card_list_name = capitalize(caption);
|
||||
}
|
||||
|
||||
void Field::after_reading(Version ver) {
|
||||
name = canonical_name_form(name);
|
||||
if(caption.empty()) caption = name_to_caption(name);
|
||||
if(card_list_name.empty()) card_list_name = capitalize(caption);
|
||||
}
|
||||
|
||||
template <>
|
||||
|
||||
Reference in New Issue
Block a user