2012-10-21 04:42:55 -06:00
|
|
|
-- a binary hack/plugin collection for df
|
2012-11-01 08:00:00 -06:00
|
|
|
local dfu=require("plugins.dfusion")
|
|
|
|
local myos=dfhack.getOSType()
|
2012-10-21 04:42:55 -06:00
|
|
|
|
2012-11-01 08:00:00 -06:00
|
|
|
--some imports go here
|
|
|
|
local plugins={
|
|
|
|
require("plugins.dfusion.embark").CustomEmbark
|
|
|
|
}
|
|
|
|
--show a table of all the statuses
|
|
|
|
function status(plug)
|
|
|
|
if dfu.plugins[plug.name]==nil then
|
|
|
|
return plug.class_status
|
|
|
|
else
|
|
|
|
return dfu.plugins[plug.name]:status()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
function printPlugs()
|
|
|
|
local endthis=false
|
|
|
|
print("current:")
|
|
|
|
while(not endthis) do
|
|
|
|
for k,v in pairs(plugins) do
|
|
|
|
if v then
|
|
|
|
print(string.format("%2d. %15s-%s",k,v.name,status(v)))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
print("e-edit and load, u-unload,c-cancel and then number to manipulate:")
|
|
|
|
local choice=io.stdin:read()
|
|
|
|
local num=tonumber(io.stdin:read())
|
|
|
|
if num then
|
|
|
|
local plg=dfu.plugins[plugins[num].name] or plugins[num]()
|
|
|
|
if choice=='e' then
|
|
|
|
plg:edit()
|
|
|
|
elseif choice=='u' then
|
|
|
|
plg:uninstall()
|
|
|
|
elseif choice=='c' then
|
|
|
|
endthis=true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
printPlugs()
|