From 284f7ce3c7b02ba53b3b47eb0cef37d7c87692a9 Mon Sep 17 00:00:00 2001 From: chenxi Date: Tue, 30 May 2023 18:17:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=95=8C=E9=9D=A2=E9=87=8C?= =?UTF-8?q?=E7=9A=84=E9=82=AE=E7=AE=B1=E5=8A=A0=E4=B8=80=E4=B8=AA=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/common/module_manager.lua | 1 + lua/app/config/const.lua | 2 +- lua/app/config/func_open.lua | 6 +++- .../ui/game_setting/select_other_btn_ui.lua | 34 ++++++++++++++----- lua/app/ui/main_city/main_city_ui.lua | 2 +- lua/app/userdata/mail/mail_data.lua | 5 +-- 6 files changed, 34 insertions(+), 16 deletions(-) diff --git a/lua/app/common/module_manager.lua b/lua/app/common/module_manager.lua index a85a2788..8156827b 100644 --- a/lua/app/common/module_manager.lua +++ b/lua/app/common/module_manager.lua @@ -65,6 +65,7 @@ ModuleManager.MODULE_KEY = { DAILY_CHALLENGE = "daily_challenge", -- 每日挑战 FUND = "act_level_gift", -- 成长基金 ACT_GIFT_SHOW_OPEN = "act_gift_show_open", -- 弹窗礼包通用开启条件 + MAIL = "mail_open", -- 邮件 } local _moduleMgrs = {} diff --git a/lua/app/config/const.lua b/lua/app/config/const.lua index 5c33ec3e..495973e2 100644 --- a/lua/app/config/const.lua +++ b/lua/app/config/const.lua @@ -190,7 +190,7 @@ local const = { ["value"]=7 }, ["model_daily_challenge"]={ - ["value"]=8000 + ["value"]=6000 }, ["level_fund_hero_1"]={ ["value"]=24001 diff --git a/lua/app/config/func_open.lua b/lua/app/config/func_open.lua index 59b643f4..f5c984ff 100644 --- a/lua/app/config/func_open.lua +++ b/lua/app/config/func_open.lua @@ -54,9 +54,13 @@ local func_open = { ["new_player_gift"]={ ["stage"]=2, ["pop_ups"]=1 + }, + ["mail_open"]={ + ["stage"]=2, + ["pop_ups"]=1 } } local config = { -data=func_open,count=14 +data=func_open,count=15 } return config \ No newline at end of file diff --git a/lua/app/ui/game_setting/select_other_btn_ui.lua b/lua/app/ui/game_setting/select_other_btn_ui.lua index 553c45e7..082a4439 100644 --- a/lua/app/ui/game_setting/select_other_btn_ui.lua +++ b/lua/app/ui/game_setting/select_other_btn_ui.lua @@ -1,5 +1,8 @@ local SelectOtherBtnUI = class("SelectOtherBtnUI", BaseUI) +local BTN_OFFSET = 32 +local BTN_INTERVAL = 16 + function SelectOtherBtnUI:ctor() end @@ -21,24 +24,37 @@ function SelectOtherBtnUI:onLoadRootComplete() ModuleManager.MailManager:showMailUI() end) - local redPoint, isAdRedPoint = DataManager.MailData:getRedPoint() - if redPoint then - if isAdRedPoint then - self.uiMap["select_other_btn_ui.bg.mail_btn"]:addRedPoint(124, 35, 1, "common_ad_3", nil, true) + local cellHeight = self.uiMap["select_other_btn_ui.bg.setting_btn"]:getRectHeight() + local cellCount = 0 + local y = -BTN_OFFSET + if DataManager.MailData:getIsOpen() then + cellCount = cellCount + 1 + 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 + self.uiMap["select_other_btn_ui.bg.mail_btn"]:addRedPoint(124, 35, 1, "common_ad_3", nil, true) + else + self.uiMap["select_other_btn_ui.bg.mail_btn"]:addRedPoint(124, 35, 0.8) + end else - self.uiMap["select_other_btn_ui.bg.mail_btn"]:addRedPoint(124, 35, 0.8) + self.uiMap["select_other_btn_ui.bg.mail_btn"]:removeRedPoint() end + self.uiMap["select_other_btn_ui.bg.mail_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.MAIL_NAME)) else - self.uiMap["select_other_btn_ui.bg.mail_btn"]:removeRedPoint() + self.uiMap["select_other_btn_ui.bg.mail_btn"]:setVisible(false) end - - self.uiMap["select_other_btn_ui.bg.mail_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.MAIL_NAME)) - + cellCount = cellCount + 1 + self.uiMap["select_other_btn_ui.bg.setting_btn"]:setAnchoredPositionY(y) self.uiMap["select_other_btn_ui.bg.setting_btn"]: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"]:setSizeDeltaY(cellCount*cellHeight + (cellCount - 1)*BTN_INTERVAL + BTN_OFFSET*2) end return SelectOtherBtnUI \ No newline at end of file diff --git a/lua/app/ui/main_city/main_city_ui.lua b/lua/app/ui/main_city/main_city_ui.lua index f2169528..0524efb3 100644 --- a/lua/app/ui/main_city/main_city_ui.lua +++ b/lua/app/ui/main_city/main_city_ui.lua @@ -787,7 +787,7 @@ function MainCityUI:refreshBottomRp() end function MainCityUI:refreshSettingBtn() - if DataManager.MailData:getRedPoint() then + if DataManager.MailData:getIsOpen() and DataManager.MailData:getRedPoint() then self.settingbtn:addRedPoint(40, 40, 0.7) else self.settingbtn:removeRedPoint() diff --git a/lua/app/userdata/mail/mail_data.lua b/lua/app/userdata/mail/mail_data.lua index dd4b6f54..6aa2c78d 100644 --- a/lua/app/userdata/mail/mail_data.lua +++ b/lua/app/userdata/mail/mail_data.lua @@ -247,10 +247,7 @@ function MailData:setLastMailId() end function MailData:getIsOpen() - if not self.mailIsOpen then - self.mailIsOpen = ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.MAIL_OPEN, true) - end - return self.mailIsOpen + return ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.MAIL, true) end return MailData \ No newline at end of file