DisplaySettingsDialog fix

This commit is contained in:
John 2015-08-14 16:47:05 +03:00
parent 0368de40e3
commit 699c54b40d

View file

@ -45,16 +45,16 @@ class DisplaySettingsDialog(DirectFrame, StateData.StateData):
self.anyChanged = 0 self.anyChanged = 0
self.apiChanged = 0 self.apiChanged = 0
if len(base.resDict[base.nativeRatio]) > 1: self.screenSizes = ((640, 480),
# We have resolutions that match our native ratio and fit it: (800, 600),
self.screenSizes = sorted(base.resDict[base.nativeRatio]) (1024, 768),
else: (1280, 720),
# Okay, we don't have any resolutions that match our native ratio (1280, 1024),
# and fit it (besides the native resolution itself, of course). (1440, 900),
# Let's just use the second largest ratio's resolutions: (1600, 900),
ratios = sorted(base.resDict.keys(), reverse=False) (1600, 1200),
nativeIndex = ratios.index(base.nativeRatio) (1920, 1080),
self.screenSizes = sorted(base.resDict[ratios[nativeIndex - 1]]) (2560, 1440))
guiButton = loader.loadModel('phase_3/models/gui/quit_button.bam') guiButton = loader.loadModel('phase_3/models/gui/quit_button.bam')
gui = loader.loadModel('phase_3.5/models/gui/friendslist_gui.bam') gui = loader.loadModel('phase_3.5/models/gui/friendslist_gui.bam')
@ -298,26 +298,12 @@ class DisplaySettingsDialog(DirectFrame, StateData.StateData):
self.current_pipe = base.pipe self.current_pipe = base.pipe
self.current_properties = WindowProperties(base.win.getProperties()) self.current_properties = WindowProperties(base.win.getProperties())
properties = self.current_properties properties = self.current_properties
if self.current_pipe == pipe and self.current_properties.getFullscreen() == fullscreen and self.current_properties.getXSize() == width and self.current_properties.getYSize() == height: if self.current_pipe == pipe and self.current_properties.getFullscreen() == fullscreen and self.current_properties.getXSize() == width and self.current_properties.getYSize() == height:
self.notify.info('DISPLAY NO CHANGE REQUIRED') self.notify.info('DISPLAY NO CHANGE REQUIRED')
state = True state = True
else: else:
properties = WindowProperties() properties = WindowProperties()
if fullscreen:
width, height = (base.nativeWidth, base.nativeHeight)
elif self.current_properties.getFullscreen():
if len(base.resDict[base.nativeRatio]) > 1:
# We have resolutions that match our native ratio and fit
# it! Let's use one:
width, height = sorted(base.resDict[base.nativeRatio])[0]
else:
# Okay, we don't have any resolutions that match our native
# ratio and fit it (besides the native resolution itself,
# of course). Let's just use one of the second largest
# ratio's resolutions:
ratios = sorted(base.resDict.keys(), reverse=False)
nativeIndex = ratios.index(base.nativeRatio)
width, height = sorted(base.resDict[ratios[nativeIndex - 1]])[0]
properties.setSize(width, height) properties.setSize(width, height)
properties.setFullscreen(fullscreen) properties.setFullscreen(fullscreen)
properties.setParentWindow(0) properties.setParentWindow(0)