guest avatar menu
This commit is contained in:
@@ -46,16 +46,46 @@ MyAvatarLabel::~MyAvatarLabel()
|
|||||||
void MyAvatarLabel::contextMenuEvent ( QContextMenuEvent *event ) {
|
void MyAvatarLabel::contextMenuEvent ( QContextMenuEvent *event ) {
|
||||||
|
|
||||||
assert(myW->getSession()->getCurrentGame());
|
assert(myW->getSession()->getCurrentGame());
|
||||||
if (myW->getSession()->isNetworkClientRunning() && !myW->getGuestMode()) {
|
if (myW->getSession()->isNetworkClientRunning()) {
|
||||||
|
|
||||||
PlayerListIterator it = myW->getSession()->getCurrentGame()->getSeatsList()->begin();
|
PlayerListIterator it = myW->getSession()->getCurrentGame()->getSeatsList()->begin();
|
||||||
//only active players are allowed to start a vote
|
//only active players are allowed to start a vote
|
||||||
if((*it)->getMyActiveStatus()) {
|
if((*it)->getMyActiveStatus()) {
|
||||||
|
|
||||||
Game *currentGame = myW->getSession()->getCurrentGame();
|
if(myW->getGuestMode()) {
|
||||||
|
//excpetions for client is logged in as guest
|
||||||
|
|
||||||
|
Game *currentGame = myW->getSession()->getCurrentGame();
|
||||||
PlayerListConstIterator it_c;
|
PlayerListConstIterator it_c;
|
||||||
int activePlayerCounter=0;
|
int activePlayerCounter=0;
|
||||||
|
|
||||||
|
setVoteOnKickContextMenuEnabled(FALSE);
|
||||||
|
action_IgnorePlayer->setEnabled(FALSE);
|
||||||
|
|
||||||
|
if(myW->getSession()->getGameType() == Session::GAME_TYPE_INTERNET) {
|
||||||
|
action_ReportBadAvatar->setVisible(TRUE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
action_ReportBadAvatar->setVisible(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
int i=0;
|
||||||
|
for (it_c=currentGame->getSeatsList()->begin(); it_c!=currentGame->getSeatsList()->end(); it_c++) {
|
||||||
|
|
||||||
|
//also inactive player which stays on table can be voted to kick
|
||||||
|
if(myContextMenuEnabled && myId != 0 && myId == i && (*it_c)->getMyType() != PLAYER_TYPE_COMPUTER && ( (*it_c)->getMyActiveStatus() || (*it_c)->getMyStayOnTableStatus() ) )
|
||||||
|
showContextMenu(event->globalPos());
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//normal player mode in internet game
|
||||||
|
|
||||||
|
Game *currentGame = myW->getSession()->getCurrentGame();
|
||||||
|
PlayerListConstIterator it_c;
|
||||||
|
int activePlayerCounter=0;
|
||||||
|
|
||||||
for (it_c=currentGame->getSeatsList()->begin(); it_c!=currentGame->getSeatsList()->end(); it_c++) {
|
for (it_c=currentGame->getSeatsList()->begin(); it_c!=currentGame->getSeatsList()->end(); it_c++) {
|
||||||
if((*it_c)->getMyActiveStatus()) activePlayerCounter++;
|
if((*it_c)->getMyActiveStatus()) activePlayerCounter++;
|
||||||
}
|
}
|
||||||
@@ -75,6 +105,13 @@ void MyAvatarLabel::contextMenuEvent ( QContextMenuEvent *event ) {
|
|||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(myW->getSession()->getGameType() == Session::GAME_TYPE_INTERNET) {
|
||||||
|
action_ReportBadAvatar->setVisible(TRUE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
action_ReportBadAvatar->setVisible(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
int i=0;
|
int i=0;
|
||||||
for (it_c=currentGame->getSeatsList()->begin(); it_c!=currentGame->getSeatsList()->end(); it_c++) {
|
for (it_c=currentGame->getSeatsList()->begin(); it_c!=currentGame->getSeatsList()->end(); it_c++) {
|
||||||
|
|
||||||
@@ -85,13 +122,7 @@ void MyAvatarLabel::contextMenuEvent ( QContextMenuEvent *event ) {
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(myW->getSession()->getGameType() == Session::GAME_TYPE_INTERNET) {
|
|
||||||
action_ReportBadAvatar->setVisible(TRUE);
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
action_ReportBadAvatar->setVisible(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user