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
0abd1fb2
Commit
0abd1fb2
authored
Jan 02, 2015
by
Fabio Bas
Browse files
Rework patch for "move to.." menu; fix "P/T"-related menus
parent
ea106718
Changes
1
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/player.cpp
View file @
0abd1fb2
...
...
@@ -1900,12 +1900,16 @@ void Player::cardMenuAction()
default:
;
}
}
game
->
sendGameCommand
(
prepareGameCommand
(
commandList
),
getId
());
if
(
local
)
sendGameCommand
(
prepareGameCommand
(
commandList
));
else
game
->
sendGameCommand
(
prepareGameCommand
(
commandList
));
}
void
Player
::
actIncPT
(
int
deltaP
,
int
deltaT
)
{
QString
ptString
=
"+"
+
QString
::
number
(
deltaP
)
+
"/+"
+
QString
::
number
(
deltaT
);
int
playerid
=
id
;
QList
<
const
::
google
::
protobuf
::
Message
*
>
commandList
;
QListIterator
<
QGraphicsItem
*>
j
(
scene
()
->
selectedItems
());
...
...
@@ -1917,13 +1921,19 @@ void Player::actIncPT(int deltaP, int deltaT)
cmd
->
set_attribute
(
AttrPT
);
cmd
->
set_attr_value
(
ptString
.
toStdString
());
commandList
.
append
(
cmd
);
if
(
local
)
playerid
=
card
->
getZone
()
->
getPlayer
()
->
getId
();
}
sendGameCommand
(
prepareGameCommand
(
commandList
));
game
->
sendGameCommand
(
prepareGameCommand
(
commandList
),
playerid
);
}
void
Player
::
actSetPT
()
{
QString
oldPT
;
int
playerid
=
id
;
QListIterator
<
QGraphicsItem
*>
i
(
scene
()
->
selectedItems
());
while
(
i
.
hasNext
())
{
CardItem
*
card
=
static_cast
<
CardItem
*>
(
i
.
next
());
...
...
@@ -1949,8 +1959,12 @@ void Player::actSetPT()
cmd
->
set_attribute
(
AttrPT
);
cmd
->
set_attr_value
(
pt
.
toStdString
());
commandList
.
append
(
cmd
);
if
(
local
)
playerid
=
card
->
getZone
()
->
getPlayer
()
->
getId
();
}
sendGameCommand
(
prepareGameCommand
(
commandList
));
game
->
sendGameCommand
(
prepareGameCommand
(
commandList
),
playerid
);
}
void
Player
::
actDrawArrow
()
...
...
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