This site is for P2P development and test software ONLY!

Connected Server in Blue/bold/greyout

erverListCtrl.cpp:

search:

COLORREF crOldTextColor = dc.SetTextColor(m_crWindowText);


add under this:

//Xman our server in blubold
//+
//grey out dead servers (BlueSonic/TK4)
LOGFONT lfFont = {0};
CFont fontCustom;
if(theApp.serverconnect->IsConnected()
&& (cur_srv = theApp.serverconnect->GetCurrentServer()) != NULL
&& cur_srv->GetPort() == server->GetPort()
//&& cur_srv->GetConnPort() == server->GetConnPort()//Morph - added by AndCycle, aux Ports, by lugdunummaster
&& _tcsicmp(cur_srv->GetAddress(), server->GetAddress()) == 0)
{
//it's our server
GetFont()->GetLogFont(&lfFont);
lfFont.lfWeight = FW_BOLD;
fontCustom.CreateFontIndirect(&lfFont);

dc.SelectObject(&fontCustom);
dc->SetTextColor(RGB(0,0,192));
}
else //TK4 Mod grey out Filtered servers or Dead servers
if(server->GetFailedCount() >= thePrefs.GetDeadServerRetries() || theApp.ipfilter->IsFiltered(server->GetIP()))
{
GetFont()->GetLogFont(&lfFont);
fontCustom.CreateFontIndirect(&lfFont);
dc.SelectObject(&fontCustom);
dc->SetTextColor(RGB(192,192,192));
} else if(server->GetFailedCount() >= 2)
{ //unreliable servers
GetFont()->GetLogFont(&lfFont);
fontCustom.CreateFontIndirect(&lfFont);
dc.SelectObject(&fontCustom);
dc->SetTextColor(RGB(128,128,128));
}
//Xman end

0 comments:

发表评论