Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
da0e3292
Commit
da0e3292
authored
Dec 29, 2015
by
Zach H
Browse files
Token PT shown in create related dialog
parent
2bf998b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/carddatabase.cpp
View file @
da0e3292
...
@@ -660,7 +660,12 @@ void CardDatabase::refreshCachedReverseRelatedCards()
...
@@ -660,7 +660,12 @@ void CardDatabase::refreshCachedReverseRelatedCards()
if
(
card
->
getReverseRelatedCards
().
isEmpty
())
if
(
card
->
getReverseRelatedCards
().
isEmpty
())
continue
;
continue
;
QString
relatedCardName
=
card
->
getName
();
QString
relatedCardName
;
if
(
card
->
getPowTough
().
size
()
>
0
)
relatedCardName
=
card
->
getPowTough
()
+
" "
+
card
->
getName
();
// "n/n name"
else
relatedCardName
=
card
->
getName
();
// "name"
foreach
(
QString
targetCard
,
card
->
getReverseRelatedCards
())
foreach
(
QString
targetCard
,
card
->
getReverseRelatedCards
())
{
{
if
(
!
cards
.
contains
(
targetCard
))
if
(
!
cards
.
contains
(
targetCard
))
...
...
cockatrice/src/player.cpp
View file @
da0e3292
...
@@ -1135,7 +1135,14 @@ void Player::actCreateRelatedCard()
...
@@ -1135,7 +1135,14 @@ void Player::actCreateRelatedCard()
// get the target card name
// get the target card name
QAction
*
action
=
static_cast
<
QAction
*>
(
sender
());
QAction
*
action
=
static_cast
<
QAction
*>
(
sender
());
CardInfo
*
cardInfo
=
db
->
getCard
(
action
->
text
());
// removes p/t from tokens (and leading space))
QStringList
spaces
=
action
->
text
().
split
(
" "
);
if
(
spaces
.
at
(
0
).
indexOf
(
"/"
)
!=
-
1
)
// Strip space from creatures
spaces
.
removeFirst
();
CardInfo
*
cardInfo
=
db
->
getCard
(
spaces
.
join
(
" "
));
// create the token for the related card
// create the token for the related card
Command_CreateToken
cmd
;
Command_CreateToken
cmd
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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