Type name of ScriptObjects is now reported as the actual object type (card/set/value/etc.);

Back trace is slightly smarter
Removed move_cursor_with_sort

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@542 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-07-10 14:39:28 +00:00
parent 1ec62f304f
commit d4af90505a
12 changed files with 100 additions and 20 deletions
+4
View File
@@ -83,6 +83,10 @@ class Card : public IntrusivePtrVirtualBase {
DECLARE_REFLECTION();
};
inline String type_name(const Card&) {
return _TYPE_("card");
}
void mark_dependency_member(const Card& value, const String& name, const Dependency& dep);
// ----------------------------------------------------------------------------- : EOF
+12
View File
@@ -79,6 +79,10 @@ inline void update_index(FieldP& f, size_t index) {
f->index = index;
}
inline String type_name(const Field&) {
return _TYPE_("field");
}
// ----------------------------------------------------------------------------- : Style
/// Style information needed to display a Value in a Field.
@@ -148,6 +152,10 @@ inline const FieldP& get_key (const StyleP& s) { return s->fieldP; }
inline const String& get_key_name(const StyleP& s) { return s->fieldP->name; }
template <> StyleP read_new<Style>(Reader&);
inline String type_name(const Style&) {
return _TYPE_("style");
}
void mark_dependency_member(const Style& style, const String& name, const Dependency& dep);
// ----------------------------------------------------------------------------- : StyleListener
@@ -201,6 +209,10 @@ inline const FieldP& get_key (const ValueP& v) { return v->fieldP; }
inline const String& get_key_name(const ValueP& v) { return v->fieldP->name; }
template <> ValueP read_new<Value>(Reader&);
inline String type_name(const Value&) {
return _TYPE_("value");
}
// ----------------------------------------------------------------------------- : Utilities
#define DECLARE_FIELD_TYPE(Type) \
+1 -2
View File
@@ -13,7 +13,7 @@
// ----------------------------------------------------------------------------- : TextField
TextField::TextField()
: multi_line(false), move_cursor_with_sort(false)
: multi_line(false)
, default_name(_("Default"))
{}
@@ -35,7 +35,6 @@ IMPLEMENT_REFLECTION(TextField) {
REFLECT(multi_line);
REFLECT(script);
REFLECT_N("default", default_script);
REFLECT(move_cursor_with_sort);
REFLECT(default_name);
}
-1
View File
@@ -36,7 +36,6 @@ class TextField : public Field {
OptionalScript script; ///< Script to apply to all values
OptionalScript default_script; ///< Script that generates the default value
bool multi_line; ///< Are newlines allowed in the text?
bool move_cursor_with_sort; ///< When the text is reordered by a script should the cursor position be updated?
String default_name; ///< Name of "default" value
virtual void initDependencies(Context&, const Dependency&) const;
+4
View File
@@ -72,5 +72,9 @@ class Game : public Packaged {
DECLARE_REFLECTION();
};
inline String type_name(const Game&) {
return _TYPE_("game");
}
// ----------------------------------------------------------------------------- : EOF
#endif
+3
View File
@@ -125,6 +125,9 @@ class Set : public Packaged {
map<ScriptValueP,OrderCacheP> order_cache;
};
inline String type_name(const Set&) {
return _TYPE_("set");
}
inline int item_count(const Set& set) {
return (int)set.cards.size();
}
+4
View File
@@ -70,5 +70,9 @@ class StyleSheet : public Packaged {
DECLARE_REFLECTION();
};
inline String type_name(const StyleSheet&) {
return _TYPE_("stylesheet");
}
// ----------------------------------------------------------------------------- : EOF
#endif