Changeset 267 for trunk/game/scripts


Ignore:
Timestamp:
08/30/09 19:09:44 (10 years ago)
Author:
Kaydeth_parpg
Message:

Ticket #91: Patch by phoku. The drag and drop logic in ContainerGUI class and Inventory class needed to be corrected after some FIFE changes made in FIFE revision 3003. Also gui_container.py was removed as the the code was previously copied into popups.py and gui_container.py is no longer used.

Location:
trunk/game/scripts
Files:
1 deleted
2 edited

Legend:

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

    r261 r267  
    214214            data_drag.dragged_item = drag_widget.item 
    215215            # get the up and down images of the widget 
    216             up_image = drag_widget._getUpImage() 
    217             down_image = drag_widget._getDownImage() 
     216            up_image = drag_widget.up_image 
     217            down_image = drag_widget.down_image 
    218218            # set the mouse cursor to be the widget's image 
    219             self.setMouseCursor(up_image,down_image) 
    220             data_drag.dragged_image = up_image 
     219            self.setMouseCursor(up_image.source,down_image.source) 
     220            data_drag.dragged_image = up_image.source 
    221221            data_drag.dragging = True 
    222222            # after dragging the 'item', set the widgets' images 
    223223            # so that it has it's default 'empty' images 
    224             drag_widget._setUpImage(self.empty_images[obj]) 
    225             drag_widget._setDownImage(self.empty_images[obj]) 
    226             drag_widget._setHoverImage(self.empty_images[obj]) 
     224            drag_widget.up_image=(self.empty_images[obj]) 
     225            drag_widget.down_image=(self.empty_images[obj]) 
     226            drag_widget.hover_image=(self.empty_images[obj]) 
    227227            # then set it's item to nothing 
    228228            drag_widget.item = "" 
     
    242242           (data_drag.dropped_type == 'main_inv')): 
    243243            drag_widget = self.inventory.findChild(name = obj) 
    244             drag_widget._setUpImage(data_drag.dragged_image) 
    245             drag_widget._setHoverImage(data_drag.dragged_image) 
    246             drag_widget._setDownImage(data_drag.dragged_image) 
     244            drag_widget.up_image = data_drag.dragged_image 
     245            drag_widget.hover_image = data_drag.dragged_image 
     246            drag_widget.down_image = data_drag.dragged_image 
    247247            drag_widget.item = data_drag.dragged_item 
    248248            print 'Item: ' + drag_widget.item 
     
    261261             (data_drag.dragged_type in self.locations)): 
    262262            drag_widget = self.inventory.findChild(name = obj) 
    263             drag_widget._setUpImage(data_drag.dragged_image) 
    264             drag_widget._setHoverImage(data_drag.dragged_image) 
    265             drag_widget._setDownImage(data_drag.dragged_image) 
     263            drag_widget.up_image = data_drag.dragged_image 
     264            drag_widget.hover_image = data_drag.dragged_image 
     265            drag_widget.down_image = data_drag.dragged_image 
    266266            drag_widget.item = data_drag.dragged_item 
    267267            print 'Item: ' + drag_widget.item 
  • trunk/game/scripts/popups.py

    r262 r267  
    176176            data_drag.dragged_item = drag_widget.item 
    177177            # get the up and down images of the widget 
    178             up_image = drag_widget._getUpImage() 
    179             down_image = drag_widget._getDownImage() 
     178            up_image = drag_widget.up_image 
     179            down_image = drag_widget.down_image 
    180180            # set the mouse cursor to be the widget's image 
    181             self.setMouseCursor(up_image,down_image) 
    182             data_drag.dragged_image = up_image 
     181            self.setMouseCursor(up_image.source, down_image.source) 
     182            data_drag.dragged_image = up_image.source 
    183183            data_drag.dragging = True 
    184184            # after dragging the 'item', set the widgets' images 
    185185            # so that it has it's default 'empty' images 
    186             drag_widget._setUpImage(self.empty_images[obj]) 
    187             drag_widget._setDownImage(self.empty_images[obj]) 
    188             drag_widget._setHoverImage(self.empty_images[obj]) 
     186            drag_widget.up_image = self.empty_images[obj] 
     187            drag_widget.down_image = self.empty_images[obj] 
     188            drag_widget.hover_image = self.empty_images[obj] 
    189189            # then set it's item to nothing 
    190190            drag_widget.item = "" 
     
    204204           (data_drag.dropped_type == 'main_inv')): 
    205205            drag_widget = self.container_gui.findChild(name = obj) 
    206             drag_widget._setUpImage(data_drag.dragged_image) 
    207             drag_widget._setHoverImage(data_drag.dragged_image) 
    208             drag_widget._setDownImage(data_drag.dragged_image) 
     206            drag_widget.up_image = data_drag.dragged_image 
     207            drag_widget.down_image = data_drag.dragged_image 
     208            drag_widget.hover_image = data_drag.dragged_image 
    209209            drag_widget.item = data_drag.dragged_item 
    210210            print 'Item: ' + drag_widget.item 
     
    223223             (data_drag.dragged_type in self.locations)): 
    224224            drag_widget = self.container_gui.findChild(name = obj) 
    225             drag_widget._setUpImage(data_drag.dragged_image) 
    226             drag_widget._setHoverImage(data_drag.dragged_image) 
    227             drag_widget._setDownImage(data_drag.dragged_image) 
     225            drag_widget.up_image = data_drag.dragged_image 
     226            drag_widget.down_image = data_drag.dragged_image 
     227            drag_widget.hover_image = data_drag.dragged_image 
    228228            drag_widget.item = data_drag.dragged_item 
    229229            print 'Item: ' + drag_widget.item 
Note: See TracChangeset for help on using the changeset viewer.