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
f2092b89
Commit
f2092b89
authored
May 29, 2010
by
Max-Wilhelm Bruker
Browse files
correct mirroring of players when spectating
parent
e1a72832
Changes
18
Hide whitespace changes
Inline
Side-by-side
cockatrice/cockatrice.pro
View file @
f2092b89
...
@@ -21,8 +21,6 @@ HEADERS += src/counter.h \
...
@@ -21,8 +21,6 @@ HEADERS += src/counter.h \
src
/
tablezone
.
h
\
src
/
tablezone
.
h
\
src
/
handzone
.
h
\
src
/
handzone
.
h
\
src
/
handcounter
.
h
\
src
/
handcounter
.
h
\
src
/
handzone_vert
.
h
\
src
/
handzone_horiz
.
h
\
src
/
carddatabase
.
h
\
src
/
carddatabase
.
h
\
src
/
gameview
.
h
\
src
/
gameview
.
h
\
src
/
deck_picturecacher
.
h
\
src
/
deck_picturecacher
.
h
\
...
@@ -78,8 +76,6 @@ SOURCES += src/counter.cpp \
...
@@ -78,8 +76,6 @@ SOURCES += src/counter.cpp \
src
/
tablezone
.
cpp
\
src
/
tablezone
.
cpp
\
src
/
handzone
.
cpp
\
src
/
handzone
.
cpp
\
src
/
handcounter
.
cpp
\
src
/
handcounter
.
cpp
\
src
/
handzone_vert
.
cpp
\
src
/
handzone_horiz
.
cpp
\
src
/
carddatabase
.
cpp
\
src
/
carddatabase
.
cpp
\
src
/
gameview
.
cpp
\
src
/
gameview
.
cpp
\
src
/
deck_picturecacher
.
cpp
\
src
/
deck_picturecacher
.
cpp
\
...
...
cockatrice/resources/hand.svg
0 → 100644
View file @
f2092b89
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc=
"http://purl.org/dc/elements/1.1/"
xmlns:cc=
"http://creativecommons.org/ns#"
xmlns:rdf=
"http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg=
"http://www.w3.org/2000/svg"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xmlns:sodipodi=
"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape=
"http://www.inkscape.org/namespaces/inkscape"
width=
"500"
height=
"500"
id=
"svg2"
sodipodi:version=
"0.32"
inkscape:version=
"0.47pre4 r22446"
sodipodi:docname=
"back.svg"
inkscape:output_extension=
"org.inkscape.output.svg.inkscape"
version=
"1.0"
>
<defs
id=
"defs4"
>
<linearGradient
id=
"linearGradient3169"
>
<stop
style=
"stop-color:#0000ff;stop-opacity:1;"
offset=
"0"
id=
"stop3171"
/>
<stop
style=
"stop-color:#000067;stop-opacity:1;"
offset=
"1"
id=
"stop3173"
/>
</linearGradient>
<linearGradient
id=
"linearGradient4766"
>
<stop
style=
"stop-color:#784421;stop-opacity:1;"
offset=
"0"
id=
"stop4768"
/>
<stop
style=
"stop-color:#3d2210;stop-opacity:0;"
offset=
"1"
id=
"stop4770"
/>
</linearGradient>
<linearGradient
id=
"linearGradient4758"
>
<stop
style=
"stop-color:#a05a2c;stop-opacity:1;"
offset=
"0"
id=
"stop4760"
/>
<stop
style=
"stop-color:#3d2210;stop-opacity:1;"
offset=
"1"
id=
"stop4762"
/>
</linearGradient>
<inkscape:perspective
sodipodi:type=
"inkscape:persp3d"
inkscape:vp_x=
"0 : 526.18109 : 1"
inkscape:vp_y=
"0 : 1000 : 0"
inkscape:vp_z=
"744.09448 : 526.18109 : 1"
inkscape:persp3d-origin=
"372.04724 : 350.78739 : 1"
id=
"perspective10"
/>
<inkscape:perspective
id=
"perspective2484"
inkscape:persp3d-origin=
"372.04724 : 350.78739 : 1"
inkscape:vp_z=
"744.09448 : 526.18109 : 1"
inkscape:vp_y=
"0 : 1000 : 0"
inkscape:vp_x=
"0 : 526.18109 : 1"
sodipodi:type=
"inkscape:persp3d"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4758"
id=
"linearGradient4764"
x1=
"466.09601"
y1=
"485.96021"
x2=
"715.14801"
y2=
"485.96021"
gradientUnits=
"userSpaceOnUse"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4766"
id=
"linearGradient4772"
x1=
"496.548"
y1=
"485.26816"
x2=
"683.31201"
y2=
"485.26816"
gradientUnits=
"userSpaceOnUse"
/>
<filter
inkscape:collect=
"always"
id=
"filter3287"
color-interpolation-filters=
"sRGB"
>
<feGaussianBlur
inkscape:collect=
"always"
stdDeviation=
"0.88403668"
id=
"feGaussianBlur3289"
/>
</filter>
<inkscape:perspective
id=
"perspective3123"
inkscape:persp3d-origin=
"0.5 : 0.33333333 : 1"
inkscape:vp_z=
"1 : 0.5 : 1"
inkscape:vp_y=
"0 : 1000 : 0"
inkscape:vp_x=
"0 : 0.5 : 1"
sodipodi:type=
"inkscape:persp3d"
/>
<linearGradient
id=
"linearGradient4758-4"
>
<stop
style=
"stop-color:#a05a2c;stop-opacity:1;"
offset=
"0"
id=
"stop4760-1"
/>
<stop
style=
"stop-color:#3d2210;stop-opacity:1;"
offset=
"1"
id=
"stop4762-5"
/>
</linearGradient>
<linearGradient
id=
"linearGradient4766-1"
>
<stop
style=
"stop-color:#784421;stop-opacity:1;"
offset=
"0"
id=
"stop4768-5"
/>
<stop
style=
"stop-color:#3d2210;stop-opacity:0;"
offset=
"1"
id=
"stop4770-5"
/>
</linearGradient>
<filter
color-interpolation-filters=
"sRGB"
inkscape:collect=
"always"
id=
"filter3287-4"
>
<feGaussianBlur
inkscape:collect=
"always"
stdDeviation=
"0.88403668"
id=
"feGaussianBlur3289-9"
/>
</filter>
<inkscape:perspective
id=
"perspective3123-2"
inkscape:persp3d-origin=
"0.5 : 0.33333333 : 1"
inkscape:vp_z=
"1 : 0.5 : 1"
inkscape:vp_y=
"0 : 1000 : 0"
inkscape:vp_x=
"0 : 0.5 : 1"
sodipodi:type=
"inkscape:persp3d"
/>
<linearGradient
id=
"linearGradient4758-7"
>
<stop
style=
"stop-color:#a05a2c;stop-opacity:1;"
offset=
"0"
id=
"stop4760-0"
/>
<stop
style=
"stop-color:#3d2210;stop-opacity:1;"
offset=
"1"
id=
"stop4762-3"
/>
</linearGradient>
<linearGradient
id=
"linearGradient4766-3"
>
<stop
style=
"stop-color:#784421;stop-opacity:1;"
offset=
"0"
id=
"stop4768-6"
/>
<stop
style=
"stop-color:#3d2210;stop-opacity:0;"
offset=
"1"
id=
"stop4770-3"
/>
</linearGradient>
<filter
color-interpolation-filters=
"sRGB"
inkscape:collect=
"always"
id=
"filter3287-3"
>
<feGaussianBlur
inkscape:collect=
"always"
stdDeviation=
"0.88403668"
id=
"feGaussianBlur3289-4"
/>
</filter>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4758-4"
id=
"linearGradient3292"
gradientUnits=
"userSpaceOnUse"
gradientTransform=
"matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
x1=
"590.62201"
y1=
"434.7522"
x2=
"698.54004"
y2=
"517.79218"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4766-1"
id=
"linearGradient3294"
gradientUnits=
"userSpaceOnUse"
gradientTransform=
"matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
x1=
"661.24402"
y1=
"602.90814"
x2=
"431.5"
y2=
"201.5482"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4758"
id=
"linearGradient3296"
gradientUnits=
"userSpaceOnUse"
gradientTransform=
"matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
x1=
"590.62201"
y1=
"434.7522"
x2=
"698.54004"
y2=
"517.79218"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4766"
id=
"linearGradient3298"
gradientUnits=
"userSpaceOnUse"
gradientTransform=
"matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
x1=
"661.24402"
y1=
"602.90814"
x2=
"431.5"
y2=
"201.5482"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4758-7"
id=
"linearGradient3300"
gradientUnits=
"userSpaceOnUse"
gradientTransform=
"matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
x1=
"590.62201"
y1=
"434.7522"
x2=
"698.54004"
y2=
"517.79218"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4766-3"
id=
"linearGradient3302"
gradientUnits=
"userSpaceOnUse"
gradientTransform=
"matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
x1=
"661.24402"
y1=
"602.90814"
x2=
"431.5"
y2=
"201.5482"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4758-7"
id=
"linearGradient3340"
gradientUnits=
"userSpaceOnUse"
gradientTransform=
"matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
x1=
"590.62201"
y1=
"434.7522"
x2=
"698.54004"
y2=
"517.79218"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4766-3"
id=
"linearGradient3342"
gradientUnits=
"userSpaceOnUse"
gradientTransform=
"matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
x1=
"661.24402"
y1=
"602.90814"
x2=
"431.5"
y2=
"201.5482"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4758"
id=
"linearGradient3344"
gradientUnits=
"userSpaceOnUse"
gradientTransform=
"matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
x1=
"590.62201"
y1=
"434.7522"
x2=
"698.54004"
y2=
"517.79218"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4766"
id=
"linearGradient3346"
gradientUnits=
"userSpaceOnUse"
gradientTransform=
"matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
x1=
"661.24402"
y1=
"602.90814"
x2=
"431.5"
y2=
"201.5482"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4758-4"
id=
"linearGradient3348"
gradientUnits=
"userSpaceOnUse"
gradientTransform=
"matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
x1=
"590.62201"
y1=
"434.7522"
x2=
"698.54004"
y2=
"517.79218"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4766-1"
id=
"linearGradient3350"
gradientUnits=
"userSpaceOnUse"
gradientTransform=
"matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
x1=
"661.24402"
y1=
"602.90814"
x2=
"431.5"
y2=
"201.5482"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4758-4"
id=
"linearGradient3369"
gradientUnits=
"userSpaceOnUse"
gradientTransform=
"matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
x1=
"590.62201"
y1=
"434.7522"
x2=
"698.54004"
y2=
"517.79218"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4766-1"
id=
"linearGradient3371"
gradientUnits=
"userSpaceOnUse"
gradientTransform=
"matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
x1=
"661.24402"
y1=
"602.90814"
x2=
"431.5"
y2=
"201.5482"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4758"
id=
"linearGradient3373"
gradientUnits=
"userSpaceOnUse"
gradientTransform=
"matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
x1=
"590.62201"
y1=
"434.7522"
x2=
"698.54004"
y2=
"517.79218"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4766"
id=
"linearGradient3375"
gradientUnits=
"userSpaceOnUse"
gradientTransform=
"matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
x1=
"661.24402"
y1=
"602.90814"
x2=
"431.5"
y2=
"201.5482"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4758-7"
id=
"linearGradient3377"
gradientUnits=
"userSpaceOnUse"
gradientTransform=
"matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
x1=
"590.62201"
y1=
"434.7522"
x2=
"698.54004"
y2=
"517.79218"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient4766-3"
id=
"linearGradient3379"
gradientUnits=
"userSpaceOnUse"
gradientTransform=
"matrix(0.9650128,0,0,0.9948433,-449.70565,-312.80927)"
x1=
"661.24402"
y1=
"602.90814"
x2=
"431.5"
y2=
"201.5482"
/>
</defs>
<sodipodi:namedview
id=
"base"
pagecolor=
"#ffffff"
bordercolor=
"#666666"
borderopacity=
"1.0"
inkscape:pageopacity=
"0.0"
inkscape:pageshadow=
"2"
inkscape:zoom=
"1.0399859"
inkscape:cx=
"321.84821"
inkscape:cy=
"191.87768"
inkscape:document-units=
"px"
inkscape:current-layer=
"layer1"
showgrid=
"false"
inkscape:window-width=
"1280"
inkscape:window-height=
"950"
inkscape:window-x=
"0"
inkscape:window-y=
"25"
inkscape:window-maximized=
"1"
/>
<metadata
id=
"metadata7"
>
<rdf:RDF>
<cc:Work
rdf:about=
""
>
<dc:format>
image/svg+xml
</dc:format>
<dc:type
rdf:resource=
"http://purl.org/dc/dcmitype/StillImage"
/>
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label=
"Ebene 1"
inkscape:groupmode=
"layer"
id=
"layer1"
transform=
"translate(0,160)"
>
<g
id=
"g3352"
transform=
"translate(-15.384821,4.3269809)"
>
<g
id=
"g3109-8"
transform=
"matrix(0.96592583,-0.25881905,0.25881905,0.96592583,29.101426,-50.437705)"
>
<g
id=
"g3008-3"
>
<rect
y=
"9.8962135"
x=
"9.7330923"
height=
"321.49753"
width=
"221.03812"
id=
"rect2490-8"
style=
"fill:url(#linearGradient3369);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:19.59629059;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
/>
<rect
y=
"31.237556"
x=
"30.434542"
height=
"277.43793"
width=
"178.29964"
id=
"rect3302-5"
style=
"fill:url(#linearGradient3371);fill-opacity:1;stroke:#000000;stroke-width:1.95962906;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
/>
<path
transform=
"matrix(1.1399786,0,0,1.0181427,-552.19487,-329.3838)"
d=
"m 661.55199,489.76617 c 0,71.08568 -32.22118,128.71201 -71.96801,128.71201 -39.74683,0 -71.968,-57.62633 -71.968,-128.71201 0,-71.08567 32.22117,-128.712 71.968,-128.712 39.74683,0 71.96801,57.62633 71.96801,128.712 z"
sodipodi:ry=
"128.71201"
sodipodi:rx=
"71.968002"
sodipodi:cy=
"489.76617"
sodipodi:cx=
"589.58398"
id=
"path3304-2"
style=
"opacity:0.39208954;fill:#a05a2c;stroke:#000000;stroke-width:2.00029755;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;filter:url(#filter3287-4)"
sodipodi:type=
"arc"
/>
</g>
</g>
<g
transform=
"translate(143.26779,-93.267107)"
id=
"g3109"
>
<g
id=
"g3008"
>
<rect
y=
"9.8962135"
x=
"9.7330923"
height=
"321.49753"
width=
"221.03812"
id=
"rect2490"
style=
"fill:url(#linearGradient3373);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:19.59629059;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
/>
<rect
y=
"31.237556"
x=
"30.434542"
height=
"277.43793"
width=
"178.29964"
id=
"rect3302"
style=
"fill:url(#linearGradient3375);fill-opacity:1;stroke:#000000;stroke-width:1.95962906;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
/>
<path
transform=
"matrix(1.1399786,0,0,1.0181427,-552.19487,-329.3838)"
d=
"m 661.55199,489.76617 c 0,71.08568 -32.22118,128.71201 -71.96801,128.71201 -39.74683,0 -71.968,-57.62633 -71.968,-128.71201 0,-71.08567 32.22117,-128.712 71.968,-128.712 39.74683,0 71.96801,57.62633 71.96801,128.712 z"
sodipodi:ry=
"128.71201"
sodipodi:rx=
"71.968002"
sodipodi:cy=
"489.76617"
sodipodi:cx=
"589.58398"
id=
"path3304"
style=
"opacity:0.39208954;fill:#a05a2c;stroke:#000000;stroke-width:2.00029755;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;filter:url(#filter3287)"
sodipodi:type=
"arc"
/>
</g>
</g>
<g
id=
"g3109-4"
transform=
"matrix(0.96592583,0.25881905,-0.25881905,0.96592583,269.3589,-107.87704)"
>
<g
id=
"g3008-39"
>
<rect
y=
"9.8962135"
x=
"9.7330923"
height=
"321.49753"
width=
"221.03812"
id=
"rect2490-7"
style=
"fill:url(#linearGradient3377);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:19.59629059;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
/>
<rect
y=
"31.237556"
x=
"30.434542"
height=
"277.43793"
width=
"178.29964"
id=
"rect3302-2"
style=
"fill:url(#linearGradient3379);fill-opacity:1;stroke:#000000;stroke-width:1.95962906;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
/>
<path
transform=
"matrix(1.1399786,0,0,1.0181427,-552.19487,-329.3838)"
d=
"m 661.55199,489.76617 c 0,71.08568 -32.22118,128.71201 -71.96801,128.71201 -39.74683,0 -71.968,-57.62633 -71.968,-128.71201 0,-71.08567 32.22117,-128.712 71.968,-128.712 39.74683,0 71.96801,57.62633 71.96801,128.712 z"
sodipodi:ry=
"128.71201"
sodipodi:rx=
"71.968002"
sodipodi:cy=
"489.76617"
sodipodi:cx=
"589.58398"
id=
"path3304-5"
style=
"opacity:0.39208954;fill:#a05a2c;stroke:#000000;stroke-width:2.00029755;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;filter:url(#filter3287-3)"
sodipodi:type=
"arc"
/>
</g>
</g>
</g>
</g>
</svg>
cockatrice/src/gamescene.cpp
View file @
f2092b89
...
@@ -35,7 +35,7 @@ void GameScene::removePlayer(Player *player)
...
@@ -35,7 +35,7 @@ void GameScene::removePlayer(Player *player)
void
GameScene
::
rearrange
()
void
GameScene
::
rearrange
()
{
{
struct
PlayerProcessor
{
struct
PlayerProcessor
{
static
void
processPlayer
(
Player
*
p
,
qreal
&
w
,
qreal
&
h
,
QPointF
&
b
)
static
void
processPlayer
(
Player
*
p
,
qreal
&
w
,
qreal
&
h
,
QPointF
&
b
,
bool
singlePlayer
)
{
{
const
QRectF
br
=
p
->
boundingRect
();
const
QRectF
br
=
p
->
boundingRect
();
if
(
br
.
width
()
>
w
)
if
(
br
.
width
()
>
w
)
...
@@ -44,6 +44,7 @@ void GameScene::rearrange()
...
@@ -44,6 +44,7 @@ void GameScene::rearrange()
h
+=
playerAreaSpacing
;
h
+=
playerAreaSpacing
;
h
+=
br
.
height
();
h
+=
br
.
height
();
p
->
setPos
(
b
);
p
->
setPos
(
b
);
p
->
setMirrored
((
b
.
y
()
<
playerAreaSpacing
)
&&
!
singlePlayer
);
b
+=
QPointF
(
0
,
br
.
height
()
+
playerAreaSpacing
);
b
+=
QPointF
(
0
,
br
.
height
()
+
playerAreaSpacing
);
}
}
};
};
...
@@ -55,11 +56,11 @@ void GameScene::rearrange()
...
@@ -55,11 +56,11 @@ void GameScene::rearrange()
for
(
int
i
=
0
;
i
<
players
.
size
();
++
i
)
for
(
int
i
=
0
;
i
<
players
.
size
();
++
i
)
if
(
!
players
[
i
]
->
getLocal
())
if
(
!
players
[
i
]
->
getLocal
())
PlayerProcessor
::
processPlayer
(
players
[
i
],
sceneWidth
,
sceneHeight
,
base
);
PlayerProcessor
::
processPlayer
(
players
[
i
],
sceneWidth
,
sceneHeight
,
base
,
players
.
size
()
==
1
);
else
else
localPlayer
=
players
[
i
];
localPlayer
=
players
[
i
];
if
(
localPlayer
)
if
(
localPlayer
)
PlayerProcessor
::
processPlayer
(
localPlayer
,
sceneWidth
,
sceneHeight
,
base
);
PlayerProcessor
::
processPlayer
(
localPlayer
,
sceneWidth
,
sceneHeight
,
base
,
players
.
size
()
==
1
);
playersRect
=
QRectF
(
0
,
0
,
sceneWidth
,
sceneHeight
);
playersRect
=
QRectF
(
0
,
0
,
sceneWidth
,
sceneHeight
);
...
...
cockatrice/src/handcounter.cpp
0 → 100644
View file @
f2092b89
#include
<QPainter>
#include
<QSvgRenderer>
#include
"handcounter.h"
#include
"cardzone.h"
HandCounter
::
HandCounter
(
QGraphicsItem
*
parent
)
:
AbstractGraphicsItem
(
parent
),
number
(
0
)
{
setCacheMode
(
DeviceCoordinateCache
);
QSvgRenderer
svg
(
QString
(
":/resources/hand.svg"
));
handImage
=
new
QPixmap
(
72
,
72
);
handImage
->
fill
(
Qt
::
transparent
);
QPainter
painter
(
handImage
);
svg
.
render
(
&
painter
,
QRectF
(
0
,
0
,
72
,
72
));
}
HandCounter
::~
HandCounter
()
{
delete
handImage
;
}
void
HandCounter
::
updateNumber
()
{
number
=
static_cast
<
CardZone
*>
(
sender
())
->
getCards
().
size
();
update
();
}
QRectF
HandCounter
::
boundingRect
()
const
{
return
QRectF
(
0
,
0
,
72
,
72
);
}
void
HandCounter
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
/*option*/
,
QWidget
*
/*widget*/
)
{
painter
->
drawPixmap
(
handImage
->
rect
(),
*
handImage
,
handImage
->
rect
());
paintNumberEllipse
(
number
,
painter
);
}
cockatrice/src/handcounter.h
0 → 100644
View file @
f2092b89
#ifndef HANDCOUNTER_H
#define HANDCOUNTER_H
#include
<QString>
#include
"abstractcarditem.h"
class
QPainter
;
class
QPixmap
;
class
HandCounter
:
public
QObject
,
public
AbstractGraphicsItem
{
Q_OBJECT
private:
int
number
;
QPixmap
*
handImage
;
public
slots
:
void
updateNumber
();
public:
enum
{
Type
=
typeOther
};
int
type
()
const
{
return
Type
;
}
HandCounter
(
QGraphicsItem
*
parent
=
0
);
~
HandCounter
();
QRectF
boundingRect
()
const
;
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
};
#endif
cockatrice/src/handzone.cpp
View file @
f2092b89
#include
<QPainter>
#include
"handzone.h"
#include
"handzone.h"
#include
"settingscache.h"
#include
"settingscache.h"
#include
"player.h"
#include
"player.h"
#include
"protocol_items.h"
#include
"protocol_items.h"
HandZone
::
HandZone
(
Player
*
_p
,
bool
_contentsKnown
,
QGraphicsItem
*
parent
)
HandZone
::
HandZone
(
Player
*
_p
,
bool
_contentsKnown
,
int
_zoneHeight
,
QGraphicsItem
*
parent
)
:
CardZone
(
_p
,
"hand"
,
false
,
false
,
_contentsKnown
,
parent
)
:
CardZone
(
_p
,
"hand"
,
false
,
false
,
_contentsKnown
,
parent
)
,
zoneHeight
(
_zoneHeight
)
{
{
connect
(
settingsCache
,
SIGNAL
(
handBgPathChanged
()),
this
,
SLOT
(
updateBgPixmap
()));
connect
(
settingsCache
,
SIGNAL
(
handBgPathChanged
()),
this
,
SLOT
(
updateBgPixmap
()));
updateBgPixmap
();
updateBgPixmap
();
setCacheMode
(
DeviceCoordinateCache
);
}
}
void
HandZone
::
updateBgPixmap
()
void
HandZone
::
updateBgPixmap
()
...
@@ -38,3 +40,79 @@ void HandZone::handleDropEvent(int cardId, CardZone *startZone, const QPoint &/*
...
@@ -38,3 +40,79 @@ void HandZone::handleDropEvent(int cardId, CardZone *startZone, const QPoint &/*
{
{
player
->
sendGameCommand
(
new
Command_MoveCard
(
-
1
,
startZone
->
getName
(),
cardId
,
getName
(),
cards
.
size
(),
-
1
,
false
));
player
->
sendGameCommand
(
new
Command_MoveCard
(
-
1
,
startZone
->
getName
(),
cardId
,
getName
(),
cards
.
size
(),
-
1
,
false
));
}
}
QRectF
HandZone
::
boundingRect
()
const
{
if
(
settingsCache
->
getHorizontalHand
())
return
QRectF
(
0
,
0
,
width
,
CARD_HEIGHT
+
10
);
else
return
QRectF
(
0
,
0
,
100
,
zoneHeight
);
}
void
HandZone
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*/
*
option
*/
,
QWidget
*/
*
widget
*/
)
{
if
(
bgPixmap
.
isNull
())
painter
->
fillRect
(
boundingRect
(),
Qt
::
darkGreen
);
else
painter
->
fillRect
(
boundingRect
(),
QBrush
(
bgPixmap
));
}
void
HandZone
::
reorganizeCards
()
{
if
(
!
cards
.
isEmpty
())
{
const
int
cardCount
=
cards
.
size
();
if
(
settingsCache
->
getHorizontalHand
())
{
const
int
xPadding
=
5
;
qreal
totalWidth
=
boundingRect
().
width
()
-
2
*
xPadding
;
qreal
cardWidth
=
cards
.
at
(
0
)
->
boundingRect
().
width
();
for
(
int
i
=
0
;
i
<
cardCount
;
i
++
)
{
CardItem
*
c
=
cards
.
at
(
i
);
// If the total width of the cards is smaller than the available width,
// the cards do not need to overlap and are displayed in the center of the area.
if
(
cardWidth
*
cardCount
>
totalWidth
)
c
->
setPos
(
xPadding
+
((
qreal
)
i
)
*
(
totalWidth
-
cardWidth
)
/
(
cardCount
-
1
),
5
);
else
c
->
setPos
(
xPadding
+
((
qreal
)
i
)
*
cardWidth
+
(
totalWidth
-
cardCount
*
cardWidth
)
/
2
,
5
);
c
->
setZValue
(
i
);
}
}
else
{
qreal
totalWidth
=
boundingRect
().
width
();
qreal
totalHeight
=
boundingRect
().
height
();
qreal
cardWidth
=
cards
.
at
(
0
)
->
boundingRect
().
width
();
qreal
cardHeight
=
cards
.
at
(
0
)
->
boundingRect
().
height
();
qreal
xspace
=
5
;
qreal
x1
=
xspace
;
qreal
x2
=
totalWidth
-
xspace
-
cardWidth
;
for
(
int
i
=
0
;
i
<
cardCount
;
i
++
)
{
CardItem
*
c
=
cards
.
at
(
i
);
qreal
x
=
i
%
2
?
x2
:
x1
;
// If the total height of the cards is smaller than the available height,
// the cards do not need to overlap and are displayed in the center of the area.
if
(
cardHeight
*
cardCount
>
totalHeight
)
c
->
setPos
(
x
,
((
qreal
)
i
)
*
(
totalHeight
-
cardHeight
)
/
(
cardCount
-
1
));
else
c
->
setPos
(
x
,
((
qreal
)
i
)
*
cardHeight
+
(
totalHeight
-
cardCount
*
cardHeight
)
/
2
);
c
->
setZValue
(
i
);
}
}
}
update
();
}
void
HandZone
::
setWidth
(
qreal
_width
)
{
if
(
settingsCache
->
getHorizontalHand
())
{
prepareGeometryChange
();
width
=
_width
;
reorganizeCards
();
}
}
void
HandZone
::
updateOrientation
()
{
prepareGeometryChange
();
reorganizeCards
();
}
cockatrice/src/handzone.h
View file @
f2092b89
...
@@ -5,14 +5,20 @@
...
@@ -5,14 +5,20 @@
class
HandZone
:
public
CardZone
{
class
HandZone
:
public
CardZone
{
Q_OBJECT
Q_OBJECT
protected:
private:
qreal
width
,
zoneHeight
;
QPixmap
bgPixmap
;
QPixmap
bgPixmap
;
private
slots
:
private
slots
:
void
updateBgPixmap
();
void
updateBgPixmap
();
public
slots
:
void
updateOrientation
();
public:
public:
HandZone
(
Player
*
_p
,
bool
_contentsKnown
,
QGraphicsItem
*
parent
=
0
);
HandZone
(
Player
*
_p
,
bool
_contentsKnown
,
int
_zoneHeight
,
QGraphicsItem
*
parent
=
0
);
void
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
dropPoint
,
bool
faceDown
);
void
handleDropEvent
(
int
cardId
,
CardZone
*
startZone
,
const
QPoint
&
dropPoint
,
bool
faceDown
);
virtual
void
setWidth
(
qreal
_width
)
=
0
;
QRectF
boundingRect
()
const
;
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
void
reorganizeCards
();
void
setWidth
(
qreal
_width
);
protected:
protected:
void
addCardImpl
(
CardItem
*
card
,
int
x
,
int
y
);
void
addCardImpl
(
CardItem
*
card
,
int
x
,
int
y
);
};
};
...
...
cockatrice/src/handzone_horiz.cpp
deleted
100644 → 0
View file @
e1a72832
#include
<QPainter>
#include
"handzone_horiz.h"
#include
"player.h"
HandZoneHoriz
::
HandZoneHoriz
(
Player
*
_p
,
bool
_contentsKnown
,
QGraphicsItem
*
parent
)
:
HandZone
(
_p
,
_contentsKnown
,
parent
),
width
(
CARD_WIDTH
*
10
)
{
setCacheMode
(
DeviceCoordinateCache
);
}
QRectF
HandZoneHoriz
::
boundingRect
()
const
{
return
QRectF
(
0
,
0
,
width
,
CARD_HEIGHT
+
10
);
}
void
HandZoneHoriz
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*/
*
option
*/
,
QWidget
*/
*
widget
*/
)
{
if
(
bgPixmap
.
isNull
())
painter
->
fillRect
(
boundingRect
(),
Qt
::
darkGreen
);
else
painter
->
fillRect
(
boundingRect
(),
QBrush
(
bgPixmap
));
}
void
HandZoneHoriz
::
reorganizeCards
()
{
if
(
!
cards
.
isEmpty
())
{
const
int
cardCount
=
cards
.
size
();
const
int
xPadding
=
5
;
qreal
totalWidth
=
boundingRect
().
width
()
-
2
*
xPadding
;
qreal
cardWidth
=
cards
.
at
(
0
)
->
boundingRect
().
width
();
for
(
int
i
=
0
;
i
<
cardCount
;
i
++
)
{
CardItem
*
c
=
cards
.
at
(
i
);
// If the total width of the cards is smaller than the available width,
// the cards do not need to overlap and are displayed in the center of the area.
if
(
cardWidth
*
cardCount
>
totalWidth
)
c
->
setPos
(
xPadding
+
((
qreal
)
i
)
*
(
totalWidth
-
cardWidth
)
/
(
cardCount
-
1
),
5
);
else
c
->
setPos
(
xPadding
+
((
qreal
)
i
)
*
cardWidth
+
(
totalWidth
-
cardCount
*
cardWidth
)
/
2
,
5
);
c
->
setZValue
(
i
);
}
}
update
();
}
void
HandZoneHoriz
::
setWidth
(
qreal
_width
)
{
prepareGeometryChange
();
width
=
_width
;
reorganizeCards
();
}
cockatrice/src/handzone_horiz.h
deleted
100644 → 0
View file @
e1a72832
#ifndef HANDZONE_HORIZ_H
#define HANDZONE_HORIZ_H
#include
"handzone.h"
class
HandZoneHoriz
:
public
HandZone
{
Q_OBJECT
private:
qreal
width
;
public:
HandZoneHoriz
(
Player
*
_p
,
bool
_contentsKnown
,
QGraphicsItem
*
parent
=
0
);
QRectF
boundingRect
()
const
;
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
void
reorganizeCards
();
void
setWidth
(
qreal
_width
);
};
#endif
cockatrice/src/handzone_vert.cpp
deleted
100644 → 0
View file @
e1a72832
#include
<QtGui>
#include
"handzone_vert.h"
#include
"player.h"
#include
"client.h"
#include
"protocol_items.h"
#include
"settingscache.h"
HandZoneVert
::
HandZoneVert
(
Player
*
_p
,
bool
_contentsKnown
,
int
_zoneHeight
,
QGraphicsItem
*
parent
)
:
HandZone
(
_p
,
_contentsKnown
,
parent
),
zoneHeight
(
_zoneHeight
)
{
setCacheMode
(
DeviceCoordinateCache
);
}
QRectF
HandZoneVert
::
boundingRect
()
const
{
return
QRectF
(
0
,
0
,
100
,
zoneHeight
);
}
void
HandZoneVert
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*/
*
option
*/
,
QWidget
*/
*
widget
*/
)
{
if
(
bgPixmap
.
isNull
())
painter
->
fillRect
(
boundingRect
(),
Qt
::
darkGreen
);
else
painter
->
fillRect
(
boundingRect
(),
QBrush
(
bgPixmap
));
}
void
HandZoneVert
::
reorganizeCards
()
{
if
(
!
cards
.
isEmpty
())
{
const
int
cardCount
=
cards
.
size
();
qreal
totalWidth
=
boundingRect
().
width
();
qreal
totalHeight
=
boundingRect
().
height
();
qreal
cardWidth
=
cards
.
at
(
0
)
->
boundingRect
().
width
();
qreal
cardHeight
=
cards
.
at
(
0
)
->
boundingRect
().
height
();
qreal
xspace
=
5
;
qreal
x1
=
xspace
;
qreal
x2
=
totalWidth
-
xspace
-
cardWidth
;
for
(
int
i
=
0
;
i
<
cardCount
;
i
++
)
{
CardItem
*
c
=
cards
.
at
(
i
);
qreal
x
=
i
%
2
?
x2
:
x1
;
// If the total height of the cards is smaller than the available height,
// the cards do not need to overlap and are displayed in the center of the area.
if
(
cardHeight
*
cardCount
>
totalHeight
)
c
->
setPos
(
x
,
((
qreal
)
i
)
*
(
totalHeight
-
cardHeight
)
/
(
cardCount
-
1
));
else
c
->
setPos
(
x
,
((
qreal
)
i
)
*
cardHeight
+
(
totalHeight
-
cardCount
*
cardHeight
)
/
2
);
c
->
setZValue
(
i
);
}
}
update
();
}
cockatrice/src/handzone_vert.h
deleted
100644 → 0
View file @
e1a72832
#ifndef HANDZONE_VERT_H
#define HANDZONE_VERT_H
#include
"handzone.h"
class
HandZoneVert
:
public
HandZone
{
Q_OBJECT
private:
int
zoneHeight
;
public:
HandZoneVert
(
Player
*
_p
,
bool
_contentsKnown
,
int
_zoneHeight
,
QGraphicsItem
*
parent
=
0
);
QRectF
boundingRect
()
const
;
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
void
reorganizeCards
();
void
setWidth
(
qreal
/*_width*/
)
{
}
};
#endif
cockatrice/src/player.cpp
View file @
f2092b89
...
@@ -9,8 +9,6 @@
...
@@ -9,8 +9,6 @@
#include
"tablezone.h"
#include
"tablezone.h"
#include
"handzone.h"
#include
"handzone.h"
#include
"handcounter.h"
#include
"handcounter.h"
#include
"handzone_vert.h"
#include
"handzone_horiz.h"
#include
"cardlist.h"
#include
"cardlist.h"
#include
"tab_game.h"
#include
"tab_game.h"
#include
"protocol_items.h"
#include
"protocol_items.h"
...
@@ -20,11 +18,12 @@
...
@@ -20,11 +18,12 @@
#include
<QPainter>
#include
<QPainter>
#include
<QMenu>
#include
<QMenu>
Player
::
Player
(
const
QString
&
_name
,
int
_id
,
bool
_local
,
bool
_mirrored
,
Client
*
_client
,
TabGame
*
_parent
)
Player
::
Player
(
const
QString
&
_name
,
int
_id
,
bool
_local
,
Client
*
_client
,
TabGame
*
_parent
)
:
QObject
(
_parent
),
defaultNumberTopCards
(
3
),
name
(
_name
),
id
(
_id
),
active
(
false
),
local
(
_local
),
mirrored
(
_mirrored
),
client
(
_client
)
:
QObject
(
_parent
),
defaultNumberTopCards
(
3
),
name
(
_name
),
id
(
_id
),
active
(
false
),
local
(
_local
),
mirrored
(
false
),
client
(
_client
)
{
{
setCacheMode
(
DeviceCoordinateCache
);
setCacheMode
(
DeviceCoordinateCache
);
connect
(
settingsCache
,
SIGNAL
(
horizontalHandChanged
()),
this
,
SLOT
(
rearrangeZones
()));
connect
(
settingsCache
,
SIGNAL
(
playerBgPathChanged
()),
this
,
SLOT
(
updateBgPixmap
()));
connect
(
settingsCache
,
SIGNAL
(
playerBgPathChanged
()),
this
,
SLOT
(
updateBgPixmap
()));
updateBgPixmap
();
updateBgPixmap
();
...
@@ -33,7 +32,7 @@ Player::Player(const QString &_name, int _id, bool _local, bool _mirrored, Clien
...
@@ -33,7 +32,7 @@ Player::Player(const QString &_name, int _id, bool _local, bool _mirrored, Clien
PileZone
*
deck
=
new
PileZone
(
this
,
"deck"
,
true
,
false
,
this
);
PileZone
*
deck
=
new
PileZone
(
this
,
"deck"
,
true
,
false
,
this
);
deck
->
setPos
(
base
);
deck
->
setPos
(
base
);
qreal
h
=
deck
->
boundingRect
().
height
()
+
2
0
;
qreal
h
=
deck
->
boundingRect
().
height
()
+
1
0
;
PileZone
*
grave
=
new
PileZone
(
this
,
"grave"
,
false
,
true
,
this
);
PileZone
*
grave
=
new
PileZone
(
this
,
"grave"
,
false
,
true
,
this
);
grave
->
setPos
(
base
+
QPointF
(
0
,
h
));
grave
->
setPos
(
base
+
QPointF
(
0
,
h
));
...
@@ -50,24 +49,7 @@ Player::Player(const QString &_name, int _id, bool _local, bool _mirrored, Clien
...
@@ -50,24 +49,7 @@ Player::Player(const QString &_name, int _id, bool _local, bool _mirrored, Clien
table
=
new
TableZone
(
this
,
this
);
table
=
new
TableZone
(
this
,
this
);
connect
(
table
,
SIGNAL
(
sizeChanged
()),
this
,
SLOT
(
updateBoundingRect
()));
connect
(
table
,
SIGNAL
(
sizeChanged
()),
this
,
SLOT
(
updateBoundingRect
()));
base
=
QPointF
(
deck
->
boundingRect
().
width
()
+
counterAreaWidth
+
5
,
0
);
hand
=
new
HandZone
(
this
,
_local
||
(
_parent
->
getSpectator
()
&&
_parent
->
getSpectatorsSeeEverything
()),
(
int
)
table
->
boundingRect
().
height
(),
this
);
if
(
settingsCache
->
getHorizontalHand
())
{
hand
=
new
HandZoneHoriz
(
this
,
_local
||
(
_parent
->
getSpectator
()
&&
_parent
->
getSpectatorsSeeEverything
()),
this
);
if
(
mirrored
)
{
hand
->
setPos
(
counterAreaWidth
+
CARD_WIDTH
+
5
,
base
.
y
());
table
->
setPos
(
base
.
x
(),
base
.
y
()
+
hand
->
boundingRect
().
height
());
}
else
{
table
->
setPos
(
base
);
hand
->
setPos
(
counterAreaWidth
+
CARD_WIDTH
+
5
,
base
.
y
()
+
table
->
boundingRect
().
height
());
}
}
else
{
hand
=
new
HandZoneVert
(
this
,
_local
||
(
_parent
->
getSpectator
()
&&
_parent
->
getSpectatorsSeeEverything
()),
(
int
)
table
->
boundingRect
().
height
(),
this
);
hand
->
setPos
(
base
);
base
+=
QPointF
(
hand
->
boundingRect
().
width
(),
0
);
table
->
setPos
(
base
);
}
connect
(
hand
,
SIGNAL
(
cardCountChanged
()),
handCounter
,
SLOT
(
updateNumber
()));
connect
(
hand
,
SIGNAL
(
cardCountChanged
()),
handCounter
,
SLOT
(
updateNumber
()));
updateBoundingRect
();
updateBoundingRect
();
...
@@ -269,6 +251,7 @@ Player::Player(const QString &_name, int _id, bool _local, bool _mirrored, Clien
...
@@ -269,6 +251,7 @@ Player::Player(const QString &_name, int _id, bool _local, bool _mirrored, Clien
cardMenu
=
0
;
cardMenu
=
0
;
}
}
rearrangeZones
();
retranslateUi
();
retranslateUi
();
}
}
...
@@ -288,6 +271,29 @@ Player::~Player()
...
@@ -288,6 +271,29 @@ Player::~Player()
delete
cardMenu
;
delete
cardMenu
;
}
}
void
Player
::
rearrangeZones
()
{
QPointF
base
=
QPointF
(
CARD_WIDTH
+
counterAreaWidth
+
5
,
0
);
if
(
settingsCache
->
getHorizontalHand
())
{
if
(
mirrored
)
{
hand
->
setPos
(
counterAreaWidth
+
CARD_WIDTH
+
5
,
base
.
y
());
table
->
setPos
(
base
.
x
(),
base
.
y
()
+
hand
->
boundingRect
().
height
());
}
else
{
table
->
setPos
(
base
);
hand
->
setPos
(
counterAreaWidth
+
CARD_WIDTH
+
5
,
base
.
y
()
+
table
->
boundingRect
().
height
());
}
hand
->
setWidth
(
table
->
getWidth
());
}
else
{
hand
->
setPos
(
base
);
base
+=
QPointF
(
hand
->
boundingRect
().
width
(),
0
);
table
->
setPos
(
base
);
}
hand
->
updateOrientation
();
updateBoundingRect
();
rearrangeCounters
();
}
void
Player
::
updateBgPixmap
()
void
Player
::
updateBgPixmap
()
{
{
QString
bgPath
=
settingsCache
->
getPlayerBgPath
();
QString
bgPath
=
settingsCache
->
getPlayerBgPath
();
...
@@ -1023,6 +1029,14 @@ qreal Player::getMinimumWidth() const
...
@@ -1023,6 +1029,14 @@ qreal Player::getMinimumWidth() const
return
table
->
getMinimumWidth
()
+
CARD_WIDTH
+
5
+
counterAreaWidth
;
return
table
->
getMinimumWidth
()
+
CARD_WIDTH
+
5
+
counterAreaWidth
;
}
}
void
Player
::
setMirrored
(
bool
_mirrored
)
{
if
(
mirrored
!=
_mirrored
)
{
mirrored
=
_mirrored
;
rearrangeZones
();
}
}
void
Player
::
processSceneSizeChange
(
const
QSizeF
&
newSize
)
void
Player
::
processSceneSizeChange
(
const
QSizeF
&
newSize
)
{
{
// This will need to be changed if player areas are displayed side by side (e.g. 2x2 for a 4-player game)
// This will need to be changed if player areas are displayed side by side (e.g. 2x2 for a 4-player game)
...
...
cockatrice/src/player.h
View file @
f2092b89
...
@@ -80,6 +80,7 @@ private slots:
...
@@ -80,6 +80,7 @@ private slots:
void
updateBoundingRect
();
void
updateBoundingRect
();
void
cardMenuAction
();
void
cardMenuAction
();
void
actSetCounters
();
void
actSetCounters
();
void
rearrangeZones
();
private:
private:
QMenu
*
playerMenu
,
*
handMenu
,
*
graveMenu
,
*
rfgMenu
,
*
libraryMenu
,
*
sbMenu
,
*
countersMenu
,
*
sayMenu
;
QMenu
*
playerMenu
,
*
handMenu
,
*
graveMenu
,
*
rfgMenu
,
*
libraryMenu
,
*
sbMenu
,
*
countersMenu
,
*
sayMenu
;
QAction
*
aMoveHandToTopLibrary
,
*
aMoveHandToBottomLibrary
,
*
aMoveHandToGrave
,
*
aMoveHandToRfg
,
QAction
*
aMoveHandToTopLibrary
,
*
aMoveHandToBottomLibrary
,
*
aMoveHandToGrave
,
*
aMoveHandToRfg
,
...
@@ -165,7 +166,7 @@ public:
...
@@ -165,7 +166,7 @@ public:
void
clearArrows
();
void
clearArrows
();
Client
*
client
;
Client
*
client
;
Player
(
const
QString
&
_name
,
int
_id
,
bool
_local
,
bool
_mirrored
,
Client
*
_client
,
TabGame
*
_parent
);
Player
(
const
QString
&
_name
,
int
_id
,
bool
_local
,
Client
*
_client
,
TabGame
*
_parent
);
~
Player
();
~
Player
();
void
retranslateUi
();
void
retranslateUi
();
QMenu
*
getPlayerMenu
()
const
{
return
playerMenu
;
}
QMenu
*
getPlayerMenu
()
const
{
return
playerMenu
;
}
...
@@ -181,6 +182,7 @@ public:
...
@@ -181,6 +182,7 @@ public:
void
setActive
(
bool
_active
);
void
setActive
(
bool
_active
);
qreal
getMinimumWidth
()
const
;
qreal
getMinimumWidth
()
const
;
void
setMirrored
(
bool
_mirrored
);
void
processSceneSizeChange
(
const
QSizeF
&
newSize
);
void
processSceneSizeChange
(
const
QSizeF
&
newSize
);
void
processPlayerInfo
(
ServerInfo_Player
*
info
);
void
processPlayerInfo
(
ServerInfo_Player
*
info
);
...
...
cockatrice/src/settingscache.cpp
View file @
f2092b89
...
@@ -89,6 +89,7 @@ void SettingsCache::setHorizontalHand(int _horizontalHand)
...
@@ -89,6 +89,7 @@ void SettingsCache::setHorizontalHand(int _horizontalHand)
{
{
horizontalHand
=
_horizontalHand
;
horizontalHand
=
_horizontalHand
;
settings
->
setValue
(
"hand/horizontal"
,
horizontalHand
);
settings
->
setValue
(
"hand/horizontal"
,
horizontalHand
);
emit
horizontalHandChanged
();
}
}
void
SettingsCache
::
setEconomicGrid
(
int
_economicGrid
)
void
SettingsCache
::
setEconomicGrid
(
int
_economicGrid
)
...
...
cockatrice/src/settingscache.h
View file @
f2092b89
...
@@ -15,6 +15,7 @@ signals:
...
@@ -15,6 +15,7 @@ signals:
void
tableBgPathChanged
();
void
tableBgPathChanged
();
void
playerBgPathChanged
();
void
playerBgPathChanged
();
void
picDownloadChanged
();
void
picDownloadChanged
();
void
horizontalHandChanged
();
void
economicGridChanged
();
void
economicGridChanged
();
private:
private:
QSettings
*
settings
;
QSettings
*
settings
;
...
...
cockatrice/src/tab_game.cpp
View file @
f2092b89
...
@@ -208,8 +208,7 @@ void TabGame::actRemoveLocalArrows()
...
@@ -208,8 +208,7 @@ void TabGame::actRemoveLocalArrows()
Player
*
TabGame
::
addPlayer
(
int
playerId
,
const
QString
&
playerName
)
Player
*
TabGame
::
addPlayer
(
int
playerId
,
const
QString
&
playerName
)
{
{
// XXX Find a different criterion for the 'mirrored' flag. When spectating, both players are not local, but only one should be mirrored.
Player
*
newPlayer
=
new
Player
(
playerName
,
playerId
,
playerId
==
localPlayerId
,
client
,
this
);
Player
*
newPlayer
=
new
Player
(
playerName
,
playerId
,
playerId
==
localPlayerId
,
playerId
!=
localPlayerId
,
client
,
this
);
scene
->
addPlayer
(
newPlayer
);
scene
->
addPlayer
(
newPlayer
);
connect
(
newPlayer
,
SIGNAL
(
newCardAdded
(
AbstractCardItem
*
)),
this
,
SLOT
(
newCardAdded
(
AbstractCardItem
*
)));
connect
(
newPlayer
,
SIGNAL
(
newCardAdded
(
AbstractCardItem
*
)),
this
,
SLOT
(
newCardAdded
(
AbstractCardItem
*
)));
...
...
cockatrice/src/tablezone.cpp
View file @
f2092b89
...
@@ -76,7 +76,7 @@ void TableZone::reorganizeCards()
...
@@ -76,7 +76,7 @@ void TableZone::reorganizeCards()
qreal
x
=
mapPoint
.
x
();
qreal
x
=
mapPoint
.
x
();
qreal
y
=
mapPoint
.
y
();
qreal
y
=
mapPoint
.
y
();
if
(
!
player
->
get
Local
())
if
(
player
->
get
Mirrored
())
y
=
height
-
CARD_HEIGHT
-
y
;
y
=
height
-
CARD_HEIGHT
-
y
;
cards
[
i
]
->
setPos
(
x
,
y
);
cards
[
i
]
->
setPos
(
x
,
y
);
cards
[
i
]
->
setZValue
((
y
+
CARD_HEIGHT
)
*
10000000
+
x
+
1000
);
cards
[
i
]
->
setZValue
((
y
+
CARD_HEIGHT
)
*
10000000
+
x
+
1000
);
...
...
cockatrice/src/tablezone.h
View file @
f2092b89
...
@@ -35,6 +35,7 @@ public:
...
@@ -35,6 +35,7 @@ public:
void
resizeToContents
();
void
resizeToContents
();
int
getMinimumWidth
()
const
{
return
currentMinimumWidth
;
}
int
getMinimumWidth
()
const
{
return
currentMinimumWidth
;
}
void
setWidth
(
qreal
_width
);
void
setWidth
(
qreal
_width
);
qreal
getWidth
()
const
{
return
width
;
}
protected:
protected:
void
addCardImpl
(
CardItem
*
card
,
int
x
,
int
y
);
void
addCardImpl
(
CardItem
*
card
,
int
x
,
int
y
);
};
};
...
...
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