Merge branch 'resolution' into 'master'

Improve window mode change

Closes #7087

See merge request OpenMW/openmw!2530
iwyu_full
psi29a 2 years ago
commit ba2ececa93

@ -36,6 +36,7 @@
Feature #6983: PCVisionBonus script functions
Feature #6995: Localize the "show effect duration" option
Feature #7058: Implement TestModels (T3D) console command
Feature #7087: Block resolution change in the Windowed Fullscreen mode
0.48.0
------

@ -267,6 +267,7 @@ namespace MWGui
getWidget(mWaterRainRippleDetail, "WaterRainRippleDetail");
getWidget(mPrimaryLanguage, "PrimaryLanguage");
getWidget(mSecondaryLanguage, "SecondaryLanguage");
getWidget(mWindowModeHint, "WindowModeHint");
getWidget(mLightingMethodButton, "LightingMethodButton");
getWidget(mLightsResetButton, "LightsResetButton");
getWidget(mMaxLights, "MaxLights");
@ -379,6 +380,8 @@ namespace MWGui
mWindowBorderButton->setEnabled(
windowMode != Settings::WindowMode::Fullscreen && windowMode != Settings::WindowMode::WindowedFullscreen);
mWindowModeHint->setVisible(windowMode == Settings::WindowMode::WindowedFullscreen);
mKeyboardSwitch->setStateSelected(true);
mControllerSwitch->setStateSelected(false);
@ -564,7 +567,24 @@ namespace MWGui
if (pos == MyGUI::ITEM_NONE)
return;
Settings::Manager::setInt("window mode", "Video", static_cast<int>(_sender->getIndexSelected()));
int index = static_cast<int>(_sender->getIndexSelected());
if (index == static_cast<size_t>(Settings::WindowMode::WindowedFullscreen))
{
mResolutionList->setEnabled(false);
mWindowModeHint->setVisible(true);
}
else
{
mResolutionList->setEnabled(true);
mWindowModeHint->setVisible(false);
}
if (index == static_cast<size_t>(Settings::WindowMode::Windowed))
mWindowBorderButton->setEnabled(true);
else
mWindowBorderButton->setEnabled(false);
Settings::Manager::setInt("window mode", "Video", index);
apply();
}
@ -644,6 +664,12 @@ namespace MWGui
apply();
}
void SettingsWindow::onResChange(int width, int height)
{
center();
highlightCurrentResolution();
}
void SettingsWindow::onSliderChangePosition(MyGUI::ScrollBar* scroller, size_t pos)
{
if (getSettingType(scroller) == "Slider")
@ -839,6 +865,9 @@ namespace MWGui
mWindowBorderButton->setEnabled(false);
}
if (index == static_cast<size_t>(Settings::WindowMode::WindowedFullscreen))
mResolutionList->setEnabled(false);
}
void SettingsWindow::layoutControlsBox()

@ -20,7 +20,7 @@ namespace MWGui
void updateWindowModeSettings();
void onResChange(int, int) override { center(); }
void onResChange(int, int) override;
protected:
MyGUI::TabControl* mSettingsTab;
@ -43,6 +43,8 @@ namespace MWGui
MyGUI::ComboBox* mPrimaryLanguage;
MyGUI::ComboBox* mSecondaryLanguage;
MyGUI::Widget* mWindowModeHint;
// controls
MyGUI::ScrollView* mControlsBox;
MyGUI::Button* mResetControlsButton;

@ -62,5 +62,6 @@ WaterShaderTextureQuality: "Texture quality"
WindowBorder: "Window Border"
WindowMode: "Window Mode"
WindowModeFullscreen: "Fullscreen"
WindowModeHint: "Hint: the Windowed Fullscreen mode\nalways uses a native screen resolution."
WindowModeWindowed: "Windowed"
WindowModeWindowedFullscreen: "Windowed Fullscreen"

@ -62,5 +62,6 @@ WaterShaderTextureQuality: "Качество текстуры воды"
WindowBorder: "Рамка окна"
WindowMode: "Режим окна"
WindowModeFullscreen: "Полный экран"
WindowModeHint: "Подсказка: режим Оконный без полей\nвсегда использует родное разрешение экрана."
WindowModeWindowed: "Оконный"
WindowModeWindowedFullscreen: "Оконный без полей"

@ -275,7 +275,7 @@
<Property key="ButtonAutoWidth" value="true"/>
<Widget type="TabItem">
<Property key="Caption" value=" #{sVideo} "/>
<Widget type="ListBox" skin="MW_List" position="0 4 185 215" align="Left Top" name="ResolutionList"/>
<Widget type="ListBox" skin="MW_List" position="0 4 185 225" align="Left Top" name="ResolutionList"/>
<Widget type="TextBox" skin="NormalText" position="197 4 185 18" align="Left Top">
<Property key="Caption" value="#{SettingsMenu:WindowMode}"/>
</Widget>
@ -323,10 +323,13 @@
<Widget type="AutoSizedTextBox" skin="SandText" position="197 154 300 32" align="Left Top">
<Property key="Caption" value="#{SettingsMenu:FrameRateHint}"/>
</Widget>
<Widget type="AutoSizedTextBox" skin="SandText" position="197 196 300 32" align="Left Top" name="WindowModeHint">
<Property key="Caption" value="#{SettingsMenu:WindowModeHint}"/>
</Widget>
<Widget type="TextBox" skin="NormalText" position="0 228 352 18" align="Left Top" name="FovText">
<Widget type="TextBox" skin="NormalText" position="0 238 352 18" align="Left Top" name="FovText">
</Widget>
<Widget type="ScrollBar" skin="MW_HScroll" position="0 252 352 18" align="HStretch Top">
<Widget type="ScrollBar" skin="MW_HScroll" position="0 262 352 18" align="HStretch Top">
<Property key="Range" value="81"/>
<Property key="Page" value="1"/>
<UserString key="SettingType" value="Slider"/>
@ -338,18 +341,18 @@
<UserString key="SettingLabelWidget" value="FovText"/>
<UserString key="SettingLabelCaption" value="#{SettingsMenu:FieldOfView} (%s)"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="0 276 352 18" align="Left Top">
<Widget type="TextBox" skin="SandText" position="0 286 352 18" align="Left Top">
<Property key="Caption" value="#{sLow}"/>
<Property key="TextAlign" value="Left"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="0 276 352 18" align="Right Top">
<Widget type="TextBox" skin="SandText" position="0 286 352 18" align="Right Top">
<Property key="Caption" value="#{sHigh}"/>
<Property key="TextAlign" value="Right"/>
</Widget>
<Widget type="TextBox" skin="NormalText" position="0 298 352 18" align="Left Top" name="GammaText">
<Widget type="TextBox" skin="NormalText" position="0 308 352 18" align="Left Top" name="GammaText">
<Property key="Caption" value="#{sGamma_Correction}"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HScroll" position="0 322 352 18" align="HStretch Top" name="GammaSlider">
<Widget type="ScrollBar" skin="MW_HScroll" position="0 332 352 18" align="HStretch Top" name="GammaSlider">
<Property key="Range" value="10000"/>
<Property key="Page" value="300"/>
<UserString key="SettingType" value="Slider"/>
@ -359,11 +362,11 @@
<UserString key="SettingMin" value="0.1"/>
<UserString key="SettingMax" value="3.0"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="0 346 352 18" align="Left Top" name="GammaTextDark">
<Widget type="TextBox" skin="SandText" position="0 356 352 18" align="Left Top" name="GammaTextDark">
<Property key="Caption" value="#{sDark_Gamma}"/>
<Property key="TextAlign" value="Left"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="0 346 352 18" align="Right Top" name="GammaTextLight">
<Widget type="TextBox" skin="SandText" position="0 356 352 18" align="Right Top" name="GammaTextLight">
<Property key="Caption" value="#{sLight_Gamma}"/>
<Property key="TextAlign" value="Right"/>
</Widget>

Loading…
Cancel
Save