Changeset 771


Ignore:
Timestamp:
03/01/11 21:31:41 (8 years ago)
Author:
aspidites
Message:

Patch by Technomage

  • Added a loadFonts method to PARPGApplication which is called upon instantiation and loads all .fontdef files used to define fonts for PyChan?;

Patch by Technomage

  • Fixed a bug in my last commit that caused the game to crash becase a) it was reading the wrong settings section and b) it was using pychan.loadFont instead of pychange.loadFonts;

Ticket #305: Patch by beliar.
Additions to the public interface of the CharacterCreationController? class:

  • Added read-only properties for name, age, gender, origin and picture.
  • Added getStatisticValue method to get the value of a primary or secondary statistic.

Note that these do not return the actual value at the moment, as there are no values stored yet.

Patch by Aspidites:

+ fixed bug caused by an object not having a description

Patch by Aspidites:

  • started integrating settings.py into current modules.

Patch by Aspidites

+ resolved conflicts before merging my setings branch

Patch by Aspidites

+ added quotes back to FontGlyphs? option

Patch by Aspidites

+ added FontsDirectory? back to config file (which is now settings.ini

Patch by Aspidites

  • I'm really getting tired of merging the same changes repeatedly
Location:
branches/active/character_customization/game
Files:
3 edited

Legend:

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

    r766 r771  
    1 #!/usr/bin/env python 
    2  
    31#   This program is free software: you can redistribute it and/or modify 
    42#   it under the terms of the GNU General Public License as published by 
     
    3331from parpg.common.listeners.console_executor import ConsoleExecuter 
    3432from parpg.common.listeners.widget_listener import WidgetListener 
    35  
    3633 
    3734class KeyFilter(fife.IKeyFilter): 
     
    191188 
    192189    def createListener(self): 
    193         """ __init__ takes care of the event listener, basicapplication's  
    194            createListener is only harmful. Without overriding it, the program 
    195            quit's on esc press, rather than invoking the main menu. 
     190        """ __init__ takes care of creating an event listener, so 
     191            basicapplication's createListener is harmful. Without  
     192            overriding it, the program quit's on esc press, rather than 
     193            invoking the main menu 
    196194        """ 
    197195        pass 
  • branches/active/character_customization/game/parpg/settings.py

    r769 r771  
    9090        """ 
    9191        try: 
     92<<<<<<< HEAD 
    9293            return dict((key, value[1:-1]) for (key, value) in  
    9394                        object.__getattribute__(self, option) if 
     
    9798        """ 
    9899        #return object.__getattribute__(self, option) 
     100======= 
     101            return self.__dict__[option] 
     102        except KeyError: 
     103            return None 
     104>>>>>>> 3ed9b3f... Patch by Aspidites: 
    99105 
    100106    def options(self): 
     
    105111            options.pop('name') 
    106112 
    107         return options 
    108  
     113        return options.keys() 
     114 
     115<<<<<<< HEAD 
     116======= 
     117#TODO: remember config filenames/paths 
     118#TODO: remove hard-coded settings filename/path 
     119>>>>>>> 3ed9b3f... Patch by Aspidites: 
    109120class Settings(object): 
    110121    """ An object that represents a settings file, its sectons, 
     
    133144        """ 
    134145 
     146<<<<<<< HEAD 
    135147        self.settings_file = '' 
    136148        self.paths = kwargs.get('paths', None) 
     
    141153        else: 
    142154            self.paths = '.' 
     155======= 
     156        self.config_file = '' 
     157 
     158        if hasattr(filenames, 'split'): 
     159            self.read(filenames) 
     160        else: 
     161            for filename in filenames: 
     162                self.read(filename) 
     163>>>>>>> 3ed9b3f... Patch by Aspidites: 
    143164 
    144165    def __getattr__(self, name): 
     
    255276         
    256277        return sections 
     278<<<<<<< HEAD 
     279======= 
     280 
     281    # backward compatibility methods 
     282    def get(self, section, option, default=None): 
     283        """ Returns the value of the requested option located in the 
     284            requested section. 
     285 
     286            This method is provided strictly for backwards                    
     287            compatibility be deprecated in future versions. 
     288  
     289            @param section: the section in which the option is located in 
     290            @type section: string 
     291            @param option: the option being requested 
     292            @type section: string 
     293            @param default: the default value to return if a section's option 
     294                is not defined 
     295            @type section: any valid object 
     296        """ 
     297        value = getattr(getattr(self, section), option) 
     298        if value is None and default is not None: 
     299            return default 
     300        else: 
     301            return value 
     302 
     303    def getScreenWidth(self): 
     304        return self.FIFE.ScreenWidth 
     305 
     306    def getScreenHeight(self): 
     307        return self.FIFE.ScreenHeight 
     308>>>>>>> 3ed9b3f... Patch by Aspidites: 
  • branches/active/character_customization/game/settings.ini

    r752 r771  
    1414WindowTitle = PARPG Demo 
    1515WindowIcon = gui/icons/window_icon.png 
     16FontsDirectory = fonts/ 
    1617Font = fonts/oldtypewriter.ttf 
    1718FontsDirectory = fonts/ 
Note: See TracChangeset for help on using the changeset viewer.