主界面

This commit is contained in:
kai 2025-07-07 23:35:01 +08:00
parent 32532ed93c
commit cfb6fc8c90
6 changed files with 35 additions and 8 deletions

View File

@ -18,6 +18,7 @@ local LOCAL_DATA_KEY = {
ACCOUNT_INFO = "ACCOUNT_INFO",
SEND_QUEUE = "SEND_QUEUE",
SDK_LOGIN_TYPE = "SDK_LOGIN_TYPE",
TRUTORIAL_SKIP_FLAG = "TRUTORIAL_SKIP_FLAG",
NEED_UPDATE = "NEED_UPDATE", -- 需要更新
IOS_ORDER_ID = "IOS_ORDER_ID",
@ -503,4 +504,12 @@ function LocalData:recordActPvpShowHelpTag(actId)
self:setInt(LOCAL_DATA_KEY.ACT_PVP_SHOW_HELP .. actId, 1)
end
function LocalData:getTutorialSkip()
return self:getInt(LOCAL_DATA_KEY.TRUTORIAL_SKIP_FLAG, 0)
end
function LocalData:setTutorialSkip(value)
self:setInt(LOCAL_DATA_KEY.TRUTORIAL_SKIP_FLAG, value)
end
return LocalData

View File

@ -15,6 +15,11 @@ end
-- 从登录界面第一次进入主城
function MaincityManager:firstEnterMainCity()
if (EDITOR_MODE or not Platform:getIsPublishChannel()) and LocalData:getTutorialSkip() > 0 then
-- 如果是新号就直接进入战斗
self:showMainCityUI(true)
return
end
if ModuleManager.TutorialManager:checkFuncTutorial(GConst.TutorialConst.START_TUTORIAL, true) then
DataManager.ChapterData:setChapterId(DataManager.ChapterData.MIN_CHAPTER_ID)
ModuleManager.BattleManager:playBattle(GConst.BattleConst.BATTLE_TYPE.STAGE)

View File

@ -24,8 +24,8 @@ function BuyVitUI:onLoadRootComplete()
uiMap["buy_vit_ui.bg.title_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BUY_ENERGY))
local constCfg = ConfigManager:getConfig("const")
local diamondReward = constCfg["stamina_diamond_buy"].reward
local adReward = constCfg["stamina_ad_buy"].reward
local diamondReward = constCfg["stamina_diamond_buy"].reward[1]
local adReward = constCfg["stamina_ad_buy"].reward[1]
uiMap["buy_vit_ui.bg.cell_1.num_tx_1"]:setText("x" .. GFunc.getRewardNum(diamondReward))
uiMap["buy_vit_ui.bg.cell_2.num_tx_1"]:setText("x" .. GFunc.getRewardNum(adReward))
@ -41,7 +41,7 @@ function BuyVitUI:onLoadRootComplete()
self.buyBtn1 = uiMap["buy_vit_ui.bg.cell_1"]
self.buyBtn2 = uiMap["buy_vit_ui.bg.cell_2"]
self.buyBtn1:addClickListener(function()
local diamondCost = constCfg["stamina_diamond_cost"].reward
local diamondCost = constCfg["stamina_diamond_cost"].reward[1]
if not GFunc.checkCost(GFunc.getRewardId(diamondCost), GFunc.getRewardNum(diamondCost), true, BIReport.ITEM_GET_TYPE.BUY_VIT) then
return
end
@ -95,7 +95,7 @@ function BuyVitUI:onRefresh()
self.descTx2:setText(I18N:getGlobalText(I18N.GlobalConst.TODAY_REMAIN_TIMES, maxAdBuy - adBuyCount))
local constCfg = ConfigManager:getConfig("const")
local diamondCost = constCfg["stamina_diamond_cost"].reward
local diamondCost = constCfg["stamina_diamond_cost"].reward[1]
self.numTx1:setText(tostring(GFunc.getRewardNum(diamondCost)))
self.numTx2:setText((maxAdBuy - adBuyCount) .. "/" .. GFunc.getConstIntValue("stamina_ad_times"))
if not self.adjustIconAndNum then

View File

@ -25,7 +25,6 @@ function GMToolUI:onRefresh()
local scrollView = self.uiMap['gm_tool_ui.ScrollView']
local textTip = self.uiMap['gm_tool_ui.text_tip']
local speedUpBtn = self.uiMap["gm_tool_ui.speed_up_btn"]
local speedUpBtn = self.uiMap["gm_tool_ui.speed_up_btn"]
local skipTutorialTx = self.uiMap["gm_tool_ui.skip_tutoria.text"]
local skipTutorialBtn = self.uiMap["gm_tool_ui.skip_tutoria"]
local skipTutorialCheck = self.uiMap["gm_tool_ui.skip_tutoria.check"]
@ -82,10 +81,14 @@ function GMToolUI:onRefresh()
end
end)
skipTutorialCheck:setVisible(ModuleManager.DevToolManager:getSkip() == true)
skipTutorialCheck:setVisible(LocalData:getTutorialSkip() > 0)
skipTutorialBtn:addClickListener(function()
ModuleManager.DevToolManager:setSkip(not ModuleManager.DevToolManager:getSkip())
skipTutorialCheck:setVisible(ModuleManager.DevToolManager:getSkip() == true)
if LocalData:getTutorialSkip() == 0 then
LocalData:setTutorialSkip(1)
else
LocalData:setTutorialSkip(0)
end
skipTutorialCheck:setActive(LocalData:getTutorialSkip() > 0)
end)
end

View File

@ -56,6 +56,10 @@ function MainComp:init()
uiMap["main_comp.arena_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_1))
uiMap["main_comp.daily_challenge_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE))
-- uiMap["main_comp.left_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE))
-- uiMap["main_comp.right_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE))
uiMap["main_comp.left_btn.text"]:setText("游历")
uiMap["main_comp.right_btn.text"]:setText("限时祈愿")
self.chapterBg = uiMap["main_comp.bg"]
self.chapterBg:setAnchoredPositionX(-720)
@ -132,8 +136,11 @@ function MainComp:init()
self:refresh()
end)
self.leftBtn:addClickListener(function()
-- GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.CHAPTER_DESC_2))
GFunc.showToast("游历")
end)
self.rightBtn:addClickListener(function()
GFunc.showToast("限时祈愿")
end)
end

View File

@ -1094,6 +1094,9 @@ end
-- 检查引导
function MainCityUI:checkTutorial(onlyCheck)
if (EDITOR_MODE or not Platform:getIsPublishChannel()) and LocalData:getTutorialSkip() > 0 then
return
end
if DataManager.ChapterData:getMaxChapterId() == 1 then
if ModuleManager.TutorialManager:checkFuncTutorial(GConst.TutorialConst.PASS_ONE_CHAPTER, onlyCheck) then
return true