Пример #1
0
void CScreenJoin::DisplayCurServerList()
{
	m_pServerListCtrl->RemoveAll();

	TServerList::const_iterator iCurServer = m_cServerList.begin();
	for (; iCurServer != m_cServerList.end(); ++iCurServer)
	{
		if (iCurServer->m_sAddress.empty())
			continue;

		// Create a control
			CLTGUIColumnCtrl* pCtrl = CreateColumnCtrl(CMD_JOIN, IDS_HELP_JOIN_LAN);
			pCtrl->SetFont(LTNULL,kListFontSize);
			// Do the name
		pCtrl->AddColumn(iCurServer->m_sName.c_str(), kColumnWidth_ServerName);
		// Do the map
		pCtrl->AddColumn(iCurServer->m_sMap.c_str(), kColumnWidth_MapName);
		// Do the number of players
		char aPlayerBuffer[256];
		sprintf(aPlayerBuffer, "%d/%d", iCurServer->m_nNumPlayers, iCurServer->m_nMaxPlayers);
		pCtrl->AddColumn(aPlayerBuffer, kColumnWidth_Players);
		// Remember where we came from
		pCtrl->SetParam1((uint32)(iCurServer - m_cServerList.begin()));

		// Add the server
		m_pServerListCtrl->AddControl(pCtrl);
	}
}
Пример #2
0
// Adds the columns to the controls
void CScreenConfigure::InitControlList()
{

	LTIntPt pos(m_ListRect.left,m_ListRect.top);


	for (int i=0; i < g_kNumCommands; i++)
	{
		const CommandData *pData = GetCommandData(i);

		//check to see that this is a TO2 command
		if (pData->nCommandID < FIRST_TRON_COMMAND)
		{
			// The initial column (contains the action)
			CLTGUIColumnCtrl *pCtrl=CreateColumnCtrl(CMD_CHANGE_CONTROL, IDS_HELP_SETCONTROL);
			pCtrl->SetFont(LTNULL,m_nListFontSize);

			// The "action" column
			char szTmp[64];
			FormatString(pData->nStringID,szTmp,sizeof(szTmp));
			pCtrl->AddColumn(szTmp, m_nActionWidth);

			// The equals column.  Changes from "" to "=" when the user is binding the key
			pCtrl->AddColumn(" ", m_nEqualsWidth);

			// The column that contains the key which is assigned to the control!
			FormatString(IDS_CONTROL_UNASSIGNED,szTmp,sizeof(szTmp));
			pCtrl->AddColumn(szTmp, m_nCommandWidth);

			pCtrl->SetParam1(i);

			m_pList[pData->nCommandType]->AddControl(pCtrl);
		}

	}
}