UIGoddress页面:增加
This commit is contained in:
parent
98ff1c4a22
commit
93913c8143
8
Assets/Content/Prefabs/UI/UIGoddess.meta
Normal file
8
Assets/Content/Prefabs/UI/UIGoddess.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2a132104460e649458d49288efd3629f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
12930
Assets/Content/Prefabs/UI/UIGoddess/UIGoddess.prefab
Normal file
12930
Assets/Content/Prefabs/UI/UIGoddess/UIGoddess.prefab
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 73102e87f1825484e9b131aec205fa56
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -5674,6 +5674,28 @@ local UICfg = {
|
||||
['top_res_id']=0,
|
||||
['top_btn_display_state']=false,
|
||||
['NoPay']=false,
|
||||
},
|
||||
},
|
||||
|
||||
[3007]={
|
||||
['id']=3007,
|
||||
['name']='UIGoddess',
|
||||
['type']=3,
|
||||
['mainViewType']=0,
|
||||
['need_mask']=false,
|
||||
['lua_path']='',
|
||||
['res_path']='UIGoddess/UIGoddess',
|
||||
['childPaths']='',
|
||||
['page_anim_in_type']=3,
|
||||
['page_anim_out_type']=4,
|
||||
['hide_main_top']=false,
|
||||
['hide_main_bottom']=false,
|
||||
['need_persistent']=false,
|
||||
['battle_main_page']=false,
|
||||
['need_cache']=true,
|
||||
['can_limit_gift']=false,
|
||||
['top_res_id']=0,
|
||||
['top_btn_display_state']=false,
|
||||
['NoPay']=false,
|
||||
},
|
||||
}
|
||||
return UICfg
|
||||
@ -179,7 +179,8 @@ local Enum = {
|
||||
UIRank = 3003,
|
||||
UITeam = 3004,
|
||||
UIRoleInfo = 3005,
|
||||
UIRoleInfo = 3006
|
||||
UISkillList = 3006,
|
||||
UIGoddess = 3007
|
||||
},
|
||||
|
||||
ParamState = {
|
||||
|
||||
@ -298,5 +298,6 @@ local UIPageName = {
|
||||
UITeam = 3004,
|
||||
UIRoleInfo = 3005,
|
||||
UISkillList = 3006,
|
||||
UIGoddess = 3007,
|
||||
}
|
||||
return setmetatable(UIPageName, { __index = Enum.UIPageName })
|
||||
8
Assets/Lua/UI/UIGoddess.meta
Normal file
8
Assets/Lua/UI/UIGoddess.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 857259387c83cb349bca1335fdea15f9
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
345
Assets/Lua/UI/UIGoddess/UIGoddessCtr.lua
Normal file
345
Assets/Lua/UI/UIGoddess/UIGoddessCtr.lua
Normal file
@ -0,0 +1,345 @@
|
||||
local UIGoddessCtr = class("UIGoddessCtr", require("UICtrBase"))
|
||||
|
||||
function UIGoddessCtr:Init(view)
|
||||
self.view = view
|
||||
end
|
||||
|
||||
function UIGoddessCtr:SetData(data)
|
||||
self.asyncIdx = 0
|
||||
if data == nil then return end
|
||||
self.data = data
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetAsyncIdx()
|
||||
self.asyncIdx = self.asyncIdx + 1
|
||||
return self.asyncIdx
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetData()
|
||||
return self.data
|
||||
end
|
||||
|
||||
function UIGoddessCtr:OnDispose()
|
||||
self.areaMaxId = nil
|
||||
self.rawCount = nil
|
||||
self.rewardMaxTime = nil
|
||||
self.rewardInterval = nil
|
||||
self.rewardRate = nil
|
||||
self.baseRewards = nil
|
||||
self.buyCosts = nil
|
||||
self.defaultHeroCute = nil
|
||||
self.robotHeroCute = nil
|
||||
self.showRawIdxs = nil
|
||||
self.sloganStartTime = nil
|
||||
self.sloganShowTime = nil
|
||||
self.sloganHideTime = nil
|
||||
self.sloganNumMax = nil
|
||||
self.lastAttackAreaId = nil
|
||||
|
||||
self.data = nil
|
||||
self.view = nil
|
||||
end
|
||||
|
||||
function UIGoddessCtr:InitData()
|
||||
self.areaMaxId = ManagerContainer.DataMgr.HundredDojoDataMgr:GetAreaMaxId()
|
||||
self:CalcRawCount()
|
||||
self.rewardMaxTime = GlobalConfig.Instance:GetConfigIntValue(255) * 3600
|
||||
self.rewardInterval = GlobalConfig.Instance:GetConfigIntValue(252)
|
||||
if self.rewardInterval <= 0 then self.rewardInterval = 1 end
|
||||
self.rewardRate = 60 / self.rewardInterval
|
||||
local baseRewardStr = GlobalConfig.Instance:GetConfigStrValue(301)
|
||||
self.baseRewards = CommonUtil.DeserializeGlobalStrToNumberTable(baseRewardStr)
|
||||
local costStr = GlobalConfig.Instance:GetConfigStrValue(265)
|
||||
self.buyCosts = CommonUtil.DeserializeGlobalStrToNumberTable(costStr)
|
||||
self.defaultHeroCute = GlobalConfig.Instance:GetConfigStrValue(259)
|
||||
self.robotHeroCute = GlobalConfig.Instance:GetConfigStrValue(258)
|
||||
local sloganShowStr = GlobalConfig.Instance:GetConfigStrValue(277)
|
||||
local sloganShowInfos = CommonUtil.DeserializeGlobalStrToNumberTable(sloganShowStr)
|
||||
self.sloganStartTime = 2
|
||||
self.sloganShowTime = 5
|
||||
self.sloganHideTime = 5
|
||||
if sloganShowInfos then
|
||||
if sloganShowInfos[1] then
|
||||
self.sloganStartTime = sloganShowInfos[1]
|
||||
end
|
||||
if sloganShowInfos[2] then
|
||||
self.sloganShowTime = sloganShowInfos[2]
|
||||
end
|
||||
if sloganShowInfos[3] then
|
||||
self.sloganHideTime = sloganShowInfos[3]
|
||||
end
|
||||
end
|
||||
self.sloganNumMax = GlobalConfig.Instance:GetConfigIntValue(278) or 5
|
||||
|
||||
self.showRawIdxs = {}
|
||||
self.lastAttackAreaId = ManagerContainer.DataMgr.HundredDojoDataMgr:GetLastAttackAreaId()
|
||||
ManagerContainer.DataMgr.HundredDojoDataMgr:ClearLastAttackAreaId()
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetChallengeCount()
|
||||
return ManagerContainer.DataMgr.HundredDojoDataMgr:GetChallengeCount()
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetBuyChallengeCount()
|
||||
return ManagerContainer.DataMgr.HundredDojoDataMgr:GetBuyChallengeCount()
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetBuyChallengeCountCost()
|
||||
local buyCount = self:GetBuyChallengeCount()
|
||||
if self.buyCosts then
|
||||
buyCount = Mathf.Clamp(buyCount + 1, 1, #self.buyCosts)
|
||||
local buyCost = self.buyCosts[buyCount]
|
||||
if buyCost then
|
||||
return buyCost[1], buyCost[2]
|
||||
end
|
||||
end
|
||||
return 1, 100
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetAreaMaxId()
|
||||
return self.areaMaxId
|
||||
end
|
||||
|
||||
function UIGoddessCtr:CalcRawCount()
|
||||
local normalAreaMaxId = (self.areaMaxId - 1)
|
||||
local rawCount = Mathf.Floor(normalAreaMaxId / 5)
|
||||
local remain = (normalAreaMaxId - rawCount * 5)
|
||||
rawCount = rawCount * 2
|
||||
if remain > 2 then
|
||||
rawCount = rawCount + 2
|
||||
elseif remain > 0 then
|
||||
rawCount = rawCount + 1
|
||||
end
|
||||
self.rawCount = rawCount + 1
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetRawCount()
|
||||
return self.rawCount
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetRawAreaStartAndEnd(rawIdx)
|
||||
if rawIdx == 0 then
|
||||
return 1, 1
|
||||
end
|
||||
local count = Mathf.Floor(rawIdx / 2) * 5 + 1
|
||||
local remain = rawIdx % 2
|
||||
local startId, endId
|
||||
if remain == 1 then
|
||||
startId = count + 1
|
||||
endId = count + 2
|
||||
else
|
||||
startId = count - 2
|
||||
endId = count
|
||||
end
|
||||
if startId > self.areaMaxId then
|
||||
startId = self.areaMaxId
|
||||
end
|
||||
if endId > self.areaMaxId then
|
||||
endId = self.areaMaxId
|
||||
end
|
||||
return startId, endId
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetRawIdxByAreaId(areaId)
|
||||
if areaId == 1 then
|
||||
return 0, 1
|
||||
end
|
||||
local normalAreaMaxId = (areaId - 1)
|
||||
local rawIdx = Mathf.Floor(normalAreaMaxId / 5)
|
||||
local remain = (normalAreaMaxId - rawIdx * 5)
|
||||
rawIdx = rawIdx * 2
|
||||
if remain > 2 then
|
||||
rawIdx = rawIdx + 1
|
||||
remain = remain - 2
|
||||
elseif remain == 0 then
|
||||
rawIdx = rawIdx - 1
|
||||
remain = 3
|
||||
elseif remain < 0 then
|
||||
LogError('[wboy] calc error ' .. tostring(areaId))
|
||||
end
|
||||
return rawIdx + 1, remain
|
||||
end
|
||||
|
||||
function UIGoddessCtr:AddShowRawIdx(rawIdx)
|
||||
if not CommonUtil.EleInTable(rawIdx, self.showRawIdxs) then
|
||||
self.showRawIdxs[#self.showRawIdxs+1] = rawIdx
|
||||
end
|
||||
end
|
||||
|
||||
function UIGoddessCtr:RemoveShowRawIdx(rawIdx)
|
||||
for k,v in pairs(self.showRawIdxs) do
|
||||
if v == rawIdx then
|
||||
table.remove(self.showRawIdxs, k)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetShowRawIdxs()
|
||||
return self.showRawIdxs
|
||||
end
|
||||
|
||||
function UIGoddessCtr:IsSelfArea(id)
|
||||
local selfAreaData = self:GetSelfAreaData()
|
||||
if selfAreaData and selfAreaData:IsValidData() and (selfAreaData.id == id) then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function UIGoddessCtr:IsLastBeAtkArea(uid)
|
||||
if not uid then
|
||||
return false
|
||||
end
|
||||
local lastBeAtkUid = ManagerContainer.DataMgr.HundredDojoDataMgr:GetLastBeAttackUid()
|
||||
if not lastBeAtkUid then
|
||||
return false
|
||||
end
|
||||
return int64.equals(lastBeAtkUid, uid)
|
||||
end
|
||||
|
||||
function UIGoddessCtr:IsSameGuild(guildId)
|
||||
local guildData = ManagerContainer.DataMgr.GuildDataMgr:GetCurGuildData()
|
||||
if guildData then
|
||||
return guildData:IsSameGuild(guildId)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function UIGoddessCtr:ForceHandleRewardRedPoint()
|
||||
ManagerContainer.DataMgr.HundredDojoDataMgr:HandleRewardRedPoint()
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetUserNickname()
|
||||
return ManagerContainer.DataMgr.UserData:GetUserNickname()
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetTotalFightPower()
|
||||
return ManagerContainer.DataMgr.UserData:GetTotalFightPower()
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetUserRoleId()
|
||||
return ManagerContainer.DataMgr.UserData:GetUserRoleId()
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetSelfAreaData()
|
||||
return ManagerContainer.DataMgr.HundredDojoDataMgr:GetSelfAreaData()
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetAreaDataById(id)
|
||||
return ManagerContainer.DataMgr.HundredDojoDataMgr:GetAreaDataById(id)
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetBaseRewardStartTime()
|
||||
return ManagerContainer.DataMgr.HundredDojoDataMgr:GetBaseRewardStartTime()
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetLastAttackAreaId()
|
||||
return self.lastAttackAreaId
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetRewardMaxTime()
|
||||
return self.rewardMaxTime
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetRewardInterval()
|
||||
return self.rewardInterval
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetRewardRate()
|
||||
return self.rewardRate
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetBaseRewards()
|
||||
return self.baseRewards
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetDefaultHeroCute()
|
||||
return self.defaultHeroCute
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetRobotHeroCute()
|
||||
return self.robotHeroCute
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetSloganStartTime()
|
||||
return self.sloganStartTime
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetSloganShowTime()
|
||||
return self.sloganShowTime
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetSloganHideTime()
|
||||
return self.sloganHideTime
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetSloganNumMax()
|
||||
return self.sloganNumMax
|
||||
end
|
||||
|
||||
function UIGoddessCtr:IsTreasureShow()
|
||||
if (ManagerContainer.DataMgr.CompetitionData:GetCurMaxSeason() == 3) then
|
||||
local stage = ManagerContainer.DataMgr.CompetitionData:GetCurStageAndNextTime(true)
|
||||
return (stage == 2)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
function UIGoddessCtr:GetSelfSlogan()
|
||||
return ManagerContainer.DataMgr.HundredDojoDataMgr:GetSlogan()
|
||||
end
|
||||
|
||||
function UIGoddessCtr:GetOwnResCountByItemId(itemCfgId)
|
||||
return CommonUtil.GetOwnResCountByItemId(itemCfgId)
|
||||
end
|
||||
|
||||
|
||||
function UIGoddessCtr:SendGetSelfInfoReq()
|
||||
if not ManagerContainer.DataMgr.HundredDojoDataMgr:SendGetAreaInfoReq(ManagerContainer.DataMgr.UserData:GetUserId()) then
|
||||
return 100007
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
function UIGoddessCtr:SendGetOtherInfosReq(areaIds)
|
||||
if not ManagerContainer.DataMgr.HundredDojoDataMgr:SendGetOtherInfosReq(areaIds) then
|
||||
return 100007
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
function UIGoddessCtr:SendGetRewardReq()
|
||||
local baseRewardTime = self:GetBaseRewardStartTime()
|
||||
local remainTime = 0
|
||||
if baseRewardTime then
|
||||
remainTime = ManagerContainer.LuaTimerMgr:CurLuaServerTime() - baseRewardTime
|
||||
remainTime = remainTime / 1000
|
||||
if type(remainTime) == 'userdata' then
|
||||
remainTime = #remainTime
|
||||
end
|
||||
end
|
||||
if remainTime < self:GetRewardInterval() then
|
||||
return 250
|
||||
end
|
||||
if not ManagerContainer.DataMgr.HundredDojoDataMgr:SendGetRewardReq() then
|
||||
return 100007
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
function UIGoddessCtr:SendBuyChallengeNumReq()
|
||||
local costCfgId, costNum = self:GetBuyChallengeCountCost()
|
||||
local ownNum = self:GetOwnResCountByItemId(costCfgId)
|
||||
if ownNum < costNum then
|
||||
return 1, costCfgId
|
||||
end
|
||||
if not ManagerContainer.DataMgr.HundredDojoDataMgr:SendBuyChallengeNumReq() then
|
||||
return 100007, nil
|
||||
end
|
||||
return 0, nil
|
||||
end
|
||||
|
||||
return UIGoddessCtr
|
||||
|
||||
7
Assets/Lua/UI/UIGoddess/UIGoddessCtr.lua.meta
Normal file
7
Assets/Lua/UI/UIGoddess/UIGoddessCtr.lua.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 07e66d3925373fe46b5f7cad937712de
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
1476
Assets/Lua/UI/UIGoddess/UIGoddessView.lua
Normal file
1476
Assets/Lua/UI/UIGoddess/UIGoddessView.lua
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Lua/UI/UIGoddess/UIGoddessView.lua.meta
Normal file
7
Assets/Lua/UI/UIGoddess/UIGoddessView.lua.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 200044fe68049214889c6c9beff62c32
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
1600
Assets/Lua/UI/UIGoddess/UIGoddessView_Generate.lua
Normal file
1600
Assets/Lua/UI/UIGoddess/UIGoddessView_Generate.lua
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Lua/UI/UIGoddess/UIGoddessView_Generate.lua.meta
Normal file
7
Assets/Lua/UI/UIGoddess/UIGoddessView_Generate.lua.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e36c513f24da11a4e9ce5ff8341e108f
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
x
Reference in New Issue
Block a user