31 lines
1.6 KiB
Lua
31 lines
1.6 KiB
Lua
-- Read exact constants upvalue and its current ActivityPanelData only.
|
|||
|
|
do
|
||
|
|
if not _G.__gacCwBookPanelStateAfterGuide1 and type(package.loaded['Ui.DailyMission.Rogue.GridFight.HandbookRogueGridFightTabItem'])=='table' then
|
||
|
|
_G.__gacCwBookPanelStateAfterGuide1=true
|
||
|
|
local function log(v)CS.UnityEngine.Debug.Log('[GAC_CW_BOOK_AFTER_GUIDE] '..tostring(v))end
|
||
|
|
local ok,err=pcall(function()
|
||
|
|
local class=package.loaded['Ui.DailyMission.Rogue.GridFight.HandbookRogueGridFightTabItem']
|
||
|
|
local fn=class and class._on_click_go
|
||
|
|
if type(fn)~='function'then error('Book Go callback not loaded')end
|
||
|
|
local constants
|
||
|
|
for i=1,16 do local name,value=debug.getupvalue(fn,i);if not name then break end
|
||
|
|
if name=='_GRID_FIGHT_CONSTANTS'then constants=value;break end
|
||
|
|
end
|
||
|
|
if not constants then error('Book Go constants upvalue absent')end
|
||
|
|
for _,key in ipairs({'ActivityID','GridFightContentID'})do log('CONSTANT '..key..' '..tostring(constants[key]))end
|
||
|
|
local module=CS.RPG.Client.GlobalVars.s_ModuleManager.ActivityModule
|
||
|
|
local id=constants.ActivityID
|
||
|
|
local panel=module:GetPanelData(id)
|
||
|
|
log('PANEL id='..tostring(id)..' present='..tostring(panel~=nil)..' type='..tostring(panel and panel:GetType().FullName))
|
||
|
|
if panel then
|
||
|
|
for _,key in ipairs({'ContentID','IsSkipSwitchStoryLine','IsOpen','PanelID'})do
|
||
|
|
local good,value=pcall(function()return panel[key]end);log('PANEL_VALUE '..key..' '..tostring(good)..' '..tostring(value))
|
||
|
|
end
|
||
|
|
local state=panel.StateData
|
||
|
|
log('STATE present='..tostring(state~=nil)..' CurState='..tostring(state and state.CurState))
|
||
|
|
end
|
||
|
|
end)
|
||
|
|
if not ok then log('ERROR '..tostring(err))end
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|