Changeset 626


Ignore:
Timestamp:
08/05/10 23:41:04 (9 years ago)
Author:
domtron_vox
Message:

Patch by domtron_vox.
Enabled the use of the new cursor images by Q_x.
-Altered settings-dist.xml to point to the 5 images for cursors.
-Altered updateMouse to set the cursor image for the direction it's scrolling
-resetMouseCursor now runs setMouseCursor with the new default cursor image.

Location:
trunk/game
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/gamescenecontroller.py

    r621 r626  
    7070                                          lambda: self.view.moveCamera \ 
    7171                                                   (self.scroll_direction))     
     72         
     73        #this is temporary untill we can set the native cursor 
     74        self.resetMouseCursor() 
     75         
    7276 
    7377        if model.settings.get("FIFE",  "PlaySounds"): 
     
    165169        """Reset cursor to default image. 
    166170           @return: None""" 
    167         c = self.engine.getCursor() 
    168         cursor_type = fife.CURSOR_NATIVE 
    169         # this is the path to the default image 
    170         cursor_id = self.original_cursor_id 
    171         c.setDrag(cursor_type, cursor_id) 
    172         c.set(cursor_type, cursor_id) 
     171        image = self.model.settings.get("PARPG", "CursorDefault") 
     172        self.setMouseCursor(image, image) 
    173173         
    174174    def mouseReleased(self, evt): 
     
    240240        mouse_y = self.last_mousecoords.y 
    241241        screen_height = self.model.engine.getSettings().getScreenHeight() 
    242   
     242         
     243        image = None 
     244        settings = self.model.settings 
     245         
     246         
    243247        #edge logic 
    244248        self.scroll_direction = [0, 0] 
     
    248252            direction[0] += 1 
    249253            direction[1] -= 1 
     254            image = settings.get("PARPG", "CursorUp") 
     255             
    250256        #right 
    251257        if mouse_x >= screen_width - pixle_edge: 
    252258            direction[0] += 1 
    253259            direction[1] += 1 
     260            image = settings.get("PARPG", "CursorRight") 
     261             
    254262        #down 
    255263        if mouse_y >= screen_height - pixle_edge: 
    256264            direction[0] -= 1 
    257265            direction[1] += 1 
     266            image = settings.get("PARPG", "CursorDown") 
     267             
    258268        #left 
    259269        if mouse_x <= pixle_edge: 
    260270            direction[0] -= 1 
    261271            direction[1] -= 1 
     272            image = settings.get("PARPG", "CursorLeft") 
     273         
     274        if image != None: 
     275            self.setMouseCursor(image, image) 
    262276        
    263277 
     
    394408            if self.scroll_direction != [0,0]: 
    395409                self.scroll_timer.start() 
    396             else: self.scroll_timer.stop() 
    397              
     410            else:  
     411                self.scroll_timer.stop() 
     412                self.resetMouseCursor() 
     413                 
    398414        self.handleCommands() 
    399415        # print "%05f" % (time.time()-t0,) 
  • trunk/game/settings-dist.xml

    r578 r626  
    2222        <Setting name="ImageChunkSize" type="int">256</Setting> 
    2323   </Module> 
    24     <Module name="PARPG"> 
    25         <Setting name="Map" type="str">Mall</Setting> 
    26         <Setting name="ObjectDatabaseFile" type="str">objects/object_database.yaml</Setting> 
    27         <Setting name="MapsFile" type = "str">maps/maps.yaml</Setting> 
    28         <Setting name="AllAgentsFile" type = "str">maps/all_agents.yaml</Setting> 
    29         <Setting name="AgentsDirectory" type="str">objects/</Setting> 
    30         <Setting name="DialoguesDirectory" type="str">dialogue/</Setting> 
    31         <Setting name="QuestsDirectory" type="str">quests/</Setting>         
    32         <Setting name="PCSpeed" type="int">3</Setting> 
    33    </Module> 
     24  <Module name="PARPG"> 
     25    <Setting name="Map" type="str">Mall</Setting> 
     26    <Setting name="ObjectDatabaseFile" type="str">objects/object_database.yaml</Setting> 
     27    <Setting name="MapsFile" type="str">maps/maps.yaml</Setting> 
     28    <Setting name="AllAgentsFile" type="str">maps/all_agents.yaml</Setting> 
     29    <Setting name="AgentsDirectory" type="str">objects/</Setting> 
     30    <Setting name="CursorDirectory" type="str">gui/cursors/</Setting> 
     31    <Setting name="CursorDefault" type="str">gui/cursors/cursor_plain.png</Setting> 
     32    <Setting name="CursorUp" type="str">gui/cursors/cursor_up.png</Setting> 
     33    <Setting name="CursorRight" type="str">gui/cursors/cursor_right.png</Setting> 
     34    <Setting name="CursorDown" type="str">gui/cursors/cursor_down.png</Setting> 
     35    <Setting name="CursorLeft" type="str">gui/cursors/cursor_left.png</Setting> 
     36    <Setting name="DialoguesDirectory" type="str">dialogue/</Setting> 
     37    <Setting name="QuestsDirectory" type="str">quests/</Setting> 
     38    <Setting name="PCSpeed" type="int">3</Setting> 
     39  </Module> 
    3440</Settings> 
Note: See TracChangeset for help on using the changeset viewer.