void CUIActorMenu::CheckDistance()
{
	CGameObject* pActorGO	= smart_cast<CGameObject*>(m_pActorInvOwner);
	CGameObject* pPartnerGO	= smart_cast<CGameObject*>(m_pPartnerInvOwner);
	CGameObject* pBoxGO		= smart_cast<CGameObject*>(m_pInvBox);
	VERIFY(pActorGO && (pPartnerGO || pBoxGO || m_pCar));

	if ( pPartnerGO )
	{
		if ( ( pActorGO->Position().distance_to( pPartnerGO->Position() ) > 3.0f ) &&
			!m_pPartnerInvOwner->NeedOsoznanieMode() )
		{
			GetHolder()->StartStopMenu( this, true ); // hide actor menu
		}
	}
	else if (m_pCar && Actor()->Holder())
	{
		//nop
	}
	else //pBoxGO
	{
		VERIFY( pBoxGO );
		if ( pActorGO->Position().distance_to( pBoxGO->Position() ) > 3.0f )
		{
			GetHolder()->StartStopMenu( this, true ); // hide actor menu
		}
	}
}
Exemple #2
0
void CUIMpTradeWnd::OnBtnOkClicked(CUIWindow* w, void* d)
{
	CheckDragItemToDestroy				();
	StorePreset							(_preset_idx_last, true);
	GetHolder()->StartStopMenu			(this,true);
	game_cl_Deathmatch * dm				= smart_cast<game_cl_Deathmatch *>(&(Game()));
	dm->OnBuyMenu_Ok					();
}
Exemple #3
0
 Object* Read(const string& Handle)
 {
     string Leftover = Handle;
     string ObjHandle = ExtractObjHandle(Leftover);
     if (Leftover.empty())
         return Holder::Read(ObjHandle);
     return GetHolder(ObjHandle)->Read(Leftover);
 }
Exemple #4
0
 void Write(const string& Handle, Object* pObject)
 {
     string Leftover = Handle;
     string ObjHandle = ExtractObjHandle(Leftover);
     if (Leftover.empty())
         Holder::Write(ObjHandle, pObject);
     else
         GetHolder(ObjHandle)->Write(Leftover, pObject);
 }
Exemple #5
0
StdString VMMethod::AsDebugString() const {
    VMClass* holder = GetHolder();
    StdString holder_str;
    if (holder == load_ptr(nilObject)) {
        holder_str = "nil";
    } else {
        holder_str = holder->GetName()->GetStdString();
    }
    return "Method(" + holder_str + ">>#" + GetSignature()->GetStdString() + ")";
}
Exemple #6
0
void CUIPdaWnd::Update()
{
	inherited::Update		();
	UpdateDateTime			();

	// Real Wolf: если предмет убрали, когда окно было открыто, то закрываем его. 07.08.2014.
#if defined(UI_LOCK_PDA_WITHOUT_PDA_IN_SLOT)
	if (!g_actor->inventory().m_slots[PDA_SLOT].m_pIItem && IsShown() )
		GetHolder()->StartStopMenu(this, true);
#endif
}
Exemple #7
0
bool CUICarBodyWnd::OnKeyboard(int dik, EUIMessages keyboard_action)
{
	if( inherited::OnKeyboard(dik,keyboard_action) )return true;

	if(keyboard_action==WINDOW_KEY_PRESSED && is_binded(kUSE, dik)) 
	{
			GetHolder()->StartStopMenu(this,true);
			return true;
	}
	return false;
}
Exemple #8
0
void CUIChangeMap::OnBtnOk()
{
	u32 idx					= lst->GetSelectedIDX();
	const shared_str& name	= maps[idx];

	{
		string512					command;
        sprintf						(command, "cl_votestart changemap %s", name.c_str());
		Console->Execute			(command);
		GetHolder()->StartStopMenu	(this, true);
	}
}
Exemple #9
0
bool CUIMessageBoxEx::IR_OnKeyboardPress( int dik )
{
	if ( dik == DIK_NUMPADENTER || dik == DIK_RETURN || dik == DIK_SPACE)
	{
		m_pMessageBox->OnYesOk();
		return true;
	}else
	if ( dik == DIK_ESCAPE)
	{
		GetHolder()->StartStopMenu(this, true);
		return true;
	}else
		return CUIDialogWnd::IR_OnKeyboardPress(dik);
}
Exemple #10
0
bool CUITalkWnd::IR_OnKeyboardPress(int dik)
{
//.	StopSnd						();
	EGameActions cmd = get_binded_action(dik);
	if(cmd==kUSE)
	{
		if (m_pOthersInvOwner&&m_pOthersInvOwner->NeedOsoznanieMode())
		{
			return true;
		}
		GetHolder()->StartStopMenu(this, true);
		return true;
	}
	return inherited::IR_OnKeyboardPress(dik);
}
Exemple #11
0
void CUICarBodyWnd::Update()
{
	if(	m_b_need_update||
		m_pOurObject->inventory().ModifyFrame()==Device.dwFrame || 
		(m_pOthersObject&&m_pOthersObject->inventory().ModifyFrame()==Device.dwFrame))

		UpdateLists		();

	
	if(m_pOthersObject && (smart_cast<CGameObject*>(m_pOurObject))->Position().distance_to((smart_cast<CGameObject*>(m_pOthersObject))->Position()) > 3.0f)
	{
		GetHolder()->StartStopMenu(this,true);
	}
	inherited::Update();
}
bool CUITalkWnd::IR_OnKeyboardPress(int dik)
{
//.	StopSnd						();
	EGameActions cmd = get_binded_action(dik);
	if ( cmd==kUSE || cmd==kQUIT)
	{
		if(!b_disable_break)
			GetHolder()->StartStopMenu(this, true);
		return true;
	}
	if ( cmd == kSPRINT_TOGGLE )
	{
		if (m_pOthersInvOwner&&m_pOthersInvOwner->NeedOsoznanieMode())
		{
			return true;
		}
		UITalkDialogWnd->SetTradeMode();
		return true;
	}
	return inherited::IR_OnKeyboardPress(dik);
}
Exemple #13
0
void CUIMessageBoxEx::SendMessage(CUIWindow* pWnd, s16 msg, void* pData /* = NULL */){
	CUIWndCallback::OnEvent(pWnd, msg, pData);
	if (pWnd == m_pMessageBox)
	{
		switch (msg){
			case MESSAGE_BOX_OK_CLICKED:
			case MESSAGE_BOX_YES_CLICKED:
			case MESSAGE_BOX_NO_CLICKED:
			case MESSAGE_BOX_CANCEL_CLICKED:
			case MESSAGE_BOX_QUIT_WIN_CLICKED:
			case MESSAGE_BOX_QUIT_GAME_CLICKED:
				GetHolder()->StartStopMenu(this, true);
			default:
				break;
		}

		if (GetMessageTarget())
            GetMessageTarget()->SendMessage(this,msg,pData);
	}
	
}
bool CUIActorMenu::OnKeyboard(int dik, EUIMessages keyboard_action)
{
/*
	if (UIPropertiesBox.GetVisible())
	{	UIPropertiesBox.OnKeyboard(dik, keyboard_action); }
*/
	InfoCurItem( NULL );
	if ( is_binded(kDROP, dik) )
	{
		if ( WINDOW_KEY_PRESSED == keyboard_action && CurrentIItem() && !CurrentIItem()->IsQuestItem() )
		{

			SendEvent_Item_Drop		(CurrentIItem(), m_pActorInvOwner->object_id());
			SetCurrentItem			(NULL);
		}
		return true;
	}
	
	if ( is_binded(kSPRINT_TOGGLE, dik) )
	{
		if ( WINDOW_KEY_PRESSED == keyboard_action )
		{
			OnPressUserKey();
		}
		return true;
	}	
	
	if ( is_binded(kUSE, dik) )
	{
		if ( WINDOW_KEY_PRESSED == keyboard_action )
		{
			GetHolder()->StartStopMenu( this, true );
		}
		return true;
	}	

	if( inherited::OnKeyboard(dik,keyboard_action) )return true;

	return false;
}
Exemple #15
0
 void ExecuteSafe(const string& HolderHandle, const string& Handle, F Func)
 {
     if (ObjectHolder_t* pHolder = GetHolder(HolderHandle))
         pHolder->Execute(Handle, Func);
 }
void CUIActorMenu::OnBtnExitClicked(CUIWindow* w, void* d)
{
	GetHolder()->StartStopMenu			(this,true);
}
Exemple #17
0
	void SingletonBase::Add(long longevity, const SingletonBase::SingletonPrivateBasePtr& holder)
	{
		GetHolder().AddSingletonHolder(longevity,holder);
		s_singletonStatus = E_Inited;

	}
Exemple #18
0
	void SingletonBase::Release()
	{
		SetStopAll();
		s_singletonStatus = E_Destroyed;
		GetHolder().ReleaseAllSingletonHolder();
	}
Exemple #19
0
void CUIMpTradeWnd::OnBtnCancelClicked(CUIWindow* w, void* d)
{
	CheckDragItemToDestroy				();
	GetHolder()->StartStopMenu			(this,true);
}
Exemple #20
0
void CUIChangeMap::OnBtnCancel()
{
		GetHolder()->StartStopMenu	(this, true);
}