Update - 1.12.0.120
EN: 1.12.0.120 CN: 1.12.0.120 JP: 1.12.0.124 KR: 1.12.0.124
This commit is contained in:
@@ -46,7 +46,9 @@ QuestWorldClassCtrl._mapNodeConfig = {
|
||||
goLevelItem = {
|
||||
sCtrlName = "Game.UI.Quest.WorldClass.WorldClassItemCtrl"
|
||||
},
|
||||
rtLevelLsv = {},
|
||||
rtLevelLsv = {
|
||||
sComponentName = "RectTransform"
|
||||
},
|
||||
levelLsv = {
|
||||
sComponentName = "LoopScrollView"
|
||||
},
|
||||
@@ -58,6 +60,16 @@ QuestWorldClassCtrl._mapNodeConfig = {
|
||||
rectContentSize = {
|
||||
sNodeName = "txtContentSize",
|
||||
sComponentName = "RectTransform"
|
||||
},
|
||||
btnFastReceive = {sComponentName = "UIButton"},
|
||||
txtBtnFastReceive = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Quest_Fast_Receive_Btn_Text"
|
||||
},
|
||||
btnFastReceiveGray = {sComponentName = "UIButton"},
|
||||
txtBtnFastReceiveGray = {
|
||||
sComponentName = "TMP_Text",
|
||||
sLanguageId = "Quest_Fast_Receive_Btn_Text"
|
||||
}
|
||||
}
|
||||
QuestWorldClassCtrl._mapEventConfig = {
|
||||
@@ -129,6 +141,28 @@ function QuestWorldClassCtrl:RefreshDemonList()
|
||||
local posX = self._mapNode.rtWorldClassLsv.anchoredPosition.x
|
||||
local posY = bMax and worldClassLsvPosY_1 or worldClassLsvPosY_2
|
||||
self._mapNode.rtWorldClassLsv.anchoredPosition = Vector2(posX, posY)
|
||||
self:RefreshFastReceiveBtn()
|
||||
end
|
||||
function QuestWorldClassCtrl:RefreshFastReceiveBtn()
|
||||
self.tbWorldClassFastReceive = {}
|
||||
for _, mapData in ipairs(self.tbWorldClass or {}) do
|
||||
if mapData.nType == AllEnum.WorldClassType.LevelUp then
|
||||
local nMin = mapData.nMinLevel or 1
|
||||
local nMax = math.min(mapData.nMaxLevel or self.nCurWorldClass, self.nCurWorldClass)
|
||||
for nLv = nMin, nMax do
|
||||
if PlayerData.Base:GetWorldClassState(nLv) then
|
||||
table.insert(self.tbWorldClassFastReceive, nLv)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local bCanReceive = #self.tbWorldClassFastReceive > 0
|
||||
if self._mapNode.btnFastReceive ~= nil then
|
||||
self._mapNode.btnFastReceive.gameObject:SetActive(bCanReceive)
|
||||
end
|
||||
if self._mapNode.btnFastReceiveGray ~= nil then
|
||||
self._mapNode.btnFastReceiveGray.gameObject:SetActive(not bCanReceive)
|
||||
end
|
||||
end
|
||||
function QuestWorldClassCtrl:OnWorldClassGridRefresh(goGrid, nGridIndex)
|
||||
local nIndex = nGridIndex + 1
|
||||
@@ -152,7 +186,10 @@ function QuestWorldClassCtrl:RefreshLevelInfo(nIndex)
|
||||
self._mapNode.rtWorldClassList.gameObject:SetActive(false)
|
||||
local data = self.tbWorldClass[nIndex]
|
||||
if data ~= nil then
|
||||
self._mapNode.goLevelItem:SetItem(data)
|
||||
local goBtnFastReceive = self._mapNode.btnFastReceive
|
||||
local goBtnFastReceiveGray = self._mapNode.btnFastReceiveGray
|
||||
local rtLevelLsv = self._mapNode.rtLevelLsv
|
||||
self._mapNode.goLevelItem:SetItem(data, goBtnFastReceive, goBtnFastReceiveGray, rtLevelLsv)
|
||||
if data.nType == AllEnum.WorldClassType.LevelUp then
|
||||
self._mapNode.rtLevelLsv.gameObject:SetActive(true)
|
||||
self._mapNode.rtQuestLsv.gameObject:SetActive(false)
|
||||
@@ -215,7 +252,7 @@ function QuestWorldClassCtrl:RefreshLevelUpInfo(data)
|
||||
end
|
||||
self._mapNode.levelLsv:InitEx(self.tbLevelGridHeight, self, self.OnLevelGridRefresh)
|
||||
if 1 < nIndex then
|
||||
self:AddTimer(1, 0.1, function()
|
||||
self:AddTimer(1, 0.15, function()
|
||||
if PlayerData.Guide:CheckInGuideGroup(9) then
|
||||
nIndex = 2
|
||||
end
|
||||
@@ -344,4 +381,15 @@ end
|
||||
function QuestWorldClassCtrl:OnEvent_DisableScrollView(bDisable)
|
||||
NovaAPI.SetScrollRectVertical(self._mapNode.levelLsv, not bDisable)
|
||||
end
|
||||
function QuestWorldClassCtrl:OnBtnClick_FastReceive()
|
||||
if self.tbWorldClassFastReceive == nil or #self.tbWorldClassFastReceive == 0 then
|
||||
return
|
||||
end
|
||||
PlayerData.Base:SendPlayerWorldClassRewardReceiveReq(nil, nil, function()
|
||||
self:RefreshFastReceiveBtn()
|
||||
end, 1)
|
||||
end
|
||||
function QuestWorldClassCtrl:OnBtnClick_FastReceiveGray()
|
||||
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("DoubleDrop_Reward_Receive_Tip"))
|
||||
end
|
||||
return QuestWorldClassCtrl
|
||||
|
||||
@@ -63,8 +63,14 @@ local worldClass_CanReceive = 3
|
||||
local worldClass_Received = 4
|
||||
local totalLength = 674
|
||||
local totalHeight = 37
|
||||
function WorldClassItemCtrl:SetItem(itemData)
|
||||
function WorldClassItemCtrl:SetItem(itemData, goBtnFastReceive, goBtnFastReceiveGray, rtLevelLsv)
|
||||
self.itemData = itemData
|
||||
self.goBtnFastReceive = goBtnFastReceive or nil
|
||||
self.goBtnFastReceiveGray = goBtnFastReceiveGray or nil
|
||||
self.rtLevelLsv = rtLevelLsv or nil
|
||||
if self.nLsvDefaultHeight == nil and rtLevelLsv ~= nil then
|
||||
self.nLsvDefaultHeight = rtLevelLsv.offsetMin
|
||||
end
|
||||
self.nCurWorldClass = PlayerData.Base:GetWorldClass()
|
||||
if itemData.nType == AllEnum.WorldClassType.LevelUp then
|
||||
self:SetLevelUpItem()
|
||||
@@ -185,16 +191,44 @@ function WorldClassItemCtrl:SetAdvanceItem()
|
||||
RedDotManager.RegisterNode(RedDotDefine.WorldClass_Advance, self.itemData.nId, self._mapNode.redDot, nil, nil, true)
|
||||
end
|
||||
function WorldClassItemCtrl:RefreshRewardState()
|
||||
self._mapNode.goingTip.gameObject:SetActive(self.nState == worldClass_Going)
|
||||
self._mapNode.goingTip.gameObject:SetActive(self.nState == worldClass_Going or self.nState == worldClass_CanReceive)
|
||||
self._mapNode.imgComplete.gameObject:SetActive(self.nState == worldClass_Received)
|
||||
self._mapNode.txtLock.gameObject:SetActive(self.nState == worldClass_Lock)
|
||||
self._mapNode.btnReceive.gameObject:SetActive(self.nState == worldClass_CanReceive)
|
||||
if self.goBtnFastReceive == nil then
|
||||
return
|
||||
end
|
||||
if self.handlerBtn == nil then
|
||||
self.handlerBtn = {}
|
||||
end
|
||||
self.goBtnFastReceive.gameObject:SetActive(self.nState == worldClass_CanReceive)
|
||||
self.goBtnFastReceive.onClick:RemoveAllListeners()
|
||||
self.handlerBtn[1] = ui_handler(self, self.OnBtnClick_Receive)
|
||||
self.goBtnFastReceive.onClick:AddListener(self.handlerBtn[1])
|
||||
self.goBtnFastReceiveGray.gameObject:SetActive(self.nState ~= worldClass_CanReceive)
|
||||
self.goBtnFastReceiveGray.onClick:RemoveAllListeners()
|
||||
self.handlerBtn[2] = ui_handler(self, self.OnBtnClick_ReceiveGray)
|
||||
self.goBtnFastReceiveGray.onClick:AddListener(self.handlerBtn[2])
|
||||
if self.nState == worldClass_Received then
|
||||
self.rtLevelLsv.offsetMin = self.nLsvDefaultHeight
|
||||
self.goBtnFastReceive.gameObject:SetActive(false)
|
||||
self.goBtnFastReceiveGray.gameObject:SetActive(false)
|
||||
else
|
||||
local v2 = Vector2(self.nLsvDefaultHeight.x, self.nLsvDefaultHeight.y + 100)
|
||||
self.rtLevelLsv.offsetMin = v2
|
||||
end
|
||||
end
|
||||
function WorldClassItemCtrl:Awake()
|
||||
end
|
||||
function WorldClassItemCtrl:OnEnable()
|
||||
end
|
||||
function WorldClassItemCtrl:OnDisable()
|
||||
if self.goBtnFastReceive ~= nil then
|
||||
self.goBtnFastReceive.onClick:RemoveListener(self.handlerBtn[1])
|
||||
self.handlerBtn[1] = nil
|
||||
self.goBtnFastReceiveGray.onClick:RemoveListener(self.handlerBtn[2])
|
||||
self.handlerBtn[2] = nil
|
||||
self.handlerBtn = {}
|
||||
end
|
||||
end
|
||||
function WorldClassItemCtrl:OnDestroy()
|
||||
end
|
||||
@@ -210,6 +244,9 @@ function WorldClassItemCtrl:OnBtnClick_Receive()
|
||||
PlayerData.Base:SendPlayerWorldClassAdvanceReq(self.itemData.nId)
|
||||
end
|
||||
end
|
||||
function WorldClassItemCtrl:OnBtnClick_ReceiveGray()
|
||||
EventManager.Hit(EventId.OpenMessageBox, ConfigTable.GetUIText("DoubleDrop_Reward_Receive_Tip"))
|
||||
end
|
||||
function WorldClassItemCtrl:OnBtnClick_RewardItem(btn, nIndex)
|
||||
local nTid = self.tbReward[nIndex].nId
|
||||
UTILS.ClickItemGridWithTips(nTid, btn.gameObject.transform, false, true, false)
|
||||
|
||||
Reference in New Issue
Block a user