Jump to content

Recommended Posts

Hellow guys,any1 have pickup system with button in inventory ?

like this,but with with a button in inventory,not with press F5!

// Search in game.py function OnUpdate and add:

		if 1 == constInfo.ENABLE_PICKUP:
			self.PickUpItem()	
// Search:

onPressKeyDict[app.DIK_F4]    = lambda : self.__PressQuickSlot(7)
// Add bellow:

onPressKeyDict[app.DIK_F5]    = lambda : self.__EnablePickUpItem()
 

	def	__EnablePickUpItem(self):
		global CHECK_ACTIVE_PICKUP
		if CHECK_ACTIVE_PICKUP == 0:
			CHECK_ACTIVE_PICKUP = 1
			constInfo.ENABLE_PICKUP = 1
		else:
			CHECK_ACTIVE_PICKUP = 0
			constInfo.ENABLE_PICKUP = 0
// Search:

testAlignment = 0
// Add bellow:

CHECK_ACTIVE_PICKUP = 0
// Add in constInfo.py:

ENABLE_PICKUP = 0

Thx!

Link to comment
Share on other sites

  • Premium

That should work:

uiInventory.py:

find:
ITEM_FLAG_APPLICABLE = 1 << 14
add bellow:
CHECK_ACTIVE_PICKUP = 0

find:
         self.costumeButton = self.GetChild2("CostumeButton")
add bellow:
         self.pickUpButton = self.GetChild2("PickUpButton")

find: 
      self.wndCostume = None
add bellow:
      self.pickUpButton.SetEvent(ui.__mem_func__(self.__EnablePickUpItem))
   
find:
   def ClickMallButton(self):
      print "click_mall_button"
      net.SendChatPacket("/click_mall")
add bellow:    
   def __EnablePickUpItem(self):
      global CHECK_ACTIVE_PICKUP
      if CHECK_ACTIVE_PICKUP == 0:
         CHECK_ACTIVE_PICKUP = 1
         constInfo.ENABLE_PICKUP = 1
      else:
         CHECK_ACTIVE_PICKUP = 0
         constInfo.ENABLE_PICKUP = 0
   
add in inventorywindow.py bellow costume code / mall code:
                                    ## CostumeButton
                                    {
                                        "name": "pickUpButton",
                                        "type": "button",

                                        "x": 118,
                                        "y": 100,

                                        "default_image": "d:/ymir work/ui/game/windows/money_icon.sub",
                                        "over_image": "d:/ymir work/ui/game/windows/money_icon.sub",
                                        "down_image": "d:/ymir work/ui/game/windows/money_icon.sub",
                                    },
  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.