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
4cf92de4
Commit
4cf92de4
authored
Jul 06, 2015
by
Zach
Browse files
Merge pull request #1220 from Fizztastic/fix_1011
Add Move to Hand in card menu
parents
bfa002e5
680332a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/player.cpp
View file @
4cf92de4
...
@@ -415,11 +415,14 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, TabGame *_pare
...
@@ -415,11 +415,14 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, TabGame *_pare
aMoveToBottomLibrary
=
new
QAction
(
this
);
aMoveToBottomLibrary
=
new
QAction
(
this
);
aMoveToBottomLibrary
->
setData
(
cmMoveToBottomLibrary
);
aMoveToBottomLibrary
->
setData
(
cmMoveToBottomLibrary
);
aMoveToGraveyard
=
new
QAction
(
this
);
aMoveToGraveyard
=
new
QAction
(
this
);
aMoveToHand
=
new
QAction
(
this
);
aMoveToHand
->
setData
(
cmMoveToHand
);
aMoveToGraveyard
->
setData
(
cmMoveToGraveyard
);
aMoveToGraveyard
->
setData
(
cmMoveToGraveyard
);
aMoveToExile
=
new
QAction
(
this
);
aMoveToExile
=
new
QAction
(
this
);
aMoveToExile
->
setData
(
cmMoveToExile
);
aMoveToExile
->
setData
(
cmMoveToExile
);
connect
(
aMoveToTopLibrary
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
cardMenuAction
()));
connect
(
aMoveToTopLibrary
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
cardMenuAction
()));
connect
(
aMoveToBottomLibrary
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
cardMenuAction
()));
connect
(
aMoveToBottomLibrary
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
cardMenuAction
()));
connect
(
aMoveToHand
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
cardMenuAction
()));
connect
(
aMoveToGraveyard
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
cardMenuAction
()));
connect
(
aMoveToGraveyard
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
cardMenuAction
()));
connect
(
aMoveToExile
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
cardMenuAction
()));
connect
(
aMoveToExile
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
cardMenuAction
()));
...
@@ -720,6 +723,7 @@ void Player::retranslateUi()
...
@@ -720,6 +723,7 @@ void Player::retranslateUi()
aSetCounter
[
i
]
->
setText
(
tr
(
"&Set counters (%1)..."
).
arg
(
counterColors
[
i
]));
aSetCounter
[
i
]
->
setText
(
tr
(
"&Set counters (%1)..."
).
arg
(
counterColors
[
i
]));
aMoveToTopLibrary
->
setText
(
tr
(
"&Top of library"
));
aMoveToTopLibrary
->
setText
(
tr
(
"&Top of library"
));
aMoveToBottomLibrary
->
setText
(
tr
(
"&Bottom of library"
));
aMoveToBottomLibrary
->
setText
(
tr
(
"&Bottom of library"
));
aMoveToHand
->
setText
(
tr
(
"&Hand"
));
aMoveToGraveyard
->
setText
(
tr
(
"&Graveyard"
));
aMoveToGraveyard
->
setText
(
tr
(
"&Graveyard"
));
aMoveToGraveyard
->
setShortcut
(
QKeySequence
(
"Ctrl+Del"
));
aMoveToGraveyard
->
setShortcut
(
QKeySequence
(
"Ctrl+Del"
));
aMoveToExile
->
setText
(
tr
(
"&Exile"
));
aMoveToExile
->
setText
(
tr
(
"&Exile"
));
...
@@ -1959,6 +1963,18 @@ void Player::cardMenuAction()
...
@@ -1959,6 +1963,18 @@ void Player::cardMenuAction()
commandList
.
append
(
cmd
);
commandList
.
append
(
cmd
);
break
;
break
;
}
}
case
cmMoveToHand
:
{
Command_MoveCard
*
cmd
=
new
Command_MoveCard
;
cmd
->
set_start_player_id
(
startPlayerId
);
cmd
->
set_start_zone
(
startZone
.
toStdString
());
cmd
->
mutable_cards_to_move
()
->
CopyFrom
(
idList
);
cmd
->
set_target_player_id
(
getId
());
cmd
->
set_target_zone
(
"hand"
);
cmd
->
set_x
(
0
);
cmd
->
set_y
(
0
);
commandList
.
append
(
cmd
);
break
;
}
case
cmMoveToGraveyard
:
{
case
cmMoveToGraveyard
:
{
Command_MoveCard
*
cmd
=
new
Command_MoveCard
;
Command_MoveCard
*
cmd
=
new
Command_MoveCard
;
cmd
->
set_start_player_id
(
startPlayerId
);
cmd
->
set_start_player_id
(
startPlayerId
);
...
@@ -2248,6 +2264,8 @@ void Player::updateCardMenu(CardItem *card)
...
@@ -2248,6 +2264,8 @@ void Player::updateCardMenu(CardItem *card)
moveMenu
->
addAction
(
aMoveToTopLibrary
);
moveMenu
->
addAction
(
aMoveToTopLibrary
);
moveMenu
->
addAction
(
aMoveToBottomLibrary
);
moveMenu
->
addAction
(
aMoveToBottomLibrary
);
moveMenu
->
addSeparator
();
moveMenu
->
addSeparator
();
moveMenu
->
addAction
(
aMoveToHand
);
moveMenu
->
addSeparator
();
moveMenu
->
addAction
(
aMoveToGraveyard
);
moveMenu
->
addAction
(
aMoveToGraveyard
);
moveMenu
->
addSeparator
();
moveMenu
->
addSeparator
();
moveMenu
->
addAction
(
aMoveToExile
);
moveMenu
->
addAction
(
aMoveToExile
);
...
...
cockatrice/src/player.h
View file @
4cf92de4
...
@@ -179,7 +179,7 @@ private:
...
@@ -179,7 +179,7 @@ private:
QAction
*
aPlay
,
*
aPlayFacedown
,
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
,
*
aMoveToHand
,
*
aMoveToGraveyard
,
*
aMoveToExile
;
bool
shortcutsActive
;
bool
shortcutsActive
;
int
defaultNumberTopCards
;
int
defaultNumberTopCards
;
...
@@ -241,7 +241,7 @@ private:
...
@@ -241,7 +241,7 @@ private:
void
eventChangeZoneProperties
(
const
Event_ChangeZoneProperties
&
event
);
void
eventChangeZoneProperties
(
const
Event_ChangeZoneProperties
&
event
);
public:
public:
static
const
int
counterAreaWidth
=
55
;
static
const
int
counterAreaWidth
=
55
;
enum
CardMenuActionType
{
cmTap
,
cmUntap
,
cmDoesntUntap
,
cmFlip
,
cmPeek
,
cmClone
,
cmMoveToTopLibrary
,
cmMoveToBottomLibrary
,
cmMoveToGraveyard
,
cmMoveToExile
};
enum
CardMenuActionType
{
cmTap
,
cmUntap
,
cmDoesntUntap
,
cmFlip
,
cmPeek
,
cmClone
,
cmMoveToTopLibrary
,
cmMoveToBottomLibrary
,
cmMoveToHand
,
cmMoveToGraveyard
,
cmMoveToExile
};
enum
{
Type
=
typeOther
};
enum
{
Type
=
typeOther
};
int
type
()
const
{
return
Type
;
}
int
type
()
const
{
return
Type
;
}
...
...
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