设置
This commit is contained in:
parent
9eeb439375
commit
c259588969
@ -1,17 +1,17 @@
|
|||||||
local SelectOtherBtnUI = class("SelectOtherBtnUI", BaseUI)
|
local SelectOtherBtnUI = class("SelectOtherBtnUI", BaseUI)
|
||||||
|
|
||||||
local BTN_OFFSET = 32
|
local BTN_OFFSET = -10
|
||||||
local BTN_INTERVAL = 16
|
local BTN_INTERVAL = 56
|
||||||
|
|
||||||
function SelectOtherBtnUI:ctor()
|
function SelectOtherBtnUI:ctor()
|
||||||
end
|
end
|
||||||
|
|
||||||
function SelectOtherBtnUI:isFullScreen()
|
function SelectOtherBtnUI:isFullScreen()
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
function SelectOtherBtnUI:getPrefabPath()
|
function SelectOtherBtnUI:getPrefabPath()
|
||||||
return "assets/prefabs/ui/setting/select_other_btn_ui.prefab"
|
return "assets/prefabs/ui/setting/select_other_btn_ui.prefab"
|
||||||
end
|
end
|
||||||
|
|
||||||
function SelectOtherBtnUI:onPressBackspace()
|
function SelectOtherBtnUI:onPressBackspace()
|
||||||
@ -19,52 +19,84 @@ function SelectOtherBtnUI:onPressBackspace()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function SelectOtherBtnUI:onLoadRootComplete()
|
function SelectOtherBtnUI:onLoadRootComplete()
|
||||||
self.uiMap = self.root:genAllChildren()
|
self.uiMap = self.root:genAllChildren()
|
||||||
self.uiMap["select_other_btn_ui.mask"]:addClickListener(function()
|
self.root:addClickListener(function()
|
||||||
self:closeUI()
|
self:closeUI()
|
||||||
end)
|
end)
|
||||||
self.uiMap["select_other_btn_ui.bg.mail_btn"]:addClickListener(function()
|
self.uiMap["select_other_btn_ui.bg.mail_btn"]:addClickListener(function()
|
||||||
self:closeUI()
|
self:closeUI()
|
||||||
ModuleManager.MailManager:showMailUI()
|
ModuleManager.MailManager:showMailUI()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local cellHeight = self.uiMap["select_other_btn_ui.bg.setting_btn"]:getRectHeight()
|
local cellCount = 0
|
||||||
local cellCount = 0
|
local y = -BTN_OFFSET
|
||||||
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, nil, nil, true)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
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"]:setVisible(false)
|
|
||||||
end
|
|
||||||
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()
|
|
||||||
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)
|
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)
|
||||||
|
|
||||||
|
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, nil, nil, true)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
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"]:setVisible(false)
|
||||||
|
end
|
||||||
|
|
||||||
|
if true then
|
||||||
|
cellCount = cellCount + 1
|
||||||
|
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.bag_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC))
|
||||||
|
end
|
||||||
|
|
||||||
|
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
|
end
|
||||||
|
|
||||||
return SelectOtherBtnUI
|
return SelectOtherBtnUI
|
||||||
Loading…
x
Reference in New Issue
Block a user