整理
This commit is contained in:
parent
8548033f82
commit
4727b573f1
@ -2,12 +2,4 @@ local VersionCompatible = {}
|
||||
|
||||
local CLIENT_VERSION = CS.BF.BFMain.CLIENT_VERSION or 0
|
||||
|
||||
function VersionCompatible:canUpdateMailVersion()
|
||||
return CLIENT_VERSION > 1
|
||||
end
|
||||
|
||||
function VersionCompatible:supportDataEncryptVersion()
|
||||
return CLIENT_VERSION > 1
|
||||
end
|
||||
|
||||
return VersionCompatible
|
||||
|
||||
@ -380,28 +380,6 @@ function GFunc.getPerByW3(ratio)
|
||||
return ratio*0.0001
|
||||
end
|
||||
|
||||
-- function GFunc.getRoundingNumByW(num)
|
||||
-- if num <= 0 then
|
||||
-- return 0
|
||||
-- end
|
||||
-- if num < 10000 then
|
||||
-- return GFunc.getRoundingNumByW(num*100) // 100
|
||||
-- end
|
||||
-- local remainder = num%10000
|
||||
-- if remainder < 5000 then
|
||||
-- return num - remainder
|
||||
-- elseif remainder > 5000 then
|
||||
-- return num - remainder + 10000
|
||||
-- else
|
||||
-- local integer = (num - remainder)*0.0001
|
||||
-- if integer%2 == 0 then
|
||||
-- return num - remainder
|
||||
-- else
|
||||
-- return num - remainder + 10000
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
|
||||
function GFunc.getPerStr(key, str)
|
||||
if key == GConst.BattleConst.BUFF_NAME.ATKP_ADD or
|
||||
key == GConst.BattleConst.BUFF_NAME.ATKP_COLOR_ADD or
|
||||
@ -600,17 +578,9 @@ function GFunc.showItemNotEnough(itemId)
|
||||
end
|
||||
end
|
||||
|
||||
function GFunc.showJewelryNotEnough(itemId)
|
||||
local gemTextInfo = I18N:getConfig("jewelry")[itemId]
|
||||
if gemTextInfo then
|
||||
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ITEM_NOT_ENOUGH, gemTextInfo.name))
|
||||
end
|
||||
end
|
||||
|
||||
function GFunc.checkCost(id, num, showToast, giftType)
|
||||
if num <= 0 then
|
||||
-- BIReport:postDataException(id, num, giftType)
|
||||
-- return false
|
||||
return false
|
||||
end
|
||||
local count = DataManager.BagData.ItemData:getItemNumById(id)
|
||||
if count < num then
|
||||
@ -623,14 +593,6 @@ function GFunc.checkCost(id, num, showToast, giftType)
|
||||
end
|
||||
end
|
||||
|
||||
function GFunc.checkCostNum(id, num, giftType)
|
||||
if num <= 0 then
|
||||
-- BIReport:postDataException(id, num, giftType)
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
---- 获得奖励的统一接口
|
||||
function GFunc.addRewards(rewards, itemGetType)
|
||||
if rewards == nil then
|
||||
@ -959,39 +921,27 @@ function GFunc.miningTipsMovePosY(obj, delay,callBack)
|
||||
end
|
||||
|
||||
function GFunc.dataEncrypt(data)
|
||||
if not VersionCompatible:supportDataEncryptVersion() then
|
||||
return data
|
||||
end
|
||||
local numStr = CS.Security.XXTEA.Encrypt(tostring(data), GConst.SECRET_KEY)
|
||||
return numStr
|
||||
end
|
||||
|
||||
function GFunc.dataDecrypt(data)
|
||||
if not VersionCompatible:supportDataEncryptVersion() then
|
||||
return data
|
||||
end
|
||||
local numStr = CS.Security.XXTEA.Decrypt(data, GConst.SECRET_KEY)
|
||||
return tonumber(numStr)
|
||||
end
|
||||
|
||||
function GFunc.getTickCount()
|
||||
if not VersionCompatible:supportDataEncryptVersion() then
|
||||
return 0
|
||||
end
|
||||
return math.floor(UnityTime.realtimeSinceStartup)
|
||||
end
|
||||
|
||||
function GFunc.IsGotServerTime()
|
||||
if not VersionCompatible:supportDataEncryptVersion() then
|
||||
return true
|
||||
end
|
||||
if not CS.BF.BFMain.IsGotServerTime then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
---得到展示奖励的图集名称,图片资源id
|
||||
---得到展示奖励的图集名称,图片资源id
|
||||
function GFunc.getFrameRes(type, id)
|
||||
if type == GConst.REWARD_TYPE.REWARD_NONE then
|
||||
return
|
||||
@ -1034,7 +984,7 @@ function GFunc.getFrameRes(type, id)
|
||||
return atlasPath, GConst.HERO_FRAME[ GConst.QUALITY[qlt] ] or "frame_1", qlt
|
||||
end
|
||||
|
||||
---得到展示奖励的图集名称,图片资源id
|
||||
---得到展示奖励的图集名称,图片资源id
|
||||
function GFunc.getQuality(type, id)
|
||||
if type == GConst.REWARD_TYPE.REWARD_NONE then
|
||||
return
|
||||
@ -1084,7 +1034,7 @@ function GFunc.getQuality(type, id)
|
||||
return qlt
|
||||
end
|
||||
|
||||
---得到展示奖励的图集名称,图片资源id
|
||||
---得到展示奖励的图集名称,图片资源id
|
||||
function GFunc.getRewardIconRes(type, id)
|
||||
if type == GConst.REWARD_TYPE.REWARD_NONE then
|
||||
return
|
||||
@ -1143,7 +1093,7 @@ function GFunc.getLegacyIconRes(legacyId)
|
||||
return GConst.ATLAS_PATH.ICON_LEGACY, tostring(config.icon)
|
||||
end
|
||||
|
||||
---得到展示奖励的图集名称,图片资源id
|
||||
---得到展示奖励的图集名称,图片资源id
|
||||
function GFunc.getRewardName(type, id)
|
||||
if type == GConst.REWARD_TYPE.REWARD_NONE then
|
||||
return
|
||||
@ -1162,23 +1112,6 @@ function GFunc.getRewardName(type, id)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function GFunc.performDurationDelay(obj, delay, callback)
|
||||
if obj.sequence then
|
||||
obj.sequence:Kill()
|
||||
obj.sequence = nil
|
||||
end
|
||||
local sequence = obj:createBindTweenSequence()
|
||||
delay = delay or 0
|
||||
delay = math.max(0, delay)
|
||||
obj.sequence = sequence
|
||||
|
||||
sequence:AppendInterval(delay or 0)
|
||||
sequence:OnComplete(callback)
|
||||
|
||||
return sequence
|
||||
end
|
||||
|
||||
function GFunc.compareVersionThan(version1, version2, include)
|
||||
if not version1 or not version2 then
|
||||
return false
|
||||
@ -1266,14 +1199,6 @@ function GFunc.getArray()
|
||||
return array
|
||||
end
|
||||
|
||||
function GFunc.showProbability()
|
||||
local language = I18N:getCurLanguage()
|
||||
if language == "ko" or language == "ja" then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function GFunc.getTable(struct)
|
||||
local t = {}
|
||||
if struct then
|
||||
@ -1503,6 +1428,7 @@ function GFunc.getCalcMinVal(arr)
|
||||
end
|
||||
return min
|
||||
end
|
||||
|
||||
---计算最大值
|
||||
function GFunc.getCalcMaxVal(arr)
|
||||
local max = arr[1] or 0
|
||||
@ -1588,14 +1514,6 @@ function GFunc.checkTableValueSame(standardTable, compareTable, debug)
|
||||
return true
|
||||
end
|
||||
|
||||
-- 获取挖矿研究得到的属性加成
|
||||
function GFunc.getMainHeroAttributeVal(key)
|
||||
local mainEntity = DataManager.HeroData:getMainHeroEntity()
|
||||
local allAttr = mainEntity:getAllAttr()
|
||||
local result = allAttr[key]
|
||||
return result
|
||||
end
|
||||
|
||||
function GFunc.showCurrencyFlyAction(rewards, pos)
|
||||
local flyPos = {}
|
||||
if not pos then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user