next steps votekick gui implementation
This commit is contained in:
@@ -103,6 +103,7 @@ void ServerGuiWrapper::stopTimeoutAnimation(int /*playerId*/) {}
|
||||
|
||||
void ServerGuiWrapper::startVoteOnKick(int /*playerId*/, int /*timeoutSec*/) {}
|
||||
void ServerGuiWrapper::changeVoteOnKickButtonsState(bool /*showHide*/) {}
|
||||
void ServerGuiWrapper::refreshVotesMonitor(int /*currentVotes*/, int /*numVotesNeededToKick*/) {}
|
||||
void ServerGuiWrapper::endVoteOnKick() {}
|
||||
|
||||
void ServerGuiWrapper::logPlayerActionMsg(string /*playerName*/, int /*action*/, int /*setValue*/) {}
|
||||
|
||||
@@ -90,6 +90,7 @@ public:
|
||||
|
||||
void startVoteOnKick(int playerId, int timeoutSec);
|
||||
void changeVoteOnKickButtonsState(bool showHide);
|
||||
void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick);
|
||||
void endVoteOnKick();
|
||||
|
||||
void logPlayerActionMsg(std::string playerName, int action, int setValue) ;
|
||||
|
||||
@@ -99,6 +99,7 @@ public:
|
||||
|
||||
virtual void startVoteOnKick(int playerId, int timeoutSec) =0;
|
||||
virtual void changeVoteOnKickButtonsState(bool showHide) =0;
|
||||
virtual void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick) =0;
|
||||
virtual void endVoteOnKick() =0;
|
||||
|
||||
//log.cpp
|
||||
|
||||
@@ -3108,9 +3108,6 @@ void gameTableImpl::startVoteOnKick(int playerId, int timeoutSec)
|
||||
pushButton_voteOnKickNo->hide();
|
||||
pushButton_voteOnKickYes->hide();
|
||||
|
||||
PlayerInfo info(myStartWindow->getSession()->getClientPlayerInfo(playerId));
|
||||
label_kickUser->setText(tr("Do you want to kick <b>%1</b><br>from this game?").arg(QString::fromUtf8(info.playerName.c_str())));
|
||||
|
||||
voteOnKickTimeoutSecs = timeoutSec;
|
||||
playerAboutToKickId = playerId;
|
||||
startVoteOnKickTimeout();
|
||||
@@ -3124,10 +3121,15 @@ void gameTableImpl::startVoteOnKick(int playerId, int timeoutSec)
|
||||
void gameTableImpl::changeVoteOnKickButtonsState(bool showHide)
|
||||
{
|
||||
if(showHide) {
|
||||
|
||||
PlayerInfo info(myStartWindow->getSession()->getClientPlayerInfo(playerAboutToKickId));
|
||||
label_kickUser->setText(tr("Do you want to kick <b>%1</b><br>from this game?").arg(QString::fromUtf8(info.playerName.c_str())));
|
||||
|
||||
pushButton_voteOnKickNo->show();
|
||||
pushButton_voteOnKickYes->show();
|
||||
}
|
||||
else {
|
||||
label_kickUser->clear();
|
||||
pushButton_voteOnKickNo->hide();
|
||||
pushButton_voteOnKickYes->hide();
|
||||
}
|
||||
@@ -3170,10 +3172,10 @@ void gameTableImpl::nextVoteOnKickTimeoutAnimationFrame()
|
||||
label_kickVoteTimeout->setText(tr("<b>%1</b> secs left").arg(voteOnKickTimeoutSecs-voteOnKickRealTimer.elapsed().total_seconds()));
|
||||
}
|
||||
|
||||
void gameTableImpl::refreshVotesMonitor()
|
||||
void gameTableImpl::refreshVotesMonitor(int currentVotes, int numVotesNeededToKick)
|
||||
{
|
||||
PlayerInfo info(myStartWindow->getSession()->getClientPlayerInfo(playerAboutToKickId));
|
||||
label_votesMonitor->setText(tr("Player <b>%1</b> has %2 votes against him.").arg(QString::fromUtf8(info.playerName.c_str())));
|
||||
label_votesMonitor->setText(tr("Player <b>%1</b> has %2 votes against him.<br>%3 votes needed to kick.").arg(QString::fromUtf8(info.playerName.c_str()), currentVotes, numVotesNeededToKick));
|
||||
}
|
||||
|
||||
void gameTableImpl::refreshCardsChance(GameState bero)
|
||||
|
||||
@@ -290,7 +290,7 @@ public slots:
|
||||
void startVoteOnKickTimeout();
|
||||
void stopVoteOnKickTimeout();
|
||||
void nextVoteOnKickTimeoutAnimationFrame();
|
||||
void refreshVotesMonitor();
|
||||
void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -107,6 +107,7 @@ void GuiWrapper::stopTimeoutAnimation(int playerId) { myW->signalStopTimeoutAnim
|
||||
|
||||
void GuiWrapper::startVoteOnKick(int playerId, int timeoutSec) { myW->signalStartVoteOnKick(playerId, timeoutSec); }
|
||||
void GuiWrapper::changeVoteOnKickButtonsState(bool showHide) { myW->changeVoteOnKickButtonsState(showHide); }
|
||||
void GuiWrapper::refreshVotesMonitor(int currentVotes, int numVotesNeededToKick) { myW->refreshVotesMonitor(currentVotes, numVotesNeededToKick); }
|
||||
void GuiWrapper::endVoteOnKick() { myW->signalEndVoteOnKick(); }
|
||||
|
||||
void GuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) { myLog->signalLogPlayerActionMsg(QString::fromUtf8(playerName.c_str()), action, setValue); }
|
||||
|
||||
@@ -98,6 +98,7 @@ public:
|
||||
|
||||
void startVoteOnKick(int playerId, int timeoutSec);
|
||||
void changeVoteOnKickButtonsState(bool showHide);
|
||||
void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick);
|
||||
void endVoteOnKick();
|
||||
|
||||
void logPlayerActionMsg(std::string playerName, int action, int setValue) ;
|
||||
|
||||
Reference in New Issue
Block a user