Enable screen resizing in some places

This commit is contained in:
Benau 2020-06-04 15:51:54 +08:00
parent da1d41bf85
commit 2f1acc8139
4 changed files with 12 additions and 0 deletions

View File

@ -40,6 +40,7 @@ using namespace irr::gui;
CustomVideoSettingsDialog::CustomVideoSettingsDialog(const float w, const float h) : CustomVideoSettingsDialog::CustomVideoSettingsDialog(const float w, const float h) :
ModalDialog(w, h) ModalDialog(w, h)
{ {
GUIEngine::getDevice()->setResizable(false);
loadFromFile("custom_video_settings.stkgui"); loadFromFile("custom_video_settings.stkgui");
updateActivation(); updateActivation();
} }
@ -48,6 +49,7 @@ CustomVideoSettingsDialog::CustomVideoSettingsDialog(const float w, const float
CustomVideoSettingsDialog::~CustomVideoSettingsDialog() CustomVideoSettingsDialog::~CustomVideoSettingsDialog()
{ {
GUIEngine::getDevice()->setResizable(true);
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------

View File

@ -120,6 +120,7 @@ void MainMenuScreen::beforeAddingWidget()
// //
void MainMenuScreen::init() void MainMenuScreen::init()
{ {
GUIEngine::getDevice()->setResizable(true);
Screen::init(); Screen::init();
m_user_id = getWidget<ButtonWidget>("user-id"); m_user_id = getWidget<ButtonWidget>("user-id");
@ -603,6 +604,7 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
void MainMenuScreen::tearDown() void MainMenuScreen::tearDown()
{ {
GUIEngine::getDevice()->setResizable(false);
} // tearDown } // tearDown
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@ -78,6 +78,8 @@ void OptionsScreenGeneral::loadedFromFile()
void OptionsScreenGeneral::init() void OptionsScreenGeneral::init()
{ {
if (StateManager::get()->getGameState() == GUIEngine::MENU)
GUIEngine::getDevice()->setResizable(true);
Screen::init(); Screen::init();
RibbonWidget* ribbon = getWidget<RibbonWidget>("options_choice"); RibbonWidget* ribbon = getWidget<RibbonWidget>("options_choice");
assert(ribbon != NULL); assert(ribbon != NULL);
@ -277,6 +279,8 @@ void OptionsScreenGeneral::setInternetCheckboxes(bool activate)
void OptionsScreenGeneral::tearDown() void OptionsScreenGeneral::tearDown()
{ {
if (StateManager::get()->getGameState() == GUIEngine::MENU)
GUIEngine::getDevice()->setResizable(false);
Screen::tearDown(); Screen::tearDown();
// save changes when leaving screen // save changes when leaving screen
user_config->saveConfig(); user_config->saveConfig();

View File

@ -192,6 +192,8 @@ void OptionsScreenVideo::loadedFromFile()
void OptionsScreenVideo::init() void OptionsScreenVideo::init()
{ {
if (StateManager::get()->getGameState() == GUIEngine::MENU)
GUIEngine::getDevice()->setResizable(true);
Screen::init(); Screen::init();
m_prev_adv_pipline = UserConfigParams::m_dynamic_lights; m_prev_adv_pipline = UserConfigParams::m_dynamic_lights;
m_prev_img_quality = getImageQuality(); m_prev_img_quality = getImageQuality();
@ -745,6 +747,8 @@ void OptionsScreenVideo::eventCallback(Widget* widget, const std::string& name,
void OptionsScreenVideo::tearDown() void OptionsScreenVideo::tearDown()
{ {
if (StateManager::get()->getGameState() == GUIEngine::MENU)
GUIEngine::getDevice()->setResizable(false);
#ifndef SERVER_ONLY #ifndef SERVER_ONLY
if (m_prev_adv_pipline != UserConfigParams::m_dynamic_lights && if (m_prev_adv_pipline != UserConfigParams::m_dynamic_lights &&
CVS->isGLSL()) CVS->isGLSL())