Merge branch 'dev' into arena
# Conflicts: # lua/app/config/localization/localization_global_const.lua # lua/app/config/strings/cn/global.lua # lua/app/module/battle/controller/battle_controller.lua # lua/app/ui/main_city/main_city_ui.lua
This commit is contained in:
commit
ce97be9b65
@ -215,6 +215,11 @@ BIReport.DIALY_CHALLENGE_OPT_TYPE = {
|
|||||||
TASK_STATE = "TaskState",
|
TASK_STATE = "TaskState",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIReport.MISCELLANEOUS_OPT_TYPE = {
|
||||||
|
EVALUATE_OPEN = "EvaluateOpen",
|
||||||
|
EVALUATE_CLOSE = "EvaluateClose",
|
||||||
|
}
|
||||||
|
|
||||||
-- b6
|
-- b6
|
||||||
local EVENT_NAME_EXIT = "client_exit"
|
local EVENT_NAME_EXIT = "client_exit"
|
||||||
local EVENT_NAME_FIGHT = "client_fight"
|
local EVENT_NAME_FIGHT = "client_fight"
|
||||||
@ -241,6 +246,7 @@ local EVENT_NAME_BOUNTY_OPT = "client_bounty_opt" -- 通用战令事件(包括
|
|||||||
local EVENT_NAME_NETWORK_OPT = "client_network_opt" -- 网络操作
|
local EVENT_NAME_NETWORK_OPT = "client_network_opt" -- 网络操作
|
||||||
local EVENT_NAME_APPLOVIN_AD_REVENUE = "client_applovin_ad_revenue" -- applovin广告收入
|
local EVENT_NAME_APPLOVIN_AD_REVENUE = "client_applovin_ad_revenue" -- applovin广告收入
|
||||||
local EVENT_NAME_DAILY_CHALLENGE_OPT = "client_daily_challenge_opt"
|
local EVENT_NAME_DAILY_CHALLENGE_OPT = "client_daily_challenge_opt"
|
||||||
|
local EVENT_NAME_MISCELLANEOUS_OPT = "event_name_miscellaneous_opt" -- 一些杂项
|
||||||
|
|
||||||
function BIReport:setIsNewPlayer(isNewPlayer)
|
function BIReport:setIsNewPlayer(isNewPlayer)
|
||||||
self.isNewPlayer = isNewPlayer
|
self.isNewPlayer = isNewPlayer
|
||||||
@ -1060,4 +1066,19 @@ function BIReport:postPbDecodefailed(pbName, reqData)
|
|||||||
self:report(EVENT_NAME_NETWORK_OPT, args)
|
self:report(EVENT_NAME_NETWORK_OPT, args)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BIReport:postRateClose(rateStar)
|
||||||
|
local args = {
|
||||||
|
event_type = BIReport.MISCELLANEOUS_OPT_TYPE.EVALUATE_CLOSE,
|
||||||
|
rate_star = rateStar,
|
||||||
|
}
|
||||||
|
self:report(EVENT_NAME_MISCELLANEOUS_OPT, args)
|
||||||
|
end
|
||||||
|
|
||||||
|
function BIReport:postRateOpen()
|
||||||
|
local args = {
|
||||||
|
event_type = BIReport.MISCELLANEOUS_OPT_TYPE.EVALUATE_OPEN,
|
||||||
|
}
|
||||||
|
self:report(EVENT_NAME_MISCELLANEOUS_OPT, args)
|
||||||
|
end
|
||||||
|
|
||||||
return BIReport
|
return BIReport
|
||||||
@ -29,6 +29,7 @@ function DataManager:init()
|
|||||||
self:initManager("SevenDayData", "app/userdata/activity/seven_day/seven_day_data")
|
self:initManager("SevenDayData", "app/userdata/activity/seven_day/seven_day_data")
|
||||||
self:initManager("ShopData", "app/userdata/shop/shop_data")
|
self:initManager("ShopData", "app/userdata/shop/shop_data")
|
||||||
self:initManager("SummonData", "app/userdata/summon/summon_data")
|
self:initManager("SummonData", "app/userdata/summon/summon_data")
|
||||||
|
self:initManager("AIHelperData", "app/userdata/game_setting/ai_helper_data")
|
||||||
end
|
end
|
||||||
|
|
||||||
function DataManager:initManager(name, path)
|
function DataManager:initManager(name, path)
|
||||||
@ -107,6 +108,7 @@ function DataManager:clear()
|
|||||||
self.SummonData:clear()
|
self.SummonData:clear()
|
||||||
-- 任务数据最后清理
|
-- 任务数据最后清理
|
||||||
self.TaskData:clear()
|
self.TaskData:clear()
|
||||||
|
self.AIHelperData:clear()
|
||||||
ModuleManager.TaskManager:clear()
|
ModuleManager.TaskManager:clear()
|
||||||
self:clearTryOpenFunc()
|
self:clearTryOpenFunc()
|
||||||
end
|
end
|
||||||
@ -151,6 +153,7 @@ function DataManager:initWithServerData(data)
|
|||||||
-- 商店礼包都初始化完了后检查一下每日红点
|
-- 商店礼包都初始化完了后检查一下每日红点
|
||||||
self.ShopData:checkShopDiscountRedPoint()
|
self.ShopData:checkShopDiscountRedPoint()
|
||||||
self.SummonData:init(data.summon, true)
|
self.SummonData:init(data.summon, true)
|
||||||
|
self.AIHelperData:init(nil, true)
|
||||||
-- 成长基金要在ShopData和PlayerDataBagData还有之后初始化,依赖这些数据
|
-- 成长基金要在ShopData和PlayerDataBagData还有之后初始化,依赖这些数据
|
||||||
if data.fund then
|
if data.fund then
|
||||||
self.GrowthFundData:init(data.fund.funds)
|
self.GrowthFundData:init(data.fund.funds)
|
||||||
|
|||||||
@ -66,6 +66,7 @@ function SDKPayGoogleManager:queryProducts(callback)
|
|||||||
if #subsList > 0 then
|
if #subsList > 0 then
|
||||||
self:queryProductInfo(PAY_TYPE_SUBS, json.encode(subsList), function(code, msg)
|
self:queryProductInfo(PAY_TYPE_SUBS, json.encode(subsList), function(code, msg)
|
||||||
if code == 0 then
|
if code == 0 then
|
||||||
|
self.queryProductsOver = true
|
||||||
if msg and msg ~= "" then -- 更新products
|
if msg and msg ~= "" then -- 更新products
|
||||||
local jData = json.decode(msg)
|
local jData = json.decode(msg)
|
||||||
if jData and #jData > 0 then
|
if jData and #jData > 0 then
|
||||||
@ -80,6 +81,7 @@ function SDKPayGoogleManager:queryProducts(callback)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
|
self.queryProductsOver = true
|
||||||
if callback then
|
if callback then
|
||||||
callback()
|
callback()
|
||||||
end
|
end
|
||||||
@ -262,51 +264,55 @@ end
|
|||||||
-- 检查是否可以支付
|
-- 检查是否可以支付
|
||||||
function SDKPayGoogleManager:checkPay(productId, callback)
|
function SDKPayGoogleManager:checkPay(productId, callback)
|
||||||
if self:_getIsGoogleStoreConnected() then -- google商店是否初始化
|
if self:_getIsGoogleStoreConnected() then -- google商店是否初始化
|
||||||
self:doUncompleteOrder(function(code) -- 先处理未完成的订单
|
self:queryProducts(function()
|
||||||
if code == 0 then
|
self:doUncompleteOrder(function(code) -- 先处理未完成的订单
|
||||||
callback(0)
|
if code == 0 then
|
||||||
elseif code == 1 then -- 指定的productId存在支付状态中的订单
|
callback(0)
|
||||||
local params = {
|
elseif code == 1 then -- 指定的productId存在支付状态中的订单
|
||||||
content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23),
|
local params = {
|
||||||
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
|
content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23),
|
||||||
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
|
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
|
||||||
}
|
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
|
||||||
GFunc.showMessageBox(params)
|
}
|
||||||
elseif code == 2 then -- 指定的productId存在未完成的订单消耗失败的情况
|
GFunc.showMessageBox(params)
|
||||||
local params = {
|
elseif code == 2 then -- 指定的productId存在未完成的订单消耗失败的情况
|
||||||
content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23),
|
local params = {
|
||||||
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
|
content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23),
|
||||||
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
|
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
|
||||||
}
|
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
|
||||||
GFunc.showMessageBox(params)
|
}
|
||||||
else -- 存在未完成的订单消耗失败的情况,但是因为不是当前productId,所以允许继续支付
|
GFunc.showMessageBox(params)
|
||||||
callback(0)
|
else -- 存在未完成的订单消耗失败的情况,但是因为不是当前productId,所以允许继续支付
|
||||||
end
|
callback(0)
|
||||||
end, productId)
|
end
|
||||||
|
end, productId)
|
||||||
|
end)
|
||||||
else
|
else
|
||||||
self:connectGoogleStore(function(code)
|
self:connectGoogleStore(function(code)
|
||||||
if code == 0 then
|
if code == 0 then
|
||||||
self:doUncompleteOrder(function(consumeSucc)
|
self:queryProducts(function()
|
||||||
if code == 0 then
|
self:doUncompleteOrder(function(consumeSucc)
|
||||||
callback(0)
|
if code == 0 then
|
||||||
elseif code == 1 then -- 指定的productId存在支付状态中的订单
|
callback(0)
|
||||||
local params = {
|
elseif code == 1 then -- 指定的productId存在支付状态中的订单
|
||||||
content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23),
|
local params = {
|
||||||
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
|
content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23),
|
||||||
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
|
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
|
||||||
}
|
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
|
||||||
GFunc.showMessageBox(params)
|
}
|
||||||
elseif code == 2 then -- 指定的productId存在未完成的订单消耗失败的情况
|
GFunc.showMessageBox(params)
|
||||||
local params = {
|
elseif code == 2 then -- 指定的productId存在未完成的订单消耗失败的情况
|
||||||
content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23),
|
local params = {
|
||||||
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
|
content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_23),
|
||||||
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
|
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
|
||||||
}
|
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
|
||||||
GFunc.showMessageBox(params)
|
}
|
||||||
else -- 存在未完成的订单消耗失败的情况,但是因为不是当前productId,所以允许继续支付
|
GFunc.showMessageBox(params)
|
||||||
callback(0)
|
else -- 存在未完成的订单消耗失败的情况,但是因为不是当前productId,所以允许继续支付
|
||||||
end
|
callback(0)
|
||||||
end, productId)
|
end
|
||||||
|
end, productId)
|
||||||
|
end)
|
||||||
else
|
else
|
||||||
local params = {
|
local params = {
|
||||||
content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_22),
|
content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_22),
|
||||||
|
|||||||
@ -127,6 +127,8 @@ function ChapterManager:endFightFinish(result)
|
|||||||
DataManager.HeroData:checkIfCanShowHeroUnlock(maxChapter)
|
DataManager.HeroData:checkIfCanShowHeroUnlock(maxChapter)
|
||||||
-- 章节通关 检查是否要弹出功能解锁界面
|
-- 章节通关 检查是否要弹出功能解锁界面
|
||||||
DataManager.PlayerData:checkIfCanShowModuleUnlock(maxChapter)
|
DataManager.PlayerData:checkIfCanShowModuleUnlock(maxChapter)
|
||||||
|
-- 评价弹窗
|
||||||
|
self:tryShowEvaluationPopup(maxChapter)
|
||||||
end
|
end
|
||||||
-- 第二章战斗结算,触发成长礼包
|
-- 第二章战斗结算,触发成长礼包
|
||||||
if result.reqData.chapter_id == GConst.ShopConst.INTRODUCTORY_GIFT_TRIGGER_CHAPTER_ID then
|
if result.reqData.chapter_id == GConst.ShopConst.INTRODUCTORY_GIFT_TRIGGER_CHAPTER_ID then
|
||||||
@ -137,4 +139,11 @@ function ChapterManager:endFightFinish(result)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function ChapterManager:tryShowEvaluationPopup(chapter)
|
||||||
|
if chapter ~= 2 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
UIManager:showUI("app/ui/game_setting/rate_ui")
|
||||||
|
end
|
||||||
|
|
||||||
return ChapterManager
|
return ChapterManager
|
||||||
@ -82,4 +82,14 @@ function GameSettingManager:showSupport(objectId)
|
|||||||
GFunc.openUrl(CS.System.Uri(url .. language .. userId .. tempStr .. customData).AbsoluteUri)
|
GFunc.openUrl(CS.System.Uri(url .. language .. userId .. tempStr .. customData).AbsoluteUri)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function GameSettingManager:reqAiHelper()
|
||||||
|
self:sendMessage(ProtoMsgType.FromMsgEnum.AIHelpUnreadReq, {}, {}, self.rspAiHelper)
|
||||||
|
end
|
||||||
|
|
||||||
|
function GameSettingManager:rspAiHelper(result)
|
||||||
|
if result.error_code == GConst.ERROR_STR.SUCCESS then
|
||||||
|
DataManager.AIHelperData:init(result)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return GameSettingManager
|
return GameSettingManager
|
||||||
@ -101,6 +101,8 @@ local ProtoMsgType = {
|
|||||||
[2731283225] = "MailExtractRsp",
|
[2731283225] = "MailExtractRsp",
|
||||||
[2849800229] = "MailReadReq",
|
[2849800229] = "MailReadReq",
|
||||||
[2849802062] = "MailReadRsp",
|
[2849802062] = "MailReadRsp",
|
||||||
|
[2909093054] = "AIHelpUnreadReq",
|
||||||
|
[2909094887] = "AIHelpUnreadRsp",
|
||||||
[3003864530] = "ActTriggerGiftNtf",
|
[3003864530] = "ActTriggerGiftNtf",
|
||||||
[3013273736] = "PVPRankHeroesReq",
|
[3013273736] = "PVPRankHeroesReq",
|
||||||
[3013275569] = "PVPRankHeroesRsp",
|
[3013275569] = "PVPRankHeroesRsp",
|
||||||
@ -266,6 +268,8 @@ local ProtoMsgType = {
|
|||||||
MailExtractRsp = 2731283225,
|
MailExtractRsp = 2731283225,
|
||||||
MailReadReq = 2849800229,
|
MailReadReq = 2849800229,
|
||||||
MailReadRsp = 2849802062,
|
MailReadRsp = 2849802062,
|
||||||
|
AIHelpUnreadReq = 2909093054,
|
||||||
|
AIHelpUnreadRsp = 2909094887,
|
||||||
ActTriggerGiftNtf = 3003864530,
|
ActTriggerGiftNtf = 3003864530,
|
||||||
PVPRankHeroesReq = 3013273736,
|
PVPRankHeroesReq = 3013273736,
|
||||||
PVPRankHeroesRsp = 3013275569,
|
PVPRankHeroesRsp = 3013275569,
|
||||||
@ -431,6 +435,8 @@ local ProtoMsgType = {
|
|||||||
MailExtractRsp = "MailExtractRsp",
|
MailExtractRsp = "MailExtractRsp",
|
||||||
MailReadReq = "MailReadReq",
|
MailReadReq = "MailReadReq",
|
||||||
MailReadRsp = "MailReadRsp",
|
MailReadRsp = "MailReadRsp",
|
||||||
|
AIHelpUnreadReq = "AIHelpUnreadReq",
|
||||||
|
AIHelpUnreadRsp = "AIHelpUnreadRsp",
|
||||||
ActTriggerGiftNtf = "ActTriggerGiftNtf",
|
ActTriggerGiftNtf = "ActTriggerGiftNtf",
|
||||||
PVPRankHeroesReq = "PVPRankHeroesReq",
|
PVPRankHeroesReq = "PVPRankHeroesReq",
|
||||||
PVPRankHeroesRsp = "PVPRankHeroesRsp",
|
PVPRankHeroesRsp = "PVPRankHeroesRsp",
|
||||||
|
|||||||
@ -18,6 +18,7 @@ function GameSettingUI:onLoadRootComplete()
|
|||||||
self.uiMap = self.root:genAllChildren()
|
self.uiMap = self.root:genAllChildren()
|
||||||
self:_display()
|
self:_display()
|
||||||
self:_addListeners()
|
self:_addListeners()
|
||||||
|
self:_bind()
|
||||||
self:addEventListener(EventManager.CUSTOM_EVENT.BIND_ACCOUNT_SUCCESS, function()
|
self:addEventListener(EventManager.CUSTOM_EVENT.BIND_ACCOUNT_SUCCESS, function()
|
||||||
self:refreshAccountInfo()
|
self:refreshAccountInfo()
|
||||||
end)
|
end)
|
||||||
@ -162,6 +163,7 @@ function GameSettingUI:initSupportBtn()
|
|||||||
self.uiMap["game_setting_ui.bg.support_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.SUPPORT_DESC_2))
|
self.uiMap["game_setting_ui.bg.support_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.SUPPORT_DESC_2))
|
||||||
self.uiMap["game_setting_ui.bg.support_btn"]:addClickListener(function()
|
self.uiMap["game_setting_ui.bg.support_btn"]:addClickListener(function()
|
||||||
ModuleManager.GameSettingManager:showSupport()
|
ModuleManager.GameSettingManager:showSupport()
|
||||||
|
DataManager.AIHelperData:clearRp()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -216,6 +218,17 @@ function GameSettingUI:_addListeners()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function GameSettingUI:_bind()
|
||||||
|
self:bind(DataManager.AIHelperData, "isDirty", function()
|
||||||
|
local supportBtn = self.uiMap["game_setting_ui.bg.support_btn"]
|
||||||
|
if DataManager.AIHelperData:getRp() then
|
||||||
|
supportBtn:addRedPoint(88, 24, 0.8)
|
||||||
|
else
|
||||||
|
supportBtn:removeRedPoint()
|
||||||
|
end
|
||||||
|
end, true)
|
||||||
|
end
|
||||||
|
|
||||||
function GameSettingUI:refreshMusic()
|
function GameSettingUI:refreshMusic()
|
||||||
local offIcon = self.uiMap["game_setting_ui.bg.music_bg.off"]
|
local offIcon = self.uiMap["game_setting_ui.bg.music_bg.off"]
|
||||||
local onIcon = self.uiMap["game_setting_ui.bg.music_bg.on"]
|
local onIcon = self.uiMap["game_setting_ui.bg.music_bg.on"]
|
||||||
|
|||||||
144
lua/app/ui/game_setting/rate_ui.lua
Normal file
144
lua/app/ui/game_setting/rate_ui.lua
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
local RateUI = class("RateUI", BaseUI)
|
||||||
|
|
||||||
|
local COLOR = BF.Color(1, 1, 1, 1)
|
||||||
|
|
||||||
|
local BTN_ICON = {
|
||||||
|
"common_btn_green_2",
|
||||||
|
"common_btn_grey_2"
|
||||||
|
}
|
||||||
|
|
||||||
|
function RateUI:isFullScreen()
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
function RateUI:showCommonBG()
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
function RateUI:getPrefabPath()
|
||||||
|
return "assets/prefabs/ui/setting/rate_ui.prefab"
|
||||||
|
end
|
||||||
|
|
||||||
|
function RateUI:ctor()
|
||||||
|
self.curStar = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
function RateUI:onClose()
|
||||||
|
if self.starSeq then
|
||||||
|
self.starSeq:Kill()
|
||||||
|
self.starSeq = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function RateUI:onLoadRootComplete()
|
||||||
|
self:_display()
|
||||||
|
self:_addListeners()
|
||||||
|
end
|
||||||
|
|
||||||
|
function RateUI:_display()
|
||||||
|
local uiMap = self.root:genAllChildren()
|
||||||
|
|
||||||
|
uiMap["rate_ui.bg.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.RATE_DESC_1))
|
||||||
|
uiMap["rate_ui.later_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.RATE_DESC_2))
|
||||||
|
|
||||||
|
if not self.stars then
|
||||||
|
self.stars = {}
|
||||||
|
for i = 1, 5 do
|
||||||
|
self.stars[i] = {
|
||||||
|
touchNode = uiMap["rate_ui.bg.bg_" .. i],
|
||||||
|
star = uiMap["rate_ui.bg.bg_" .. i .. ".star"]
|
||||||
|
}
|
||||||
|
self.stars[i].star:setVisible(true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self:onClickStar(0)
|
||||||
|
end
|
||||||
|
|
||||||
|
function RateUI:_addListeners()
|
||||||
|
local uiMap = self.root:genAllChildren()
|
||||||
|
|
||||||
|
uiMap["rate_ui.bg.bg_1"]:addClickListener(function()
|
||||||
|
self:onClickStar(1)
|
||||||
|
end)
|
||||||
|
|
||||||
|
uiMap["rate_ui.bg.bg_2"]:addClickListener(function()
|
||||||
|
self:onClickStar(2)
|
||||||
|
end)
|
||||||
|
|
||||||
|
uiMap["rate_ui.bg.bg_3"]:addClickListener(function()
|
||||||
|
self:onClickStar(3)
|
||||||
|
end)
|
||||||
|
|
||||||
|
uiMap["rate_ui.bg.bg_4"]:addClickListener(function()
|
||||||
|
self:onClickStar(4)
|
||||||
|
end)
|
||||||
|
|
||||||
|
uiMap["rate_ui.bg.bg_5"]:addClickListener(function()
|
||||||
|
self:onClickStar(5)
|
||||||
|
end)
|
||||||
|
|
||||||
|
uiMap["rate_ui.bg.btn"]:addClickListener(function()
|
||||||
|
if self.curStar <= 0 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
BIReport:postRateClose(self.curStar)
|
||||||
|
self:closeUI()
|
||||||
|
|
||||||
|
if self.curStar > 3 then
|
||||||
|
local url = "https://play.google.com/store/apps/details?id=com.combo.heroes.puzzle.rpg"
|
||||||
|
if Platform:isIosPlatform() then
|
||||||
|
url = "https://itunes.apple.com/app/6450101181"
|
||||||
|
end
|
||||||
|
GFunc.openUrl(url)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
uiMap["rate_ui.later_tx"]:addClickListener(function()
|
||||||
|
self:closeUI()
|
||||||
|
end)
|
||||||
|
BIReport:postRateOpen()
|
||||||
|
end
|
||||||
|
|
||||||
|
function RateUI:onClickStar(star)
|
||||||
|
self.curStar = star
|
||||||
|
for index, starInfo in ipairs(self.stars) do
|
||||||
|
starInfo.star:setVisible(index <= star)
|
||||||
|
end
|
||||||
|
|
||||||
|
local uiMap = self.root:genAllChildren()
|
||||||
|
local icon = BTN_ICON[1]
|
||||||
|
|
||||||
|
local btnTx = uiMap["rate_ui.bg.btn.ok_tx"]
|
||||||
|
local btnTxGray = uiMap["rate_ui.bg.btn.ok_tx_gray"]
|
||||||
|
if self.curStar <= 0 then
|
||||||
|
icon = BTN_ICON[2]
|
||||||
|
btnTx:setText(GConst.EMPTY_STRING)
|
||||||
|
btnTxGray:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK))
|
||||||
|
else
|
||||||
|
btnTx:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK))
|
||||||
|
btnTxGray:setText(GConst.EMPTY_STRING)
|
||||||
|
end
|
||||||
|
local btn = uiMap["rate_ui.bg.btn"]
|
||||||
|
btn:setSprite(GConst.ATLAS_PATH.COMMON, icon)
|
||||||
|
btn:setTouchEnable(self.curStar > 0)
|
||||||
|
|
||||||
|
if self.starSeq then
|
||||||
|
self.starSeq:Kill()
|
||||||
|
self.starSeq = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
self.stars[1].star:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE).color = COLOR
|
||||||
|
if self.curStar > 0 then
|
||||||
|
return
|
||||||
|
else
|
||||||
|
self.starSeq = self.root:createBindTweenSequence()
|
||||||
|
self.stars[1].star:setVisible(true)
|
||||||
|
self.starSeq:Append(self.stars[1].star:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):DOFade(0, 1))
|
||||||
|
self.starSeq:Append(self.stars[1].star:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):DOFade(1, 1))
|
||||||
|
self.starSeq:SetLoops(-1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return RateUI
|
||||||
10
lua/app/ui/game_setting/rate_ui.lua.meta
Normal file
10
lua/app/ui/game_setting/rate_ui.lua.meta
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5559edab930e7aa479e17c2ed272a89c
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||||
@ -51,8 +51,14 @@ function SelectOtherBtnUI:onLoadRootComplete()
|
|||||||
self.uiMap["select_other_btn_ui.bg.mail_btn"]:setVisible(false)
|
self.uiMap["select_other_btn_ui.bg.mail_btn"]:setVisible(false)
|
||||||
end
|
end
|
||||||
cellCount = cellCount + 1
|
cellCount = cellCount + 1
|
||||||
self.uiMap["select_other_btn_ui.bg.setting_btn"]:setAnchoredPositionY(y)
|
local settingBtn = self.uiMap["select_other_btn_ui.bg.setting_btn"]
|
||||||
self.uiMap["select_other_btn_ui.bg.setting_btn"]:addClickListener(function()
|
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()
|
self:closeUI()
|
||||||
ModuleManager.GameSettingManager:showSettingUI()
|
ModuleManager.GameSettingManager:showSettingUI()
|
||||||
end)
|
end)
|
||||||
|
|||||||
@ -266,6 +266,7 @@ function MainCityUI:_bind()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
self:bind(DataManager.ArenaData, "isDirty", function()
|
self:bind(DataManager.ArenaData, "isDirty", function()
|
||||||
if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN then
|
if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN then
|
||||||
if self.subComps[self.selectedIndex] then
|
if self.subComps[self.selectedIndex] then
|
||||||
@ -273,6 +274,10 @@ function MainCityUI:_bind()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
self:bind(DataManager.AIHelperData, "isDirty", function()
|
||||||
|
self:refreshSettingBtn()
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function MainCityUI:initBottomUI()
|
function MainCityUI:initBottomUI()
|
||||||
@ -784,6 +789,10 @@ function MainCityUI:updateTime()
|
|||||||
self:refreshRightBtns()
|
self:refreshRightBtns()
|
||||||
self.waitRefreshSideBar = false
|
self.waitRefreshSideBar = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if DataManager.AIHelperData:getNeedReqTime() then
|
||||||
|
ModuleManager.GameSettingManager:reqAiHelper()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function MainCityUI:updateSideBarStatus()
|
function MainCityUI:updateSideBarStatus()
|
||||||
@ -913,7 +922,7 @@ function MainCityUI:refreshBottomRp()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function MainCityUI:refreshSettingBtn()
|
function MainCityUI:refreshSettingBtn()
|
||||||
if DataManager.MailData:getIsOpen() and DataManager.MailData:getRedPoint() then
|
if (DataManager.MailData:getIsOpen() and DataManager.MailData:getRedPoint()) or DataManager.AIHelperData:getRp() then
|
||||||
self.settingbtn:addRedPoint(40, 40, 0.7)
|
self.settingbtn:addRedPoint(40, 40, 0.7)
|
||||||
else
|
else
|
||||||
self.settingbtn:removeRedPoint()
|
self.settingbtn:removeRedPoint()
|
||||||
|
|||||||
52
lua/app/userdata/game_setting/ai_helper_data.lua
Normal file
52
lua/app/userdata/game_setting/ai_helper_data.lua
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
local AIHelperData = class("AIHelperData", BaseData)
|
||||||
|
|
||||||
|
local INIT_DELAY_TIME = 10
|
||||||
|
local REQ_INTERVAL = 1800
|
||||||
|
|
||||||
|
function AIHelperData:ctor()
|
||||||
|
self.data.isDirty = false
|
||||||
|
self.aiHelperRpCount = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
function AIHelperData:init(data, isInit)
|
||||||
|
self.nextReqTime = Time:getServerTime() + REQ_INTERVAL
|
||||||
|
if isInit then -- 初始化没有数据,自己构建一份,并且延迟发送请求
|
||||||
|
data = {
|
||||||
|
count = 0
|
||||||
|
}
|
||||||
|
self.nextReqTime = Time:getServerTime() + INIT_DELAY_TIME
|
||||||
|
end
|
||||||
|
if not data then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self.aiHelperRpCount = data.count
|
||||||
|
self:setIsDirty()
|
||||||
|
end
|
||||||
|
|
||||||
|
function AIHelperData:setIsDirty()
|
||||||
|
self.data.isDirty = not self.data.isDirty
|
||||||
|
end
|
||||||
|
|
||||||
|
function AIHelperData:getNextReqTime()
|
||||||
|
return self.nextReqTime
|
||||||
|
end
|
||||||
|
|
||||||
|
function AIHelperData:getNeedReqTime()
|
||||||
|
if self:getNextReqTime() <= Time:getServerTime() then
|
||||||
|
self.nextReqTime = Time:getServerTime() + REQ_INTERVAL
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
function AIHelperData:getRp()
|
||||||
|
return self.aiHelperRpCount > 0
|
||||||
|
end
|
||||||
|
|
||||||
|
function AIHelperData:clearRp()
|
||||||
|
self.aiHelperRpCount = 0
|
||||||
|
self:setIsDirty()
|
||||||
|
end
|
||||||
|
|
||||||
|
return AIHelperData
|
||||||
10
lua/app/userdata/game_setting/ai_helper_data.lua.meta
Normal file
10
lua/app/userdata/game_setting/ai_helper_data.lua.meta
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c61b7067b2b095246bcc2b80c0f7f55f
|
||||||
|
ScriptedImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||||
@ -166,8 +166,10 @@ function HeroData:getRp()
|
|||||||
end
|
end
|
||||||
|
|
||||||
for id, entity in pairs(self.heroes) do
|
for id, entity in pairs(self.heroes) do
|
||||||
if entity:canLvUp() and not heroMap[id] then
|
if entity:canLvUp() then
|
||||||
return true
|
if heroMap[id] or not entity:isActived() then
|
||||||
|
return true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user