【命格】提交
parent
a0675baeb8
commit
2a68523d05
File diff suppressed because it is too large
Load Diff
|
|
@ -38,19 +38,19 @@ function this.GetWearedGem(_GemList)
|
|||
end
|
||||
end
|
||||
end
|
||||
if #this.myGemList == 0 then
|
||||
LogError("没有命石数据,将使用测试数据")
|
||||
this.myGemList = {--我穿戴命石的id
|
||||
[1] = {45001,45002,45003},
|
||||
[2] = {45004,45005,45006},
|
||||
[3] = {45007,45008,45009},
|
||||
[4] = {45010,45011,45013},
|
||||
[5] = {45021,45022,45023},
|
||||
[6] = {45031,45032,45033},
|
||||
[7] = {45041,45042,45043},
|
||||
[8] = {45051,45052,45053},
|
||||
}
|
||||
end
|
||||
-- if #this.myGemList == 0 then
|
||||
-- LogError("没有命石数据,将使用测试数据")
|
||||
-- this.myGemList = {--我穿戴命石的id
|
||||
-- [1] = {45001,45002,45003},
|
||||
-- [2] = {45004,45005,45006},
|
||||
-- [3] = {45007,45008,45009},
|
||||
-- [4] = {45010,45011,45013},
|
||||
-- [5] = {45021,45022,45023},
|
||||
-- [6] = {45031,45032,45033},
|
||||
-- [7] = {45041,45042,45043},
|
||||
-- [8] = {45051,45052,45053},
|
||||
-- }
|
||||
-- end
|
||||
end
|
||||
|
||||
return this
|
||||
|
|
@ -16,6 +16,8 @@ function Gem:InitComponent()
|
|||
self.fx_ui_xiuxingshengxin_cangzhu = Util.GetGameObject(self.gameObject, "Bg/fx_ui_xiuxingshengxin_cangzhu")
|
||||
--Gems
|
||||
self.gems = Util.GetGameObject(self.gameObject, "Gems")
|
||||
self.stones = Util.GetGameObject(self.gameObject, "Stones")
|
||||
self.itemList = {}
|
||||
|
||||
--页签
|
||||
self.btnPractice = Util.GetGameObject(self.gameObject, "Tab/tab1")
|
||||
|
|
@ -111,6 +113,26 @@ end
|
|||
|
||||
function Gem:SetStones(_data)
|
||||
LogWarn("[1]:"..tostring(_data[1]).." [2]:"..tostring(_data[2]).." [3]:"..tostring(_data[3]))
|
||||
local data = _data
|
||||
for i = 1, 3 do
|
||||
local stoneGo = Util.GetGameObject(self.stones,"Stone ("..i..")")
|
||||
local item = Util.GetGameObject(stoneGo,"Item")
|
||||
local mask = Util.GetGameObject(stoneGo,"Mask")
|
||||
local property = Util.GetGameObject(stoneGo,"Property")
|
||||
local textPre = Util.GetGameObject(property,"Text")
|
||||
textPre:SetActive(false)
|
||||
if data[i] > 0 then
|
||||
if not self.itemList[i] then
|
||||
local view = SubUIManager.Open(SubUIConfig.ItemView,item.transform)
|
||||
self.itemList[i] = view
|
||||
end
|
||||
self.itemList[i]:OnOpen(false, {data[i],0}, 1.1, true,false,false,self.sortingOrder + 1)
|
||||
self.itemList[i].gameObject:SetActive(true)
|
||||
end
|
||||
Util.AddOnceClick(mask,function ()
|
||||
LogError("打开命石选择")
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function Gem:OnClose()
|
||||
|
|
@ -126,6 +148,7 @@ function Gem:OnDestroy()
|
|||
SubUIManager.Close(self.playerInfoView)
|
||||
self.playerInfoView = nil
|
||||
end
|
||||
self.itemList = {}
|
||||
end
|
||||
|
||||
return Gem
|
||||
|
|
@ -6246,24 +6246,24 @@ function this.LifeStoneUpRequest(_type,_gridId,_gridIndex,_curGemId,_selectNum,f
|
|||
local data = HeroInfoProto_pb.LifeStoneUpRequest()
|
||||
LogPink("_type:"..tostring(_type))
|
||||
data.type = _type
|
||||
-- if _gridId then
|
||||
-- data.gridId = _gridId
|
||||
-- end
|
||||
-- if _gridIndex then
|
||||
-- data.gridIndex = _gridIndex
|
||||
-- end
|
||||
-- if _curGemId then
|
||||
-- data.curGemId = _curGemId
|
||||
-- end
|
||||
-- if _selectNum then
|
||||
-- data.selectNum = _selectNum
|
||||
-- end
|
||||
if _gridId then
|
||||
data.gridId = _gridId
|
||||
end
|
||||
if _gridIndex then
|
||||
data.gridIndex = _gridIndex
|
||||
end
|
||||
if _curGemId then
|
||||
data.curGemId = _curGemId
|
||||
end
|
||||
if _selectNum then
|
||||
data.selectNum = _selectNum
|
||||
end
|
||||
local msg = data:SerializeToString()
|
||||
Network:SendMessageWithCallBack(MessageTypeProto_pb.LIFE_STONE_UP_REQUEST , MessageTypeProto_pb.LIFE_STONE_UP_RESPONSE , msg, function(buffer)
|
||||
local data = buffer:DataByte()
|
||||
local msg = HeroInfoProto_pb.LifeStoneUpResponse()
|
||||
msg:ParseFromString(data)
|
||||
if msg and msg.lifeGridInfo then
|
||||
if msg and msg.lifeGridInfo and msg.lifeGridInfo.gridId and msg.lifeGridInfo.gridId > 0 then
|
||||
GemManager.myGemList[msg.lifeGridInfo.gridId][msg.lifeGridInfo.gridIndex] = msg.lifeGridInfo.itemId
|
||||
end
|
||||
if func then
|
||||
|
|
@ -6291,7 +6291,7 @@ function this.LifeGridChangeRequest(_type,_gridId,_gridIndex,_curGemId,func)
|
|||
local data = buffer:DataByte()
|
||||
local msg = HeroInfoProto_pb.LifeGridChangeResponse()
|
||||
msg:ParseFromString(data)
|
||||
if msg and msg.lifeGridInfo then
|
||||
if msg and msg.lifeGridInfo and msg.lifeGridInfo.gridId and msg.lifeGridInfo.gridId > 0 then
|
||||
GemManager.myGemList[msg.lifeGridInfo.gridId][msg.lifeGridInfo.gridIndex] = msg.lifeGridInfo.itemId
|
||||
end
|
||||
if func then
|
||||
|
|
|
|||
Loading…
Reference in New Issue