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
7e0eb5a8
Commit
7e0eb5a8
authored
Sep 20, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for named colors, e.g. "white" and "black";
Added missing keys to locale.
parent
8cb9fd2f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
11 deletions
+27
-11
data/en.mse-locale/locale
data/en.mse-locale/locale
+7
-0
data/magic-new-planeswalker.mse-style/style
data/magic-new-planeswalker.mse-style/style
+4
-10
doc/type/color.txt
doc/type/color.txt
+6
-0
src/script/value.cpp
src/script/value.cpp
+7
-1
src/util/io/reader.cpp
src/util/io/reader.cpp
+3
-0
No files found.
data/en.mse-locale/locale
View file @
7e0eb5a8
...
...
@@ -91,6 +91,13 @@ menu:
basic
shapes
:
&
Basic
Shapes
F8
symmetry
:
S
&
ymmetry
F9
paint
:
P
&
aint
F10
#
Updates
window
apply
changes
:
Apply
changes
cancel
changes
:
Cancel
changes
install
package
:
Install
package
upgrade
package
:
Upgrade
package
remove
package
:
Remove
package
##############################################################
Menu
help
texts
help
:
...
...
data/magic-new-planeswalker.mse-style/style
View file @
7e0eb5a8
...
...
@@ -38,8 +38,8 @@ init script:
# Use guild mana symbols?
guild_mana := { styling.use_guild_mana_symbols }
paintbrush_color:= {
if card.border_color == "black" or card.border_color == rgb(0,0,0) then "white"
else "black"
paintbrush_color:= {
if card.border_color < 96 then "white"
else "black"
}
# Loyalty cost arrows
...
...
@@ -334,10 +334,7 @@ card style:
name: Matrix
size: 10
weight: bold
color:
script:
if card.border_color == "black" or card.border_color == rgb(0,0,0) then rgb(255,255,255)
else rgb(0,0,0)
color: { paintbrush_color() }
copyright line:
left: 43
...
...
@@ -349,10 +346,7 @@ card style:
font:
name: MPlantin
size: 7
color:
script:
if card.border_color == "black" or card.border_color == rgb(0,0,0) then rgb(255,255,255)
else rgb(0,0,0)
color: { paintbrush_color() }
############################################################## Extra card fields
extra card field:
...
...
doc/type/color.txt
View file @
7e0eb5a8
...
...
@@ -5,6 +5,12 @@ In files and scritps a color can be represented as
<pre>rgb(<i>red_component</i>, <i>green_component</i>, <i>blue_component</i>)</pre>
where red_component, green_component and blue_component are numbers between 0 and 255 (inclusive).
--Named colors--
MSE also supports named colors, for instance @"white"@ is the same as @rgb(255,255,255)@.
For a full list of supported colors, see [[http://www.wxwidgets.org/manuals/stable/wx_wxcolourdatabase.html|the wxWidgets documentation]].
In scripts named colors are represented as [[type:string]]s.
--Examples--
For example:
! Code Represents <<<
...
...
src/script/value.cpp
View file @
7e0eb5a8
...
...
@@ -195,7 +195,12 @@ class ScriptString : public ScriptValue {
if
(
wxSscanf
(
value
.
c_str
(),
_
(
"rgb(%u,%u,%u)"
),
&
r
,
&
g
,
&
b
))
{
return
Color
(
r
,
g
,
b
);
}
else
{
throw
ScriptError
(
_ERROR_3_
(
"can't convert value"
,
value
,
typeName
(),
_TYPE_
(
"color"
)));
// color from database?
Color
c
(
value
);
if
(
!
c
.
Ok
())
{
throw
ScriptError
(
_ERROR_3_
(
"can't convert value"
,
value
,
typeName
(),
_TYPE_
(
"color"
)));
}
return
c
;
}
}
virtual
int
itemCount
()
const
{
return
(
int
)
value
.
size
();
}
...
...
@@ -226,6 +231,7 @@ class ScriptColor : public ScriptValue {
virtual
ScriptType
type
()
const
{
return
SCRIPT_COLOR
;
}
virtual
String
typeName
()
const
{
return
_TYPE_
(
"color"
);
}
virtual
operator
Color
()
const
{
return
value
;
}
virtual
operator
int
()
const
{
return
(
value
.
Red
()
+
value
.
Blue
()
+
value
.
Green
())
/
3
;
}
virtual
operator
String
()
const
{
return
String
::
Format
(
_
(
"rgb(%u,%u,%u)"
),
value
.
Red
(),
value
.
Green
(),
value
.
Blue
());
}
...
...
src/util/io/reader.cpp
View file @
7e0eb5a8
...
...
@@ -329,6 +329,9 @@ template <> void Reader::handle(Color& col) {
UInt
r
,
g
,
b
;
if
(
wxSscanf
(
getValue
().
c_str
(),
_
(
"rgb(%u,%u,%u)"
),
&
r
,
&
g
,
&
b
))
{
col
.
Set
(
r
,
g
,
b
);
}
else
{
col
=
Color
(
previous_value
);
if
(
!
col
.
Ok
())
col
=
*
wxBLACK
;
}
}
...
...
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