source: branches/active/character_customization/game/parpg/gui/charactercreationview.py @ 833

Revision 785, 1.0 KB checked in by technomage, 9 years ago (diff)

Patch by Technomage

  • Mostly finished the character creation GUI in gui/character_screen.xml - still needs a few cosmetic touch-ups and it hasn't been tested with stats, traits, and skills lists yet;
  • Added a new CharacterCreationView? class in parpg/gui/charactercreationview.py which should be used by the CharacterCreationController? to display the character creation GUI. It is mostly a skeleton at this point, however, and it hasn't been integrated with the controller yet;
  • Fixed a few graphical glitches in the Spinner widget in parpg/gui/spinners.py that caused the text field to be positioned incorrectly;
  • Added a few new properties to the Spinner widget, including background_color, min_size and max_size, which override the inherited properties. Spinner widgets that uses these properties should now behave in a much more intuitive way;
  • Re-sized the gui/notebook/notebook_background.png background image to 800x600 to accommodate tab-buttons on the edges of the notebook;
  • Added a new widget, TabWidget?, which consists of a view that has tabs which can switch between the various views. Views in a TabWidget? can be added in XML as child tags whose name attribute ends up as the tab text;
  • Added two new size fonts to fonts/oldtypewriter.fontdef, 9 pt and 10 pt;
Line 
1from fife.extensions import pychan
2from fife.extensions.pychan.widgets import Label, HBox
3
4from parpg.gui.spinner import IntSpinner
5
6class CharacterCreationView(object):
7    def __init__(self, xml_script_path='gui/character_creation.xml'):
8        self.gui = pychan.loadXML(xml_script_path)
9   
10    def createStatisticList(self, statistics):
11        statistics_list = self.gui.findChild(name='statisticsList')
12        # Start with an empty list.
13        statistics_list.removeAllChildren()
14        for statistic in statistics:
15            name = statistic.long_name
16            hbox = HBox()
17            hbox.opaque = 0
18            label = Label(text=name)
19            spinner = IntSpinner(lower_limit=0, upper_limit=100)
20            hbox.addChildren(label, spinner)
21            statistics_list.addChildren(hbox)
22   
23    def createTraitsList(self, traits):
24        pass
25   
26    def updateMessageArea(self, message):
27        message_area = self.gui.findChild(name='messageArea')
28        message_area.text = unicode(message)
Note: See TracBrowser for help on using the repository browser.