void CUIListBoxMultiCol::DrawText ( int nCol, int nRow, int nX, int nY, TEXT_ALIGN enAlign, COLOR TextColor )
{
	CDrawPort* pDrawPort = CUIManager::getSingleton()->GetDrawPort();

	switch( enAlign )
	{
		case TEXT_LEFT:
			pDrawPort->PutTextEx( m_vecString[nCol].vecString[nRow], nX, nY, TextColor );
			break;
		case TEXT_CENTER:
			pDrawPort->PutTextExCX( m_vecString[nCol].vecString[nRow], nX + m_vecRowWidht[nRow]/2, nY, TextColor );
			break;
		case TEXT_RIGHT:
			pDrawPort->PutTextExRX( m_vecString[nCol].vecString[nRow], nX, nY, TextColor );
			break;
		default:
			pDrawPort->PutTextEx( m_vecString[nCol].vecString[nRow], nX, nY, TextColor );
	}
}
// ----------------------------------------------------------------------------
// Name : Render()
// Desc :
// ----------------------------------------------------------------------------
void CUICreateChar::Render()
{	
	extern INDEX	sam_bWideScreen;
	CDrawPort* pDrawPort = CUIManager::getSingleton()->GetDrawPort();

	// Set create character textire
	pDrawPort->InitTextureData( m_ptdBaseTexture );
	
	// Character information
	// Top
	pDrawPort->AddTexture( m_rcCharInfo.Left, m_rcCharInfo.Top,
										m_rcCharInfo.Right, m_rcCharInfo.Top + CREATECHAR_INFO_HEIGHT,
										m_rtCharInfoTop.U0, m_rtCharInfoTop.V0,
										m_rtCharInfoTop.U1, m_rtCharInfoTop.V1,
										0xFFFFFFFF );
	// Bottom
	pDrawPort->AddTexture( m_rcCharInfo.Left, m_rcCharInfo.Top + CREATECHAR_INFO_HEIGHT,
										m_rcCharInfo.Right, m_rcCharInfo.Bottom,
										m_rtCharInfoBottom.U0, m_rtCharInfoBottom.V0,
										m_rtCharInfoBottom.U1, m_rtCharInfoBottom.V1,
										0xFFFFFFFF );

	// Character name input box
	m_ebCharName.Render();

	// Job button
	m_btnJobPrev.Render();
	m_btnJobNext.Render();

	// Head button
	m_btnFacePrev.Render();
	m_btnFaceNext.Render();

	// Hair button
	m_btnHairPrev.Render();
	m_btnHairNext.Render();

	// Face button
	//m_btnHeadPrev.Render();
	//m_btnHeadNext.Render();

	// OK button
	m_btnOK.Render();

	// Cancel button
	m_btnCancel.Render();

	// Character control
	/*
	// Zoom in button
	m_btnZoomIn.Render();

	// Zoom out button
	m_btnZoomOut.Render();

	// Rotate to left button
	m_btnRotateToLeft.Render();

	// Rotate to right
	m_btnRotateToRight.Render();
	*/

	// Render all elements
	pDrawPort->FlushRenderingQueue();

	// Render character information
	int	nX = m_rcCharInfo.Left + CREATECHAR_DESC_SX;
	int	nY = m_rcCharInfo.Top + CREATECHAR_DESC_SY;
	for( int iInfo = 0; iInfo < m_nCurInfoLines; iInfo++ )
	{
		pDrawPort->PutTextEx( m_strCharInfo[iInfo], nX, nY, m_colCharInfo[iInfo] );
		nY += _pUIFontTexMgr->GetLineHeight();
	}
	
	// Prepare Rendering Text
	nX = m_rcCharInfo.Left;
	nY = m_rcCharInfo.Top;
	pDrawPort->PutTextEx( _S( 140, "캐릭터 생성" ),
										nX + CREATECHAR_TITLE_OFFSETX, nY + CREATECHAR_TITLE_OFFSETY );
	pDrawPort->PutTextExRX( _S( 71, "이름" ),
											nX + CREATECHAR_NAME_RX, nY + CREATECHAR_NAME_SY );
	pDrawPort->PutTextExRX( _S( 141, "직업" ),
											nX + CREATECHAR_NAME_RX, nY + CREATECHAR_JOB_SY );
	pDrawPort->PutTextExRX( _S( 144, "얼굴" ),		// 얼굴
											nX + CREATECHAR_NAME_RX, nY + CREATECHAR_FACE_SY );
	pDrawPort->PutTextExRX( _S( 143, "헤어" ),		// 헤어
											nX + CREATECHAR_NAME_RX, nY + CREATECHAR_HAIR_SY );
	//pDrawPort->PutTextExRX( _S( 142, "머리" ),		// 머리
	//										nX + CREATECHAR_NAME_RX, nY + CREATECHAR_HEAD_SY );

	// Print Job
	pDrawPort->PutTextExCX( JobInfo().GetName(m_iSelectedJob),
											nX + CREATECHAR_JOB_MAIN_CY, nY + CREATECHAR_JOB_SY );
	// Print Face
	CTString strTemp;
	strTemp.PrintF("%d", m_sbSelectedFace + 1);
	pDrawPort->PutTextExCX( strTemp,
											nX + CREATECHAR_JOB_MAIN_CY, nY + CREATECHAR_FACE_SY );

	strTemp.PrintF("%d", m_sbSelectedHair + 1);
	// Print Hair
	pDrawPort->PutTextExCX( strTemp,
											nX + CREATECHAR_JOB_MAIN_CY, nY + CREATECHAR_HAIR_SY );

	// Print Head
	//pDrawPort->PutTextExCX( CTString( "1" ),
	//										nX + CREATECHAR_JOB_MAIN_CY, nY + CREATECHAR_FACE_SY );

	// Flush all render text queue
	pDrawPort->EndTextEx();

	// Reading window
	if( m_ebCharName.DoesShowReadingWindow() )
	{
		// Set texture
		pDrawPort->InitTextureData( m_ptdBaseTexture );

		// Reading window
		m_ebCharName.RenderReadingWindow();

		// Render all elements
		pDrawPort->FlushRenderingQueue();

		// Flush all render text queue
		pDrawPort->EndTextEx();
	}

	// show night shadow message [11/6/2009 rumist]
	if( m_bIsShowMessageInfo )
	{
		pDrawPort->InitTextureData( m_ptdMsgTexture );
		m_bxNoticeMsg.SetBoxPos(m_rcMessageInfo);
		m_bxNoticeMsg.Render();
		
		// Render all elements
		pDrawPort->FlushRenderingQueue();
		
		m_msgNCText.SetRenderPos( m_rcMessageInfo.Left, m_rcMessageInfo.Top );
		m_msgNCText.Render();
	}
}
Beispiel #3
0
// ----------------------------------------------------------------------------
// Name : Render()
// Desc :
// ----------------------------------------------------------------------------
void CUIRemission::Render()
{
    // Check distance
    FLOAT	fDiffX = _pNetwork->MyCharacterInfo.x - m_fNpcX;
    FLOAT	fDiffZ = _pNetwork->MyCharacterInfo.z - m_fNpcZ;
    if( fDiffX * fDiffX + fDiffZ * fDiffZ > UI_VALID_SQRDIST )
        CloseRemission();

    CDrawPort* pDrawPort = CUIManager::getSingleton()->GetDrawPort();

    // Set remission texture
    pDrawPort->InitTextureData( m_ptdBaseTexture );

    // Add render regions
    // Background
    pDrawPort->AddTexture( m_nPosX, m_nPosY, m_nPosX + m_nWidth, m_nPosY + m_nHeight,
                           m_rtBackground.U0, m_rtBackground.V0, m_rtBackground.U1, m_rtBackground.V1,
                           0xFFFFFFFF );

    // Close button
    m_btnClose.Render();

    // Buy button
    m_btnOK.Render();

    // Cancel button
    m_btnCancel.Render();

    m_sbRemissionIcon.Render();

    // List box of remission desc
    m_lbRemissionDesc.Render();

    // Render all elements
    pDrawPort->FlushRenderingQueue();

    // Remission buttons
    RenderRemissionBtns();

    // Text in remission
    pDrawPort->PutTextEx( _S( 601, "면죄부" ), m_nPosX + REMISSION_TITLE_TEXT_OFFSETX,
                          m_nPosY + REMISSION_TITLE_TEXT_OFFSETY, 0xFFFFFFFF );

    pDrawPort->PutTextExCX( _S( 601, "면죄부" ), m_nPosX + REMISSION_TAB_CX, m_nPosY + REMISSION_TAB_SY,
                            0x6B6B6BFF );

    pDrawPort->PutTextEx( _S( 609, "현재 나스" ), m_nPosX + REMISSION_CURSP_SX,
                          m_nPosY + REMISSION_CURSP_SY );

    CUIManager* pUIManager = CUIManager::getSingleton();

    // Set money
    CTString strPlayerMoney;
    if( _pNetwork->MyCharacterInfo.money > 0 )
    {
        strPlayerMoney.PrintF( "%I64d", _pNetwork->MyCharacterInfo.money );
        pUIManager->InsertCommaToString( strPlayerMoney );
    }

    pDrawPort->PutTextExRX( strPlayerMoney,
                            m_nPosX + REMISSION_CURSP_RX, m_nPosY + REMISSION_CURSP_SY, pUIManager->GetNasColor( strPlayerMoney ) );

    // Flush all render text queue
    pDrawPort->EndTextEx();
}
Beispiel #4
0
// ----------------------------------------------------------------------------
// Name : Render()
// Desc :
// ----------------------------------------------------------------------------
void CUIListBox::Render()
{
	// Get position
	int	nX, nY;
	GetAbsPos( nX, nY );

	CDrawPort* pDrawPort = CUIManager::getSingleton()->GetDrawPort();
	
	// Add render regions
	// Selection bar
	if( m_bShowSelectBar && m_nSelectList >= 0 )
	{
		int	nSelLine = m_nSelectList - m_sbScrollBar.GetScrollPos();
		
		if( nSelLine >= 0 )
		{
			if( !m_bScrollBar || nSelLine < m_sbScrollBar.GetScrollRange() )
			{
			
				int	nBarY = nY + m_nTextSY + nSelLine * m_nLineHeight;
				pDrawPort->AddTexture( nX + m_rcSelectOver.Left, nBarY + m_rcSelectOver.Top,
													nX + m_rcSelectOver.Right, nBarY + m_rcSelectOver.Bottom,
													m_rtSelectOver.U0, m_rtSelectOver.V0,
													m_rtSelectOver.U1, m_rtSelectOver.V1,
													0xFFFFFFFF );
			}
		}
	}

	// Scroll bar
	if( m_bScrollBar )
		m_sbScrollBar.Render();

	// Text in list box
	for( int nCol = 0; nCol < m_vecString.size(); nCol++ )
	{
		int	nRowS = m_sbScrollBar.GetScrollPos();
		int	nRowE = nRowS + m_nLinePerPage;
		if( nRowE > m_vecString[nCol].vecString.size() )
			nRowE = m_vecString[nCol].vecString.size();

		COLOR	colText;
		int		nTextX = nX + m_nTextSX + m_vecColumnSX[nCol];
		int		nTextY = nY + m_nTextSY;
		int		nSelList = -1, nOverList = -1;
		if( m_bSelectList )
		{
			nSelList = m_nSelectList;
			nOverList = nRowS + m_nOverList;
		}

		for( int nList = nRowS; nList < nRowE; nList++ )
		{
			if( m_vecSelectable[nList] )
			{
				if( nList == nSelList )
					colText = m_colSelectList;
				else if( nList == nOverList )
					colText = m_colOverList;
				else
					colText = m_vecColor[nCol].vecColor[nList];
			}
			else
				colText = m_vecColor[nCol].vecColor[nList];

			switch( m_vecAlign[nCol] )
			{
			case TEXT_LEFT:
				pDrawPort->PutTextEx( m_vecString[nCol].vecString[nList], nTextX, nTextY, colText );
				if (m_vecBold[nCol].vecBold[nList])
					pDrawPort->PutTextEx( m_vecString[nCol].vecString[nList], nTextX+1, nTextY, colText );
				break;
			case TEXT_CENTER:
				pDrawPort->PutTextExCX( m_vecString[nCol].vecString[nList], nTextX, nTextY, colText );
				if (m_vecBold[nCol].vecBold[nList])
					pDrawPort->PutTextExCX( m_vecString[nCol].vecString[nList], nTextX+1, nTextY, colText );
				break;
			case TEXT_RIGHT:
				pDrawPort->PutTextExRX( m_vecString[nCol].vecString[nList], nTextX, nTextY, colText );
				if (m_vecBold[nCol].vecBold[nList])
					pDrawPort->PutTextExRX( m_vecString[nCol].vecString[nList], nTextX+1, nTextY, colText );
				break;
			}

			nTextY += m_nLineHeight;
		}
	}
}