Add about_modules command

This commit is contained in:
Eduardo Bart 2013-02-28 19:05:53 -03:00
parent b804dd6959
commit 425bfd998b
2 changed files with 22 additions and 8 deletions

View File

@ -1,7 +1,5 @@
MinimapFlag < UIWidget MinimapFlag < UIWidget
size: 11 11 size: 11 11
anchors.left: parent.left
anchors.top: parent.top
focusable: false focusable: false
MinimapCross < UIWidget MinimapCross < UIWidget

View File

@ -1,3 +1,8 @@
local function pcolored(text, color)
color = color or 'white'
modules.client_terminal.addLine(text, color)
end
function draw_debug_boxes(enable) function draw_debug_boxes(enable)
if enable == nil then enable = true end if enable == nil then enable = true end
g_ui.setDebugBoxesDrawing(enable) g_ui.setDebugBoxesDrawing(enable)
@ -51,21 +56,32 @@ function ls(path)
local files = g_resources.listDirectoryFiles(path) local files = g_resources.listDirectoryFiles(path)
for k,v in pairs(files) do for k,v in pairs(files) do
if g_resources.directoryExists(path .. v) then if g_resources.directoryExists(path .. v) then
modules.client_terminal.addLine(path .. v, 'blue') pcolored(path .. v, 'blue')
else else
pinfo(path .. v) pcolored(path .. v)
end end
end end
end end
function about_version() function about_version()
pinfo(g_app.getName() .. ' ' .. g_app.getVersion() .. '\n' .. pcolored(g_app.getName() .. ' ' .. g_app.getVersion() .. '\n' ..
'Rev ' .. g_app.getBuildRevision() .. ' ('.. g_app.getBuildCommit() .. ')\n' .. 'Rev ' .. g_app.getBuildRevision() .. ' ('.. g_app.getBuildCommit() .. ')\n' ..
'Built on ' .. g_app.getBuildDate()) 'Built on ' .. g_app.getBuildDate())
end end
function about_graphics() function about_graphics()
pinfo('Vendor ' .. g_graphics.getVendor() ) pcolored('Vendor ' .. g_graphics.getVendor() )
pinfo('Renderer' .. g_graphics.getRenderer()) pcolored('Renderer' .. g_graphics.getRenderer())
pinfo('Version' .. g_graphics.getVersion()) pcolored('Version' .. g_graphics.getVersion())
end
function about_modules()
for k,m in pairs(g_modules.getModules()) do
local loadedtext
if m:isLoaded() then
pcolored(m:getName() .. ' => loaded', 'green')
else
pcolored(m:getName() .. ' => not loaded', 'red')
end
end
end end