Changeset 653 for trunk/game/scripts


Ignore:
Timestamp:
09/20/10 21:53:36 (9 years ago)
Author:
beliar
Message:

Patch by Beliar.

  • Added a class for the action box at the bottom of the screen and replaced the sections in hud.py to use this instead. Currently it does the same as before but this may change.
  • Fixed svn eol_style properties of sever python scripts
Location:
trunk/game/scripts
Files:
1 added
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/common/listeners/__init__.py

    • Property svn:eol-style set to native
  • trunk/game/scripts/common/listeners/command_listener.py

    • Property svn:eol-style set to native
  • trunk/game/scripts/common/listeners/console_executor.py

    • Property svn:eol-style set to native
  • trunk/game/scripts/common/listeners/key_listener.py

    • Property svn:eol-style set to native
  • trunk/game/scripts/common/listeners/mouse_listener.py

    • Property svn:eol-style set to native
  • trunk/game/scripts/common/listeners/widget_listener.py

    • Property svn:eol-style set to native
  • trunk/game/scripts/controllerbase.py

    • Property svn:eol-style set to native
  • trunk/game/scripts/dialoguecontroller.py

    • Property svn:eol-style set to native
  • trunk/game/scripts/dialoguevalidator.py

    • Property svn:eol-style set to native
  • trunk/game/scripts/gui/__init__.py

    • Property svn:eol-style set to native
  • trunk/game/scripts/gui/containergui.py

    • Property svn:eol-style set to native
  • trunk/game/scripts/gui/containergui_base.py

    • Property svn:eol-style set to native
  • trunk/game/scripts/gui/hud.py

    r652 r653  
    2626from scripts.gui.dialoguegui import DialogueGUI 
    2727from scripts.gui import drag_drop_data as data_drag 
     28from actionsbox import ActionsBox 
    2829 
    2930class Hud(object): 
     
    4445 
    4546        # TODO: perhaps this should not be hard-coded here 
     47        pychan.registerWidget(ActionsBox) 
    4648        self.hud = pychan.loadXML("gui/hud.xml") 
    4749        self.controller = controller 
     
    104106        ready3 = self.hud.findChild(name='hudReady3') 
    105107        ready4 = self.hud.findChild(name='hudReady4') 
    106         actions_scroll_area = self.hud.findChild(name='actionsScrollArea') 
    107108 
    108109        if (screen_width <=800) : 
     
    114115        ready3.position = (screen_width-180-gap, 7) 
    115116        ready4.position = (screen_width-120-gap, 7) 
    116         actions_scroll_area.position = (280+gap, 5) 
     117        self.actions_box.position = (280+gap, 5) 
    117118        actions_width = screen_width - 470 - 2*gap 
    118119 
    119         self.actions_box.min_width = actions_width 
    120         self.actions_box.max_width = actions_width 
     120        self.actions_box.ContentBox.min_width = actions_width 
     121        self.actions_box.ContentBox.max_width = actions_width 
    121122         
    122123        # and finally add an actions box 
    123         actions_scroll_area.min_size = (actions_width, 55) 
    124         actions_scroll_area.max_size = (actions_width, 55) 
     124        self.actions_box.min_size = (actions_width, 55) 
     125        self.actions_box.max_size = (actions_width, 55) 
    125126        # now it should be OK to display it all 
    126127        self.showHUD() 
    127128         
    128     def refreshActionsBox(self): 
    129         """Refresh the actions box so that it displays the contents of 
    130            self.actions_text 
    131            @return: None""" 
    132         self.actions_box.adaptLayout() 
    133         actions_scroll_area = self.actions_box.parent 
    134         actions_scroll_area.adaptLayout() 
    135         actions_scroll_area.vertical_scroll_amount = actions_scroll_area.getVerticalMaxScroll() 
    136  
    137129    def addAction(self, action): 
    138130        """Add an action to the actions box. 
    139131           @type action: (unicode) string 
    140132           @param action: The text that you want to display in the actions box 
    141            @return: None"""         
    142         if not type(action) is unicode: 
    143             action = unicode(action) 
    144         action_label = pychan.widgets.Label(text = action, wrap_text = True) 
    145         action_label.max_width = self.actions_box.width 
    146         self.actions_box.addChild(action_label) 
    147         self.refreshActionsBox() 
     133           @return: None"""     
     134        self.actions_box.addAction(action) 
    148135 
    149136    def showHUD(self): 
  • trunk/game/scripts/mainmenucontroller.py

    • Property svn:eol-style set to native
  • trunk/game/scripts/mainmenuview.py

    • Property svn:eol-style set to native
  • trunk/game/scripts/objects/items.py

    • Property svn:eol-style set to native
  • trunk/game/scripts/parpg.py

    • Property svn:eol-style set to native
  • trunk/game/scripts/quest_engine.py

    • Property svn:eol-style set to native
  • trunk/game/scripts/viewbase.py

    • Property svn:eol-style set to native
Note: See TracChangeset for help on using the changeset viewer.