Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --VARIABLES
- bgrPath = settings.get("DiamondOS.cfg.bgr", "/diamondOS.beta/bin/desktop/wallpapers/bgr0.nfp")
- local hasAdminPermision = false
- --LOCAL
- local function finishApp()
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.clear()
- term.setCursorPos(1,1)
- shell.run("/os/.sys/main")
- --error()
- end
- local function printCetered(y,s,clearLine)
- local x = math.floor((w - string.len(s)) / 2)
- term.setCursorPos(x,y)
- if clearLine == true then
- term.clearLine()
- end
- term.write(s)
- end
- local function drawdesk()
- deskimage = paintutils.loadImage(bgrPath)
- paintutils.drawImage(deskimage, 1, 1)
- drawhotbar()
- end
- local function drawhotbar()
- term.setBackgroundColor(colors.gray)
- term.setCursorPos(1,1)
- term.clearLine()
- --if openedPrograms == true then
- -- print("[Menu] | [Close]") -- [CLOSE] 12-18
- --else
- print("[ OS ]")
- --end
- end
- --FUNCTIONS
- function initWindow(backgroundColor, possibleToClose)
- local x, y = term.getSize()
- term.setBackgroundColor(backgroundColor)
- term.clear()
- term.setCursorPos(x-2,2)
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.red)
- if possibleToClose == true then
- print("[X]")
- end
- term.setBackgroundColor(backgroundColor)
- drawhotbar()
- end
- function showDialogWindow(windowName, collection)
- end
- function appClose()
- term.clear()
- drawdesk()
- end
- function appInit(appName, author, version, path)
- --collection = settings.get("Apps")
- --info = {appName, author, version, path}
- --settings.set("Apps", textutils.serialise({collection, info}, {allow_repetitions = true, compact = true}))
- --settings.save()
- end
- function accountAskAdminPermission()
- end
- function dShell_Shutdown()
- if hasAdminPermision == true then
- os.shutdown()
- else
- return false
- end
- end
- function dShell_Reboot()
- if hasAdminPermision == true then
- os.reboot()
- else
- return false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment