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
1847fb7d
Commit
1847fb7d
authored
Mar 22, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implemented 'default set style', so that doesn't have to be duplicated for each style
parent
8667020f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
97 additions
and
55 deletions
+97
-55
data/magic-new.mse-style/style
data/magic-new.mse-style/style
+0
-48
data/magic.mse-game/game
data/magic.mse-game/game
+74
-4
src/data/field.hpp
src/data/field.hpp
+8
-1
src/data/field/boolean.hpp
src/data/field/boolean.hpp
+1
-0
src/data/game.cpp
src/data/game.cpp
+3
-0
src/data/stylesheet.cpp
src/data/stylesheet.cpp
+2
-2
src/util/index_map.hpp
src/util/index_map.hpp
+9
-0
No files found.
data/magic-new.mse-style/style
View file @
1847fb7d
...
...
@@ -41,54 +41,6 @@ init script:
}
############################################################## Set info fields
info style:
title:
padding left: 2
font:
size: 16
symbol:
variation:
name: common
border radius: 0.10
fill type: solid
fill color: rgb(0,0,0)
border color: rgb(255,255,255)
variation:
name: uncommon
border radius: 0.05
fill type: linear gradient
fill color 1: rgb(224,224,224)
fill color 2: rgb(84, 84, 84)
border color 1: rgb(0, 0, 0)
border color 2: rgb(0, 0, 0)
variation:
name: rare
border radius: 0.05
fill type: linear gradient
fill color 1: rgb(214,196,94)
fill color 2: rgb(95, 84, 40)
border color 1: rgb(0, 0, 0)
border color 2: rgb(0, 0, 0)
variation:
name: special
border radius: 0.10
fill type: linear gradient
fill color 1: rgb(224,170,247)
fill color 2: rgb(58,7,80)
border color 1: rgb(255,255,255)
border color 2: rgb(255,255,255)
automatic reminder text:
render style: both
choice images:
yes: script: buildin_image("bool_yes")
no: script: buildin_image("bool_no")
use gradient multicolor:
render style: both
choice images:
yes: script: buildin_image("bool_yes")
no: script: buildin_image("bool_no")
############################################################## Extra style
...
...
data/magic.mse-game/game
View file @
1847fb7d
...
...
@@ -273,6 +273,15 @@ set field:
choice: only for custom keywords
choice: no
description: Should reminder text be added to keywords by default? Note: you can enable/disable reminder text by right clicking the keyword.
set field:
# TODO : RENAME
type: multiple choice
name: automatic reminder text2
choice: old keywords
choice: core set keywords
choice: expert level keywords
choice: custom keywords
description: Should reminder text be added to keywords by default? Note: you can enable/disable reminder text by right clicking the keyword.
set field:
type: boolean
name: automatic card numbers
...
...
@@ -290,6 +299,58 @@ set field:
description: Use gradients on multicolor cards by default, you can always change it be clicking on the card border.
initial: no
############################# Default style
default set style:
title:
padding left: 2
font:
size: 16
symbol:
variation:
name: common
border radius: 0.10
fill type: solid
fill color: rgb(0,0,0)
border color: rgb(255,255,255)
variation:
name: uncommon
border radius: 0.05
fill type: linear gradient
fill color 1: rgb(224,224,224)
fill color 2: rgb(84, 84, 84)
border color 1: rgb(0, 0, 0)
border color 2: rgb(0, 0, 0)
variation:
name: rare
border radius: 0.05
fill type: linear gradient
fill color 1: rgb(214,196,94)
fill color 2: rgb(95, 84, 40)
border color 1: rgb(0, 0, 0)
border color 2: rgb(0, 0, 0)
variation:
name: special
border radius: 0.10
fill type: linear gradient
fill color 1: rgb(224,170,247)
fill color 2: rgb(58,7,80)
border color 1: rgb(255,255,255)
border color 2: rgb(255,255,255)
automatic reminder text:
render style: both
choice images:
yes: script: buildin_image("bool_yes")
no: script: buildin_image("bool_no")
automatic reminder text2:
render style: checklist
direction: vertical
use gradient multicolor:
render style: both
choice images:
yes: script: buildin_image("bool_yes")
no: script: buildin_image("bool_no")
############################################################## Card fields
############################# Background stuff
...
...
@@ -719,10 +780,6 @@ statistics dimension:
numeric: true
icon: stats/casting_cost.png
statistics dimension:
name: rarity_twice
script: card.rarity + card.rarity
statistics category:
name: color / rarity
dimension: card_color
...
...
@@ -805,6 +862,19 @@ statistics category:
has keywords: true
keyword mode:
name: old
description: Old keywords (Banding, Phasing, etc.)
keyword mode:
name: core
description: Core set keywords (Flying, Haste, etc.)
keyword mode:
name: expert
description: Expert level keywords (Cycling, Vanishing, etc.)
keyword mode:
name: custom
description: Custom keywords
keyword parameter type:
name: no parameter
keyword parameter type:
...
...
src/data/field.hpp
View file @
1847fb7d
...
...
@@ -92,6 +92,9 @@ class Style {
inline
RealSize
getSize
()
const
{
return
RealSize
(
width
,
height
);
}
inline
RealRect
getRect
()
const
{
return
RealRect
(
left
,
top
,
width
,
height
);
}
/// Get a copy of this style
virtual
StyleP
clone
()
const
=
0
;
/// Make a viewer object for values using this style
/** thisP is a smart pointer to this */
virtual
ValueViewerP
makeViewer
(
DataViewer
&
parent
,
const
StyleP
&
thisP
)
=
0
;
...
...
@@ -157,12 +160,16 @@ template <> ValueP read_new<Value>(Reader&);
ValueP
Type
##
Field
::
newValue
(
const
FieldP
&
thisP
)
const
{
\
assert
(
thisP
.
get
()
==
this
);
\
return
new_shared1
<
Type
##
Value
>
(
static_pointer_cast
<
Type
##
Field
>
(
thisP
));
\
}
\
StyleP
Type
##
Style
::
clone
()
const
{
\
return
new_shared1
<
Type
##
Style
>
(
*
this
);
\
}
#define DECLARE_STYLE_TYPE(Type) \
DECLARE_HAS_FIELD
(
Type
)
\
virtual
StyleP
clone
()
const
;
\
virtual
ValueViewerP
makeViewer
(
DataViewer
&
parent
,
const
StyleP
&
thisP
);
\
virtual
ValueViewerP
makeEditor
(
DataEditor
&
parent
,
const
StyleP
&
thisP
)
virtual
ValueViewerP
makeEditor
(
DataEditor
&
parent
,
const
StyleP
&
thisP
)
;
// implement field() which returns a field with the right (derived) type
#define DECLARE_HAS_FIELD(Type) \
...
...
src/data/field/boolean.hpp
View file @
1847fb7d
...
...
@@ -37,6 +37,7 @@ class BooleanStyle : public ChoiceStyle {
public:
BooleanStyle
(
const
ChoiceFieldP
&
field
);
DECLARE_HAS_FIELD
(
Boolean
);
// not DECLARE_STYLE_TYPE, because we use a normal ChoiceValueViewer/Editor
virtual
StyleP
clone
()
const
;
// no extra data
...
...
src/data/game.cpp
View file @
1847fb7d
...
...
@@ -40,6 +40,9 @@ IMPLEMENT_REFLECTION(Game) {
REFLECT_BASE
(
Packaged
);
REFLECT
(
init_script
);
REFLECT
(
set_fields
);
REFLECT_IF_READING
{
default_set_style
.
init
(
set_fields
);
}
REFLECT
(
default_set_style
);
REFLECT
(
card_fields
);
REFLECT
(
statistics_dimensions
);
...
...
src/data/stylesheet.cpp
View file @
1847fb7d
...
...
@@ -69,8 +69,8 @@ IMPLEMENT_REFLECTION(StyleSheet) {
REFLECT
(
card_background
);
if
(
game
)
{
REFLECT_IF_READING
{
card_style
.
init
(
game
->
card_fields
);
set_info_style
.
init
(
game
->
set_fields
);
card_style
.
init
(
game
->
card_fields
);
set_info_style
.
cloneFrom
(
game
->
default_set_style
);
}
REFLECT
(
card_style
);
REFLECT
(
set_info_style
);
...
...
src/util/index_map.hpp
View file @
1847fb7d
...
...
@@ -53,6 +53,15 @@ class IndexMap : private vector<Value> {
init_object
(
key
,
(
*
this
)[
key
->
index
]);
}
}
/// Initialize this map with cloned values from another list
void
cloneFrom
(
const
IndexMap
<
Key
,
Value
>&
values
)
{
if
(
this
->
size
()
==
values
.
size
())
return
;
this
->
reserve
(
values
.
size
());
for
(
size_t
index
=
size
()
;
index
<
values
.
size
()
;
++
index
)
{
const
Value
&
value
=
values
[
index
];
push_back
(
value
?
value
->
clone
()
:
value
);
}
}
/// Change this map by adding an additional key and value
void
add
(
const
Key
&
key
,
const
Value
&
value
)
{
assert
(
get_key
(
value
)
==
key
);
...
...
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