mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-05 04:33:51 +00:00
feat: add Lua 5.1 addon system with .toc loader and /run command
Foundation for WoW-compatible addon support: - Vendor Lua 5.1.5 source as a static library (extern/lua-5.1.5) - TocParser: parses .toc files (## directives + file lists) - LuaEngine: Lua 5.1 VM with sandboxed stdlib (no io/os/debug), WoW-compatible print() that outputs to chat, GetTime() stub - AddonManager: scans Data/interface/AddOns/ for .toc files, loads .lua files on world entry, skips LoadOnDemand addons - /run <code> slash command for inline Lua execution - HelloWorld test addon that prints to chat on load Integration: AddonManager initialized after asset manager, addons loaded once on first world entry, reset on logout. XML frame parsing is deferred to a future step.
This commit is contained in:
parent
52064eb438
commit
290e9bfbd8
115 changed files with 29035 additions and 2 deletions
32
extern/lua-5.1.5/test/trace-calls.lua
vendored
Normal file
32
extern/lua-5.1.5/test/trace-calls.lua
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
-- trace calls
|
||||
-- example: lua -ltrace-calls bisect.lua
|
||||
|
||||
local level=0
|
||||
|
||||
local function hook(event)
|
||||
local t=debug.getinfo(3)
|
||||
io.write(level," >>> ",string.rep(" ",level))
|
||||
if t~=nil and t.currentline>=0 then io.write(t.short_src,":",t.currentline," ") end
|
||||
t=debug.getinfo(2)
|
||||
if event=="call" then
|
||||
level=level+1
|
||||
else
|
||||
level=level-1 if level<0 then level=0 end
|
||||
end
|
||||
if t.what=="main" then
|
||||
if event=="call" then
|
||||
io.write("begin ",t.short_src)
|
||||
else
|
||||
io.write("end ",t.short_src)
|
||||
end
|
||||
elseif t.what=="Lua" then
|
||||
-- table.foreach(t,print)
|
||||
io.write(event," ",t.name or "(Lua)"," <",t.linedefined,":",t.short_src,">")
|
||||
else
|
||||
io.write(event," ",t.name or "(C)"," [",t.what,"] ")
|
||||
end
|
||||
io.write("\n")
|
||||
end
|
||||
|
||||
debug.sethook(hook,"cr")
|
||||
level=0
|
||||
Loading…
Add table
Add a link
Reference in a new issue