mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 02:15:32 +00:00
Use first resolution in fullscreen if current is not supported (Fixes #4113)
This commit is contained in:
parent
64e27c032b
commit
5b10e3128e
1 changed files with 13 additions and 6 deletions
|
@ -353,24 +353,31 @@ namespace MWGui
|
|||
}
|
||||
|
||||
bool supported = false;
|
||||
int fallbackX = 0, fallbackY = 0;
|
||||
for (unsigned int i=0; i<mResolutionList->getItemCount(); ++i)
|
||||
{
|
||||
std::string resStr = mResolutionList->getItemNameAt(i);
|
||||
int resX, resY;
|
||||
parseResolution (resX, resY, resStr);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
fallbackX = resX;
|
||||
fallbackY = resY;
|
||||
}
|
||||
|
||||
if (resX == Settings::Manager::getInt("resolution x", "Video")
|
||||
&& resY == Settings::Manager::getInt("resolution y", "Video"))
|
||||
supported = true;
|
||||
}
|
||||
|
||||
if (!supported)
|
||||
if (!supported && mResolutionList->getItemCount())
|
||||
{
|
||||
std::string msg = "This resolution is not supported in Fullscreen mode. Please select a resolution from the list.";
|
||||
MWBase::Environment::get().getWindowManager()->
|
||||
messageBox(msg);
|
||||
_sender->castType<MyGUI::Button>()->setCaption(off);
|
||||
return;
|
||||
if (fallbackX != 0 && fallbackY != 0)
|
||||
{
|
||||
Settings::Manager::setInt("resolution x", "Video", fallbackX);
|
||||
Settings::Manager::setInt("resolution y", "Video", fallbackY);
|
||||
}
|
||||
}
|
||||
|
||||
mWindowBorderButton->setEnabled(!newState);
|
||||
|
|
Loading…
Reference in a new issue