mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 13:37:00 -04:00
Use underscores instead of spaces for all internal names. And renamed some script functions at the same time.
* cannocial_name_form now outputs "_", where it used to use " " * this simplifies reflectio and scripting code, because now C++ names are also MSE internal names * added 'caption' property to fields. This is used instead of the name in NativeLookEditor, since the latter will now contain underscores. * renamed text related script functions for consistency, since we were touching that part of the code anyway.
This commit is contained in:
@@ -192,7 +192,8 @@ void ChoiceStyle::initImage() {
|
||||
// OR_ELSE
|
||||
ScriptCustomCollectionP lookup(new ScriptCustomCollection());
|
||||
FOR_EACH(ci, choice_images) {
|
||||
lookup->key_value[ci.first] = ci.second.getValidScriptP();
|
||||
lookup->key_value[uncanonical_name_form(ci.first)] =
|
||||
lookup->key_value[ci.first] = ci.second.getValidScriptP();
|
||||
}
|
||||
Script& script = image.getMutableScript();
|
||||
script.addInstruction(I_PUSH_CONST, lookup);
|
||||
@@ -270,7 +271,7 @@ template <> void reflect_content(GetMember& tag, const ChoiceStyle& cs
|
||||
}
|
||||
|
||||
IMPLEMENT_REFLECTION(ChoiceStyle) {
|
||||
REFLECT_ALIAS(300, "card list colors", "colors card list");
|
||||
REFLECT_ALIAS(300, "card_list_colors", "colors_card_list");
|
||||
REFLECT_BASE(Style);
|
||||
REFLECT(popup_style);
|
||||
REFLECT(render_style);
|
||||
|
||||
@@ -63,7 +63,7 @@ String InfoValue::toString() const {
|
||||
return value;
|
||||
}
|
||||
bool InfoValue::update(Context& ctx) {
|
||||
if (value.empty()) value = field().name;
|
||||
if (value.empty()) value = field().caption;
|
||||
bool change = field().script.invokeOn(ctx, value);
|
||||
Value::update(ctx);
|
||||
return change;
|
||||
|
||||
@@ -53,7 +53,7 @@ IMPLEMENT_REFLECTION_NAMELESS(MultipleChoiceValue) {
|
||||
|
||||
bool MultipleChoiceValue::update(Context& ctx) {
|
||||
String old_value = value();
|
||||
ctx.setVariable(_("last change"), to_script(last_change));
|
||||
ctx.setVariable(_("last_change"), to_script(last_change));
|
||||
ChoiceValue::update(ctx);
|
||||
normalForm();
|
||||
return value() != old_value;
|
||||
|
||||
Reference in New Issue
Block a user