24 lines
1.5 KiB
Lua
24 lines
1.5 KiB
Lua
-- Existing handbook wrapper metadata only, one inheritance level per heartbeat.
|
|
do
|
|
local s=_G.__gacCwEquipmentSchema2 or {};_G.__gacCwEquipmentSchema2=s
|
|
if s.done then return end
|
|
local log=function(v)CS.UnityEngine.Debug.Log('[GAC_CW_EQUIP_CONFIG_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
|
|
if not s.initialized then
|
|
local rows=CS.RPG.Client.GlobalVars.s_ModuleManager.GridFightModule:GetHandBookAllEquipItemData()
|
|
if not rows or rows.Count==0 then return end
|
|
log('COUNT '..rows.Count);local first=nil;for i=0,math.min(rows.Count-1,255)do if rows[i].IsEquipment then first=rows[i].EquipConfig;break end end;if not first then error('no initialized equipment wrapper')end;s.type=first:GetType();s.depth=0;s.initialized=true
|
|
end
|
|
local t=s.type;if not t or s.depth>=4 then s.done=true;log('END');return end
|
|
log('TYPE '..t.FullName)
|
|
local fs=t:GetFields(flags);for i=0,math.min(fs.Length-1,47)do log('FIELD '..tostring(fs[i]))end
|
|
local ps=t:GetProperties(flags);for i=0,math.min(ps.Length-1,47)do log('PROPERTY '..tostring(ps[i]))end
|
|
s.type=t.BaseType;s.depth=s.depth+1
|
|
end)
|
|
if not ok then log('ERROR '..tostring(err));s.done=true end
|
|
end
|