Changeset 89 for trunk/PARPG/scripts


Ignore:
Timestamp:
06/05/09 01:35:18 (11 years ago)
Author:
bretzel_parpg
Message:

Added a button that sets all the options to default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PARPG/scripts/hud.py

    r80 r89  
    55import pychan 
    66from pychan.tools import callbackWithArguments as cbwa 
     7import shutil 
    78 
    89"""Main Hud class""" 
     
    5758    def initializeOptionsMenu(self): 
    5859        """Initalize the options menu""" 
     60 
    5961        self.options_menu = pychan.loadXML("gui/hud_options.xml") 
    6062        self.options_events = {"applyButton":self.applyOptions, 
    61                                "closeButton":self.options_menu.hide} 
     63                               "closeButton":self.options_menu.hide, 
     64                               "defaultsButton":self.setToDefaults} 
    6265 
    6366        self.Resolutions = ['640x480', '800x600', '1024x768', '1280x1024', '1440x900'] 
     
    7982        self.options_menu.mapEvents(self.options_events) 
    8083 
     84    def setToDefaults(self): 
     85        shutil.copyfile('settings-dist.xml', 'settings.xml') 
     86        self.requireRestartDialog() 
     87        self.options_menu.hide() 
     88 
    8189 
    8290    def refreshActionsBox(self): 
Note: See TracChangeset for help on using the changeset viewer.