Revert "【优化】优化装备界面卡顿,一键卸下/装备卡顿的问题"

This reverts commit cb4c81b420.
dev_chengFeng
gaoxin 2021-09-18 10:56:55 +08:00
parent 9da6a42947
commit 0e86945c53
2 changed files with 13 additions and 60 deletions

View File

@ -599,8 +599,6 @@ function this.EquipTreasureBuildRequest(_IdDyn, _type,_mats,func)
if func then
func(msg)
end
-- 宝物属性改变需要重新计算战斗力
EquipTreasureManager.SetTreasureDirty(_IdDyn, true)
end)
end

View File

@ -8,7 +8,6 @@ local jewerLevelUpConfig = ConfigManager.GetConfig(ConfigName.JewelRankupConfig)
local EquipTreasureData = require("Modules.RoleInfo.EquipTreasureData")
function this.Initialize()
this.TreasurePowerData = {}
end
--初始化所有宝器数据
function this.InitAllEquipTreasure(_equipData)
@ -525,65 +524,21 @@ end
--计算战斗力
function this.CalculateWarForce(Did)
-- Log("CalculateWarForce "..Did)
local power = 0
if this.IsTreasureDirty(Did) then
local curTreasure = allTreasures[Did]
if not curTreasure then
curTreasure = MonsterCampManager.GetSingleTreasureByIdDyn(Did)
end
if not curTreasure then
curTreasure = ExpeditionManager.GetSingleTreasureByIdDyn(Did)
end
if not curTreasure then
curTreasure = GoodFriendManager.GetSingleTreasureByIdDyn(Did)
end
if curTreasure then
power = this.CalculateWarForceBase(curTreasure.id, curTreasure.lv, curTreasure.refineLv, curTreasure.treeLv,curTreasure)
end
this.SetTreasurePower(Did, power)
this.SetTreasureDirty(Did, false)
else
if this.TreasurePowerData and this.TreasurePowerData[Did] then
power = this.TreasurePowerData[Did].power or 0
end
local curTreasure = allTreasures[Did]
if not curTreasure then
curTreasure = MonsterCampManager.GetSingleTreasureByIdDyn(Did)
end
return power
if not curTreasure then
curTreasure = ExpeditionManager.GetSingleTreasureByIdDyn(Did)
end
if not curTreasure then
curTreasure = GoodFriendManager.GetSingleTreasureByIdDyn(Did)
end
if curTreasure then
return this.CalculateWarForceBase(curTreasure.id, curTreasure.lv, curTreasure.refineLv, curTreasure.treeLv,curTreasure)
end
return 0
end
-- 判断脏数据
function this.IsTreasureDirty(dId)
if not this.TreasurePowerData then
this.TreasurePowerData = {}
end
if not this.TreasurePowerData[dId] then
this.TreasurePowerData[dId] = {}
end
return this.TreasurePowerData[dId].isDirty ~= false
end
-- 设置脏数据
function this.SetTreasureDirty(dId, isDirty)
if not this.TreasurePowerData then
this.TreasurePowerData = {}
end
if not this.TreasurePowerData[dId] then
this.TreasurePowerData[dId] = {}
end
this.TreasurePowerData[dId].isDirty = isDirty ~= false
end
-- 设置宝物战斗力
function this.SetTreasurePower(dId, power)
if not this.TreasurePowerData then
this.TreasurePowerData = {}
end
if not this.TreasurePowerData[dId] then
this.TreasurePowerData[dId] = {}
end
this.TreasurePowerData[dId].power = power or 0
end
function this.CalculateWarForceBase(sId, lv, rlv, tlv,curTreasure)
-- LogGreen("sId:"..sId.." lv:"..lv.." rlv:"..rlv.." tlv:"..tlv)
local curEuipTreaSureConfig = ConfigManager.GetConfigData(ConfigName.JewelConfig, sId)