Ejemplo n.º 1
0
	void ChatWidget::playerJoinedGame( const std::string& player,int seatNo )
	{
		if(!m_shared)
		{
			return;
		}
		if(seatNo != -1)
			return;

		ClientPlayer* p = m_shared->getPlayerManager()->getSelfPlayer();
		if(p && p->getUsername() != player)
		{
			m_toolbar->addPlayer(player,getGamePlayerColor(player));
			m_toolbar->setPlayerMuted(player,isMutedG(player));
		}
		
	}
Ejemplo n.º 2
0
	void ChatWidget::loadSettings( ClientShared* shared )
	{
		m_shared = shared;
		m_toolbar->getCensorButton()->setToggleState(getBoolSetting("chat.censored"));
		m_fontRatio = getNumericSetting("chat.game.font");
		Log::write("ChatWidget","loaded game chat settings");
		m_toolbar->getFontSlider()->setValue(
			((m_toolbar->getFontSlider()->getMaxValue() - 
			m_toolbar->getFontSlider()->getMinValue())  * m_fontRatio)
			+ m_toolbar->getFontSlider()->getMinValue());
		//all this code just adds players to mute list
		int tbl = getTableG();
		LobbyCache::Table* t = shared->getLobbyCache()->getTableAt(tbl);

		if(t)
		{
			ClientPlayer* s = shared->getPlayerManager()->getSelfPlayer();
/*
			for(int i = 0; i < t->getNumChairs(); ++i)
			{
				ClientPlayer* p = t->getChairAt(i)->getPlayer();
				//valid and not me
				if(s && p && p->getUsername() != s->getUsername())
				{
					m_toolbar->addPlayer(p->getUsername(),getGamePlayerColor(p->getUsername()));
					m_toolbar->setPlayerMuted(p->getUsername(),isMutedG(p->getUsername()));
				}
			}
			*/

			for(int i = 0; i < t->getNumWatchers(); ++i)
			{
				ClientPlayer* p = t->getWatcherAt(i);
				if(s && p && p->getUsername() != s->getUsername())
				{
					m_toolbar->addPlayer(p->getUsername(),getGamePlayerColor(p->getUsername()));
					m_toolbar->setPlayerMuted(p->getUsername(),isMutedG(p->getUsername()));
				}
			}
		}
		
		std::string chatStyle = getStringSetting("chat.style");
		chatStyleChanged(chatStyle);
	}