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
ed24b38a
Commit
ed24b38a
authored
Jun 24, 2015
by
Fabio Bas
Browse files
support <tablerow> for tokens; fix #232
parent
9f247283
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/player.cpp
View file @
ed24b38a
...
...
@@ -102,6 +102,7 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, TabGame *_pare
shortcutsActive
(
false
),
defaultNumberTopCards
(
1
),
lastTokenDestroy
(
true
),
lastTokenTableRow
(
0
),
id
(
_id
),
active
(
false
),
local
(
_local
),
...
...
@@ -1035,6 +1036,7 @@ void Player::actCreateToken()
lastTokenPT
=
dlg
.
getPT
();
if
(
CardInfo
*
correctedCard
=
db
->
getCardBySimpleName
(
lastTokenName
,
false
))
{
lastTokenName
=
correctedCard
->
getName
();
lastTokenTableRow
=
2
-
correctedCard
->
getTableRow
();
if
(
lastTokenPT
.
isEmpty
())
lastTokenPT
=
correctedCard
->
getPowTough
();
}
...
...
@@ -1056,7 +1058,7 @@ void Player::actCreateAnotherToken()
cmd
.
set_annotation
(
lastTokenAnnotation
.
toStdString
());
cmd
.
set_destroy_on_zone_change
(
lastTokenDestroy
);
cmd
.
set_x
(
-
1
);
cmd
.
set_y
(
0
);
cmd
.
set_y
(
lastTokenTableRow
);
sendGameCommand
(
cmd
);
}
...
...
@@ -1070,6 +1072,7 @@ void Player::actCreatePredefinedToken()
lastTokenColor
=
cardInfo
->
getColors
().
isEmpty
()
?
QString
()
:
cardInfo
->
getColors
().
first
().
toLower
();
lastTokenPT
=
cardInfo
->
getPowTough
();
lastTokenAnnotation
=
cardInfo
->
getText
();
lastTokenTableRow
=
2
-
cardInfo
->
getTableRow
();
lastTokenDestroy
=
true
;
aCreateAnotherToken
->
setEnabled
(
true
);
...
...
cockatrice/src/player.h
View file @
ed24b38a
...
...
@@ -185,6 +185,7 @@ private:
int
defaultNumberTopCards
;
QString
lastTokenName
,
lastTokenColor
,
lastTokenPT
,
lastTokenAnnotation
;
bool
lastTokenDestroy
;
int
lastTokenTableRow
;
ServerInfo_User
*
userInfo
;
int
id
;
bool
active
;
...
...
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