comparison settings.py @ 4:bf1dd9c24a7e

Scrolling by keyboard is now possible. * Patch by DomtronVox. * Added scrolling with the arrow keys. * Added a slider bar in the settings menu to allow players to set the scrolling speed. * Fixed an error that occurred when the ok button in settings was pressed. * There is some kind of focus issue where opening the settings menu in-game causes scrolling to be disabled. Workaround is to change the scroll speed setting whenever you open the settings menu.
author DomtronVox
date Fri, 17 Jun 2011 14:49:48 -1000
parents 4912a6f97c52
children 76041ed90a5d
comparison
equal deleted inserted replaced
3:06be71be07f1 4:bf1dd9c24a7e
265 if filename is None: 265 if filename is None:
266 filename = os.path.join(self.paths['user'], 266 filename = os.path.join(self.paths['user'],
267 'user{0}'.format(self.suffix)) 267 'user{0}'.format(self.suffix))
268 268
269 for section in self.sections: 269 for section in self.sections:
270
270 if '[{0}]\n'.format(section) not in self.settings_file: 271 if '[{0}]\n'.format(section) not in self.settings_file:
271 self.settings_file.append('\n[{0}]\n'.format(section)) 272 self.settings_file.append('\n[{0}]\n'.format(section))
272 for option, value in getattr(self, section).options.iteritems(): 273 for option, value in getattr(self, section).options.iteritems():
273 template = '{0} = {1}\n'.format(option, value) 274 template = '{0} = {1}\n'.format(option, value)
274 self.settings_file.append(template) 275 self.settings_file.append(template)
307 """ Returns a list of existing sections""" 308 """ Returns a list of existing sections"""
308 sections = self.__dict__.keys() 309 sections = self.__dict__.keys()
309 sections.pop(sections.index('settings_file')) 310 sections.pop(sections.index('settings_file'))
310 sections.pop(sections.index('paths')) 311 sections.pop(sections.index('paths'))
311 sections.pop(sections.index('suffix')) 312 sections.pop(sections.index('suffix'))
313 sections.pop(sections.index('filename'))
312 314
313 return sections 315 return sections
314 316
315 @property 317 @property
316 def system_path(self): 318 def system_path(self):
449 # File to use for down cursor (filename) 451 # File to use for down cursor (filename)
450 CursorDown = cursor_down.png 452 CursorDown = cursor_down.png
451 453
452 # File to use for left cursor (filename) 454 # File to use for left cursor (filename)
453 CursorLeft = cursor_left.png 455 CursorLeft = cursor_left.png
456
457 # how many pixles to move the camera per time frame (digit)
458 ScrollSpeed = 1.0
454 459
455 # Player walk speed (digit) 460 # Player walk speed (digit)
456 PCSpeed = 3\ 461 PCSpeed = 3\
457 """ 462 """
458 463