From b3deb0ffd529300109f569aab5f802e8ff4c7fa9 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 18 Nov 2010 19:41:53 +0100 Subject: [PATCH] Changed: Fix crashes if interface doesn't have specified controls --- .../src/interface_v3/action_handler_game.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/action_handler_game.cpp b/code/ryzom/client/src/interface_v3/action_handler_game.cpp index e44516aba..36f289959 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_game.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_game.cpp @@ -3137,23 +3137,29 @@ class CHandlerGameConfigFullscreen : public IActionHandler bool bFullscreen; { CCtrlBaseButton *pBut = dynamic_cast(pIM->getElementFromId( GAME_CONFIG_VIDEO_FULLSCREEN_BUTTON )); - if (pBut == NULL) return; - bFullscreen = pBut->getPushed(); + if (pBut) bFullscreen = pBut->getPushed(); } CDBGroupComboBox *pCB; if (bFullscreen) { + // show modes combo pCB= dynamic_cast(pIM->getElementFromId( GAME_CONFIG_VIDEO_MODES_COMBO )); - pCB->setActive(true); + if (pCB) pCB->setActive(true); + + // show frequencies combo pCB= dynamic_cast(pIM->getElementFromId( GAME_CONFIG_VIDEO_FREQS_COMBO )); - pCB->setActive(true); + if (pCB) pCB->setActive(true); } else { + // hide modes combo pCB= dynamic_cast(pIM->getElementFromId( GAME_CONFIG_VIDEO_MODES_COMBO )); - pCB->setActive(false); + if (pCB) pCB->setActive(false); + + // hide frequencies combo pCB= dynamic_cast(pIM->getElementFromId( GAME_CONFIG_VIDEO_FREQS_COMBO )); - pCB->setActive(false); + if (pCB) pCB->setActive(false); + } // **** dirt the apply button of the DDX