mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-11 15:40:39 +00:00
Select the current resolution in resolution list on game start (Fixes #2768)
This commit is contained in:
parent
d22f8703e5
commit
f1b52c964a
@ -233,6 +233,7 @@ namespace MWGui
|
|||||||
if (mResolutionList->findItemIndexWith(str) == MyGUI::ITEM_NONE)
|
if (mResolutionList->findItemIndexWith(str) == MyGUI::ITEM_NONE)
|
||||||
mResolutionList->addItem(str);
|
mResolutionList->addItem(str);
|
||||||
}
|
}
|
||||||
|
highlightCurrentResolution();
|
||||||
|
|
||||||
std::string tf = Settings::Manager::getString("texture filtering", "General");
|
std::string tf = Settings::Manager::getString("texture filtering", "General");
|
||||||
mTextureFilteringButton->setCaption(textureFilteringToStr(tf));
|
mTextureFilteringButton->setCaption(textureFilteringToStr(tf));
|
||||||
@ -299,8 +300,28 @@ namespace MWGui
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SettingsWindow::onResolutionCancel()
|
void SettingsWindow::onResolutionCancel()
|
||||||
|
{
|
||||||
|
highlightCurrentResolution();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SettingsWindow::highlightCurrentResolution()
|
||||||
{
|
{
|
||||||
mResolutionList->setIndexSelected(MyGUI::ITEM_NONE);
|
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)
|
void SettingsWindow::onShadowTextureSizeChanged(MyGUI::ComboBox *_sender, size_t pos)
|
||||||
|
@ -59,6 +59,7 @@ namespace MWGui
|
|||||||
void onResolutionSelected(MyGUI::ListBox* _sender, size_t index);
|
void onResolutionSelected(MyGUI::ListBox* _sender, size_t index);
|
||||||
void onResolutionAccept();
|
void onResolutionAccept();
|
||||||
void onResolutionCancel();
|
void onResolutionCancel();
|
||||||
|
void highlightCurrentResolution();
|
||||||
|
|
||||||
void onShadowTextureSizeChanged(MyGUI::ComboBox* _sender, size_t pos);
|
void onShadowTextureSizeChanged(MyGUI::ComboBox* _sender, size_t pos);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user