Example #1
0
void CQuiz::SetNPC()
{
	CMover* pMover	= (CMover*)CreateObj( D3DDEVICE, OT_MOVER, m_sNPC.dwNPCId );
	if( !pMover )
	{
		Error( "CQuiz::SetNPC() - pMover is NULL - %d, %s", m_sNPC.dwNPCId, m_sNPC.strCharKey.c_str() );
		return;
	}
	lstrcpy( pMover->m_szCharacterKey, m_sNPC.strCharKey.c_str() );
	pMover->InitNPCProperty();
	pMover->InitCharacter( pMover->GetCharacter() );
	pMover->SetPos( m_sNPC.vPos );
	pMover->InitMotion( MTI_STAND );
	pMover->UpdateLocalMatrix();
	pMover->AddItToGlobalId();
	m_sNPC.idNpc = pMover->GetId();
	CWorld* pWorld	= g_WorldMng.GetWorld( WI_WORLD_MADRIGAL );
	if( pWorld )
		pWorld->ADDOBJ( pMover, FALSE, nDefaultLayer );
}
Example #2
0
void CWndDialog::ParsingString( LPCTSTR lpszString )
{
	CString strWord, strOriginal;
	int nMarkBraceIdx;
	BOOL bKey = FALSE;
	BOOL bBrace = FALSE;
	int nTemp  =0;
	BOOL bWirdChar = FALSE;

	CMover* pMover = prj.GetMover( m_idMover );
	if( pMover == NULL ) return;

	int nPos =  m_strArray.GetSize();
	m_aContextMark[ nPos ].RemoveAll();

	CEditString editString;
	editString.AddParsingString( lpszString );
	CEditString* pEditString = new CEditString;

	int nLength = editString.GetLength();
	
	// 왼쪽이 strWord, 오른쪽이 strOrigital
	int i; for( i = 0; i < nLength; i++ )
	{
		if( editString[ i ] == '['  )
		{
			nMarkBraceIdx = i;
			bBrace = TRUE;
			if( bKey == FALSE )
			{
				strOriginal.Empty();
				strWord.Empty();
				nTemp = 1;
			}
		}
		else
		if( editString[ i ] == ']' )
		{
			if( bBrace == TRUE )
			{
				bBrace = FALSE;
				if( bKey == FALSE )
				{
					bKey = TRUE;
					int nLen = strWord.GetLength();
					int nMark = 3;
					if( nLen == 1 ) 
						nMark = 4;
					if( nLen == 2 && bWirdChar )
						nMark = 4;
					m_aContextMark[ nPos ].SetAt( m_aContextMark[ nPos ].GetSize() - 1, nMark );
					if( bWirdChar )
						m_aContextMark[ nPos ].SetAt( m_aContextMark[ nPos ].GetSize() - 2, nMark );
				}
				else
				{
					bKey = FALSE;
					if( strOriginal.IsEmpty() )
						strOriginal = strWord;
					m_mapWordToOriginal.SetAt( strWord, strOriginal );
				}
			}
		}
		else
		{
			if( bKey == TRUE )
			{
				if( bBrace == FALSE )
				{
					LPCHARACTER lpCharacter = pMover->GetCharacter();
					CString string;
					string.Format( "%s에서 [%s]와 [] 사이에 잡문자가 들어있거나 연결이 안된다.", lpCharacter->m_szDialog, strWord );
					AfxMessageBox( string );
				}
				strOriginal += editString[ i ];
				if( IsDBCSLeadByte( editString[ i ] ) )
					strOriginal += editString[ ++i ];
			}
			else
			{
				int nMarkTemp = 0;
				DWORD dwStyle = editString.m_abyStyle.GetAt( i );
				DWORD dwColor = editString.m_adwColor.GetAt( i );
				if( bBrace )
				{
					nMarkTemp = nTemp;
					if( nTemp == 1 ) nTemp++;
					dwStyle = ESSTY_BOLD;
				}
				m_aContextMark[ nPos ].Add( nMarkTemp );
				pEditString->AddString( editString[ i ], dwColor, dwStyle );

				strWord += editString[ i ];
				bWirdChar = FALSE;
				if( IsDBCSLeadByte( editString[ i ] ) )
				{
					m_aContextMark[ nPos ].Add( nMarkTemp );
					pEditString->AddString( editString[ ++i ], 0xff000000, dwStyle );

					strWord += editString[ i ];
					bWirdChar = TRUE;
				}
			}
		}
	}
	pEditString->Align( pEditString->m_pFont, 0 );
	m_strArray.Add( pEditString );
}
Example #3
0
void CWndDialog::OnInitialUpdate() 
{ 
	CWndNeuz::OnInitialUpdate(); 

#if __VER >= 15 // __IMPROVE_QUEST_INTERFACE
	CWndGroupBox* pWndGroupBox = ( CWndGroupBox* )GetDlgItem( WIDC_GROUP_BOX_TITLE );
	if( pWndGroupBox )
	{
		pWndGroupBox->m_dwColor = D3DCOLOR_ARGB( 255, 128, 0, 64 );
		pWndGroupBox->SetTitle( prj.GetText( TID_GAME_DIALOG ) );
	}

	m_pNewQuestListIconTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_THEME, _T( "QuestUiPaperGreen.tga" )), 0xffffffff );
	m_pExpectedQuestListIconTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_THEME, _T( "QuestUiPaperRed.tga" )), 0xffffffff );
	m_pCurrentQuestListIconTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_THEME, _T( "QuestUiPaperGray.tga" )), 0xffffffff );
	m_pCompleteQuestListIconTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, MakePath( DIR_THEME, _T( "QuestUiPaperYellow.tga" )), 0xffffffff );

	LPWNDCTRL lpWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
	lpWndCtrl->dwWndStyle |= WBS_VSCROLL;

	static const int QUEST_LIST_SELECT_COLOR = 0xffff0000;
	static const int QUEST_LIST_LINE_SPACE = 3;

	m_WndNewQuestListBox.Create( lpWndCtrl->dwWndStyle, lpWndCtrl->rect, this, lpWndCtrl->dwWndId );
	m_WndNewQuestListBox.m_nSelectColor = QUEST_LIST_SELECT_COLOR;
	m_WndNewQuestListBox.m_nLineSpace = QUEST_LIST_LINE_SPACE;
	if( m_pNewQuestListIconTexture )
		m_WndNewQuestListBox.SetLeftMargin( m_pNewQuestListIconTexture->m_size.cx );
	m_WndNewQuestListBox.SetVisible( FALSE );

	m_WndCurrentQuestListBox.Create( lpWndCtrl->dwWndStyle, lpWndCtrl->rect, this, lpWndCtrl->dwWndId );
	m_WndCurrentQuestListBox.m_nSelectColor = QUEST_LIST_SELECT_COLOR;
	m_WndCurrentQuestListBox.m_nLineSpace = QUEST_LIST_LINE_SPACE;
	if( m_pCurrentQuestListIconTexture )
		m_WndCurrentQuestListBox.SetLeftMargin( m_pCurrentQuestListIconTexture->m_size.cx );
	m_WndCurrentQuestListBox.SetVisible( FALSE );
#endif // __IMPROVE_QUEST_INTERFACEf
	
	CWndBase* pWndBase = (CWndBase*)g_WndMng.GetApplet( APP_INVENTORY );

	if( pWndBase )
	{
		pWndBase->Destroy();
	}
	
	CMover* pMover = prj.GetMover( m_idMover );
	if( pMover == NULL ) return;
	LPCHARACTER lpCharacter = pMover->GetCharacter();

	if( lpCharacter )
	{
		m_texChar.DeleteDeviceObjects();
		m_texChar.LoadTexture( g_Neuz.m_pd3dDevice, MakePath( "char\\",lpCharacter->m_szChar ), 0xffff00ff, TRUE );
		if( lpCharacter->m_dwMusicId )
			PlayMusic( lpCharacter->m_dwMusicId, 1 );
	}
	m_nCurArray = 0;
	int i; for( i = 0; i < m_strArray.GetSize(); i++ )
	{
		CEditString* pEditString = (CEditString*) m_strArray.GetAt( i );
		safe_delete( pEditString );
	}
	m_strArray.RemoveAll();


	MakeKeyButton();
	
	m_bSay = FALSE;

	UpdateButtonEnable();
	// 윈도를 중앙으로 옮기는 부분.
	CRect rectRoot = m_pWndRoot->GetLayoutRect();
	CRect rect = GetWindowRect();
	int nWidth  = rect.Width(); 
	int nHeight = rect.Height(); 
	int x = rectRoot.left + (rectRoot.Width()  / 2) - (nWidth  / 2);
	int y = rectRoot.top  + (rectRoot.Height() / 2) - (nHeight / 2);	
	CPoint point( x, 10 );
	Move( point );

#if __VER >= 15 // __IMPROVE_QUEST_INTERFACE
	CWndQuest* pWndQuest = (CWndQuest*)g_WndMng.GetWndBase( APP_QUEST_EX_LIST );
#else // __IMPROVE_QUEST_INTERFACE
	CWndQuest* pWndQuest = (CWndQuest*)g_WndMng.GetWndBase( APP_QUEST );
#endif // __IMPROVE_QUEST_INTERFACE
	if( pWndQuest ) pWndQuest->Update();
}