Files
GaCy-GO/tools/cw_spotlight_schema.lua
T

33 lines
1.7 KiB
Lua
Raw Normal View History

-- Named Spotlight config and active session metadata, no actions/loaders.
do
local s=_G.__gacCwSpotlightSchema1 or {index=1};_G.__gacCwSpotlightSchema1=s
if s.done then return end
local log=function(v)CS.UnityEngine.Debug.Log('[GAC_CW_SPOTLIGHT_SCHEMA] '..tostring(v))end
local ok,err=pcall(function()
local flags=CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags),60)
local manager=CS.RPG.Client.GlobalVars.s_GamePhaseManager
local phase=manager and typeof(CS.RPG.Client.GamePhaseManager):GetField('_CurrentPhase',flags):GetValue(manager)
if not phase or typeof(CS.RPG.Client.BattleGamePhase):IsInstanceOfType(phase)then return end
local module=CS.RPG.Client.GlobalVars.s_ModuleManager.GridFightModule
if not s.objects then
local rows=module:GetHandBookAllSpotLightData();log('COUNT '..rows.Count)
if rows.Count==0 then error('Spotlight handbook is empty')end
s.objects={rows[0],module.CurGameSession}
end
local object=s.objects[s.index];if not object then s.done=true;log('END');return end
s.index=s.index+1
local t=object:GetType();log('TYPE '..t.FullName)
local fs=t:GetFields(flags)
for i=0,math.min(fs.Length-1,63)do
log('FIELD '..tostring(fs[i]))
if s.index==2 and tostring(fs[i].FieldType.FullName):find('Row$')then
local row=fs[i]:GetValue(object);if row then log('ROW '..CS.Newtonsoft.Json.JsonConvert.SerializeObject(row))end
end
end
local ps=t:GetProperties(flags);for i=0,math.min(ps.Length-1,63)do log('PROPERTY '..tostring(ps[i]))end
local ms=t:GetMethods(flags)
for i=0,math.min(ms.Length-1,127)do if ms[i].DeclaringType==t then log('METHOD '..tostring(ms[i]))end end
if s.index==3 then s.done=true;log('END')end
end)
if not ok then log('ERROR '..tostring(err));s.done=true end
end