void CUIActorMenu::SetPartner(CInventoryOwner* io) { R_ASSERT (!IsShown()); m_pPartnerInvOwner = io; if ( m_pPartnerInvOwner ) { CBaseMonster* monster = smart_cast<CBaseMonster*>( m_pPartnerInvOwner ); if ( monster || m_pPartnerInvOwner->use_simplified_visual() ) { m_PartnerCharacterInfo->ClearInfo(); if ( monster ) { shared_str monster_tex_name = pSettings->r_string( monster->cNameSect(), "icon" ); // m_PartnerCharacterInfo->UIIcon().InitTexture( monster_tex_name.c_str() ); // m_PartnerCharacterInfo->UIIcon().SetStretchTexture( true ); m_PartnerCharacterInfo->InitMonsterCharacter(monster_tex_name); } } else { m_PartnerCharacterInfo->InitCharacter( m_pPartnerInvOwner->object_id() ); } SetInvBox( NULL ); } else { m_PartnerCharacterInfo->ClearInfo(); } }
void CUICarBodyWnd::InitCarBody(CInventoryOwner* pOur, CInventoryOwner* pOthers) { m_pOurObject = pOur; m_pOthersObject = pOthers; m_pInventoryBox = NULL; u16 our_id = smart_cast<CGameObject*>(m_pOurObject)->ID(); u16 other_id = smart_cast<CGameObject*>(m_pOthersObject)->ID(); m_pUICharacterInfoLeft->InitCharacter (our_id); m_pUIOthersIcon->Show (true); CBaseMonster *monster = NULL; if(m_pOthersObject) { monster = smart_cast<CBaseMonster *>(m_pOthersObject); if (monster || m_pOthersObject->use_simplified_visual() ) { m_pUICharacterInfoRight->ClearInfo (); if(monster) { shared_str monster_tex_name = pSettings->r_string(monster->cNameSect(),"icon"); m_pUICharacterInfoRight->UIIcon().InitTexture(monster_tex_name.c_str()); m_pUICharacterInfoRight->UIIcon().SetStretchTexture(true); } }else { m_pUICharacterInfoRight->InitCharacter (other_id); } } m_pUIPropertiesBox->Hide (); EnableAll (); UpdateLists (); if(!monster){ CInfoPortionWrapper *known_info_registry = xr_new<CInfoPortionWrapper>(); known_info_registry->registry().init (other_id); KNOWN_INFO_VECTOR& known_info = known_info_registry->registry().objects(); KNOWN_INFO_VECTOR_IT it = known_info.begin(); for(int i=0;it!=known_info.end();++it,++i){ (*it).info_id; NET_Packet P; CGameObject::u_EventGen (P,GE_INFO_TRANSFER, our_id); P.w_u16 (0);//not used P.w_stringZ ((*it).info_id); //сообщение P.w_u8 (1); //добавление сообщения CGameObject::u_EventSend (P); } known_info.clear (); xr_delete (known_info_registry); } }