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
af8e498a
Commit
af8e498a
authored
Mar 07, 2011
by
Max-Wilhelm Bruker
Browse files
readjusted position of 'move to' menu in card context menu; fixed logMoveCard
parent
64c3c098
Changes
4
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/carditem.cpp
View file @
af8e498a
...
...
@@ -156,6 +156,12 @@ void CardItem::updateCardMenu()
if
(
revealedCard
)
cardMenu
->
addAction
(
aHide
);
else
if
(
owner
->
getLocal
())
{
moveMenu
->
clear
();
moveMenu
->
addAction
(
aMoveToTopLibrary
);
moveMenu
->
addAction
(
aMoveToBottomLibrary
);
moveMenu
->
addAction
(
aMoveToGraveyard
);
moveMenu
->
addAction
(
aMoveToExile
);
if
(
zone
)
{
if
(
zone
->
getName
()
==
"table"
)
{
cardMenu
->
addAction
(
aTap
);
...
...
@@ -171,6 +177,7 @@ void CardItem::updateCardMenu()
cardMenu
->
addAction
(
aSetAnnotation
);
cardMenu
->
addSeparator
();
cardMenu
->
addAction
(
aClone
);
cardMenu
->
addMenu
(
moveMenu
);
for
(
int
i
=
0
;
i
<
aAddCounter
.
size
();
++
i
)
{
cardMenu
->
addSeparator
();
...
...
@@ -181,15 +188,10 @@ void CardItem::updateCardMenu()
cardMenu
->
addSeparator
();
}
else
{
cardMenu
->
addAction
(
aPlay
);
cardMenu
->
addMenu
(
moveMenu
);
}
}
moveMenu
->
clear
();
moveMenu
->
addAction
(
aMoveToTopLibrary
);
moveMenu
->
addAction
(
aMoveToBottomLibrary
);
moveMenu
->
addAction
(
aMoveToGraveyard
);
moveMenu
->
addAction
(
aMoveToExile
);
cardMenu
->
addMenu
(
moveMenu
);
}
else
cardMenu
->
addMenu
(
moveMenu
);
}
}
...
...
cockatrice/src/dlg_creategame.cpp
View file @
af8e498a
...
...
@@ -25,6 +25,12 @@ DlgCreateGame::DlgCreateGame(AbstractClient *_client, int _roomId, const QMap<in
maxPlayersEdit
->
setValue
(
2
);
maxPlayersLabel
->
setBuddy
(
maxPlayersEdit
);
QGridLayout
*
generalGrid
=
new
QGridLayout
;
generalGrid
->
addWidget
(
descriptionLabel
,
0
,
0
);
generalGrid
->
addWidget
(
descriptionEdit
,
0
,
1
);
generalGrid
->
addWidget
(
maxPlayersLabel
,
1
,
0
);
generalGrid
->
addWidget
(
maxPlayersEdit
,
1
,
1
);
QVBoxLayout
*
gameTypeLayout
=
new
QVBoxLayout
;
QMapIterator
<
int
,
QString
>
gameTypeIterator
(
gameTypes
);
while
(
gameTypeIterator
.
hasNext
())
{
...
...
@@ -67,13 +73,10 @@ DlgCreateGame::DlgCreateGame(AbstractClient *_client, int _roomId, const QMap<in
spectatorsGroupBox
->
setLayout
(
spectatorsLayout
);
QGridLayout
*
grid
=
new
QGridLayout
;
grid
->
addWidget
(
descriptionLabel
,
0
,
0
);
grid
->
addWidget
(
descriptionEdit
,
0
,
1
);
grid
->
addWidget
(
maxPlayersLabel
,
1
,
0
);
grid
->
addWidget
(
maxPlayersEdit
,
1
,
1
);
grid
->
addWidget
(
gameTypeGroupBox
,
2
,
0
,
1
,
2
);
grid
->
addWidget
(
joinRestrictionsGroupBox
,
3
,
0
,
1
,
2
);
grid
->
addWidget
(
spectatorsGroupBox
,
4
,
0
,
1
,
2
);
grid
->
addLayout
(
generalGrid
,
0
,
0
);
grid
->
addWidget
(
spectatorsGroupBox
,
1
,
0
);
grid
->
addWidget
(
joinRestrictionsGroupBox
,
0
,
1
);
grid
->
addWidget
(
gameTypeGroupBox
,
1
,
1
);
okButton
=
new
QPushButton
(
tr
(
"&OK"
));
okButton
->
setDefault
(
true
);
...
...
cockatrice/src/messagelogwidget.cpp
View file @
af8e498a
...
...
@@ -189,7 +189,7 @@ void MessageLogWidget::doMoveCard(LogMoveCard &attributes)
QString
targetName
=
attributes
.
targetZone
->
getName
();
if
(((
startName
==
"table"
)
&&
(
targetName
==
"table"
)
&&
(
attributes
.
startZone
==
attributes
.
targetZone
))
||
((
startName
==
"hand"
)
&&
(
targetName
==
"hand"
)))
return
;
QString
cardName
=
attributes
.
card
->
get
Name
()
;
QString
cardName
=
attributes
.
cardName
;
QPair
<
QString
,
QString
>
temp
=
getFromStr
(
attributes
.
startZone
,
cardName
,
attributes
.
oldX
);
bool
cardNameContainsStartZone
=
false
;
if
(
!
temp
.
first
.
isEmpty
())
{
...
...
@@ -225,7 +225,7 @@ void MessageLogWidget::doMoveCard(LogMoveCard &attributes)
else
if
(
targetName
==
"deck"
)
{
if
(
attributes
.
newX
==
-
1
)
finalStr
=
tr
(
"%1 puts %2%3 into his library."
);
else
if
(
attributes
.
newX
==
attributes
.
targetZone
->
getCards
().
size
())
else
if
(
attributes
.
newX
==
attributes
.
targetZone
->
getCards
().
size
()
-
1
)
finalStr
=
tr
(
"%1 puts %2%3 on bottom of his library."
);
else
if
(
attributes
.
newX
==
0
)
finalStr
=
tr
(
"%1 puts %2%3 on top of his library."
);
...
...
@@ -241,7 +241,7 @@ void MessageLogWidget::doMoveCard(LogMoveCard &attributes)
void
MessageLogWidget
::
logMoveCard
(
Player
*
player
,
CardItem
*
card
,
CardZone
*
startZone
,
int
oldX
,
CardZone
*
targetZone
,
int
newX
)
{
LogMoveCard
attributes
=
{
player
,
card
,
startZone
,
oldX
,
targetZone
,
newX
};
LogMoveCard
attributes
=
{
player
,
card
,
card
->
getName
(),
startZone
,
oldX
,
targetZone
,
newX
};
if
(
currentContext
==
MessageContext_MoveCard
)
moveCardQueue
.
append
(
attributes
);
else
...
...
cockatrice/src/messagelogwidget.h
View file @
af8e498a
...
...
@@ -17,6 +17,7 @@ class CardItem;
struct
LogMoveCard
{
Player
*
player
;
CardItem
*
card
;
QString
cardName
;
CardZone
*
startZone
;
int
oldX
;
CardZone
*
targetZone
;
...
...
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