FindBagFirstItem.lua 737 B

123456789101112131415161718192021222324252627282930
  1. local FindBagFirstItem = class("FindBagFirstItem", require("ForceGuide/ForceGuideBase"))
  2. function FindBagFirstItem:ctor(data)
  3. end
  4. function FindBagFirstItem:Enter(forceView, uiId, param, cb)
  5. self.wnd = forceView
  6. self.cb = cb
  7. local page = ManagerContainer.LuaUIMgr:GetPage(uiId)
  8. if page == nil then
  9. self.cb(self.wnd, true)
  10. return
  11. end
  12. local bagView = page.MLuaTable
  13. bagView:FindBagFirstItem(tonumber(param), self, self.EnterCallBack)
  14. end
  15. function FindBagFirstItem:EnterCallBack(target)
  16. if self.wnd and self.cb then
  17. if target == nil then
  18. self.cb(self.wnd, true)
  19. else
  20. self.cb(self.wnd, false, target)
  21. end
  22. end
  23. end
  24. return FindBagFirstItem