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
96af5bd0
Commit
96af5bd0
authored
Feb 14, 2015
by
Gavin Bisesi
Browse files
Merge pull request #726 from kaiserfro/jo-add-play-face-down-menu-item
Add a play face down context menu item when in the hand zone.
parents
e0450d45
4bd161ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/player.cpp
View file @
96af5bd0
...
@@ -415,7 +415,9 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, TabGame *_pare
...
@@ -415,7 +415,9 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, TabGame *_pare
connect
(
aPlay
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
actPlay
()));
connect
(
aPlay
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
actPlay
()));
aHide
=
new
QAction
(
this
);
aHide
=
new
QAction
(
this
);
connect
(
aHide
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
actHide
()));
connect
(
aHide
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
actHide
()));
aPlayFacedown
=
new
QAction
(
this
);
connect
(
aPlayFacedown
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
actPlayFacedown
()));
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
QAction
*
tempAddCounter
=
new
QAction
(
this
);
QAction
*
tempAddCounter
=
new
QAction
(
this
);
tempAddCounter
->
setData
(
9
+
i
*
1000
);
tempAddCounter
->
setData
(
9
+
i
*
1000
);
...
@@ -651,7 +653,8 @@ void Player::retranslateUi()
...
@@ -651,7 +653,8 @@ void Player::retranslateUi()
aPlay
->
setText
(
tr
(
"&Play"
));
aPlay
->
setText
(
tr
(
"&Play"
));
aHide
->
setText
(
tr
(
"&Hide"
));
aHide
->
setText
(
tr
(
"&Hide"
));
aPlayFacedown
->
setText
(
tr
(
"Play &Face Down"
));
aTap
->
setText
(
tr
(
"&Tap"
));
aTap
->
setText
(
tr
(
"&Tap"
));
aUntap
->
setText
(
tr
(
"&Untap"
));
aUntap
->
setText
(
tr
(
"&Untap"
));
aDoesntUntap
->
setText
(
tr
(
"Toggle &normal untapping"
));
aDoesntUntap
->
setText
(
tr
(
"Toggle &normal untapping"
));
...
@@ -2141,6 +2144,11 @@ void Player::actHide()
...
@@ -2141,6 +2144,11 @@ void Player::actHide()
game
->
getActiveCard
()
->
getZone
()
->
removeCard
(
game
->
getActiveCard
());
game
->
getActiveCard
()
->
getZone
()
->
removeCard
(
game
->
getActiveCard
());
}
}
void
Player
::
actPlayFacedown
()
{
playCard
(
game
->
getActiveCard
(),
true
,
game
->
getActiveCard
()
->
getInfo
()
->
getCipt
());
}
void
Player
::
updateCardMenu
(
CardItem
*
card
)
void
Player
::
updateCardMenu
(
CardItem
*
card
)
{
{
QMenu
*
cardMenu
=
card
->
getCardMenu
();
QMenu
*
cardMenu
=
card
->
getCardMenu
();
...
@@ -2217,6 +2225,7 @@ void Player::updateCardMenu(CardItem *card)
...
@@ -2217,6 +2225,7 @@ void Player::updateCardMenu(CardItem *card)
cardMenu
->
addMenu
(
moveMenu
);
cardMenu
->
addMenu
(
moveMenu
);
}
else
{
}
else
{
cardMenu
->
addAction
(
aPlay
);
cardMenu
->
addAction
(
aPlay
);
cardMenu
->
addAction
(
aPlayFacedown
);
cardMenu
->
addMenu
(
moveMenu
);
cardMenu
->
addMenu
(
moveMenu
);
}
}
}
else
}
else
...
...
cockatrice/src/player.h
View file @
96af5bd0
...
@@ -156,6 +156,7 @@ private slots:
...
@@ -156,6 +156,7 @@ private slots:
void
actSetAnnotation
();
void
actSetAnnotation
();
void
actPlay
();
void
actPlay
();
void
actHide
();
void
actHide
();
void
actPlayFacedown
();
private:
private:
TabGame
*
game
;
TabGame
*
game
;
...
@@ -173,7 +174,7 @@ private:
...
@@ -173,7 +174,7 @@ private:
*
aCardMenu
,
*
aMoveBottomCardToGrave
;
*
aCardMenu
,
*
aMoveBottomCardToGrave
;
QList
<
QAction
*>
aAddCounter
,
aSetCounter
,
aRemoveCounter
;
QList
<
QAction
*>
aAddCounter
,
aSetCounter
,
aRemoveCounter
;
QAction
*
aPlay
,
QAction
*
aPlay
,
*
aPlayFacedown
,
*
aHide
,
*
aHide
,
*
aTap
,
*
aUntap
,
*
aDoesntUntap
,
*
aAttach
,
*
aUnattach
,
*
aDrawArrow
,
*
aSetPT
,
*
aIncP
,
*
aDecP
,
*
aIncT
,
*
aDecT
,
*
aIncPT
,
*
aDecPT
,
*
aSetAnnotation
,
*
aFlip
,
*
aPeek
,
*
aClone
,
*
aTap
,
*
aUntap
,
*
aDoesntUntap
,
*
aAttach
,
*
aUnattach
,
*
aDrawArrow
,
*
aSetPT
,
*
aIncP
,
*
aDecP
,
*
aIncT
,
*
aDecT
,
*
aIncPT
,
*
aDecPT
,
*
aSetAnnotation
,
*
aFlip
,
*
aPeek
,
*
aClone
,
*
aMoveToTopLibrary
,
*
aMoveToBottomLibrary
,
*
aMoveToGraveyard
,
*
aMoveToExile
;
*
aMoveToTopLibrary
,
*
aMoveToBottomLibrary
,
*
aMoveToGraveyard
,
*
aMoveToExile
;
...
...
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