mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
added time_created and time_modified to Card. This changes the file format
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1321 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+9
-2
@@ -21,7 +21,10 @@ DECLARE_TYPEOF_NO_REV(IndexMap<FieldP COMMA ValueP>);
|
||||
// ----------------------------------------------------------------------------- : Card
|
||||
|
||||
Card::Card()
|
||||
: has_styling(false)
|
||||
// for files made before we saved these times, set the time to 'yesterday'
|
||||
: time_created (wxDateTime::Now().Subtract(wxDateSpan::Day()).ResetTime())
|
||||
, time_modified(wxDateTime::Now().Subtract(wxDateSpan::Day()).ResetTime())
|
||||
, has_styling(false)
|
||||
{
|
||||
if (!game_for_reading()) {
|
||||
throw InternalError(_("game_for_reading not set"));
|
||||
@@ -30,7 +33,9 @@ Card::Card()
|
||||
}
|
||||
|
||||
Card::Card(const Game& game)
|
||||
: has_styling(false)
|
||||
: time_created (wxDateTime::Now())
|
||||
, time_modified(wxDateTime::Now())
|
||||
, has_styling(false)
|
||||
{
|
||||
data.init(game.card_fields);
|
||||
}
|
||||
@@ -73,6 +78,8 @@ IMPLEMENT_REFLECTION(Card) {
|
||||
}
|
||||
}
|
||||
REFLECT(notes);
|
||||
REFLECT_NO_SCRIPT(time_created);
|
||||
REFLECT_NO_SCRIPT(time_modified);
|
||||
REFLECT(extra_data); // don't allow scripts to depend on style specific data
|
||||
REFLECT_NAMELESS(data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user