mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Added 'filter' support to position function; Made sure sort script can depend on the value of the field itself.
Cleaned up some things, why is a blank image not thread safe? git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@548 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -37,6 +37,10 @@ Field::Field()
|
||||
|
||||
Field::~Field() {}
|
||||
|
||||
void Field::initDependencies(Context& ctx, const Dependency& dep) const {
|
||||
sort_script.initDependencies(ctx, dep);
|
||||
}
|
||||
|
||||
IMPLEMENT_REFLECTION(Field) {
|
||||
REFLECT_IF_NOT_READING {
|
||||
String type = typeName();
|
||||
@@ -215,6 +219,18 @@ bool Value::equals(const Value* that) {
|
||||
return this == that;
|
||||
}
|
||||
|
||||
bool Value::update(Context& ctx) {
|
||||
updateAge();
|
||||
updateSortValue(ctx);
|
||||
return false;
|
||||
}
|
||||
void Value::updateAge() {
|
||||
last_script_update.update();
|
||||
}
|
||||
void Value::updateSortValue(Context& ctx) {
|
||||
sort_value = fieldP->sort_script.invoke(ctx)->toString();
|
||||
}
|
||||
|
||||
void init_object(const FieldP& field, ValueP& value) {
|
||||
if (!value)
|
||||
value = field->newValue(field);
|
||||
|
||||
Reference in New Issue
Block a user