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::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::refreshVotesMonitor(int /*currentVotes*/, int /*numVotesNeededToKick*/) {}
|
||||
void ServerGuiWrapper::endVoteOnKick() {}
|
||||
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
void startTimeoutAnimation(int playerNum, int timeoutSec);
|
||||
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 refreshVotesMonitor(int currentVotes, int numVotesNeededToKick);
|
||||
void endVoteOnKick();
|
||||
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
virtual void startTimeoutAnimation(int playerNum, int timeoutSec) =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 refreshVotesMonitor(int currentVotes, int numVotesNeededToKick) =0;
|
||||
virtual void endVoteOnKick() =0;
|
||||
|
||||
+61
-24
@@ -1780,28 +1780,65 @@
|
||||
<attribute name="title" >
|
||||
<string>Kick</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_3" >
|
||||
<layout class="QGridLayout" name="gridLayout" >
|
||||
<item row="0" column="0" >
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2" >
|
||||
<layout class="QVBoxLayout" name="verticalLayout" >
|
||||
<property name="spacing" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_timeout" >
|
||||
<property name="text" >
|
||||
<string>Vote Timeout:</string>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3" >
|
||||
<property name="spacing" >
|
||||
<number>5</number>
|
||||
</property>
|
||||
</widget>
|
||||
<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>
|
||||
<widget class="QLabel" name="label_kickVoteTimeout" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Preferred" hsizetype="MinimumExpanding" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2" >
|
||||
<property name="spacing" >
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_timeout" >
|
||||
<property name="text" >
|
||||
<string>Vote Timeout:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_kickVoteTimeout" >
|
||||
<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>
|
||||
</layout>
|
||||
</item>
|
||||
@@ -1836,6 +1873,13 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0" >
|
||||
<widget class="QLabel" name="label_votesMonitor" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" >
|
||||
<spacer name="verticalSpacer" >
|
||||
<property name="orientation" >
|
||||
@@ -1849,13 +1893,6 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="0" >
|
||||
<widget class="QLabel" name="label_votesMonitor" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
@@ -2976,7 +3013,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1000</width>
|
||||
<height>22</height>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuView" >
|
||||
|
||||
@@ -401,6 +401,8 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
||||
label_kickVoteTimeout->setStyleSheet("QLabel { color: #99D500;}");
|
||||
label_kickUser->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; }");
|
||||
|
||||
@@ -589,7 +591,7 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
||||
connect(this, SIGNAL(signalPostRiverRunAnimation1()), this, SLOT(postRiverRunAnimation1()));
|
||||
connect(this, SIGNAL(signalFlipHolecardsAllIn()), this, SLOT(flipHolecardsAllIn()));
|
||||
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(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)
|
||||
tabWidget_Left->insertTab(2, tab_Kick, QString(tr("Kick")));
|
||||
@@ -3127,6 +3129,9 @@ void gameTableImpl::startVoteOnKick(unsigned playerId, int timeoutSec, int numVo
|
||||
playerAboutToBeKickedId = playerId;
|
||||
refreshVotesMonitor(1, numVotesNeededToKick);
|
||||
|
||||
PlayerInfo info(myStartWindow->getSession()->getClientPlayerInfo(voteStarterPlayerId));
|
||||
label_voteStarterNick->setText(QString::fromUtf8(info.playerName.c_str()));
|
||||
|
||||
startVoteOnKickTimeout();
|
||||
|
||||
int i;
|
||||
|
||||
@@ -119,7 +119,7 @@ signals:
|
||||
|
||||
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 signalEndVoteOnKick();
|
||||
|
||||
@@ -283,7 +283,7 @@ public slots:
|
||||
void showMaximized ();
|
||||
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 endVoteOnKick();
|
||||
void voteOnKickYes();
|
||||
|
||||
@@ -38,8 +38,15 @@ void MyAvatarLabel::contextMenuEvent ( QContextMenuEvent *event ) {
|
||||
|
||||
|
||||
Game *currentGame = myW->getSession()->getCurrentGame();
|
||||
|
||||
|
||||
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;
|
||||
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::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::refreshVotesMonitor(int currentVotes, int numVotesNeededToKick) { myW->refreshVotesMonitor(currentVotes, numVotesNeededToKick); }
|
||||
void GuiWrapper::endVoteOnKick() { myW->signalEndVoteOnKick(); }
|
||||
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
void startTimeoutAnimation(int playerNum, int timeoutSec);
|
||||
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 refreshVotesMonitor(int currentVotes, int numVotesNeededToKick);
|
||||
void endVoteOnKick();
|
||||
|
||||
@@ -1029,7 +1029,7 @@ ClientThread::StartPetition(unsigned petitionId, unsigned proposingPlayerId, uns
|
||||
boost::mutex::scoped_lock lock(m_curPetitionIdMutex);
|
||||
m_curPetitionId = petitionId;
|
||||
}
|
||||
GetGui().startVoteOnKick(kickPlayerId, timeoutSec, numVotesToKick);
|
||||
GetGui().startVoteOnKick(kickPlayerId, proposingPlayerId, timeoutSec, numVotesToKick);
|
||||
if (GetGuiPlayerId() != kickPlayerId
|
||||
&& GetGuiPlayerId() != proposingPlayerId)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user