Ignore:
Timestamp:
08/14/10 21:49:10 (9 years ago)
Author:
beliar
Message:

Ticket #118: Patch by Beliar

  • Added a simple main menu
  • Removed unnnecessary und harmful calls to pychan.init() in hud.py and popups.py
  • Moved methods from GameSceneController? to ControllerBase? that set/reset the mouse cursor

fixes[s:trac, t:118]

File:
1 edited

Legend:

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

    r642 r648  
    9797                                                                  "*.ogg"))) 
    9898                self.view.sounds.playMusic(music_file)  
    99  
     99        self.initHud() 
     100                 
    100101 
    101102    def initHud(self): 
     
    162163            self.model.active_map.centerCameraOnPlayer()  
    163164     
    164     def setMouseCursor(self, image, dummy_image, mc_type="native"):  
    165         """Set the mouse cursor to an image. 
    166            @type image: string 
    167            @param image: The image you want to set the cursor to 
    168            @type dummy_image: string 
    169            @param dummy_image: ??? 
    170            @type type: string 
    171            @param type: ??? 
    172            @return: None""" 
    173         cursor = self.engine.getCursor() 
    174         cursor_type = fife.CURSOR_IMAGE 
    175         img_pool = self.engine.getImagePool() 
    176         if(mc_type == "target"): 
    177             target_cursor_id = img_pool.addResourceFromFile(image)   
    178             dummy_cursor_id = img_pool.addResourceFromFile(dummy_image) 
    179             cursor.set(cursor_type, dummy_cursor_id) 
    180             cursor.setDrag(cursor_type, target_cursor_id, -16, -16) 
    181         else: 
    182             cursor_type = fife.CURSOR_IMAGE 
    183             zero_cursor_id = img_pool.addResourceFromFile(image) 
    184             cursor.set(cursor_type, zero_cursor_id) 
    185             cursor.setDrag(cursor_type, zero_cursor_id) 
    186  
    187     def resetMouseCursor(self): 
    188         """Reset cursor to default image. 
    189            @return: None""" 
    190         image = self.model.settings.get("PARPG", "CursorDefault") 
    191         self.setMouseCursor(image, image) 
    192          
    193165    def mouseReleased(self, evt): 
    194166        """If a mouse button is released, fife calls this routine. 
Note: See TracChangeset for help on using the changeset viewer.