Files
SL1900 5e0d58cfad Initial version - 1.2.0.60
EN: 1.2.0.60
CN: 1.2.0.61
JP: 1.2.0.63
KR: 1.2.0.67
2025-12-03 01:00:00 +09:00

133 lines
3.2 KiB
Lua

local GuideGroup_14 = class("GuideGroup_14")
local mapEventConfig = {
OnEvent_PanelOnEnableById = "OnEvent_PanelOnEnableById"
}
local groupId = 14
local totalStep = 2
local current = 1
function GuideGroup_14:Init(parent, runStep)
self:BindEvent()
self.tabChar = {}
self.parent = parent
current = 1
local funName = "Step_" .. current
local func = handler(self, self[funName])
func()
end
function GuideGroup_14:BindEvent()
if type(mapEventConfig) ~= "table" then
return
end
for nEventId, sCallbackName in pairs(mapEventConfig) do
local callback = self[sCallbackName]
if type(callback) == "function" then
EventManager.Add(nEventId, self, callback)
end
end
end
function GuideGroup_14:UnBindEvent()
if type(mapEventConfig) ~= "table" then
return
end
for nEventId, sCallbackName in pairs(mapEventConfig) do
local callback = self[sCallbackName]
if type(callback) == "function" then
EventManager.Remove(nEventId, self, callback)
end
end
end
function GuideGroup_14:SendGuideStep(step)
self.parent:SendGuideStep(groupId, step)
end
function GuideGroup_14:Clear()
self.runGuide = false
self:UnBindEvent()
self.parent = nil
self.tabChar = nil
end
function GuideGroup_14:Step_1()
EventManager.Hit("Guide_SelectQuestPage", AllEnum.QuestPanelTab.DailyQuest)
self.msg = {
BindIcon = "QuestPanel/----SafeAreaRoot----/rtDailyQuest/goQuestList",
Deviation = {0, 0},
Desc = "Guide_14_1",
DescDeviation = {-930, -420},
Type = GameEnum.guidetype.Introductory
}
self.parent:ActiveHide(true)
current = 1
self.waitAnimTime = 0.5
if self.waitAnimTime ~= 0 then
local wait = function()
coroutine.yield(CS.UnityEngine.WaitForSeconds(self.waitAnimTime))
self.parent:PlayTypeMask(self.msg)
end
cs_coroutine.start(wait)
else
self.parent:PlayTypeMask(self.msg)
end
end
function GuideGroup_14:Step_2()
self.msg = {
BindIcon = "QuestPanel/----SafeAreaRoot----/rtDailyQuest/imgTitleBg",
Size = {1050, 160},
Deviation = {0, 0},
Desc = "Guide_14_2",
DescDeviation = {-500, -280},
Type = GameEnum.guidetype.Introductory
}
self.parent:ActiveHide(true)
current = 2
self.waitAnimTime = 0.2
end
function GuideGroup_14:FinishCurrentStep()
self.msg = nil
self.openPanelId = nil
self.waitAinEnd = nil
self.runGuide = false
self.waitAnimTime = 0
if current == 1 then
local tab = {}
table.insert(tab, {
"role_id",
tostring(PlayerData.Base._nPlayerId)
})
table.insert(tab, {"action", "0"})
table.insert(tab, {
"normal_tutorial_id",
"3"
})
NovaAPI.UserEventUpload("normal_tutorial", tab)
elseif current == 3 then
local tab = {}
table.insert(tab, {
"role_id",
tostring(PlayerData.Base._nPlayerId)
})
table.insert(tab, {"action", "1"})
table.insert(tab, {
"normal_tutorial_id",
"3"
})
NovaAPI.UserEventUpload("normal_tutorial", tab)
end
if current == 1 then
self:SendGuideStep(-1)
end
if current == totalStep then
self.parent:ClearCurGuide(true)
return
end
local funName = "Step_" .. current + 1
local func = handler(self, self[funName])
func()
if self.openPanelId == nil and self.waitAnimTime ~= 0 then
local wait = function()
coroutine.yield(CS.UnityEngine.WaitForSeconds(self.waitAnimTime + 0.2))
self.parent:PlayTypeMask(self.msg)
end
cs_coroutine.start(wait)
end
end
return GuideGroup_14