HeroTakeOffEquipResponseCommand.lua 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. local HeroTakeOffEquipResponseCommand = class('HeroTakeOffEquipResponseCommand', framework.SimpleCommand)
  2. function HeroTakeOffEquipResponseCommand:ctor()
  3. end
  4. function HeroTakeOffEquipResponseCommand:execute(notification)
  5. local data = notification:getBody()
  6. SLBridge:onLUAEvent(LUA_EVENT_HERO_TAKE_OFF_EQUIP, {isSuccess = data.isSuccess})
  7. if not data.isSuccess then -- 脱装备失败
  8. if data.header and data.header.recog ~= 0 then
  9. local data = {
  10. MakeIndex = data.header.recog,
  11. state = 1
  12. }
  13. global.Facade:sendNotification( global.NoticeTable.Layer_Player_Equip_State_Change_Hero, data )
  14. SLBridge:onLUAEvent(LUA_EVENT_HERO_EQUIP_STATE_CHANGE, data)
  15. end
  16. if data.header and data.header.param1 ~= 0 then
  17. local errorCode = data.header.param1
  18. local stringCode = 600000325
  19. if errorCode == -1 then --位置错误
  20. stringCode = 600000320
  21. elseif errorCode == -2 then -- 未穿戴该位置物品
  22. stringCode = 600000321
  23. elseif errorCode == -4 then -- 无法取下
  24. stringCode = 600000322
  25. elseif errorCode == -5 then -- 背包已满
  26. stringCode = 600000323
  27. elseif errorCode == -6 then --未开启人物英雄背包互通
  28. stringCode = 600000324
  29. end
  30. global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(stringCode))
  31. end
  32. end
  33. end
  34. return HeroTakeOffEquipResponseCommand