Ignore:
Timestamp:
07/28/10 11:44:30 (9 years ago)
Author:
beliar
Message:

Ticket #233: Patch by Beliar.

fixes[s:trac, t:233]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/objects/action.py

    r599 r601  
    1616 
    1717#exceptions 
     18 
     19from scripts.gui import drag_drop_data as data_drag 
     20 
    1821class NoSuchQuestException(Exception): 
    1922    """NoQuestException is used when there is no active quest with the id""" 
     
    5154                else: 
    5255                    raise NoSuchQuestException 
     56            elif command == "ResetMouseCursor": 
     57                self.controller.resetMouseCursor() 
     58            elif command == "StopDragging": 
     59                data_drag.dragging = False 
    5360                 
    5461class ChangeMapAction(Action): 
     
    299306        self.view.hud.inventory.updateInventoryButtons() 
    300307        super(PickUpAction, self).execute() 
    301          
     308 
    302309class DropItemAction(Action): 
    303310    """Action for dropping an items on a map""" 
    304  
    305     def __init__(self, controller, item, container_gui, commands = None): 
     311    def __init__(self, controller, item, commands = None): 
    306312        super(DropItemAction, self).__init__(controller, commands) 
    307313        self.item = item 
    308         self.container_gui = container_gui 
    309  
     314         
    310315    def execute(self): 
    311316        item_data = self.item.getStateForSaving() 
     
    327332        self.model.placeAgents() 
    328333        self.item.in_container.takeItem(self.item)         
     334        super(DropItemAction, self).execute() 
     335         
     336class DropItemFromContainerAction(DropItemAction): 
     337    """Action for dropping an items from the Inventory to a map""" 
     338 
     339    def __init__(self, controller, item, container_gui, commands = None): 
     340        super(DropItemFromContainerAction, self).__init__(controller, item, commands) 
     341        self.container_gui = container_gui 
     342 
     343    def execute(self): 
     344        super(DropItemFromContainerAction, self).execute() 
    329345        self.container_gui.updateImages() 
    330         super(DropItemAction, self).execute() 
    331346 
    332347ACTIONS = {"ChangeMap":ChangeMapAction,  
     
    340355           "Use":UseAction, 
    341356           "PickUp":PickUpAction, 
    342            "Drop":DropItemAction} 
     357           "DropFromInventory":DropItemFromContainerAction} 
Note: See TracChangeset for help on using the changeset viewer.