【修行】提交

dev_chengFeng
ZhangBiao 2021-05-12 20:53:34 +08:00
parent b6854deccd
commit 98e4de79b2
5 changed files with 61 additions and 34 deletions

View File

@ -42,7 +42,7 @@ function PracticeStatePreview:OnShow(_parent,_args)
self.ScrollView:SetData(self.previewData, function(index, go) self.ScrollView:SetData(self.previewData, function(index, go)
self:SetSingleData(index,go,self.previewData[index]) self:SetSingleData(index,go,self.previewData[index])
end) end)
ForceRebuildLayout(self.Grid.transform) ForceRebuildLayout(self.GameObject.transform)
self.ScrollView:SetIndex(PracticeManager.PracticeBigLevel) self.ScrollView:SetIndex(PracticeManager.PracticeBigLevel)
end end

View File

@ -64,21 +64,23 @@ function ServerListSelectPanel:SetServerList()
return return
end end
for idx, serverInfo in ipairs(self.context.serverList) do for idx, serverInfo in ipairs(self.context.serverList) do
local serverItem = ServerListItem.create(self.serverPrototype, self.serverContent.transform) if serverInfo.state > 0 then
local index = table.indexof(self.context.myServerList, serverInfo.server_id) local serverItem = ServerListItem.create(self.serverPrototype, self.serverContent.transform)
serverItem:SetValue(serverInfo, index) local index = table.indexof(self.context.myServerList, serverInfo.server_id)
serverItem:SetVisible(true) serverItem:SetValue(serverInfo, index)
serverItem.cloneObj:GetComponent("Button").onClick:AddListener(function() serverItem:SetVisible(true)
if serverInfo.state == ServerStateDef.Maintenance then serverItem.cloneObj:GetComponent("Button").onClick:AddListener(function()
PopupTipPanel.ShowTip(Language[11142]) if serverInfo.state == ServerStateDef.Maintenance then
return PopupTipPanel.ShowTip(Language[11142])
end return
if self.context.callback then end
self.context.callback(idx) if self.context.callback then
end self.context.callback(idx)
self:ClosePanel() end
end) self:ClosePanel()
table.insert(self.serverItemList, serverItem) end)
table.insert(self.serverItemList, serverItem)
end
end end
end end

View File

@ -224,10 +224,7 @@ function this.PlayerInfoRequest(func)
QinglongSerectTreasureManager.SetTreasureBuyStatus(msg.hadBuyTreasure) QinglongSerectTreasureManager.SetTreasureBuyStatus(msg.hadBuyTreasure)
PlayerManager.RefreshWorldLeveData(msg.worldLeve) PlayerManager.RefreshWorldLeveData(msg.worldLeve)
PlayerManager.InitSkinTitleMountData(msg.userSkinList,msg.userTitleList,msg.userMountList) PlayerManager.InitSkinTitleMountData(msg.userSkinList,msg.userTitleList,msg.userMountList)
local test = { PracticeManager.UpdataFromServer(msg.practiceLevel)
level = 10,
}
PracticeManager.UpdataFromServer(test)
if func then if func then
func(msg) func(msg)
end end
@ -5002,7 +4999,7 @@ function this.UpPracticeLevelRequest(func)
local data = buffer:DataByte() local data = buffer:DataByte()
local msg = HeroInfoProto_pb.UpPracticeLevelResponse() local msg = HeroInfoProto_pb.UpPracticeLevelResponse()
msg:ParseFromString(data) msg:ParseFromString(data)
PracticeManager.PracticeLevel = msg.practiceLevel PracticeManager.UpdataFromServer(msg.practiceLevel)
if func then if func then
func(msg) func(msg)
end end

View File

@ -10,8 +10,9 @@ function this.Initialize()
this.PracticeConfigData = {} this.PracticeConfigData = {}
end end
--从服务器更新当前修行等级 --从服务器更新当前修行等级
function this.UpdataFromServer(msg) function this.UpdataFromServer(_level)
this.PracticeLevel = msg.level this.PracticeLevel = _level
this.PracticeLevel = this.PracticeLevel > 0 and this.PracticeLevel or 1
this.PracticeBigLevel = XinXianConfig[this.PracticeLevel].RealmId this.PracticeBigLevel = XinXianConfig[this.PracticeLevel].RealmId
this.StarNum = PlayerManager.level this.StarNum = PlayerManager.level
end end
@ -21,6 +22,16 @@ function this.GetCurConfigData()
return XinXianConfig[this.PracticeLevel] return XinXianConfig[this.PracticeLevel]
end end
function this.BuildAddTemplate()
local TemplateList = {}
for _, configInfo in ConfigPairs(PropertyConfig) do
if configInfo.IfShow == 1 or configInfo.IfShow == 2 then
TemplateList[configInfo.PropertyId] = 0
end
end
return TemplateList
end
--获取每一小点属性加成 --获取每一小点属性加成
function this.GetSinglePointAdd() function this.GetSinglePointAdd()
local singlePointAddList = {} local singlePointAddList = {}
@ -36,21 +47,35 @@ end
--获取当前获得的所有属性相加 --获取当前获得的所有属性相加
function this.GetCurAllGetAdd() function this.GetCurAllGetAdd()
local curAllGetAddList = {} local PropertyList = this.BuildAddTemplate()
for i = 1, this.PracticeLevel do for i = 1, this.PracticeLevel do
local Pros = XinXianConfig[this.PracticeLevel].TotalPros if XinXianConfig[this.PracticeLevel].TotalPros then
for i = 1, #Pros do local Pros = XinXianConfig[this.PracticeLevel].TotalPros
if not curAllGetAddList[Pros[i][1]] then for i = 1, #Pros do
curAllGetAddList[Pros[i][1]] = 0 PropertyList[Pros[i][1]] = PropertyList[Pros[i][1]] + Pros[i][2]
end end
curAllGetAddList[Pros[i][1]] = curAllGetAddList[Pros[i][1]] + Pros[i][2]
end end
end end
return curAllGetAddList return PropertyList
end end
--获取各个大境界中所有小属性加成的总和 --获取各个大境界中所有小属性加成的总和+模板的
function this.GetAddsList() function this.GetAddsListWithTemplate()
local PropertyList = this.BuildAddTemplate()
local addsList = {}
for i, v in ConfigPairs(XinXianConfig) do
if v.TotalPros then
local Pros = v.TotalPros
for i = 1, #Pros do
PropertyList[Pros[i][1]] = PropertyList[Pros[i][1]] + Pros[i][2]
end
end
end
return PropertyList
end
--获取各个大境界中所有小属性加成的总和不加模板的
function this.GetAddsListWithOutTemplate()
local addsList = {} local addsList = {}
for i, v in ConfigPairs(XinXianConfig) do for i, v in ConfigPairs(XinXianConfig) do
if not addsList[v.RealmId] then if not addsList[v.RealmId] then
@ -71,7 +96,7 @@ end
--获取预览界面数据 --获取预览界面数据
function this.GetPreViewData() function this.GetPreViewData()
local AddListData = this.GetAddsList() local AddListData = this.GetAddsListWithOutTemplate()
local previewList = {} local previewList = {}
for i = 2, #AddListData do for i = 2, #AddListData do
local data = {} local data = {}

View File

@ -60,7 +60,10 @@ function Practice:BindEvent()
LogGreen("打开山河社稷图") LogGreen("打开山河社稷图")
end) end)
Util.AddClick(self.button, function() Util.AddClick(self.button, function()
LogGreen("打开山河社稷图") self:UpgradeCheck()
NetManager.UpPracticeLevelRequest(function ()
self:OnShow()
end)
end) end)
end end