show votekick starter nick, disable kick contextmenu for only 2 players
This commit is contained in:
@@ -101,7 +101,7 @@ void ServerGuiWrapper::updateMyButtonsState() {}
|
|||||||
void ServerGuiWrapper::startTimeoutAnimation(int /*playerNum*/, int /*timeoutSec*/) {}
|
void ServerGuiWrapper::startTimeoutAnimation(int /*playerNum*/, int /*timeoutSec*/) {}
|
||||||
void ServerGuiWrapper::stopTimeoutAnimation(int /*playerNum*/) {}
|
void ServerGuiWrapper::stopTimeoutAnimation(int /*playerNum*/) {}
|
||||||
|
|
||||||
void ServerGuiWrapper::startVoteOnKick(unsigned /*playerId*/, int /*timeoutSec*/, int /*numVotesNeededToKick*/) {}
|
void ServerGuiWrapper::startVoteOnKick(unsigned /*playerId*/, unsigned /*voteStarterPlayerId*/, int /*timeoutSec*/, int /*numVotesNeededToKick*/) {}
|
||||||
void ServerGuiWrapper::changeVoteOnKickButtonsState(bool /*showHide*/) {}
|
void ServerGuiWrapper::changeVoteOnKickButtonsState(bool /*showHide*/) {}
|
||||||
void ServerGuiWrapper::refreshVotesMonitor(int /*currentVotes*/, int /*numVotesNeededToKick*/) {}
|
void ServerGuiWrapper::refreshVotesMonitor(int /*currentVotes*/, int /*numVotesNeededToKick*/) {}
|
||||||
void ServerGuiWrapper::endVoteOnKick() {}
|
void ServerGuiWrapper::endVoteOnKick() {}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public:
|
|||||||
void startTimeoutAnimation(int playerNum, int timeoutSec);
|
void startTimeoutAnimation(int playerNum, int timeoutSec);
|
||||||
void stopTimeoutAnimation(int playerNum);
|
void stopTimeoutAnimation(int playerNum);
|
||||||
|
|
||||||
void startVoteOnKick(unsigned playerId, int timeoutSec, int numVotesNeededToKick);
|
void startVoteOnKick(unsigned playerId, unsigned voteStarterPlayerId, int timeoutSec, int numVotesNeededToKick);
|
||||||
void changeVoteOnKickButtonsState(bool showHide);
|
void changeVoteOnKickButtonsState(bool showHide);
|
||||||
void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick);
|
void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick);
|
||||||
void endVoteOnKick();
|
void endVoteOnKick();
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ public:
|
|||||||
virtual void startTimeoutAnimation(int playerNum, int timeoutSec) =0;
|
virtual void startTimeoutAnimation(int playerNum, int timeoutSec) =0;
|
||||||
virtual void stopTimeoutAnimation(int playerNum) =0;
|
virtual void stopTimeoutAnimation(int playerNum) =0;
|
||||||
|
|
||||||
virtual void startVoteOnKick(unsigned playerId, int timeoutSec, int numVotesNeededToKick) =0;
|
virtual void startVoteOnKick(unsigned playerId, unsigned voteStarterPlayerId, int timeoutSec, int numVotesNeededToKick) =0;
|
||||||
virtual void changeVoteOnKickButtonsState(bool showHide) =0;
|
virtual void changeVoteOnKickButtonsState(bool showHide) =0;
|
||||||
virtual void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick) =0;
|
virtual void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick) =0;
|
||||||
virtual void endVoteOnKick() =0;
|
virtual void endVoteOnKick() =0;
|
||||||
|
|||||||
+46
-9
@@ -1780,9 +1780,44 @@
|
|||||||
<attribute name="title" >
|
<attribute name="title" >
|
||||||
<string>Kick</string>
|
<string>Kick</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gridLayout_3" >
|
<layout class="QGridLayout" name="gridLayout" >
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout" >
|
||||||
|
<property name="spacing" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3" >
|
||||||
|
<property name="spacing" >
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_votestartedby" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Vote started by:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_voteStarterNick" >
|
||||||
|
<property name="sizePolicy" >
|
||||||
|
<sizepolicy vsizetype="Preferred" hsizetype="MinimumExpanding" >
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text" >
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2" >
|
<layout class="QHBoxLayout" name="horizontalLayout_2" >
|
||||||
|
<property name="spacing" >
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_timeout" >
|
<widget class="QLabel" name="label_timeout" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
@@ -1805,6 +1840,8 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item row="1" column="0" >
|
<item row="1" column="0" >
|
||||||
<widget class="QLabel" name="label_kickUser" >
|
<widget class="QLabel" name="label_kickUser" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
@@ -1836,6 +1873,13 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0" >
|
||||||
|
<widget class="QLabel" name="label_votesMonitor" >
|
||||||
|
<property name="text" >
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="4" column="0" >
|
<item row="4" column="0" >
|
||||||
<spacer name="verticalSpacer" >
|
<spacer name="verticalSpacer" >
|
||||||
<property name="orientation" >
|
<property name="orientation" >
|
||||||
@@ -1849,13 +1893,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" >
|
|
||||||
<widget class="QLabel" name="label_votesMonitor" >
|
|
||||||
<property name="text" >
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -2976,7 +3013,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1000</width>
|
<width>1000</width>
|
||||||
<height>22</height>
|
<height>28</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuView" >
|
<widget class="QMenu" name="menuView" >
|
||||||
|
|||||||
@@ -401,6 +401,8 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
|||||||
label_kickVoteTimeout->setStyleSheet("QLabel { color: #99D500;}");
|
label_kickVoteTimeout->setStyleSheet("QLabel { color: #99D500;}");
|
||||||
label_kickUser->setStyleSheet("QLabel { color: #99D500;}");
|
label_kickUser->setStyleSheet("QLabel { color: #99D500;}");
|
||||||
label_votesMonitor->setStyleSheet("QLabel { color: #99D500;}");
|
label_votesMonitor->setStyleSheet("QLabel { color: #99D500;}");
|
||||||
|
label_voteStarterNick->setStyleSheet("QLabel { color: #99D500;}");
|
||||||
|
label_votestartedby->setStyleSheet("QLabel { color: #99D500;}");
|
||||||
|
|
||||||
statusbar->setStyleSheet(" QStatusBar { "+ font1String +" font-size: 12px; color: #B7FF00; }");
|
statusbar->setStyleSheet(" QStatusBar { "+ font1String +" font-size: 12px; color: #B7FF00; }");
|
||||||
|
|
||||||
@@ -589,7 +591,7 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
|||||||
connect(this, SIGNAL(signalPostRiverRunAnimation1()), this, SLOT(postRiverRunAnimation1()));
|
connect(this, SIGNAL(signalPostRiverRunAnimation1()), this, SLOT(postRiverRunAnimation1()));
|
||||||
connect(this, SIGNAL(signalFlipHolecardsAllIn()), this, SLOT(flipHolecardsAllIn()));
|
connect(this, SIGNAL(signalFlipHolecardsAllIn()), this, SLOT(flipHolecardsAllIn()));
|
||||||
connect(this, SIGNAL(signalNextRoundCleanGui()), this, SLOT(nextRoundCleanGui()));
|
connect(this, SIGNAL(signalNextRoundCleanGui()), this, SLOT(nextRoundCleanGui()));
|
||||||
connect(this, SIGNAL(signalStartVoteOnKick(unsigned, int, int)), this, SLOT(startVoteOnKick(unsigned, int, int)));
|
connect(this, SIGNAL(signalStartVoteOnKick(unsigned, unsigned, int, int)), this, SLOT(startVoteOnKick(unsigned, unsigned, int, int)));
|
||||||
connect(this, SIGNAL(signalChangeVoteOnKickButtonsState(bool)), this, SLOT(changeVoteOnKickButtonsState(bool)));
|
connect(this, SIGNAL(signalChangeVoteOnKickButtonsState(bool)), this, SLOT(changeVoteOnKickButtonsState(bool)));
|
||||||
connect(this, SIGNAL(signalEndVoteOnKick()), this, SLOT(endVoteOnKick()));
|
connect(this, SIGNAL(signalEndVoteOnKick()), this, SLOT(endVoteOnKick()));
|
||||||
|
|
||||||
@@ -3114,7 +3116,7 @@ void gameTableImpl::triggerVoteOnKick(int id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gameTableImpl::startVoteOnKick(unsigned playerId, int timeoutSec, int numVotesNeededToKick)
|
void gameTableImpl::startVoteOnKick(unsigned playerId, unsigned voteStarterPlayerId, int timeoutSec, int numVotesNeededToKick)
|
||||||
{
|
{
|
||||||
if(tabWidget_Left->widget(2) != tab_Kick)
|
if(tabWidget_Left->widget(2) != tab_Kick)
|
||||||
tabWidget_Left->insertTab(2, tab_Kick, QString(tr("Kick")));
|
tabWidget_Left->insertTab(2, tab_Kick, QString(tr("Kick")));
|
||||||
@@ -3127,6 +3129,9 @@ void gameTableImpl::startVoteOnKick(unsigned playerId, int timeoutSec, int numVo
|
|||||||
playerAboutToBeKickedId = playerId;
|
playerAboutToBeKickedId = playerId;
|
||||||
refreshVotesMonitor(1, numVotesNeededToKick);
|
refreshVotesMonitor(1, numVotesNeededToKick);
|
||||||
|
|
||||||
|
PlayerInfo info(myStartWindow->getSession()->getClientPlayerInfo(voteStarterPlayerId));
|
||||||
|
label_voteStarterNick->setText(QString::fromUtf8(info.playerName.c_str()));
|
||||||
|
|
||||||
startVoteOnKickTimeout();
|
startVoteOnKickTimeout();
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ signals:
|
|||||||
|
|
||||||
void signalNextRoundCleanGui();
|
void signalNextRoundCleanGui();
|
||||||
|
|
||||||
void signalStartVoteOnKick(unsigned playerId, int timeoutSec, int numVotesNeededToKick);
|
void signalStartVoteOnKick(unsigned playerId, unsigned voteStarterPlayerId, int timeoutSec, int numVotesNeededToKick);
|
||||||
void signalChangeVoteOnKickButtonsState(bool showHide);
|
void signalChangeVoteOnKickButtonsState(bool showHide);
|
||||||
void signalEndVoteOnKick();
|
void signalEndVoteOnKick();
|
||||||
|
|
||||||
@@ -283,7 +283,7 @@ public slots:
|
|||||||
void showMaximized ();
|
void showMaximized ();
|
||||||
void closeGameTable();
|
void closeGameTable();
|
||||||
|
|
||||||
void startVoteOnKick(unsigned playerId, int timeoutSec, int numVotesNeededToKick);
|
void startVoteOnKick(unsigned playerId, unsigned voteStarterPlayerId, int timeoutSec, int numVotesNeededToKick);
|
||||||
void changeVoteOnKickButtonsState(bool showHide);
|
void changeVoteOnKickButtonsState(bool showHide);
|
||||||
void endVoteOnKick();
|
void endVoteOnKick();
|
||||||
void voteOnKickYes();
|
void voteOnKickYes();
|
||||||
|
|||||||
@@ -40,6 +40,13 @@ void MyAvatarLabel::contextMenuEvent ( QContextMenuEvent *event ) {
|
|||||||
Game *currentGame = myW->getSession()->getCurrentGame();
|
Game *currentGame = myW->getSession()->getCurrentGame();
|
||||||
|
|
||||||
PlayerListConstIterator it_c;
|
PlayerListConstIterator it_c;
|
||||||
|
int activePlayerCounter=0;
|
||||||
|
for (it_c=currentGame->getSeatsList()->begin(); it_c!=currentGame->getSeatsList()->end(); it_c++) {
|
||||||
|
if((*it_c)->getMyActiveStatus()) activePlayerCounter++;
|
||||||
|
}
|
||||||
|
if(activePlayerCounter > 2) setVoteOnKickContextMenuEnabled(TRUE);
|
||||||
|
else setVoteOnKickContextMenuEnabled(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++) {
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ void GuiWrapper::disableMyButtons() { myW->signalDisableMyButtons(); }
|
|||||||
void GuiWrapper::startTimeoutAnimation(int playerNum, int timeoutSec) { myW->signalStartTimeoutAnimation(playerNum, timeoutSec); }
|
void GuiWrapper::startTimeoutAnimation(int playerNum, int timeoutSec) { myW->signalStartTimeoutAnimation(playerNum, timeoutSec); }
|
||||||
void GuiWrapper::stopTimeoutAnimation(int playerNum) { myW->signalStopTimeoutAnimation(playerNum); }
|
void GuiWrapper::stopTimeoutAnimation(int playerNum) { myW->signalStopTimeoutAnimation(playerNum); }
|
||||||
|
|
||||||
void GuiWrapper::startVoteOnKick(unsigned playerId, int timeoutSec, int numVotesNeededToKick) { myW->signalStartVoteOnKick(playerId, timeoutSec, numVotesNeededToKick); }
|
void GuiWrapper::startVoteOnKick(unsigned playerId, unsigned voteStarterPlayerId, int timeoutSec, int numVotesNeededToKick) { myW->signalStartVoteOnKick(playerId, voteStarterPlayerId, timeoutSec, numVotesNeededToKick); }
|
||||||
void GuiWrapper::changeVoteOnKickButtonsState(bool showHide) { myW->signalChangeVoteOnKickButtonsState(showHide); }
|
void GuiWrapper::changeVoteOnKickButtonsState(bool showHide) { myW->signalChangeVoteOnKickButtonsState(showHide); }
|
||||||
void GuiWrapper::refreshVotesMonitor(int currentVotes, int numVotesNeededToKick) { myW->refreshVotesMonitor(currentVotes, numVotesNeededToKick); }
|
void GuiWrapper::refreshVotesMonitor(int currentVotes, int numVotesNeededToKick) { myW->refreshVotesMonitor(currentVotes, numVotesNeededToKick); }
|
||||||
void GuiWrapper::endVoteOnKick() { myW->signalEndVoteOnKick(); }
|
void GuiWrapper::endVoteOnKick() { myW->signalEndVoteOnKick(); }
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ public:
|
|||||||
void startTimeoutAnimation(int playerNum, int timeoutSec);
|
void startTimeoutAnimation(int playerNum, int timeoutSec);
|
||||||
void stopTimeoutAnimation(int playerNum);
|
void stopTimeoutAnimation(int playerNum);
|
||||||
|
|
||||||
void startVoteOnKick(unsigned playerId, int timeoutSec, int numVotesNeededToKick);
|
void startVoteOnKick(unsigned playerId, unsigned voteStarterPlayerId, int timeoutSec, int numVotesNeededToKick);
|
||||||
void changeVoteOnKickButtonsState(bool showHide);
|
void changeVoteOnKickButtonsState(bool showHide);
|
||||||
void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick);
|
void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick);
|
||||||
void endVoteOnKick();
|
void endVoteOnKick();
|
||||||
|
|||||||
@@ -1029,7 +1029,7 @@ ClientThread::StartPetition(unsigned petitionId, unsigned proposingPlayerId, uns
|
|||||||
boost::mutex::scoped_lock lock(m_curPetitionIdMutex);
|
boost::mutex::scoped_lock lock(m_curPetitionIdMutex);
|
||||||
m_curPetitionId = petitionId;
|
m_curPetitionId = petitionId;
|
||||||
}
|
}
|
||||||
GetGui().startVoteOnKick(kickPlayerId, timeoutSec, numVotesToKick);
|
GetGui().startVoteOnKick(kickPlayerId, proposingPlayerId, timeoutSec, numVotesToKick);
|
||||||
if (GetGuiPlayerId() != kickPlayerId
|
if (GetGuiPlayerId() != kickPlayerId
|
||||||
&& GetGuiPlayerId() != proposingPlayerId)
|
&& GetGuiPlayerId() != proposingPlayerId)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user