Files
GaCy-GO/tools/cw_pending_track_schema.lua
T

32 lines
1.8 KiB
Lua

-- Named Spotlight config and active session metadata, no actions/loaders.
do
local s=_G.__gacCwSpotlightSchema3 or {index=1};_G.__gacCwSpotlightSchema3=s
if s.done then return end
local log=function(v)CS.UnityEngine.Debug.Log('[GAC_CW_PENDING_TRACK_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 session=module.CurGameSession;if not session then return end;local families=module:GetHandBookAllRoleConfig();s.objects={session.Track.EquipTrackData,families[0].DefaultRole};s.extra=typeof(CS.RPG.Client.GridFightSpotLightSelectAction)
end
local object=s.objects[s.index];if not object and s.index~=3 then s.done=true;log('END');return end
s.index=s.index+1
local t=object and object:GetType() or s.extra;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 false 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==4 then s.done=true;log('END')end
end)
if not ok then log('ERROR '..tostring(err));s.done=true end
end