RefreshDropItemCommand.lua 738 B

1234567891011121314151617181920212223242526
  1. local RefreshDropItemCommand = class('RefreshDropItemCommand', framework.SimpleCommand)
  2. function RefreshDropItemCommand:ctor()
  3. end
  4. function RefreshDropItemCommand:execute(notification)
  5. local itemID = notification:getBody()
  6. if not itemID then
  7. return nil
  8. end
  9. local dropItem = global.actorManager:GetActor(itemID)
  10. if not dropItem then
  11. return nil
  12. end
  13. local ownerID = dropItem:GetOwnerID()
  14. local mainPlayerID = global.gamePlayerController:GetMainPlayerID()
  15. if dropItem:CheckOwnerID(mainPlayerID) then
  16. local autoProxy = global.Facade:retrieveProxy(global.ProxyTable.Auto)
  17. autoProxy:SetPickItemFlag(true)
  18. end
  19. end
  20. return RefreshDropItemCommand