void CUITalkWnd::Update() { //остановить разговор, если нужно if (g_actor && m_pActor && !m_pActor->IsTalking() ) { StopTalk(); }else{ CGameObject* pOurGO = smart_cast<CGameObject*>(m_pOurInvOwner); CGameObject* pOtherGO = smart_cast<CGameObject*>(m_pOthersInvOwner); if( NULL==pOurGO || NULL==pOtherGO ) Game().StartStopMenu(this,true); } if(m_bNeedToUpdateQuestions) { UpdateQuestions (); } inherited::Update (); UpdateCameraDirection (smart_cast<CGameObject*>(m_pOthersInvOwner)); UITalkDialogWnd->UpdateButtonsLayout(b_disable_break, m_pOthersInvOwner->IsTradeEnabled()); if(playing_sound()) { CGameObject* pOtherGO = smart_cast<CGameObject*>(m_pOthersInvOwner); Fvector P = pOtherGO->Position(); P.y += 1.8f; m_sound.set_position (P); } }
void CInventoryOwner::UpdateInventoryOwner(u32 deltaT) { inventory().Update(); if(m_pTrade) m_pTrade->UpdateTrade(); if(IsTalking()) { //если наш собеседник перестал говорить с нами, //то и нам нечего ждать. if(!m_pTalkPartner->IsTalking()) { StopTalk(); } //если мы умерли, то тоже не говорить CEntityAlive* pOurEntityAlive = smart_cast<CEntityAlive*>(this); R_ASSERT(pOurEntityAlive); if(!pOurEntityAlive->g_Alive()) StopTalk(); } }
void CDeviceEditDlg::OnTalk() { HTREEITEM hSelectItem = m_deviceTree.GetSelectedItem(); if ( hSelectItem ) { HTREEITEM parentItem = m_deviceTree.GetParentItem(hSelectItem); if ( parentItem ) { return; } else { DEV_INFO *pDev = (DEV_INFO *)m_deviceTree.GetItemData(hSelectItem); if ( pDev && pDev->lLoginID > 0 ) { if ( strcmp(m_talkDevice.szDevName, pDev->szDevName) ) { // if talk already started, stop it first. if ( m_talkDevice.lLoginID > 0 ) StopTalk(&m_talkDevice); StartTalk(pDev); memcpy( &m_talkDevice, pDev, sizeof(m_talkDevice)); } else { StopTalk(pDev); memset( &m_talkDevice, 0 ,sizeof(m_talkDevice)); } } } } }