Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
afabe2a5
Commit
afabe2a5
authored
Jan 09, 2009
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added time_created and time_modified to Card. This changes the file format
parent
a178b4ec
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
4 deletions
+26
-4
src/data/card.cpp
src/data/card.cpp
+9
-2
src/data/card.hpp
src/data/card.hpp
+2
-0
src/util/io/reader.cpp
src/util/io/reader.cpp
+7
-0
src/util/io/writer.cpp
src/util/io/writer.cpp
+5
-0
src/util/version.cpp
src/util/version.cpp
+3
-2
No files found.
src/data/card.cpp
View file @
afabe2a5
...
...
@@ -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
);
}
src/data/card.hpp
View file @
afabe2a5
...
...
@@ -37,6 +37,8 @@ class Card : public IntrusivePtrVirtualBase {
IndexMap
<
FieldP
,
ValueP
>
data
;
/// Notes for this card
String
notes
;
/// Time the card was created/last modified
wxDateTime
time_created
,
time_modified
;
/// Alternative style to use for this card
/** Optional; if not set use the card style from the set */
StyleSheetP
stylesheet
;
...
...
src/util/io/reader.cpp
View file @
afabe2a5
...
...
@@ -371,8 +371,15 @@ template <> void Reader::handle(tribool& b) {
const
String
&
v
=
getValue
();
b
=
(
v
==
_
(
"true"
)
||
v
==
_
(
"1"
)
||
v
==
_
(
"yes"
));
}
// ----------------------------------------------------------------------------- : Handling less basic util types
template
<>
void
Reader
::
handle
(
wxDateTime
&
date
)
{
if
(
!
date
.
ParseDateTime
(
getValue
().
c_str
()))
{
throw
ParseError
(
_
(
"Expected a date and time"
));
}
}
template
<>
void
Reader
::
handle
(
Vector2D
&
vec
)
{
if
(
!
wxSscanf
(
getValue
().
c_str
(),
_
(
"(%lf,%lf)"
),
&
vec
.
x
,
&
vec
.
y
))
{
throw
ParseError
(
_
(
"Expected (x,y)"
));
...
...
src/util/io/writer.cpp
View file @
afabe2a5
...
...
@@ -113,6 +113,11 @@ template <> void Writer::handle(const tribool& value) {
// ----------------------------------------------------------------------------- : Handling less basic util types
template
<>
void
Writer
::
handle
(
const
wxDateTime
&
date
)
{
if
(
date
.
IsValid
())
{
handle
(
date
.
Format
(
_
(
"%Y-%m-%d %H:%M:%S"
)));
}
}
template
<>
void
Writer
::
handle
(
const
Vector2D
&
vec
)
{
handle
(
String
::
Format
(
_
(
"(%.10lf,%.10lf)"
),
vec
.
x
,
vec
.
y
));
}
...
...
src/util/version.cpp
View file @
afabe2a5
...
...
@@ -78,14 +78,15 @@ const Char* version_suffix = _(" (beta, ascii build)");
* - tag_contents function fixed
* - alignment:justify behavior changed
* - more scriptable fields.
* - store time created,modified for cards -> changes set and clipboard format
*/
const
Version
file_version_locale
=
308
;
// 0.3.8
const
Version
file_version_set
=
30
6
;
// 0.3.6
const
Version
file_version_set
=
30
8
;
// 0.3.8
const
Version
file_version_game
=
308
;
// 0.3.8
const
Version
file_version_stylesheet
=
308
;
// 0.3.8
const
Version
file_version_symbol_font
=
306
;
// 0.3.6
const
Version
file_version_export_template
=
307
;
// 0.3.7
const
Version
file_version_installer
=
307
;
// 0.3.7
const
Version
file_version_symbol
=
305
;
// 0.3.5
const
Version
file_version_clipboard
=
30
6
;
// 0.3.6
const
Version
file_version_clipboard
=
30
8
;
// 0.3.8
const
Version
file_version_script
=
307
;
// 0.3.7
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment