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
73d6577a
Commit
73d6577a
authored
Dec 18, 2006
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtg editor import
parent
ef68b5a7
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
264 additions
and
4 deletions
+264
-4
src/data/format/formats.hpp
src/data/format/formats.hpp
+12
-0
src/data/format/mse1.cpp
src/data/format/mse1.cpp
+1
-1
src/data/format/mtg_editor.cpp
src/data/format/mtg_editor.cpp
+240
-1
src/script/scriptable.hpp
src/script/scriptable.hpp
+1
-1
src/util/defaultable.hpp
src/util/defaultable.hpp
+1
-1
src/util/string.cpp
src/util/string.cpp
+6
-0
src/util/string.hpp
src/util/string.hpp
+3
-0
No files found.
src/data/format/formats.hpp
View file @
73d6577a
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
class
Game
;
class
Game
;
DECLARE_POINTER_TYPE
(
Set
);
DECLARE_POINTER_TYPE
(
Set
);
DECLARE_POINTER_TYPE
(
Card
);
DECLARE_POINTER_TYPE
(
FileFormat
);
DECLARE_POINTER_TYPE
(
FileFormat
);
// ----------------------------------------------------------------------------- : FileFormat
// ----------------------------------------------------------------------------- : FileFormat
...
@@ -78,5 +79,16 @@ FileFormatP mse1_file_format();
...
@@ -78,5 +79,16 @@ FileFormatP mse1_file_format();
FileFormatP
mse2_file_format
();
FileFormatP
mse2_file_format
();
FileFormatP
mtg_editor_file_format
();
FileFormatP
mtg_editor_file_format
();
// ----------------------------------------------------------------------------- : Other ways to export
/// Export images for each card in a set to a list of files
void
export_images
(
Window
*
parent
,
const
SetP
&
set
);
/// Export the image of a single card
void
export_image
(
const
SetP
&
set
,
const
CardP
&
card
,
const
String
&
filename
);
/// Generate a bitmap image of a card
Bitmap
export_bitmap
(
const
SetP
&
set
,
const
CardP
&
card
);
// ----------------------------------------------------------------------------- : EOF
// ----------------------------------------------------------------------------- : EOF
#endif
#endif
src/data/format/mse1.cpp
View file @
73d6577a
...
@@ -75,7 +75,7 @@ SetP MSE1FileFormat::importSet(const String& filename) {
...
@@ -75,7 +75,7 @@ SetP MSE1FileFormat::importSet(const String& filename) {
if
(
stylesheet
.
substr
(
0
,
3
)
==
_
(
"old"
))
{
if
(
stylesheet
.
substr
(
0
,
3
)
==
_
(
"old"
))
{
try
{
try
{
set
->
stylesheet
=
StyleSheet
::
byGameAndName
(
*
set
->
game
,
_
(
"old"
));
set
->
stylesheet
=
StyleSheet
::
byGameAndName
(
*
set
->
game
,
_
(
"old"
));
}
catch
(
Error
)
{
}
catch
(
const
Error
&
)
{
// If old style doesn't work try the new one
// If old style doesn't work try the new one
set
->
stylesheet
=
StyleSheet
::
byGameAndName
(
*
set
->
game
,
_
(
"new"
));
set
->
stylesheet
=
StyleSheet
::
byGameAndName
(
*
set
->
game
,
_
(
"new"
));
}
}
...
...
src/data/format/mtg_editor.cpp
View file @
73d6577a
This diff is collapsed.
Click to expand it.
src/script/scriptable.hpp
View file @
73d6577a
...
@@ -64,7 +64,7 @@ class OptionalScript {
...
@@ -64,7 +64,7 @@ class OptionalScript {
template
<
typename
T
>
template
<
typename
T
>
bool
invokeOnDefault
(
Context
&
ctx
,
Defaultable
<
T
>&
value
)
const
{
bool
invokeOnDefault
(
Context
&
ctx
,
Defaultable
<
T
>&
value
)
const
{
if
(
value
.
isDefault
()
&&
invokeOn
(
ctx
,
value
))
{
if
(
value
.
isDefault
()
&&
invokeOn
(
ctx
,
value
))
{
value
.
set
Default
();
// restore defaultness
value
.
make
Default
();
// restore defaultness
return
true
;
return
true
;
}
else
{
}
else
{
return
false
;
return
false
;
...
...
src/util/defaultable.hpp
View file @
73d6577a
...
@@ -49,7 +49,7 @@ class Defaultable {
...
@@ -49,7 +49,7 @@ class Defaultable {
/// Is this value in the default state?
/// Is this value in the default state?
inline
bool
isDefault
()
const
{
return
is_default
;
}
inline
bool
isDefault
()
const
{
return
is_default
;
}
/// Set the defaultness to true
/// Set the defaultness to true
inline
void
set
Default
()
{
is_default
=
true
;
}
inline
void
make
Default
()
{
is_default
=
true
;
}
/// Set the defaultness to false
/// Set the defaultness to false
inline
void
unsetDefault
()
{
is_default
=
false
;
}
inline
void
unsetDefault
()
{
is_default
=
false
;
}
...
...
src/util/string.cpp
View file @
73d6577a
...
@@ -66,6 +66,12 @@ String substr_replace(const String& input, size_t start, size_t end, const Strin
...
@@ -66,6 +66,12 @@ String substr_replace(const String& input, size_t start, size_t end, const Strin
return
input
.
substr
(
0
,
start
)
+
replacement
+
input
.
substr
(
end
);
return
input
.
substr
(
0
,
start
)
+
replacement
+
input
.
substr
(
end
);
}
}
String
replace_all
(
const
String
&
heystack
,
const
String
&
needle
,
const
String
&
replacement
)
{
String
ret
=
heystack
;
ret
.
Replace
(
needle
,
replacement
);
return
ret
;
}
// ----------------------------------------------------------------------------- : Words
// ----------------------------------------------------------------------------- : Words
String
last_word
(
const
String
&
s
)
{
String
last_word
(
const
String
&
s
)
{
...
...
src/util/string.hpp
View file @
73d6577a
...
@@ -84,6 +84,9 @@ String trim_left(const String&);
...
@@ -84,6 +84,9 @@ String trim_left(const String&);
/// Replace the substring [start...end) of 'input' with 'replacement'
/// Replace the substring [start...end) of 'input' with 'replacement'
String
substr_replace
(
const
String
&
input
,
size_t
start
,
size_t
end
,
const
String
&
replacement
);
String
substr_replace
(
const
String
&
input
,
size_t
start
,
size_t
end
,
const
String
&
replacement
);
/// Replace all occurences of one needle with replacement
String
replace_all
(
const
String
&
heystack
,
const
String
&
needle
,
const
String
&
replacement
);
// ----------------------------------------------------------------------------- : Words
// ----------------------------------------------------------------------------- : Words
/// Returns the last word in a string
/// Returns the last word in a string
...
...
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