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
4d0c9962
Commit
4d0c9962
authored
Sep 07, 2010
by
Max-Wilhelm Bruker
Browse files
phase toolbar fixed
parent
0b98d903
Changes
3
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/phasestoolbar.cpp
View file @
4d0c9962
...
@@ -152,20 +152,20 @@ void PhasesToolbar::phaseButtonClicked()
...
@@ -152,20 +152,20 @@ void PhasesToolbar::phaseButtonClicked()
PhaseButton
*
button
=
qobject_cast
<
PhaseButton
*>
(
sender
());
PhaseButton
*
button
=
qobject_cast
<
PhaseButton
*>
(
sender
());
if
(
button
->
getActive
())
if
(
button
->
getActive
())
button
->
triggerDoubleClickAction
();
button
->
triggerDoubleClickAction
();
emit
sendGameCommand
(
new
Command_SetActivePhase
(
-
1
,
buttonList
.
indexOf
(
button
)));
emit
sendGameCommand
(
new
Command_SetActivePhase
(
-
1
,
buttonList
.
indexOf
(
button
))
,
-
1
);
}
}
void
PhasesToolbar
::
actNextTurn
()
void
PhasesToolbar
::
actNextTurn
()
{
{
emit
sendGameCommand
(
new
Command_NextTurn
);
emit
sendGameCommand
(
new
Command_NextTurn
,
-
1
);
}
}
void
PhasesToolbar
::
actUntapAll
()
void
PhasesToolbar
::
actUntapAll
()
{
{
emit
sendGameCommand
(
new
Command_SetCardAttr
(
-
1
,
"table"
,
-
1
,
"tapped"
,
"0"
));
emit
sendGameCommand
(
new
Command_SetCardAttr
(
-
1
,
"table"
,
-
1
,
"tapped"
,
"0"
)
,
-
1
);
}
}
void
PhasesToolbar
::
actDrawCard
()
void
PhasesToolbar
::
actDrawCard
()
{
{
emit
sendGameCommand
(
new
Command_DrawCards
(
-
1
,
1
));
emit
sendGameCommand
(
new
Command_DrawCards
(
-
1
,
1
)
,
-
1
);
}
}
cockatrice/src/phasestoolbar.h
View file @
4d0c9962
...
@@ -45,7 +45,7 @@ private slots:
...
@@ -45,7 +45,7 @@ private slots:
void
actUntapAll
();
void
actUntapAll
();
void
actDrawCard
();
void
actDrawCard
();
signals:
signals:
void
sendGameCommand
(
GameCommand
*
command
);
void
sendGameCommand
(
GameCommand
*
command
,
int
playerId
);
};
};
#endif
#endif
cockatrice/src/tab_game.cpp
View file @
4d0c9962
...
@@ -384,8 +384,10 @@ void TabGame::processGameEventContainer(GameEventContainer *cont)
...
@@ -384,8 +384,10 @@ void TabGame::processGameEventContainer(GameEventContainer *cont)
void
TabGame
::
sendGameCommand
(
GameCommand
*
command
,
int
playerId
)
void
TabGame
::
sendGameCommand
(
GameCommand
*
command
,
int
playerId
)
{
{
if
(
playerId
==
-
1
)
playerId
=
getActiveLocalPlayer
()
->
getId
();
command
->
setGameId
(
gameId
);
command
->
setGameId
(
gameId
);
AbstractClient
*
client
;
AbstractClient
*
client
;
if
(
clients
.
size
()
>
1
)
if
(
clients
.
size
()
>
1
)
client
=
clients
.
at
(
playerId
);
client
=
clients
.
at
(
playerId
);
...
@@ -396,6 +398,9 @@ void TabGame::sendGameCommand(GameCommand *command, int playerId)
...
@@ -396,6 +398,9 @@ void TabGame::sendGameCommand(GameCommand *command, int playerId)
void
TabGame
::
sendCommandContainer
(
CommandContainer
*
cont
,
int
playerId
)
void
TabGame
::
sendCommandContainer
(
CommandContainer
*
cont
,
int
playerId
)
{
{
if
(
playerId
==
-
1
)
playerId
=
getActiveLocalPlayer
()
->
getId
();
const
QList
<
Command
*>
&
cmdList
=
cont
->
getCommandList
();
const
QList
<
Command
*>
&
cmdList
=
cont
->
getCommandList
();
for
(
int
i
=
0
;
i
<
cmdList
.
size
();
++
i
)
{
for
(
int
i
=
0
;
i
<
cmdList
.
size
();
++
i
)
{
GameCommand
*
cmd
=
qobject_cast
<
GameCommand
*>
(
cmdList
[
i
]);
GameCommand
*
cmd
=
qobject_cast
<
GameCommand
*>
(
cmdList
[
i
]);
...
...
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