| 1234567891011121314151617181920212223242526272829303132333435363738 |
- local TakeOffEquipToHeroBagRequestCommand = class('TakeOffEquipToHeroBagRequestCommand', framework.SimpleCommand)
- function TakeOffEquipToHeroBagRequestCommand:ctor()
- end
- function TakeOffEquipToHeroBagRequestCommand:execute(notification) ---脱装备
- local equipProxy = global.Facade:retrieveProxy(global.ProxyTable.Equip)
- local data = notification:getBody()
- local bagProxy = global.Facade:retrieveProxy(global.ProxyTable.Bag)
- if bagProxy:GetBagCollimator() then --有准星操作
- return
- end
- -- is bag full?
- if bagProxy:isToBeFull() then
- global.Facade:sendNotification(global.NoticeTable.SystemTips, GET_STRING(800050))
- local data = {
- MakeIndex = data.MakeIndex,
- state = 1
- }
- global.Facade:sendNotification(global.NoticeTable.Layer_Player_Equip_State_Change, data)
- SLBridge:onLUAEvent(LUA_EVENT_PLAYER_EQUIP_STATE_CHANGE, data)
- return false
- end
- local name = data.Name
- local pos = data.Where
- local MakeIndex = data.MakeIndex
- local AutoUseItemProxy = global.Facade:retrieveProxy(global.ProxyTable.AutoUseItemProxy)
- AutoUseItemProxy:AddEquipOffMakeIndex(MakeIndex)
- LuaSendMsg(global.MsgType.MSG_CS_HUM_TAKEOFF_TO_HEROBAG, MakeIndex, pos, 0, 0, name, string.len(name))
- end
- return TakeOffEquipToHeroBagRequestCommand
|