Changed: Fix crashes if interface doesn't have specified controls

This commit is contained in:
kervala 2010-11-18 19:41:53 +01:00
parent 50fbaf860d
commit 068f3853f2

View file

@ -3137,23 +3137,29 @@ class CHandlerGameConfigFullscreen : public IActionHandler
bool bFullscreen; bool bFullscreen;
{ {
CCtrlBaseButton *pBut = dynamic_cast<CCtrlBaseButton*>(pIM->getElementFromId( GAME_CONFIG_VIDEO_FULLSCREEN_BUTTON )); CCtrlBaseButton *pBut = dynamic_cast<CCtrlBaseButton*>(pIM->getElementFromId( GAME_CONFIG_VIDEO_FULLSCREEN_BUTTON ));
if (pBut == NULL) return; if (pBut) bFullscreen = pBut->getPushed();
bFullscreen = pBut->getPushed();
} }
CDBGroupComboBox *pCB; CDBGroupComboBox *pCB;
if (bFullscreen) if (bFullscreen)
{ {
// show modes combo
pCB= dynamic_cast<CDBGroupComboBox*>(pIM->getElementFromId( GAME_CONFIG_VIDEO_MODES_COMBO )); pCB= dynamic_cast<CDBGroupComboBox*>(pIM->getElementFromId( GAME_CONFIG_VIDEO_MODES_COMBO ));
pCB->setActive(true); if (pCB) pCB->setActive(true);
// show frequencies combo
pCB= dynamic_cast<CDBGroupComboBox*>(pIM->getElementFromId( GAME_CONFIG_VIDEO_FREQS_COMBO )); pCB= dynamic_cast<CDBGroupComboBox*>(pIM->getElementFromId( GAME_CONFIG_VIDEO_FREQS_COMBO ));
pCB->setActive(true); if (pCB) pCB->setActive(true);
} }
else else
{ {
// hide modes combo
pCB= dynamic_cast<CDBGroupComboBox*>(pIM->getElementFromId( GAME_CONFIG_VIDEO_MODES_COMBO )); pCB= dynamic_cast<CDBGroupComboBox*>(pIM->getElementFromId( GAME_CONFIG_VIDEO_MODES_COMBO ));
pCB->setActive(false); if (pCB) pCB->setActive(false);
// hide frequencies combo
pCB= dynamic_cast<CDBGroupComboBox*>(pIM->getElementFromId( GAME_CONFIG_VIDEO_FREQS_COMBO )); pCB= dynamic_cast<CDBGroupComboBox*>(pIM->getElementFromId( GAME_CONFIG_VIDEO_FREQS_COMBO ));
pCB->setActive(false); if (pCB) pCB->setActive(false);
} }
// **** dirt the apply button of the DDX // **** dirt the apply button of the DDX