Files
GaCy-GO/tools/cw_tutorial_config_export.lua
T

32 lines
1.6 KiB
Lua
Raw Normal View History

-- Export identified scalar tutorial rules from initialized native wrappers.
-- One wrapper per heartbeat. Does not start tutorials or load any JsonPath.
do
_G.__gacCwTutorialConfig1=_G.__gacCwTutorialConfig1 or {count=0}
local s=_G.__gacCwTutorialConfig1
if not s.done then
local log=function(v)CS.UnityEngine.Debug.Log('[GAC_CW_TUTORIAL_CONFIG] '..tostring(v))end
local ok,err=pcall(function()
if not s.iterator then
local rows=CS.RPG.Client.GlobalVars.s_ModuleManager.GridFightModule.TutorialStageConfigs
if rows.Count>64 then error('Tutorial count exceeds capture bound')end
s.iterator=rows:GetEnumerator();s.expected=rows.Count;log('BEGIN count='..s.expected)
end
if s.iterator:MoveNext()then
local pair=s.iterator.Current
local row=pair.Value
local values={'"ID":'..pair.Key}
for _,name in ipairs({'DivisionID','RewardQuest','ForbiddenBattleFailChapterID','ForbiddenSellRoleBeforeChapterId','ForbiddenSellRoleBeforeSectionId','HasMonsterReveal','HasPortal','HasInitialSupply','HasRouteShow','HasEquipRecommendShow','HasBossToastShow','UseTrialAvatar'})do
values[#values+1]='"'..name..'":'..tostring(row[name])
end
for _,name in ipairs({'ForbiddenSellRoleDict','ForbiddenAutoOpenShopNodeList'})do
values[#values+1]='"'..name..'":'..CS.Newtonsoft.Json.JsonConvert.SerializeObject(row[name])
end
log('ROW {'..table.concat(values,',')..'}');s.count=s.count+1
else
if s.count~=s.expected then error('Tutorial table changed')end
s.done=true;log('END')
end
end)
if not ok then log('ERROR '..tostring(err));s.done=true end
end
end