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
72223b32
Commit
72223b32
authored
Jan 04, 2011
by
Max-Wilhelm Bruker
Browse files
minor reveal fix
parent
509d5401
Changes
5
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/gamescene.cpp
View file @
72223b32
...
...
@@ -82,7 +82,7 @@ void GameScene::toggleZoneView(Player *player, const QString &zoneName, int numb
}
}
ZoneViewWidget
*
item
=
new
ZoneViewWidget
(
player
,
player
->
getZones
().
value
(
zoneName
),
numberCards
);
ZoneViewWidget
*
item
=
new
ZoneViewWidget
(
player
,
player
->
getZones
().
value
(
zoneName
),
numberCards
,
false
);
views
.
append
(
item
);
connect
(
item
,
SIGNAL
(
closePressed
(
ZoneViewWidget
*
)),
this
,
SLOT
(
removeZoneView
(
ZoneViewWidget
*
)));
addItem
(
item
);
...
...
@@ -91,7 +91,7 @@ void GameScene::toggleZoneView(Player *player, const QString &zoneName, int numb
void
GameScene
::
addRevealedZoneView
(
Player
*
player
,
CardZone
*
zone
,
const
QList
<
ServerInfo_Card
*>
&
cardList
)
{
ZoneViewWidget
*
item
=
new
ZoneViewWidget
(
player
,
zone
,
-
2
,
cardList
);
ZoneViewWidget
*
item
=
new
ZoneViewWidget
(
player
,
zone
,
-
2
,
true
,
cardList
);
views
.
append
(
item
);
connect
(
item
,
SIGNAL
(
closePressed
(
ZoneViewWidget
*
)),
this
,
SLOT
(
removeZoneView
(
ZoneViewWidget
*
)));
addItem
(
item
);
...
...
cockatrice/src/zoneviewwidget.cpp
View file @
72223b32
...
...
@@ -9,7 +9,7 @@
#include
"protocol_items.h"
#include
"settingscache.h"
ZoneViewWidget
::
ZoneViewWidget
(
Player
*
_player
,
CardZone
*
_origZone
,
int
numberCards
,
const
QList
<
ServerInfo_Card
*>
&
cardList
)
ZoneViewWidget
::
ZoneViewWidget
(
Player
*
_player
,
CardZone
*
_origZone
,
int
numberCards
,
bool
_revealZone
,
const
QList
<
ServerInfo_Card
*>
&
cardList
)
:
QGraphicsWidget
(
0
,
Qt
::
Tool
|
Qt
::
CustomizeWindowHint
|
Qt
::
WindowSystemMenuHint
|
Qt
::
WindowTitleHint
/* | Qt::WindowCloseButtonHint*/
),
player
(
_player
)
{
setAttribute
(
Qt
::
WA_DeleteOnClose
);
...
...
@@ -48,7 +48,7 @@ ZoneViewWidget::ZoneViewWidget(Player *_player, CardZone *_origZone, int numberC
extraHeight
=
vbox
->
sizeHint
(
Qt
::
PreferredSize
).
height
();
resize
(
150
,
150
);
zone
=
new
ZoneViewZone
(
player
,
_origZone
,
numberCards
,
this
);
zone
=
new
ZoneViewZone
(
player
,
_origZone
,
numberCards
,
_revealZone
,
this
);
connect
(
zone
,
SIGNAL
(
optimumRectChanged
()),
this
,
SLOT
(
resizeToZoneContents
()));
connect
(
zone
,
SIGNAL
(
beingDeleted
()),
this
,
SLOT
(
zoneDeleted
()));
vbox
->
addItem
(
zone
);
...
...
cockatrice/src/zoneviewwidget.h
View file @
72223b32
...
...
@@ -30,7 +30,7 @@ private slots:
void
resizeToZoneContents
();
void
zoneDeleted
();
public:
ZoneViewWidget
(
Player
*
_player
,
CardZone
*
_origZone
,
int
numberCards
=
0
,
const
QList
<
ServerInfo_Card
*>
&
cardList
=
QList
<
ServerInfo_Card
*>
());
ZoneViewWidget
(
Player
*
_player
,
CardZone
*
_origZone
,
int
numberCards
=
0
,
bool
_revealZone
=
false
,
const
QList
<
ServerInfo_Card
*>
&
cardList
=
QList
<
ServerInfo_Card
*>
());
ZoneViewZone
*
getZone
()
const
{
return
zone
;
}
void
retranslateUi
();
protected:
...
...
cockatrice/src/zoneviewzone.cpp
View file @
72223b32
...
...
@@ -5,17 +5,19 @@
#include
"protocol_items.h"
#include
"carddragitem.h"
ZoneViewZone
::
ZoneViewZone
(
Player
*
_p
,
CardZone
*
_origZone
,
int
_numberCards
,
QGraphicsItem
*
parent
)
:
SelectZone
(
_p
,
_origZone
->
getName
(),
false
,
false
,
true
,
parent
,
true
),
bRect
(
QRectF
()),
minRows
(
0
),
numberCards
(
_numberCards
),
origZone
(
_origZone
),
sortByName
(
false
),
sortByType
(
false
)
ZoneViewZone
::
ZoneViewZone
(
Player
*
_p
,
CardZone
*
_origZone
,
int
_numberCards
,
bool
_revealZone
,
QGraphicsItem
*
parent
)
:
SelectZone
(
_p
,
_origZone
->
getName
(),
false
,
false
,
true
,
parent
,
true
),
bRect
(
QRectF
()),
minRows
(
0
),
numberCards
(
_numberCards
),
origZone
(
_origZone
),
revealZone
(
_revealZone
),
sortByName
(
false
),
sortByType
(
false
)
{
origZone
->
setView
(
this
);
if
(
!
revealZone
)
origZone
->
setView
(
this
);
}
ZoneViewZone
::~
ZoneViewZone
()
{
emit
beingDeleted
();
qDebug
(
"ZoneViewZone destructor"
);
origZone
->
setView
(
NULL
);
if
(
!
revealZone
)
origZone
->
setView
(
NULL
);
}
QRectF
ZoneViewZone
::
boundingRect
()
const
...
...
cockatrice/src/zoneviewzone.h
View file @
72223b32
...
...
@@ -15,9 +15,10 @@ private:
int
minRows
,
numberCards
;
void
handleDropEvent
(
CardDragItem
*
dragItem
,
CardZone
*
startZone
,
const
QPoint
&
dropPoint
,
bool
faceDown
);
CardZone
*
origZone
;
bool
revealZone
;
bool
sortByName
,
sortByType
;
public:
ZoneViewZone
(
Player
*
_p
,
CardZone
*
_origZone
,
int
_numberCards
=
-
1
,
QGraphicsItem
*
parent
=
0
);
ZoneViewZone
(
Player
*
_p
,
CardZone
*
_origZone
,
int
_numberCards
=
-
1
,
bool
_revealZone
=
false
,
QGraphicsItem
*
parent
=
0
);
~
ZoneViewZone
();
QRectF
boundingRect
()
const
;
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
...
...
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