This commit is contained in:
puxuan 2025-11-08 17:16:58 +08:00
parent 1a3f85d55b
commit e9ad1db4b3
2 changed files with 16 additions and 6 deletions

View File

@ -1,7 +1,7 @@
local SelectOtherBtnUI = class("SelectOtherBtnUI", BaseUI) local SelectOtherBtnUI = class("SelectOtherBtnUI", BaseUI)
local BTN_OFFSET = -14 local BTN_OFFSET = -26
local BTN_INTERVAL = 56 local BTN_INTERVAL = 59
function SelectOtherBtnUI:ctor() function SelectOtherBtnUI:ctor()
end end
@ -28,6 +28,10 @@ function SelectOtherBtnUI:onLoadRootComplete()
ModuleManager.MailManager:showMailUI() ModuleManager.MailManager:showMailUI()
end) end)
local line1 = self.uiMap["select_other_btn_ui.bg.line_1"]
local line2 = self.uiMap["select_other_btn_ui.bg.line_2"]
local line3 = self.uiMap["select_other_btn_ui.bg.line_3"]
local cellCount = 0 local cellCount = 0
local y = -BTN_OFFSET local y = -BTN_OFFSET
@ -47,6 +51,7 @@ function SelectOtherBtnUI:onLoadRootComplete()
self.uiMap["select_other_btn_ui.bg.setting_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC)) self.uiMap["select_other_btn_ui.bg.setting_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC))
if DataManager.MailData:getIsOpen() then if DataManager.MailData:getIsOpen() then
line1:setActive(true)
cellCount = cellCount + 1 cellCount = cellCount + 1
y = y - BTN_INTERVAL y = y - BTN_INTERVAL
self.uiMap["select_other_btn_ui.bg.mail_btn"]:setVisible(true) self.uiMap["select_other_btn_ui.bg.mail_btn"]:setVisible(true)
@ -64,10 +69,12 @@ function SelectOtherBtnUI:onLoadRootComplete()
end end
self.uiMap["select_other_btn_ui.bg.mail_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.MAIL_NAME)) self.uiMap["select_other_btn_ui.bg.mail_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.MAIL_NAME))
else else
line1:setActive(false)
self.uiMap["select_other_btn_ui.bg.mail_btn"]:setVisible(false) self.uiMap["select_other_btn_ui.bg.mail_btn"]:setVisible(false)
end end
if DataManager.BagData:getIsOpen() then if DataManager.BagData:getIsOpen() then
line2:setActive(true)
cellCount = cellCount + 1 cellCount = cellCount + 1
y = y - BTN_INTERVAL y = y - BTN_INTERVAL
local bagBtn = self.uiMap["select_other_btn_ui.bg.bag_btn"] local bagBtn = self.uiMap["select_other_btn_ui.bg.bag_btn"]
@ -83,10 +90,12 @@ function SelectOtherBtnUI:onLoadRootComplete()
end) end)
self.uiMap["select_other_btn_ui.bg.bag_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.BAG_DESC_1)) self.uiMap["select_other_btn_ui.bg.bag_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.BAG_DESC_1))
else else
line2:setActive(false)
self.uiMap["select_other_btn_ui.bg.bag_btn"]:setVisible(false) self.uiMap["select_other_btn_ui.bg.bag_btn"]:setVisible(false)
end end
if EDITOR_MODE or Platform:getIsDevChannel() then if EDITOR_MODE or Platform:getIsDevChannel() then
line3:setActive(true)
cellCount = cellCount + 1 cellCount = cellCount + 1
y = y - BTN_INTERVAL y = y - BTN_INTERVAL
local gmBtn = self.uiMap["select_other_btn_ui.bg.gm_btn"] local gmBtn = self.uiMap["select_other_btn_ui.bg.gm_btn"]
@ -97,10 +106,11 @@ function SelectOtherBtnUI:onLoadRootComplete()
end) end)
self.uiMap["select_other_btn_ui.bg.gm_btn.text"]:setText("GM") self.uiMap["select_other_btn_ui.bg.gm_btn.text"]:setText("GM")
else else
line3:setActive(false)
self.uiMap["select_other_btn_ui.bg.gm_btn"]:setVisible(false) self.uiMap["select_other_btn_ui.bg.gm_btn"]:setVisible(false)
end end
self.uiMap["select_other_btn_ui.bg"]:setSizeDeltaY(cellCount*BTN_INTERVAL - BTN_OFFSET*2) self.uiMap["select_other_btn_ui.bg"]:setSizeDeltaY(cellCount*BTN_INTERVAL + 8)
end end
return SelectOtherBtnUI return SelectOtherBtnUI

View File

@ -534,7 +534,7 @@ function MainCityUI:refreshTask()
self.taskBtn:setVisible(true) self.taskBtn:setVisible(true)
local showRedPoint = DataManager.DailyTaskData:showRedPoint() local showRedPoint = DataManager.DailyTaskData:showRedPoint()
if showRedPoint then if showRedPoint then
self.taskBtn:addRedPoint(32, 28, 1) self.taskBtn:addRedPoint(28, 36, 1)
else else
self.taskBtn:removeRedPoint() self.taskBtn:removeRedPoint()
end end
@ -615,7 +615,7 @@ end
function MainCityUI:refreshSettingBtn() function MainCityUI:refreshSettingBtn()
if (DataManager.MailData:getIsOpen() and DataManager.MailData:getRedPoint()) or DataManager.AIHelperData:getRp() then if (DataManager.MailData:getIsOpen() and DataManager.MailData:getRedPoint()) or DataManager.AIHelperData:getRp() then
self.settingBtn:addRedPoint(40, 40, 1) self.settingBtn:addRedPoint(32, 36, 1)
else else
self.settingBtn:removeRedPoint() self.settingBtn:removeRedPoint()
end end