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 } } }
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 (); }
Object* Read(const string& Handle) { string Leftover = Handle; string ObjHandle = ExtractObjHandle(Leftover); if (Leftover.empty()) return Holder::Read(ObjHandle); return GetHolder(ObjHandle)->Read(Leftover); }
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); }
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() + ")"; }
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 }
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; }
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); } }
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); }
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); }
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); }
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; }
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); }
void SingletonBase::Add(long longevity, const SingletonBase::SingletonPrivateBasePtr& holder) { GetHolder().AddSingletonHolder(longevity,holder); s_singletonStatus = E_Inited; }
void SingletonBase::Release() { SetStopAll(); s_singletonStatus = E_Destroyed; GetHolder().ReleaseAllSingletonHolder(); }
void CUIMpTradeWnd::OnBtnCancelClicked(CUIWindow* w, void* d) { CheckDragItemToDestroy (); GetHolder()->StartStopMenu (this,true); }
void CUIChangeMap::OnBtnCancel() { GetHolder()->StartStopMenu (this, true); }