Merge branch 'dev' of http://git.juzugame.com/b6-client/b6-lua into dev
This commit is contained in:
commit
22d9bb9b3d
@ -53,34 +53,34 @@ function MessageBox:showMessageBox(params)
|
|||||||
if costId then
|
if costId then
|
||||||
local itemInfo = ConfigManager:getConfig("item")[costId]
|
local itemInfo = ConfigManager:getConfig("item")[costId]
|
||||||
if itemInfo then
|
if itemInfo then
|
||||||
uiMap["message_box.title_bg_img.ok_btn.icon"]:setSprite(GConst.ATLAS_PATH.ICON_ITEM, itemInfo.icon)
|
uiMap["message_box.title_bg_img.btn.ok_btn.icon"]:setSprite(GConst.ATLAS_PATH.ICON_ITEM, itemInfo.icon)
|
||||||
uiMap["message_box.title_bg_img.ok_btn.text"]:setText(tostring(costNum))
|
uiMap["message_box.title_bg_img.btn.ok_btn.text"]:setText(tostring(costNum))
|
||||||
GFunc.centerImgAndTx(uiMap["message_box.title_bg_img.ok_btn.icon"], uiMap["message_box.title_bg_img.ok_btn.text"])
|
GFunc.centerImgAndTx(uiMap["message_box.title_bg_img.btn.ok_btn.icon"], uiMap["message_box.title_bg_img.btn.ok_btn.text"])
|
||||||
else
|
else
|
||||||
uiMap["message_box.title_bg_img.ok_btn.text"]:setAnchoredPositionX(0)
|
uiMap["message_box.title_bg_img.btn.ok_btn.text"]:setAnchoredPositionX(0)
|
||||||
uiMap["message_box.title_bg_img.ok_btn.text"]:setText(okText or I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK))
|
uiMap["message_box.title_bg_img.btn.ok_btn.text"]:setText(okText or I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK))
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
uiMap["message_box.title_bg_img.ok_btn.text"]:setAnchoredPositionX(0)
|
uiMap["message_box.title_bg_img.btn.ok_btn.text"]:setAnchoredPositionX(0)
|
||||||
uiMap["message_box.title_bg_img.ok_btn.text"]:setText(okText or I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK))
|
uiMap["message_box.title_bg_img.btn.ok_btn.text"]:setText(okText or I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK))
|
||||||
end
|
end
|
||||||
|
|
||||||
uiMap["message_box.title_bg_img.title_text"]:setText(titleTx)
|
uiMap["message_box.title_bg_img.title_text"]:setText(titleTx)
|
||||||
uiMap["message_box.title_bg_img.bg.content_tx"]:setText(content)
|
uiMap["message_box.title_bg_img.bg.content_tx"]:setText(content)
|
||||||
uiMap["message_box.title_bg_img.cancel_btn.text"]:setText(cancelText or I18N:getGlobalText(I18N.GlobalConst.CANCEL_1))
|
uiMap["message_box.title_bg_img.btn.cancel_btn.text"]:setText(cancelText or I18N:getGlobalText(I18N.GlobalConst.CANCEL_1))
|
||||||
|
|
||||||
if boxType == GConst.MESSAGE_BOX_TYPE.MB_OK then
|
if boxType == GConst.MESSAGE_BOX_TYPE.MB_OK then
|
||||||
uiMap["message_box.title_bg_img.cancel_btn"]:setVisible(false)
|
uiMap["message_box.title_bg_img.btn.cancel_btn"]:setVisible(false)
|
||||||
uiMap["message_box.title_bg_img.ok_btn"]:setVisible(true)
|
uiMap["message_box.title_bg_img.btn.ok_btn"]:setVisible(true)
|
||||||
uiMap["message_box.title_bg_img.ok_btn"]:setAnchoredPositionX(0)
|
uiMap["message_box.title_bg_img.btn.ok_btn"]:setAnchoredPositionX(0)
|
||||||
elseif boxType == GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL then
|
elseif boxType == GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL then
|
||||||
if cancelFunc == nil then
|
if cancelFunc == nil then
|
||||||
prefabObject._closeByAndroidBackspace = true
|
prefabObject._closeByAndroidBackspace = true
|
||||||
end
|
end
|
||||||
uiMap["message_box.title_bg_img.ok_btn"]:setVisible(true)
|
uiMap["message_box.title_bg_img.btn.ok_btn"]:setVisible(true)
|
||||||
uiMap["message_box.title_bg_img.ok_btn"]:setAnchoredPositionX(-124)
|
uiMap["message_box.title_bg_img.btn.ok_btn"]:setAnchoredPositionX(-124)
|
||||||
uiMap["message_box.title_bg_img.cancel_btn"]:setVisible(true)
|
uiMap["message_box.title_bg_img.btn.cancel_btn"]:setVisible(true)
|
||||||
uiMap["message_box.title_bg_img.cancel_btn"]:addClickListener(function()
|
uiMap["message_box.title_bg_img.btn.cancel_btn"]:addClickListener(function()
|
||||||
self:closeAndClear(prefabObject, uiMap)
|
self:closeAndClear(prefabObject, uiMap)
|
||||||
if cancelFunc then
|
if cancelFunc then
|
||||||
cancelFunc()
|
cancelFunc()
|
||||||
@ -88,7 +88,7 @@ function MessageBox:showMessageBox(params)
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
uiMap["message_box.title_bg_img.ok_btn"]:addClickListener(function()
|
uiMap["message_box.title_bg_img.btn.ok_btn"]:addClickListener(function()
|
||||||
if showToday and selected then
|
if showToday and selected then
|
||||||
local todayTime = Time:getBeginningOfServerToday()
|
local todayTime = Time:getBeginningOfServerToday()
|
||||||
LocalData:setMessageBoxShowTodayTime(showToday, todayTime)
|
LocalData:setMessageBoxShowTodayTime(showToday, todayTime)
|
||||||
@ -100,6 +100,7 @@ function MessageBox:showMessageBox(params)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
if showToday then -- 今天内不在提示
|
if showToday then -- 今天内不在提示
|
||||||
|
uiMap["message_box.title_bg_img.btn"]:setAnchoredPositionY(-136)
|
||||||
uiMap["message_box.title_bg_img.bg"]:setSizeDeltaY(153)
|
uiMap["message_box.title_bg_img.bg"]:setSizeDeltaY(153)
|
||||||
uiMap["message_box.title_bg_img.today"]:setVisible(true)
|
uiMap["message_box.title_bg_img.today"]:setVisible(true)
|
||||||
uiMap["message_box.title_bg_img.today.check.select"]:setVisible(false)
|
uiMap["message_box.title_bg_img.today.check.select"]:setVisible(false)
|
||||||
@ -116,6 +117,7 @@ function MessageBox:showMessageBox(params)
|
|||||||
|
|
||||||
GFunc.centerImgAndTx(checkUI, textUI, 5)
|
GFunc.centerImgAndTx(checkUI, textUI, 5)
|
||||||
else
|
else
|
||||||
|
uiMap["message_box.title_bg_img.btn"]:setAnchoredPositionY(-95)
|
||||||
uiMap["message_box.title_bg_img.bg"]:setSizeDeltaY(210)
|
uiMap["message_box.title_bg_img.bg"]:setSizeDeltaY(210)
|
||||||
uiMap["message_box.title_bg_img.today"]:setVisible(false)
|
uiMap["message_box.title_bg_img.today"]:setVisible(false)
|
||||||
end
|
end
|
||||||
@ -133,13 +135,13 @@ function MessageBox:refreshText(isTop)
|
|||||||
local uiMap = gameObject:genAllChildren()
|
local uiMap = gameObject:genAllChildren()
|
||||||
uiMap["message_box.title_bg_img.title_text"]:setText("")
|
uiMap["message_box.title_bg_img.title_text"]:setText("")
|
||||||
uiMap["message_box.title_bg_img.bg.content_tx"]:setText("")
|
uiMap["message_box.title_bg_img.bg.content_tx"]:setText("")
|
||||||
uiMap["message_box.title_bg_img.ok_btn.text"]:setText("")
|
uiMap["message_box.title_bg_img.btn.ok_btn.text"]:setText("")
|
||||||
uiMap["message_box.title_bg_img.cancel_btn.text"]:setText("")
|
uiMap["message_box.title_bg_img.btn.cancel_btn.text"]:setText("")
|
||||||
end
|
end
|
||||||
|
|
||||||
function MessageBox:closeAndClear(prefabObject, uiMap)
|
function MessageBox:closeAndClear(prefabObject, uiMap)
|
||||||
uiMap["message_box.title_bg_img.ok_btn"]:removeClickListener()
|
uiMap["message_box.title_bg_img.btn.ok_btn"]:removeClickListener()
|
||||||
uiMap["message_box.title_bg_img.cancel_btn"]:removeClickListener()
|
uiMap["message_box.title_bg_img.btn.cancel_btn"]:removeClickListener()
|
||||||
uiMap["message_box.title_bg_img.today.check"]:removeClickListener()
|
uiMap["message_box.title_bg_img.today.check"]:removeClickListener()
|
||||||
prefabObject:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS).enabled = false
|
prefabObject:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS).enabled = false
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user