This commit is contained in:
puxuan 2025-08-11 10:17:14 +08:00
parent 9eeb439375
commit c259588969

View File

@ -1,7 +1,7 @@
local SelectOtherBtnUI = class("SelectOtherBtnUI", BaseUI)
local BTN_OFFSET = 32
local BTN_INTERVAL = 16
local BTN_OFFSET = -10
local BTN_INTERVAL = 56
function SelectOtherBtnUI:ctor()
end
@ -20,7 +20,7 @@ end
function SelectOtherBtnUI:onLoadRootComplete()
self.uiMap = self.root:genAllChildren()
self.uiMap["select_other_btn_ui.mask"]:addClickListener(function()
self.root:addClickListener(function()
self:closeUI()
end)
self.uiMap["select_other_btn_ui.bg.mail_btn"]:addClickListener(function()
@ -28,14 +28,30 @@ function SelectOtherBtnUI:onLoadRootComplete()
ModuleManager.MailManager:showMailUI()
end)
local cellHeight = self.uiMap["select_other_btn_ui.bg.setting_btn"]:getRectHeight()
local cellCount = 0
local y = -BTN_OFFSET
cellCount = cellCount + 1
y = y - BTN_INTERVAL
local settingBtn = self.uiMap["select_other_btn_ui.bg.setting_btn"]
if DataManager.AIHelperData:getRp() then
settingBtn:addRedPoint(124, 35, 0.8, nil, nil, true)
else
settingBtn:removeRedPoint()
end
settingBtn:setAnchoredPositionY(y)
settingBtn:addClickListener(function()
self:closeUI()
ModuleManager.GameSettingManager:showSettingUI()
end)
self.uiMap["select_other_btn_ui.bg.setting_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC))
if DataManager.MailData:getIsOpen() then
cellCount = cellCount + 1
y = y - BTN_INTERVAL
self.uiMap["select_other_btn_ui.bg.mail_btn"]:setVisible(true)
self.uiMap["select_other_btn_ui.bg.mail_btn"]:setAnchoredPositionY(y)
y = y - BTN_INTERVAL - cellHeight
local redPoint, isAdRedPoint = DataManager.MailData:getRedPoint()
if redPoint then
if isAdRedPoint then
@ -50,21 +66,37 @@ function SelectOtherBtnUI:onLoadRootComplete()
else
self.uiMap["select_other_btn_ui.bg.mail_btn"]:setVisible(false)
end
if true then
cellCount = cellCount + 1
local settingBtn = self.uiMap["select_other_btn_ui.bg.setting_btn"]
if DataManager.AIHelperData:getRp() then
settingBtn:addRedPoint(124, 35, 0.8, nil, nil, true)
else
settingBtn:removeRedPoint()
end
settingBtn:setAnchoredPositionY(y)
settingBtn:addClickListener(function()
y = y - BTN_INTERVAL
local bagBtn = self.uiMap["select_other_btn_ui.bg.bag_btn"]
-- if DataManager.AIHelperData:getRp() then
-- bagBtn:addRedPoint(124, 35, 0.8, nil, nil, true)
-- else
-- bagBtn:removeRedPoint()
-- end
bagBtn:setAnchoredPositionY(y)
bagBtn:addClickListener(function()
self:closeUI()
ModuleManager.GameSettingManager:showSettingUI()
end)
self.uiMap["select_other_btn_ui.bg.setting_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC))
self.uiMap["select_other_btn_ui.bg.bag_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC))
end
self.uiMap["select_other_btn_ui.bg"]:setSizeDeltaY(cellCount*cellHeight + (cellCount - 1)*BTN_INTERVAL + BTN_OFFSET*2)
if Platform:getIsDevChannel() then
cellCount = cellCount + 1
y = y - BTN_INTERVAL
local gmBtn = self.uiMap["select_other_btn_ui.bg.gm_btn"]
gmBtn:setAnchoredPositionY(y)
gmBtn:addClickListener(function()
self:closeUI()
ModuleManager.DevToolManager:showOrHideDevListUI()
end)
self.uiMap["select_other_btn_ui.bg.gm_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC))
end
self.uiMap["select_other_btn_ui.bg"]:setSizeDeltaY(cellCount*BTN_INTERVAL - BTN_OFFSET*2)
end
return SelectOtherBtnUI