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
89de0488
Commit
89de0488
authored
Mar 24, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaned up magic keywords; correct drawing of placeholders
parent
fe606b03
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
153 additions
and
82 deletions
+153
-82
data/en.mse-locale/locale
data/en.mse-locale/locale
+7
-0
data/magic.mse-game/game
data/magic.mse-game/game
+118
-61
src/data/font.cpp
src/data/font.cpp
+5
-1
src/data/font.hpp
src/data/font.hpp
+2
-2
src/data/keyword.cpp
src/data/keyword.cpp
+3
-2
src/gui/control/keyword_list.cpp
src/gui/control/keyword_list.cpp
+1
-1
src/render/text/element.cpp
src/render/text/element.cpp
+1
-1
src/render/text/font.cpp
src/render/text/font.cpp
+7
-14
src/script/functions/english.cpp
src/script/functions/english.cpp
+9
-0
No files found.
data/en.mse-locale/locale
View file @
89de0488
...
...
@@ -308,7 +308,14 @@ tooltip:
##############################################################
Labels
in
the
GUI
label
:
#
Cards
tab
card
notes
:
Card
notes
:
#
Keywords
tab
keyword
:
Keyword
match
:
Matches
mode
:
Mode
uses
:
Uses
reminder
:
Reminder
text
#
Open
dialogs
all
files
All
files
...
...
data/magic.mse-game/game
View file @
89de0488
This diff is collapsed.
Click to expand it.
src/data/font.cpp
View file @
89de0488
...
...
@@ -27,7 +27,7 @@ void Font::initDependencies(Context& ctx, const Dependency& dep) const {
shadow_color
.
initDependencies
(
ctx
,
dep
);
}
FontP
Font
::
make
(
bool
bold
,
bool
italic
)
const
{
FontP
Font
::
make
(
bool
bold
,
bool
italic
,
bool
placeholder_color
)
const
{
FontP
f
(
new
Font
(
*
this
));
if
(
bold
)
f
->
font
.
SetWeight
(
wxBOLD
);
if
(
italic
)
{
...
...
@@ -37,6 +37,10 @@ FontP Font::make(bool bold, bool italic) const {
f
->
font
.
SetWeight
(
wxBOLD
);
}
}
if
(
placeholder_color
)
{
f
->
color
=
f
->
separator_color
;
f
->
shadow_displacement
=
RealSize
(
0
,
0
);
// no shadow
}
return
f
;
}
...
...
src/data/font.hpp
View file @
89de0488
...
...
@@ -40,8 +40,8 @@ class Font {
/// Does this font have a shadow?
inline
bool
hasShadow
()
{
return
shadow_displacement
.
width
!=
0
||
shadow_displacement
.
height
!=
0
;
}
/// Make a bold/italic version of this font
FontP
make
(
bool
bold
,
bool
italic
)
const
;
/// Make a bold/italic
/placeholder
version of this font
FontP
make
(
bool
bold
,
bool
italic
,
bool
placeholder_color
)
const
;
private:
DECLARE_REFLECTION
();
...
...
src/data/keyword.cpp
View file @
89de0488
...
...
@@ -360,14 +360,15 @@ String KeywordDatabase::expand(const String& text,
// j = even -> parameter #(j/2)
size_t
start_u
,
len_u
;
kw
->
matchRe
.
GetMatch
(
&
start_u
,
&
len_u
,
j
);
size_t
part_end
=
untagged_to_index
(
s
,
start_u
+
len_u
,
true
);
// note: start_u can be (uint)-1 when len_u == 0
size_t
part_end
=
len_u
>
0
?
untagged_to_index
(
s
,
start_u
+
len_u
,
true
)
:
start
;
String
part
=
s
.
substr
(
start
,
part_end
-
start
);
if
((
j
%
2
)
==
0
)
{
// parameter
String
param
=
untagged
.
substr
(
start_u
,
len_u
);
// untagged version
if
(
param
.
empty
())
{
// placeholder
param
=
_
(
"<atom-kwpph>"
)
+
kw
->
parameters
[
j
/
2
-
1
]
->
name
+
_
(
"</atom-kwpph>"
);
param
=
_
(
"<atom-kwpph>"
)
+
kw
->
parameters
[
j
/
2
-
1
]
->
name
+
_
(
"</atom-kwpph>"
);
part
=
part
+
param
;
// keep tags
}
else
if
(
kw
->
parameters
[
j
/
2
-
1
]
->
script
)
{
// apply parameter script
...
...
src/gui/control/keyword_list.cpp
View file @
89de0488
...
...
@@ -27,7 +27,7 @@ KeywordList::KeywordList(Window* parent, int id, long additional_style)
// Add columns
InsertColumn
(
0
,
_LABEL_
(
"keyword"
),
wxLIST_FORMAT_LEFT
,
0
);
InsertColumn
(
1
,
_LABEL_
(
"match"
),
wxLIST_FORMAT_LEFT
,
200
);
InsertColumn
(
2
,
_LABEL_
(
"mode"
),
wxLIST_FORMAT_LEFT
,
10
0
);
InsertColumn
(
2
,
_LABEL_
(
"mode"
),
wxLIST_FORMAT_LEFT
,
6
0
);
InsertColumn
(
3
,
_LABEL_
(
"uses"
),
wxLIST_FORMAT_RIGHT
,
80
);
InsertColumn
(
4
,
_LABEL_
(
"reminder"
),
wxLIST_FORMAT_LEFT
,
300
);
}
...
...
src/render/text/element.cpp
View file @
89de0488
...
...
@@ -108,7 +108,7 @@ struct TextElementsFromString {
te
.
elements
.
push_back
(
new_shared5
<
SymbolTextElement
>
(
text
,
pos
,
pos
+
1
,
style
.
symbol_font
,
&
ctx
));
}
else
{
te
.
elements
.
push_back
(
new_shared6
<
FontTextElement
>
(
text
,
pos
,
pos
+
1
,
style
.
font
.
make
(
bold
>
0
,
italic
>
0
),
style
.
font
.
make
(
bold
>
0
,
italic
>
0
,
soft
>
0
||
kwpph
>
0
),
soft
>
0
?
DRAW_ACTIVE
:
DRAW_NORMAL
,
line
>
0
?
BREAK_LINE
:
BREAK_HARD
));
}
...
...
src/render/text/font.cpp
View file @
89de0488
...
...
@@ -15,21 +15,14 @@ void FontTextElement::draw(RotatedDC& dc, double scale, const RealRect& rect, co
if
((
what
&
draw_as
)
!=
draw_as
)
return
;
// don't draw
dc
.
SetFont
(
font
->
font
,
font
->
size
*
scale
);
if
(
end
!=
start
&&
text
.
substr
(
end
-
1
,
1
)
==
_
(
"
\n
"
))
end
-=
1
;
// don't draw the newline character at the end
if
(
draw_as
==
DRAW_ACTIVE
)
{
// we are drawing a separator
dc
.
SetTextForeground
(
font
->
separator_color
);
dc
.
DrawText
(
text
.
substr
(
start
,
end
-
start
),
rect
.
position
());
}
else
{
// draw normally
// draw shadow
if
(
font
->
hasShadow
())
{
dc
.
SetTextForeground
(
font
->
shadow_color
);
dc
.
DrawText
(
text
.
substr
(
start
,
end
-
start
),
rect
.
position
()
+
font
->
shadow_displacement
);
}
// draw
dc
.
SetTextForeground
(
font
->
color
);
dc
.
DrawText
(
text
.
substr
(
start
,
end
-
start
),
rect
.
position
());
// draw shadow
if
(
font
->
hasShadow
())
{
dc
.
SetTextForeground
(
font
->
shadow_color
);
dc
.
DrawText
(
text
.
substr
(
start
,
end
-
start
),
rect
.
position
()
+
font
->
shadow_displacement
);
}
// draw
dc
.
SetTextForeground
(
font
->
color
);
dc
.
DrawText
(
text
.
substr
(
start
,
end
-
start
),
rect
.
position
());
}
void
FontTextElement
::
getCharInfo
(
RotatedDC
&
dc
,
double
scale
,
vector
<
CharInfo
>&
out
)
const
{
...
...
src/script/functions/english.cpp
View file @
89de0488
...
...
@@ -9,6 +9,7 @@
#include <script/functions/functions.hpp>
#include <script/functions/util.hpp>
#include <util/tagged_string.hpp>
#include <util/error.hpp>
// ----------------------------------------------------------------------------- : Numbers
...
...
@@ -71,6 +72,14 @@ SCRIPT_FUNCTION(english_number_a) {
// ----------------------------------------------------------------------------- : Singular/plural
SCRIPT_FUNCTION
(
english_singular
)
{
throw
InternalError
(
_
(
"TODO"
));
}
SCRIPT_FUNCTION
(
english_plural
)
{
throw
InternalError
(
_
(
"TODO"
));
}
// ----------------------------------------------------------------------------- : Hints
// insert a hint, <hint-1> for singular, <hint-2> otherwise
...
...
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