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
fb49a886
Commit
fb49a886
authored
Apr 01, 2015
by
Zach
Browse files
Merge pull request #897 from poixen/counter_issue
Fixed accidental +/- of counters when using middle click menu
parents
6c35253b
a0be18ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/abstractcounter.cpp
View file @
fb49a886
...
...
@@ -88,23 +88,25 @@ void AbstractCounter::setValue(int _value)
void
AbstractCounter
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
if
(
event
->
button
()
==
Qt
::
LeftButton
)
{
Command_IncCounter
cmd
;
cmd
.
set_counter_id
(
id
);
cmd
.
set_delta
(
1
);
player
->
sendGameCommand
(
cmd
);
event
->
accept
();
}
else
if
(
event
->
button
()
==
Qt
::
RightButton
)
{
Command_IncCounter
cmd
;
cmd
.
set_counter_id
(
id
);
cmd
.
set_delta
(
-
1
);
player
->
sendGameCommand
(
cmd
);
event
->
accept
();
}
else
if
(
event
->
button
()
==
Qt
::
MidButton
)
{
if
(
menu
)
menu
->
exec
(
event
->
screenPos
());
event
->
accept
();
}
else
if
(
isUnderMouse
())
{
if
(
event
->
button
()
==
Qt
::
LeftButton
)
{
Command_IncCounter
cmd
;
cmd
.
set_counter_id
(
id
);
cmd
.
set_delta
(
1
);
player
->
sendGameCommand
(
cmd
);
event
->
accept
();
}
else
if
(
event
->
button
()
==
Qt
::
RightButton
)
{
Command_IncCounter
cmd
;
cmd
.
set_counter_id
(
id
);
cmd
.
set_delta
(
-
1
);
player
->
sendGameCommand
(
cmd
);
event
->
accept
();
}
else
if
(
event
->
button
()
==
Qt
::
MidButton
)
{
if
(
menu
)
menu
->
exec
(
event
->
screenPos
());
event
->
accept
();
}
}
else
event
->
ignore
();
}
...
...
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