【修行】提交

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:SetSingleData(index,go,self.previewData[index])
end)
ForceRebuildLayout(self.Grid.transform)
ForceRebuildLayout(self.GameObject.transform)
self.ScrollView:SetIndex(PracticeManager.PracticeBigLevel)
end

View File

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

View File

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

View File

@ -10,8 +10,9 @@ function this.Initialize()
this.PracticeConfigData = {}
end
--从服务器更新当前修行等级
function this.UpdataFromServer(msg)
this.PracticeLevel = msg.level
function this.UpdataFromServer(_level)
this.PracticeLevel = _level
this.PracticeLevel = this.PracticeLevel > 0 and this.PracticeLevel or 1
this.PracticeBigLevel = XinXianConfig[this.PracticeLevel].RealmId
this.StarNum = PlayerManager.level
end
@ -21,6 +22,16 @@ function this.GetCurConfigData()
return XinXianConfig[this.PracticeLevel]
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()
local singlePointAddList = {}
@ -36,21 +47,35 @@ end
--获取当前获得的所有属性相加
function this.GetCurAllGetAdd()
local curAllGetAddList = {}
local PropertyList = this.BuildAddTemplate()
for i = 1, this.PracticeLevel do
local Pros = XinXianConfig[this.PracticeLevel].TotalPros
for i = 1, #Pros do
if not curAllGetAddList[Pros[i][1]] then
curAllGetAddList[Pros[i][1]] = 0
if XinXianConfig[this.PracticeLevel].TotalPros then
local Pros = XinXianConfig[this.PracticeLevel].TotalPros
for i = 1, #Pros do
PropertyList[Pros[i][1]] = PropertyList[Pros[i][1]] + Pros[i][2]
end
curAllGetAddList[Pros[i][1]] = curAllGetAddList[Pros[i][1]] + Pros[i][2]
end
end
return curAllGetAddList
return PropertyList
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 = {}
for i, v in ConfigPairs(XinXianConfig) do
if not addsList[v.RealmId] then
@ -71,7 +96,7 @@ end
--获取预览界面数据
function this.GetPreViewData()
local AddListData = this.GetAddsList()
local AddListData = this.GetAddsListWithOutTemplate()
local previewList = {}
for i = 2, #AddListData do
local data = {}

View File

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