Example #1
0
 def onBodyClick(self, event):
     global cursor
     slot = event.current_element.child_nodes[0]
     if cursor is True and slot.GetAttribute("empty") == "false":
         freeablo.placeItem(10, 3, 0, 0, 0, 0, 0)
         self.updateInventory(event)
     elif cursor is False and slot.GetAttribute("empty") == "true":
         freeablo.placeItem(3, 10, 0, 0, 0, 0, 0)
         self.updateInventory(event)
Example #2
0
 def onBodyClick(self, event):
     global cursor
     slot = event.current_element.child_nodes[0]
     if cursor is True and slot.GetAttribute("empty") == "false":
         freeablo.placeItem(10, 3, 0, 0, 0, 0, 0)
         self.updateInventory(event)
     elif cursor is False and slot.GetAttribute("empty") == "true":
         freeablo.placeItem(3, 10, 0, 0, 0, 0, 0)
         self.updateInventory(event)
Example #3
0
    def onBeltClick(self, event):
        global cursor
        element = event.current_element.child_nodes[0]

        beltx = int(element.GetAttribute("BeltX"))
        if cursor is True and element.GetAttribute("empty") == "false":
            freeablo.placeItem(10, 8, 0, 0, 0, 0, beltx)
        elif cursor is False and element.GetAttribute("empty") == "true":
            freeablo.placeItem(8, 10, 0, 0, 0, 0, beltx)
            cursor = True
        self.updateBelt(event)
Example #4
0
    def onBeltClick(self, event):
        global cursor
        element = event.current_element.child_nodes[0]

        beltx = int(element.GetAttribute("BeltX"))
        if cursor is True and element.GetAttribute("empty") == "false":
            freeablo.placeItem(10, 8, 0, 0, 0, 0, beltx)
        elif cursor is False and element.GetAttribute("empty") =="true":            
            freeablo.placeItem(8, 10, 0, 0, 0, 0, beltx)
            cursor = True
        self.updateBelt(event)
Example #5
0
 def onRingClick(self, event):
     global cursor
     slot = event.current_element.child_nodes[0]
     if event.current_element.GetAttribute("id") == "leftRing":
         to = 14
     else:
         to = 13
     if cursor is True and slot.GetAttribute("empty") == "false":
         freeablo.placeItem(10, to, 0, 0, 0, 0, 0)
         self.updateInventory(event)
     elif cursor is False and slot.GetAttribute("empty") == "true":
         freeablo.placeItem(to, 10, 0, 0, 0, 0, 0)
         self.updateInventory(event)
Example #6
0
 def onRingClick(self, event):
     global cursor
     slot = event.current_element.child_nodes[0]
     if event.current_element.GetAttribute("id") =="leftRing":
         to=14
     else:
         to=13
     if cursor is True and slot.GetAttribute("empty") == "false":
         freeablo.placeItem(10, to, 0, 0, 0, 0, 0)
         self.updateInventory(event)
     elif cursor is False and slot.GetAttribute("empty") == "true":
             freeablo.placeItem(to, 10, 0, 0, 0, 0, 0)
             self.updateInventory(event)
Example #7
0
    def socketMouseDown(self, event):
        global cursor
        if cursor is True and "itemGraphic" in event.current_element.child_nodes[0].GetAttribute("class"):
            y, x = (int(event.current_element.child_nodes[0].GetAttribute("InvX")), int(event.current_element.child_nodes[0].GetAttribute("InvY")))
            freeablo.placeItem(10, 0, x, y, x, y, 0)


        elif cursor is False and "itemGraphic" not in event.current_element.child_nodes[0].GetAttribute("class"):

            x, y = (int(event.current_element.child_nodes[0].GetAttribute("InvX")), int(event.current_element.child_nodes[0].GetAttribute("InvY")))

            freeablo.placeItem(0, 10, 0, 0, y, x, 0)
            cursor = True
        self.updateInventory(event)
        event.StopPropagation()
Example #8
0
    def socketMouseDown(self, event):
        global cursor
        if cursor is True and "itemGraphic" in event.current_element.child_nodes[0].GetAttribute("class"):
            y, x = (int(event.current_element.child_nodes[0].GetAttribute("InvX")), int(event.current_element.child_nodes[0].GetAttribute("InvY")))
            freeablo.placeItem(10, 0, x, y, x, y, 0)


        elif cursor is False and "itemGraphic" not in event.current_element.child_nodes[0].GetAttribute("class"):

            x, y = (int(event.current_element.child_nodes[0].GetAttribute("InvX")), int(event.current_element.child_nodes[0].GetAttribute("InvY")))

            freeablo.placeItem(0, 10, 0, 0, y, x, 0)
            cursor = True
        self.updateInventory(event)
        event.StopPropagation()
Example #9
0
    def onWeaponClick(self, event):
        global cursor
        slot = event.current_element.child_nodes[0]
        if event.current_element.GetAttribute("id") == "leftHand":
            to = 12
        else:
            to = 11

        # cursor -> weapon slot
        if cursor is True and slot.GetAttribute("empty") == "false":
            freeablo.placeItem(10, to, 0, 0, 0, 0, 0)
            self.updateInventory(event)
        # weapon slot -> cursor
        elif cursor is False and slot.GetAttribute("empty") == "true":
            freeablo.placeItem(to, 10, 0, 0, 0, 0, 0)
            self.updateInventory(event)
Example #10
0
    def onWeaponClick(self, event):
        global cursor
        slot = event.current_element.child_nodes[0]
        if event.current_element.GetAttribute("id") == "leftHand":
            to=12
        else:
            to=11

        #cursor -> weapon slot
        if cursor is True and slot.GetAttribute("empty") == "false":
            freeablo.placeItem(10, to, 0, 0, 0, 0, 0)
            self.updateInventory(event)
        #weapon slot -> cursor
        elif cursor is False and slot.GetAttribute("empty") == "true":
                freeablo.placeItem(to, 10, 0, 0, 0, 0, 0)
                self.updateInventory(event)