Ignore:
Timestamp:
03/07/11 20:24:45 (8 years ago)
Author:
aspidites
Message:

Patch by Aspidites:

-Available Resolutions are selectable in Settings menu

Location:
branches/active/character_customization/game/parpg
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/active/character_customization/game/parpg/gui/hud.py

    r797 r801  
    230230 
    231231    def initializeSettingsMenu(self): 
    232         self.settings_menu = SettingsMenu(self.settings) 
     232        self.settings_menu = SettingsMenu(self.engine, self.settings) 
    233233 
    234234    def displaySettings(self): 
  • branches/active/character_customization/game/parpg/gui/menus.py

    r796 r801  
    1414#   along with PARPG.  If not, see <http://www.gnu.org/licenses/>. 
    1515 
     16import logging 
     17 
    1618from fife.extensions import pychan 
    1719from dialogs import RestartDialog 
     20 
     21logger = logging.getLogger('menus') 
    1822 
    1923class ContextMenu(object): 
     
    6872         
    6973class SettingsMenu(object): 
    70     def __init__(self, settings): 
     74    def __init__(self, engine, settings): 
     75        self.engine = engine 
    7176        self.settings = settings 
    7277 
     
    7580 
    7681        # available options 
    77         self.resolutions =  ['640x480', '800x600', '1024x768', '1280x800',  
    78                              '1440x900'] 
     82        screen_modes = self.engine.getDeviceCaps().getSupportedScreenModes() 
     83        resolutions = list(set([(mode.getWidth(), mode.getHeight()) 
     84                                for mode in screen_modes])) 
     85        self.resolutions = ["{0}x{1}".format(item[0], item[1]) 
     86                            for item in sorted(resolutions)[1:]] 
     87 
    7988        self.render_backends = ['OpenGL', 'SDL'] 
    8089        self.lighting_models = range(3) 
  • branches/active/character_customization/game/parpg/mainmenuview.py

    r796 r801  
    123123 
    124124    def initializeSettingsMenu(self): 
    125         self.settings_menu = SettingsMenu(self.model.settings) 
     125        self.settings_menu = SettingsMenu(self.engine, self.model.settings) 
    126126 
    127127    def displaySettings(self): 
Note: See TracChangeset for help on using the changeset viewer.