LTBOOL CFolderHostLevels::OnRButtonUp(int x, int y) { // if (GetSelectedControl() == m_pAvailLevels || // GetSelectedControl() == m_pSelLevels) // return LTFALSE; // int adjX = x+g_pInterfaceResMgr->GetXOffset(); int adjY = y+g_pInterfaceResMgr->GetYOffset(); if (GetSelectedControl() == m_pAvailLevels) { int ndx = 0; if (m_pAvailLevels->GetControlUnderPoint(adjX,adjY,&ndx)) { if (ndx >= 0) return m_pAddLevel->OnEnter(); } } if (GetSelectedControl() == m_pSelLevels) { int ndx = 0; if (m_pSelLevels->GetControlUnderPoint(adjX,adjY,&ndx)) { if (ndx >= 0) return m_pRemoveLevel->OnEnter(); } } return CBaseFolder::OnRButtonUp(x,y); }
LTBOOL CScreenDisplay::OnLeft() { if (!CBaseScreen::OnLeft()) return LTFALSE; CLTGUICtrl* pCtrl = GetSelectedControl(); if (pCtrl == m_pHardwareCursor) { m_pHardwareCursor->UpdateData(LTTRUE); if (m_bHardwareCursor) { MBCreate mb; mb.eType = LTMB_YESNO; mb.pFn = AreYouSureCallBack; mb.pData = this; g_pInterfaceMgr->ShowMessageBox(IDS_CONFIRM_CURSOR,&mb,0,LTFALSE); } else { g_pCursorMgr->UseHardwareCursor(LTFALSE); WriteConsoleInt("HardwareCursor",0); } } if (GetSelectedControl() == m_pGamma) { pCtrl->UpdateData(); float fGamma = ConvertToGamma(m_nGamma); WriteConsoleFloat("GammaR",fGamma); WriteConsoleFloat("GammaG",fGamma); WriteConsoleFloat("GammaB",fGamma); } return LTTRUE; }
LTBOOL CScreenTeam::OnMouseMove(int x, int y) { LTBOOL bHandled = CBaseScreen::OnMouseMove(x, y); if (GetSelectedControl() == m_pLeft || GetSelectedControl() == m_pRight) m_pModel->Select(LTTRUE); else if (GetSelectedControl() != m_pModel) m_pModel->Select(LTFALSE); return bHandled; }
LTBOOL CFolderHostLevels::OnDown() { if (GetSelectedControl() == m_pSelLevels && m_pSelLevels->OnDown()) return LTTRUE; if (GetSelectedControl() == m_pAvailLevels && m_pAvailLevels->OnDown()) return LTTRUE; LTBOOL bHandled = CBaseFolder::OnDown(); UpdateButtons(); return bHandled; }
LTBOOL CFolderHostLevels::OnLeft() { if (CBaseFolder::OnLeft()) return LTTRUE; if (GetSelectedControl() == m_pSelLevels) return m_pRemoveLevel->OnEnter(); if (GetSelectedControl() == m_pRemoveLevel) return m_pRemoveLevel->OnEnter(); if (GetSelectedControl() == m_pRemoveAll) return m_pRemoveAll->OnEnter(); return LTFALSE; }
LTBOOL CFolderHostLevels::OnRight() { if (CBaseFolder::OnRight()) return LTTRUE; if (GetSelectedControl() == m_pAvailLevels) return m_pAddLevel->OnEnter(); if (GetSelectedControl() == m_pAddLevel) return m_pAddLevel->OnEnter(); if (GetSelectedControl() == m_pAddAll) return m_pAddAll->OnEnter(); return LTFALSE; }
// Override the left and right controls so that the volumes can be changed LTBOOL CScreenAudio::OnLeft() { LTBOOL handled = LTFALSE; CLTGUICtrl* pCtrl = GetSelectedControl(); if (pCtrl) handled = pCtrl->OnLeft(); if (handled) { if (pCtrl == m_pMusicVolumeCtrl) { UpdateData(LTTRUE); m_pMusicQualityCtrl->Enable(m_bMusicEnabled && m_nMusicVolume > MUSIC_MIN_VOL); SaveSoundSettings(); } else if (pCtrl == m_pMusicQualityCtrl) ConfirmQualityChange(true); else if (pCtrl == m_pSoundQualityCtrl) ConfirmQualityChange(false); else SaveSoundSettings(); g_pInterfaceMgr->RequestInterfaceSound(IS_SELECT); } return handled; }
LTBOOL CFolderJoin::OnEnter() { if (GetSelectedControl() == m_pServerList && m_pServerList->IsItemSelected()) return m_pJoin->OnEnter(); if (CBaseFolder::OnEnter()) return LTTRUE; return LTFALSE; }
void CFolderWeaponControls::UpdateSelection() { CLTGUICtrl *pCtrl = GetSelectedControl(); if (!pCtrl) return; int nComm = pCtrl->GetParam1(); if (!nComm) return; uint8 nWeaponId = g_pWeaponMgr->GetWeaponId(m_nActions[nComm-1]); if (nWeaponId != nLastId) { WEAPON* pWeapon = g_pWeaponMgr->GetWeapon(nWeaponId); if (pWeapon) { SAFE_STRCPY(m_szModel, pWeapon->szInterfaceModel); SAFE_STRCPY(m_szSkin, pWeapon->szInterfaceSkin); VEC_COPY(m_vOffset, pWeapon->vInterfaceOffset); m_fScale = pWeapon->fInterfaceScale; CreateModelSFX(); } nLastId = nWeaponId; } }
LTBOOL CFolderJoin::OnDown() { if (! CBaseFolder::OnDown()) return LTFALSE; if (GetSelectedControl() == m_pServerList) { SendCommand(CMD_SELECT_SERVER,0,0); } return LTTRUE; }
LTBOOL CFolderJoin::OnLButtonDblClick(int x, int y) { bDblClick = LTTRUE; CLTGUICtrl* pCtrl = GetSelectedControl(); if (pCtrl==m_pServerList && !m_pServerList->OnLButtonDblClick( x, y)) return OnEnter(); return CBaseFolder::OnLButtonDblClick( x, y); }
LTBOOL CFolderAdvDisplay::OnRight() { if (!CBaseFolder::OnRight()) return LTFALSE; if (GetSelectedControl() == m_pLightMap) { if (m_pLightMap->GetSelIndex()) { m_nSettingToConfirm = IDS_CONFIRM_LIGHTMAP; HSTRING hString = g_pLTClient->FormatString(IDS_CONFIRM_LIGHTMAP); g_pInterfaceMgr->ShowMessageBox(hString,LTMB_YESNO,AreYouSureCallBack,this,LTFALSE,LTFALSE); g_pLTClient->FreeString(hString); } } return LTTRUE; }
bool CScreenDisplay::OnRight() { if (!CBaseScreen::OnRight()) return false; CLTGUICtrl* pCtrl = GetSelectedControl(); if (pCtrl == m_pGamma) { pCtrl->UpdateData(); float fGamma = ConvertToGamma(m_nGamma); WriteConsoleFloat("GammaR",fGamma); WriteConsoleFloat("GammaG",fGamma); WriteConsoleFloat("GammaB",fGamma); } return true; }
LTBOOL CFolderDisplay::OnRButtonUp(int x, int y) { // Get the control that the click was on int nControlIndex=0; if (GetControlUnderPoint(x, y, &nControlIndex)) { CLTGUICtrl* pCtrl = GetControl(nControlIndex); if (m_pCaptureCtrl && pCtrl != m_pCaptureCtrl) return LTFALSE; // If the mouse is over the same control now as it was when the down message was called // then send the "left" message to the control. if (nControlIndex == m_nRMouseDownItemSel) { if (pCtrl->IsEnabled()) { if (GetSelectedControl() == m_pRendererCtrl) { // Get the current resolution FolderDisplayResolution currentResolution=GetCurrentSelectedResolution(); LTBOOL handled = pCtrl->OnRButtonUp(x,y); if (handled) { SetupResolutionCtrl(); // Set the resolution for the control SetCurrentCtrlResolution(currentResolution); } return handled; } else if (pCtrl == m_pHardwareCursor) { return OnLeft(); } else { SetSelection(nControlIndex); return CBaseFolder::OnRButtonUp(x,y); } } } } else { m_nRMouseDownItemSel= kNoSelection; } return LTFALSE; }
LTBOOL CFolderWeaponControls::OnRight() { CLTGUICtrl *pCtrl = GetSelectedControl(); if (pCtrl && pCtrl->GetParam1()) { CLTGUIColumnTextCtrl *pColumn=(CLTGUIColumnTextCtrl *)pCtrl; int nAct = pCtrl->GetParam1()-1; m_nActions[nAct] = GetNextCommand(m_nActions[nAct]); int nWeaponId = g_pWeaponMgr->GetWeaponId(m_nActions[nAct]); WEAPON *pWeapon = g_pWeaponMgr->GetWeapon(nWeaponId); if (pWeapon) pColumn->SetString(1,pWeapon->nNameId); else pColumn->SetString(1,IDS_CONTROL_UNASSIGNED); return LTTRUE; } return CBaseFolder::OnRight(); }
LTBOOL CFolderDisplay::OnRight() { if (!CBaseFolder::OnRight()) return LTFALSE; if (GetSelectedControl() == m_pHardwareCursor) { m_pHardwareCursor->UpdateData(LTTRUE); if (m_bHardwareCursor) { HSTRING hString = g_pLTClient->FormatString(IDS_CONFIRM_CURSOR); g_pInterfaceMgr->ShowMessageBox(hString,LTMB_YESNO,AreYouSureCallBack,this,LTFALSE,LTFALSE); g_pLTClient->FreeString(hString); } else { g_pInterfaceMgr->UseHardwareCursor(LTFALSE); WriteConsoleInt("HardwareCursor",0); } } return LTTRUE; }
LTBOOL CScreenTeam::OnRButtonUp(int x, int y) { CLTGUICtrl *pCtrl = GetSelectedControl(); return CBaseScreen::OnRButtonUp(x,y); }
LTBOOL CFolderHostLevels::Render(HSURFACE hDestSurf) { DrawFrame(hDestSurf,&rcAvailRect,(GetSelectedControl() == m_pAvailLevels)); DrawFrame(hDestSurf,&rcSelRect,(GetSelectedControl() == m_pSelLevels)); return CBaseFolder::Render(hDestSurf); }