作者:手机用户2502853923 | 来源:互联网 | 2023-09-23 10:09
--砖石选择localbtnMasonryshopBg:getChildByName(btn_Masonry)self.m_btnMasonrybtnMasonrybtnMas
--砖石选择
local btnMasOnry= shopBg:getChildByName("btn_Masonry")
self.m_btnMasOnry=btnMasonry
btnMasonry:setTag(self.BT_BEAN)
btnMasonry:setSelected(true)
btnMasonry:addTouchEventListener(function (ref,eventType)
if eventType == ccui.TouchEventType.ended then
self.m_btnProp:setSelected(false)
btnMasonry:setSelected(true)
if 0 == #self._beanList then
self:loadPropertyAndVip(ShopLayer.CBT_BEAN)
else
self:onUpdateBeanList()
end
end
end)
--道具选择
local btnProp = shopBg:getChildByName("btn_Prop")
self.m_btnProp=btnProp
btnProp:setTag(self.BT_PROPERTY)
btnProp:setSelected(false)
btnProp:addTouchEventListener(function (ref,eventType)
self.m_btnMasonry:setSelected(false)
btnProp:setSelected(true)
if eventType == ccui.TouchEventType.ended then
if (#self._propertyList==0) then
self:loadPropertyAndVip(ShopLayer.CBT_PROPERTY)
else
self:onUpdateProperty()
end
end
end)