mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
Symbol editor now has constraints on selection, but part list allows selection inside groups.
Added logical 'xor' operator for scripting. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@534 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+22
-11
@@ -204,7 +204,12 @@ String SymbolSymmetry::typeName() const {
|
||||
}
|
||||
|
||||
SymbolPartP SymbolSymmetry::clone() const {
|
||||
return new_intrusive1<SymbolSymmetry>(*this);
|
||||
SymbolSymmetryP part(new SymbolSymmetry(*this));
|
||||
// also clone the parts inside
|
||||
FOR_EACH(p, part->parts) {
|
||||
p = p->clone();
|
||||
}
|
||||
return part;
|
||||
}
|
||||
|
||||
IMPLEMENT_REFLECTION(SymbolSymmetry) {
|
||||
@@ -213,20 +218,16 @@ IMPLEMENT_REFLECTION(SymbolSymmetry) {
|
||||
REFLECT(copies);
|
||||
REFLECT(center);
|
||||
REFLECT(handle);
|
||||
// Fixes after reading
|
||||
REFLECT_IF_READING {
|
||||
if (name.empty()) {
|
||||
if (kind == SYMMETRY_REFLECTION) {
|
||||
name = _("Mirror");
|
||||
} else {
|
||||
name = _("Symmetry");
|
||||
}
|
||||
}
|
||||
}
|
||||
REFLECT(parts);
|
||||
REFLECT_IF_READING calculateBoundsNonRec();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : SymbolGroup
|
||||
|
||||
SymbolGroup::SymbolGroup() {
|
||||
name = capitalize(_TYPE_("group"));
|
||||
}
|
||||
|
||||
String SymbolGroup::typeName() const {
|
||||
return _("group");
|
||||
}
|
||||
@@ -240,6 +241,14 @@ SymbolPartP SymbolGroup::clone() const {
|
||||
return part;
|
||||
}
|
||||
|
||||
bool SymbolGroup::isAncestor(const SymbolPart& that) const {
|
||||
if (this == &that) return true;
|
||||
FOR_EACH_CONST(p, parts) {
|
||||
if (p->isAncestor(that)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void SymbolGroup::calculateBounds() {
|
||||
FOR_EACH(p, parts) p->calculateBounds();
|
||||
calculateBoundsNonRec();
|
||||
@@ -256,12 +265,14 @@ void SymbolGroup::calculateBoundsNonRec() {
|
||||
IMPLEMENT_REFLECTION(SymbolGroup) {
|
||||
REFLECT_BASE(SymbolPart);
|
||||
REFLECT(parts);
|
||||
REFLECT_IF_READING calculateBoundsNonRec();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Symbol
|
||||
|
||||
IMPLEMENT_REFLECTION(Symbol) {
|
||||
REFLECT(parts);
|
||||
REFLECT_IF_READING calculateBoundsNonRec();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Default symbol
|
||||
|
||||
Reference in New Issue
Block a user