Sunday, September 4, 2022

[Source Code] Online players source code

Show online player source code

Open the SelectServerPage.cpp file.
RanClientUILib\Interface

search :
m_pServerList = new CBasicTextBoxEx;
m_pServerList->CreateSub ( this, "SELECT_SERVER_LIST", UI_FLAG_DEFAULT, SELECT_SERVER_LIST );
m_pServerList->SetFont ( pFont9 );
m_pServerList->SetTextAlign ( TEXT_ALIGN_CENTER_X | TEXT_ALIGN_CENTER_Y );
m_pServerList->SetPartInterval ( fLIST_PART_INTERVAL );
m_pServerList->CreateMouseClick ( dwCLICKCOLOR );
m_pServerList->SetSensitive ( TRUE );
m_pServerList->SetSensitiveView ( false );
RegisterControl ( m_pServerList );

int nTotalLine = m_pServerList->GetVisibleLine ();



// add this code to the bottom line
m_pCurrentUserOnline = new CBasicTextBox;
m_pCurrentUserOnline->CreateSub ( this, "SELECT_SERVER_LIST_CURRENT_ONLINE" );
m_pCurrentUserOnline->SetFont ( pFont9 );
m_pCurrentUserOnline->SetTextAlign (TEXT_ALIGN_CENTER_X | TEXT_ALIGN_CENTER_Y );
m_pCurrentUserOnline->SetPartInterval ( fLIST_PART_INTERVAL );
RegisterControl ( m_pCurrentUserOnline );




search :
void CSelectServerPage::ResetAll ()

// add this code to the bottom line
if ( m_pCurrentUserOnline )        m_pCurrentUserOnline->ClearText (); //Add OnlinePlayer By DavinciNox


-------------------------------------------------------------------------------------------

Open the SelectServerPage.h file.

RanClientUILib\Interface

search :
CBasicTextBoxEx*        m_pServerList;

// add this code to the bottom line
CBasicTextBox*        m_pCurrentUserOnline; //Add OnlinePlayer By DavinciNox


-------------------------------------------------------------------------------------------

Open the SelectServerPageTw.cpp file.
RanClientUILib\Interface

search :
m_pSelectServerChannel->AddChannel

// add to the line above

/////////// Start Update OnlinePlayer Show number of people online By DavinciNox ///////////
CString strCurrentOnline;
strCurrentOnline.Format( "Current players: %d", pServerInfo->nServerCurrentClient );
m_pCurrentUserOnline->AddTextNoSplit ( strCurrentOnline, NS_UITEXTCOLOR::PALEGREEN );
/////////// End Update OnlinePlayer shows the number of people online By DavinciNox ///////////


-------------------------------------------------------------------------------------------

Add this code to Data/Gui/ filename uioutercfg.xml.

<!----------------- Start Update OnlinePlayer Show Number Of People Online By DavinciNox ----------------->
<CONTROL Local="Common" Id="SELECT_SERVER_LIST_CURRENT_ONLINE">
<WINDOW_POS X="33" Y="0" W="115" H="300" />
</CONTROL>
<!----------------- End Update OnlinePlayer Show Number Of People Online By DavinciNox ----------------->


Paste the line at the top of the code..
You may need to adjust the numbers, XY axes, and sizes manually as appropriate.
Because of each EP, the window is not the same.

0 comments:

Post a Comment