Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button") --pastebin.com/HRbMF1Eg
- local menu = {}
- function loadMenu(menuName, buttonTable, fenv)
- if menuName == nil then menuName = "" end
- if fenv == nil then fenv = {} end
- if buttonTable == nil then return end
- menu = { menuName, buttonTable, fenv }
- button.clearTable()
- button.heading(menuName)
- for _,v in ipairs(buttonTable) do
- button.setTable(v.name, v.func, v.xmin, v.xmax, v.ymin, v.ymax)
- setfenv(buttonTable.func, fenv)
- end
- button.screen()
- end
- function reload() loadMenu(unpack(menu)) end
- function packButton(name, func, xmin, xmax, ymin, ymax)
- local b = {}
- b.name = name
- b.func = func
- b.active = false
- b.xmin = xmin
- b.ymin = ymin
- b.xmax = xmax
- b.ymax = ymax
- return b
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement