mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 12:53:53 +00:00
Select the current resolution in resolution list on game start (Fixes #2768)
This commit is contained in:
parent
d22f8703e5
commit
f1b52c964a
2 changed files with 22 additions and 0 deletions
|
@ -233,6 +233,7 @@ namespace MWGui
|
|||
if (mResolutionList->findItemIndexWith(str) == MyGUI::ITEM_NONE)
|
||||
mResolutionList->addItem(str);
|
||||
}
|
||||
highlightCurrentResolution();
|
||||
|
||||
std::string tf = Settings::Manager::getString("texture filtering", "General");
|
||||
mTextureFilteringButton->setCaption(textureFilteringToStr(tf));
|
||||
|
@ -299,8 +300,28 @@ namespace MWGui
|
|||
}
|
||||
|
||||
void SettingsWindow::onResolutionCancel()
|
||||
{
|
||||
highlightCurrentResolution();
|
||||
}
|
||||
|
||||
void SettingsWindow::highlightCurrentResolution()
|
||||
{
|
||||
mResolutionList->setIndexSelected(MyGUI::ITEM_NONE);
|
||||
|
||||
int currentX = Settings::Manager::getInt("resolution x", "Video");
|
||||
int currentY = Settings::Manager::getInt("resolution y", "Video");
|
||||
|
||||
for (size_t i=0; i<mResolutionList->getItemCount(); ++i)
|
||||
{
|
||||
int resX, resY;
|
||||
parseResolution (resX, resY, mResolutionList->getItemNameAt(i));
|
||||
|
||||
if (resX == currentX && resY == currentY)
|
||||
{
|
||||
mResolutionList->setIndexSelected(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsWindow::onShadowTextureSizeChanged(MyGUI::ComboBox *_sender, size_t pos)
|
||||
|
|
|
@ -59,6 +59,7 @@ namespace MWGui
|
|||
void onResolutionSelected(MyGUI::ListBox* _sender, size_t index);
|
||||
void onResolutionAccept();
|
||||
void onResolutionCancel();
|
||||
void highlightCurrentResolution();
|
||||
|
||||
void onShadowTextureSizeChanged(MyGUI::ComboBox* _sender, size_t pos);
|
||||
|
||||
|
|
Loading…
Reference in a new issue