Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[Program Info
- Stargate Theme player
- System requirements:
- Tier 3 GPU
- Tier 3 Screen
- Redstone IO
- Music disc change system requiremets:
- EnderIO
- Extra Utilities 2
- Custom Records - not required (only for custom music discs)
- --]]
- -- Changelog ----------------------------------------------
- local changelog = [[
- - Optimalization of progress bar
- - Edited functions
- - Added new Info screens - disc status
- ]]
- -- End of Changelog ---------------------------------------
- -- Start --------------------------------------------------
- local term = require("term")
- local component = require("component")
- local computer = require("computer")
- local event = require("event")
- local unicode = require("unicode")
- local colors = require("colors")
- local sides = require("sides")
- local gpu = component.gpu
- local screen = component.screen
- local creators = [[Augur ShicKla, TheRedCreations, Fredyman_95]]
- local version = [[1.4.0.0]]
- -- End of start -------------------------------------------
- -- Sides config -------------------------------------------
- local song1 = sides.north
- local song2 = sides.south
- local song3 = sides.top
- local song4 = sides.west
- local song5 = sides.east
- local stopSong = sides.bottom
- -- End of Sides config ------------------------------------
- -- System requirements check ------------------------------
- if gpu.maxResolution() < 100 then
- io.stderr:write("Tier 3 GPU and Screen Required")
- computer.beep()
- os.sleep(0.2)
- computer.beep()
- os.exit(1)
- end
- if not component.isAvailable("redstone") then
- io.stderr:write("No RedstoneIO Connected.")
- computer.beep()
- os.sleep(0.2)
- computer.beep()
- os.sleep(0.2)
- computer.beep()
- os.exit(1)
- end
- -- end of System requirements check -----------------------
- -- Declarations--------------------------------------------
- local ActiveButtons = {}
- local buttons = {}
- local User = ""
- local mainScreen = function() end
- local ErrorMessage = ""
- local StopPlaying = false
- local rs = component.redstone
- local logoColor = 0xFFFFFF --Default 0xFFFFFF white
- local AdminList = {"Example_Name","Fredyman_95","ShicKla","TheRedCreations","MineDragonCZ_","Matousss"}
- local mainloop = true
- screen.setTouchModeInverted(true)
- -- end of Declarations ------------------------------------
- -- Colors Declarations ------------------------------------
- local white = 0xFFFFFF
- local blue = 0x00B6FF
- local darkBlue = 0x0049FF
- local red = 0xAA0000
- local darkRed = 0x660000
- local grey = 0xB4B4B4
- local lightGrey =0xE1E1E1
- local mediumGrey = 0x787878
- local darkGrey = 0x4B4B4B
- -- End of colors Declarations -----------------------------
- -- Player settings ----------------------------------------
- local barSymbol = [[█]]
- -- End of player settings ---------------------------------
- -- Restart of RedstoneIO -> outputs -----------------------
- rs.setOutput(song1, 0)
- rs.setOutput(song2, 0)
- rs.setOutput(song3, 0)
- rs.setOutput(song4, 0)
- rs.setOutput(song5, 0)
- rs.setOutput(stopSong, 0)
- -- End of retart of RedstoneIO -> outputs -----------------
- -- Buttons Objects === by Augur ShicKla === ---------------
- local Button = {}
- Button.__index = Button
- function Button.new(xPos, yPos, width, height, label, func, border)
- local self = setmetatable({}, Button)
- if xPos < 1 or xPos > term.window.width then xPos = 1 end
- if yPos < 1 or yPos > term.window.height then yPos = 1 end
- if (width-2) < unicode.len(label) then width = unicode.len(label)+2 end
- if height < 3 then height = 3 end
- if border == nil then
- self.border = true
- else
- self.border = border
- end
- self.xPos = xPos
- self.yPos = yPos
- self.width = width
- self.height = height
- self.label = label
- self.func = func
- self.visible = false
- self.disabled = false
- return self
- end
- function Button.display(self, x, y)
- table.insert(ActiveButtons, 1, self)
- if (self.width-2) < unicode.len(self.label) then self.width = unicode.len(self.label)+2 end
- if x ~= nil and y ~= nil then
- self.xPos = x
- self.yPos = y
- end
- if self.border then
- gpu.fill(self.xPos+1, self.yPos, self.width-2, 1, "─")
- gpu.fill(self.xPos+1, self.yPos+self.height-1, self.width-2, 1, "─")
- gpu.fill(self.xPos, self.yPos+1, 1, self.height-2, "│")
- gpu.fill(self.xPos+self.width-1, self.yPos+1, 1, self.height-2, "│")
- gpu.set(self.xPos, self.yPos, "┌")
- gpu.set(self.xPos+self.width-1, self.yPos, "┐")
- gpu.set(self.xPos, self.yPos+self.height-1, "└")
- gpu.set(self.xPos+self.width-1, self.yPos+self.height-1, "┘")
- end
- gpu.set(self.xPos+1, self.yPos+1, self.label)
- self.visible = true
- end
- function Button.hide(self)
- self.visible = false
- for i,v in ipairs(ActiveButtons) do
- if v == self then table.remove(ActiveButtons, i) end
- end
- if self.border then
- gpu.fill(self.xPos, self.yPos, self.width, self.height, " ")
- else
- gpu.fill(self.xPos+1, self.yPos+1, self.width-2, 1, " ")
- end
- end
- function Button.disable(self, bool)
- if bool == nil then
- self.disabled = false
- else
- self.disabled = bool
- end
- if self.disabled then gpu.setForeground(0x0F0F0F) end
- if self.visible then self:display() end
- gpu.setForeground(0xFFFFFF)
- end
- function Button.touch(self, x, y)
- local wasTouched = false
- if self.visible and not self.disabled then
- if self.border then
- if x >= self.xPos and x <= (self.xPos+self.width-1) and y >= self.yPos and y <= (self.yPos+self.height-1) then wasTouched = true end
- else
- if x >= self.xPos+1 and x <= (self.xPos+self.width-2) and y >= self.yPos+1 and y <= (self.yPos+self.height-2) then wasTouched = true end
- end
- end
- if wasTouched then
- gpu.setBackground(0x878787)
- gpu.set(self.xPos+1, self.yPos+1, self.label)
- gpu.setBackground(0x000000)
- if self.visible then gpu.set(self.xPos+1, self.yPos+1, self.label) end
- self.func()
- end
- return wasTouched
- end
- function Button.forceTouch(self)
- self:touch(self.xPos+1, self.yPos+1)
- end
- -- end of Buttons Objects === by Augur ShicKla === --------
- -- Interuption --------------------------------------------
- local function isAuthorized(name)
- local authorized = false
- if #AdminList == 0 then
- authorized = true
- else
- for _,v in ipairs(AdminList) do
- if string.lower(v) == string.lower(name) then
- authorized = true
- break
- end
- end
- end
- return authorized
- end
- -- End of Interuption -------------------------------------
- -- Events -------------------------------------------------
- local Events = {}
- Events.key_down = event.listen("key_down", function(_, keyboardAddress, chr, code, playerName)
- User = playerName
- end)
- Events.key_up = event.listen("key_up", function(_, keyboardAddress, chr, code, playerName)
- User = ""
- end)
- Events.interrupted = event.listen("interrupted", function()
- if isAuthorized(User) then
- mainloop = false
- end
- end)
- Events.touch = event.listen("touch", function(_, screenAddress, x, y, button, playerName)
- local success, msg = xpcall(function()
- if button == 0 then
- for i,v in ipairs(ActiveButtons) do
- if v:touch(x,y) then break end
- end
- end
- end, debug.traceback)
- if not success then
- ErrorMessage = msg
- mainloop = false
- end
- end)
- -- end of Events ------------------------------------------
- -- Pictures -----------------------------------------------
- local mainHeader = [[
- ████████╗██╗ ██╗███████╗███╗ ███╗███████╗ ██████╗ ██╗ █████╗ ██╗ ██╗███████╗██████╗
- ╚══██╔══╝██║ ██║██╔════╝████╗ ████║██╔════╝ ██╔══██╗██║ ██╔══██╗╚██╗ ██╔╝██╔════╝██╔══██╗
- ██║ ███████║█████╗ ██╔████╔██║█████╗ ██████╔╝██║ ███████║ ╚████╔╝ █████╗ ██████╔╝
- ██║ ██╔══██║██╔══╝ ██║╚██╔╝██║██╔══╝ ██╔═══╝ ██║ ██╔══██║ ╚██╔╝ ██╔══╝ ██╔══██╗
- ██║ ██║ ██║███████╗██║ ╚═╝ ██║███████╗ ██║ ███████╗██║ ██║ ██║ ███████╗██║ ██║
- ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝]]
- local logoSG1 = [[
- ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣶⣿⣿⣿⣿⣷⣄
- ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⡟⠁⠈⢻⣿⣿⡇
- ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣧⣀⢀⣼⣿⣿⡇
- ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠿⣿⣿⣿⣿⠿⠋
- ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣤⡀
- ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⡀
- ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣿⣿⡿⢿⣿⣿⣦⡀
- ⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣾⣿⣿⠏⠀⠀⠹⣿⣿⣷⡄
- ⠀⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⡿⠇⠀⠀⠀⠀⠈⢻⣿⣿⣦⡀
- ⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣷⣄
- ⠀⠀⠀⠀⢀⣴⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⣿⣦⡀
- ⠀⠀⠀⢀⣾⣿⣿⠏⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣿⣿⣿⣦
- ⠀⢀⣾⣿⣿⣿⣟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣹⣿⣿⣿⣷⡀
- ⠰⠿⠿⠿⠿⠿⠿⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⠾⠿⠿⠿⠿⠿⠿⠆]]
- local logoAtlantis = [[
- ⢀⣤⣄
- ⢺⣿⣿⠂⠀⠀⠀⠀⠀⠀⠀⢰⣶⣶⣀⠀⠀⠀⣠⣤⡀
- ⠀⠸⡆⠀⠀⠀⠀⣀⣤⣀⡴⠚⠻⠟⠉⠉⠉⠛⢿⣿⡿⠦⠤⣤⣀⣴⣶⣄
- ⠀⠀⣧⠀⠀⠀⠀⢿⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⡿⠋
- ⠀⢰⣾⣶⡀⠀⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣤⣶⣄⠀⠀⠀⢸
- ⠀⠘⠿⣟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠿⠿⢯⡀⠀⠀⣸
- ⠀⠀⠀⢹⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢦⣀⣿
- ⠀⠀⠀⠈⣧⠀⠀⢠⣾⣿⡆⠀⠀⠀⠀⠀⢠⣤⣄⣀⣀⣠⣤⠴⣿⣿⡷
- ⠀⠀⠀⢠⣿⣿⡖⠋⠛⠛⠁⠀⠀⠀⢀⣠⠿⣿⡿⠋⠁⠀⠀⠀⠈⠉
- ⠀⠀⠀⠀⠙⠛⢧⡀⠀⠀⢠⣾⣷⡞⠉⠀⢰⠃
- ⠀⠀⠀⠀⠀⠀⢰⣿⣿⡇⠈⠻⠟⠁⠀⣀⡟
- ⠀⠀⠀⠀⠀⠀⠀⠙⠋⠁⠀⠀⠀⠀⣼⣿⣿
- ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⠉]]
- local logoUniTheme = [[
- ⠀⣠⣴⣶⣶⣤⡀
- ⢸⣿⣿⠛⢻⣿⣿
- ⠸⣿⣿⣶⣾⣿⡿
- ⠀⠉⠛⠿⠟⠋⠁
- ⠀⠀⢀⣠⣀
- ⠀⠀⢸⣿⣿
- ⠀⠀⢸⣿⣿
- ⠀⠀⠈⠛⠋
- ⠀⠀⣠⣤⣤⣀
- ⠀⢸⣿⣿⣿⣿⡄
- ⠀⠈⠻⢿⡿⠟
- ⠀⠀⠀⣀⡀
- ⠀⠀⢰⣿⣿
- ⠀⠀⢸⣿⣿
- ⠀⠀⠘⠿⠟ ]]
- local logoUniOpening = [[
- ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇
- ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇
- ⣿⣿⣿⡏⠉⠉⠉⠉⠉⠉⣿⣿⣿⡇ ⣿⣿⣿⡏⠉⠉⠉⠉⠉⠉⣿⣿⣿⡇
- ⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⣿⣿⣿⡇ ⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⣿⣿⣿⡇
- ⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⣿⣿⣿⡇ ⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⣿⣿⣿⡇
- ⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⣿⣿⣿⡇ ⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⣿⣿⣿⡇
- ⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⣿⣿⣿⡇ ⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⣿⣿⣿⡇
- ⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⣿⣿⣿⡇ ⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⣿⣿⣿⡇
- ⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⣿⣿⣿⡇ ⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⣿⣿⣿⡇
- ⣿⣿⣿⣧⣤⣤⣤⣤⣤⣤⣿⣿⣿⡇ ⣿⣿⣿⣧⣤⣤⣤⣤⣤⣤⣿⣿⣿⡇
- ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇
- ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇
- ⠀⠀⠀⠀⠀⣿⣿⣿⡇ ⣿⣿⣿⡇
- ⠀⠀⠀⠀⠀⣿⣿⣿⡇ ⣿⣿⣿⡇
- ⠀⠀⠀⠀⠀⣿⣿⣿⡇ ⣿⣿⣿⡇]]
- local logoUniGauntlet = [[
- ⠀⣠⣴⣶⣶⣤⡀ ⠀⢀⣠⣤⣶⣤⣄ ⠀⢠⣶⡆
- ⢸⣿⣿⠛⢻⣿⣿ ⢠⣿⣿⡿⠿⢿⣿⣷⡄ ⠀⢸⣿⡇
- ⠸⣿⣿⣶⣾⣿⡿ ⣾⣿⣿⠀⠀⠀⣿⣿⡇ ⠀⢸⣿⡇
- ⠀⠉⠛⠿⠟⠋⠁ ⠸⣿⣿⣦⣤⣴⣿⣿⠃ ⠀⠈⠛⠁
- ⠀⠀⢀⣠⣀ ⠈⠻⠿⠿⠿⠛⠁ ⠀⢀⣀
- ⠀⠀⢸⣿⣿ ⣴⣿⣿⣿⣆
- ⠀⠀⢸⣿⣿ ⠀⠀⣀⣤⣤⣄⡀ ⣿⣿⣿⣿⡿
- ⠀⠀⠈⠛⠋ ⢠⣾⣿⣿⠿⣿⣿⣷⡀ ⠈⠉⠉⠉
- ⠀⠀⣠⣤⣤⣀ ⣾⣿⣿⠁⠀⠈⣿⣿⡇ ⠀⠀⢀⡀
- ⠀⢸⣿⣿⣿⣿⡄ ⠸⣿⣿⣦⣤⣴⣿⣿⠃ ⠀⣴⣿⠟
- ⠀⠈⠻⢿⡿⠟ ⠀⠈⠻⠿⠿⠿⠛⠁ ⢸⣿⡏
- ⠀⠀⠀⣀⡀ ⠘⢿⣷⣄
- ⠀⠀⢰⣿⣿ ⠀⠀⣴⣿⣿⣿⣦ ⢹⣿
- ⠀⠀⢸⣿⣿ ⠘⣿⣿⣿⣿⣿ ⣼⣿
- ⠀⠀⠘⠿⠟ ⠙⠻⠿⠟⠁ ⠀⠸⠿⠋]]
- -- End of pictures ----------------------------------------
- -- Functions ----------------------------------------------
- local function setScreenResolution()
- gpu.setResolution(104, 43)
- end
- local function screenClear()
- buttons.SG1:hide()
- buttons.SGA:hide()
- buttons.SGUT:hide()
- buttons.SGUO:hide()
- buttons.SGUG:hide()
- buttons.STOP:hide()
- buttons.PrevSG1:hide()
- buttons.PrevA:hide()
- buttons.PrevUT:hide()
- buttons.PrevUO:hide()
- buttons.NextA:hide()
- buttons.NextUT:hide()
- buttons.NextUO:hide()
- buttons.NextUG:hide()
- -------------------------------
- buttons.SG1:disable(true)
- buttons.SGA:disable(true)
- buttons.SGUT:disable(true)
- buttons.SGUO:disable(true)
- buttons.SGUG:disable(true)
- buttons.STOP:disable(true)
- buttons.PrevSG1:disable(true)
- buttons.PrevA:disable(true)
- buttons.PrevUT:disable(true)
- buttons.PrevUO:disable(true)
- buttons.NextA:disable(true)
- buttons.NextUT:disable(true)
- buttons.NextUO:disable(true)
- buttons.NextUG:disable(true)
- term.clear()
- end
- local function screenHeader(HeaderColor)
- term.setCursor(1, 3)
- gpu.setForeground(HeaderColor)
- print(mainHeader)
- gpu.setForeground(white)
- end
- local function removeDisc(removeTime)
- rs.setOutput(stopSong, 15)
- os.sleep(removeTime)
- rs.setOutput(stopSong, 0)
- end
- local function insertDisc(songNum, preInsertPause, insertPause)
- StopPlaying = false
- removeDisc(0.5)
- os.sleep(preInsertPause)
- rs.setOutput(songNum, 15)
- os.sleep(insertPause)
- rs.setOutput(songNum, 0)
- end
- local function convert(timeValue)
- local timeValue = tonumber(timeValue)
- if timeValue <= 0 then
- mins = "00"
- secs = "00"
- else
- hours = string.format("%02.f", math.floor(timeValue/3600));
- mins = string.format("%02.f", math.floor(timeValue/60 - (hours*60)));
- secs = string.format("%02.f", math.floor(timeValue - hours*3600 - mins *60));
- end
- end
- local function albumLogo(logoPosX, logoPosY, pictureColor, songPicture)
- term.setCursor(logoPosX, logoPosY)
- gpu.setForeground(pictureColor)
- print(songPicture)
- gpu.setForeground(white)
- term.setCursor(3, 12)
- print("┌─────────────────────────────────────────┐")
- local columb = 3
- local line = 13
- for i = 0, 15, 1 do
- term.setCursor(columb, line)
- print("│")
- columb = columb + 42
- term.setCursor(columb, line)
- print("│")
- line = line + 1
- columb = 3
- end
- term.setCursor(columb, line)
- print("└─────────────────────────────────────────┘")
- end
- local function infoText(textPosX, textPosY, space1, space2, line1, line2)
- term.setCursor(textPosX, textPosY)
- print("Now is playing:")
- textPosY = textPosY + space1 + 1
- term.setCursor(textPosX, textPosY)
- print(line1)
- textPosY = textPosY + space2 + 1
- term.setCursor(textPosX, textPosY)
- print(line2)
- end
- local function progressBarTable(totalTime)
- term.setCursor(2, 39)
- print("┌───────────────────────────────────────────────────────────────────────────────────────────────────┐")
- term.setCursor(2, 40)
- print("│ │")
- term.setCursor(2, 41)
- print("└───────────────────────────────────────────────────────────────────────────────────────────────────┘")
- term.setCursor(98, 42)
- convert(totalTime)
- print(mins..":"..secs)
- end
- local function progressBar(duration, barColor)
- local loopTime = duration - 1
- local barPositionX = 3
- local playedTime = 0
- local add2 = duration * 10
- local add = 99 / add2
- for i=0, loopTime, 1 do
- gpu.setForeground(white)
- convert(playedTime)
- term.setCursor(3, 42)
- print(mins..":"..secs)
- playedTime = playedTime + 1
- for i=0, 9, 1 do
- gpu.setForeground(barColor)
- term.setCursor(barPositionX, 40)
- print(barSymbol)
- barPositionX = barPositionX + add
- if StopPlaying then break end
- os.sleep(0.1)
- end
- if StopPlaying then break end
- end
- gpu.setForeground(white)
- return
- end
- local function playerArrows(played)
- if played == 1 then
- buttons.NextA:display()
- -----------------------------
- buttons.NextA:disable(false)
- elseif played == 2 then
- buttons.PrevSG1:display()
- buttons.NextUT:display()
- -----------------------------
- buttons.PrevSG1:disable(false)
- buttons.NextUT:disable(false)
- elseif played == 3 then
- buttons.PrevA:display()
- buttons.NextUO:display()
- -----------------------------
- buttons.PrevA:disable(false)
- buttons.NextUO:disable(false)
- elseif played == 4 then
- buttons.PrevUT:display()
- buttons.NextUG:display()
- -----------------------------
- buttons.PrevUT:disable(false)
- buttons.NextUG:disable(false)
- elseif played == 5 then
- buttons.PrevUO:display()
- -----------------------------
- buttons.PrevUO:disable(false)
- else
- os.sleep(0.1)
- end
- end
- -- End of Functions ---------------------------------------
- -- Screens ------------------------------------------------
- local function loadingScreen(bootTime)
- screenClear()
- setScreenResolution()
- screenHeader(logoColor)
- computer.beep()
- gpu.set(44, 9, "Version:")
- gpu.set(53, 9, version)
- gpu.set(2, 11, "Created by:")
- gpu.set(2, 12, creators)
- term.setCursor(2, 20)
- print("Changelog:")
- term.setCursor(1, 22)
- print(changelog)
- os.sleep(bootTime)
- end
- local function mainScreen()
- screenClear()
- setScreenResolution()
- screenHeader(logoColor)
- buttons.SG1:display()
- buttons.SGA:display()
- buttons.SGUT:display()
- buttons.SGUO:display()
- buttons.SGUG:display()
- -----------------------------
- buttons.SG1:disable(false)
- buttons.SGA:disable(false)
- buttons.SGUT:disable(false)
- buttons.SGUO:disable(false)
- buttons.SGUG:disable(false)
- end
- local function insertDiscScreen()
- screenClear()
- gpu.setResolution(19, 3)
- term.setCursor(2, 2)
- print("Inserting disc...")
- end
- local function removeDiscScreen()
- screenClear()
- gpu.setForeground(white)
- gpu.setResolution(19, 3)
- term.setCursor(2, 2)
- print("Removing disc...")
- end
- local function playScreen(colorHeader, PosXlogo, PosYlogo, colorImage, Image, PosXtext, PosYtext, freeLine1, freeLine2, text1, text2, pageNum, durationTime, colorBar)
- screenClear()
- setScreenResolution()
- screenHeader(colorHeader)
- albumLogo(PosXlogo, PosYlogo, colorImage, Image)
- infoText(PosXtext, PosYtext, freeLine1, freeLine2, text1, text2)
- buttons.STOP:display()
- -----------------------------
- buttons.STOP:disable(false)
- playerArrows(pageNum)
- progressBarTable(durationTime)
- progressBar(durationTime, colorBar)
- mainScreen()
- end
- -- End of Screens -----------------------------------------
- -- Buttons ------------------------------------------------
- buttons = {
- SG1 = Button.new(4, 10, 96, 5, "Stargate SG-1 Theme", function()
- computer.beep()
- insertDiscScreen()
- insertDisc(song1, 1, 0.5)
- playScreen(red, 20, 13, darkRed, logoSG1, 50, 12, 1, 0, "Stargate SG-1 theme", "David Arnold", 1, 59, red)
- end),
- SGA = Button.new(4, 16, 96, 5, "Stargate Atlantis Theme", function()
- computer.beep()
- insertDiscScreen()
- insertDisc(song2, 1, 0.5)
- playScreen(blue, 7, 15, darkBlue, logoAtlantis, 50, 12, 1, 0, "Stargate SGA theme", "Joel Goldsmith", 2, 61, blue)
- end),
- SGUT = Button.new(4, 22, 96, 5, "Stargate Universe Opening theme - Destiny arrival", function()
- computer.beep()
- insertDiscScreen()
- insertDisc(song3, 1, 0.5)
- playScreen(grey, 17, 13, lightGrey, logoUniTheme, 50, 12, 1, 0, "Stargate Universe theme", "Joel Goldsmith", 3, 126, grey)
- end),
- SGUO = Button.new(4, 28, 96, 5, "Stargate Universe Opening", function()
- computer.beep()
- insertDiscScreen()
- insertDisc(song4, 1, 0.5)
- playScreen(grey, 6, 13, mediumGrey, logoUniOpening, 50, 12, 1, 0, "Stargate Universe Opening", "Joel Goldsmith", 4, 51, grey)
- end),
- SGUG = Button.new(4, 34, 96, 5, "Stargate Universe Gauntlet", function()
- computer.beep()
- insertDiscScreen()
- insertDisc(song5, 1, 0.5)
- playScreen(grey, 8, 13, darkGrey, logoUniGauntlet, 50, 12, 1, 0, "Stargate Universe Gauntlet", "Joel Goldsmith", 5, 161, grey)
- end),
- STOP = Button.new(49, 36, 6, 3, "STOP", function()
- computer.beep()
- removeDiscScreen()
- removeDisc(0.5)
- StopPlaying = true
- end),
- NextA = Button.new(56, 36, 5, 3, "───►", function()
- computer.beep()
- removeDiscScreen()
- removeDisc(0.5)
- StopPlaying = true
- insertDiscScreen()
- insertDisc(song2, 1, 0.5)
- playScreen(blue, 7, 15, darkBlue, logoAtlantis, 50, 12, 1, 0, "Stargate SGA theme", "Joel Goldsmith", 2, 61, blue)
- end),
- NextUT = Button.new(56, 36, 5, 3, "───►", function()
- computer.beep()
- removeDiscScreen()
- removeDisc(0.5)
- StopPlaying = true
- insertDiscScreen()
- insertDisc(song3, 1, 0.5)
- playScreen(grey, 17, 13, lightGrey, logoUniTheme, 50, 12, 1, 0, "Stargate Universe theme", "Joel Goldsmith", 3, 126, grey)
- end),
- NextUO = Button.new(56, 36, 5, 3, "───►", function()
- computer.beep()
- removeDiscScreen()
- removeDisc(0.5)
- StopPlaying = true
- insertDiscScreen()
- insertDisc(song4, 1, 0.5)
- playScreen(grey, 6, 13, mediumGrey, logoUniOpening, 50, 12, 1, 0, "Stargate Universe Opening", "Joel Goldsmith", 4, 51, grey)
- end),
- NextUG = Button.new(56, 36, 5, 3, "───►", function()
- computer.beep()
- removeDiscScreen()
- removeDisc(0.5)
- StopPlaying = true
- insertDiscScreen()
- insertDisc(song5, 1, 0.5)
- playScreen(grey, 8, 13, darkGrey, logoUniGauntlet, 50, 12, 1, 0, "Stargate Universe Gauntlet", "Joel Goldsmith", 5, 161, grey)
- end),
- PrevUO = Button.new(42, 36, 5, 3, "◄───", function()
- computer.beep()
- removeDiscScreen()
- removeDisc(0.5)
- StopPlaying = true
- insertDiscScreen()
- insertDisc(song4, 1, 0.5)
- playScreen(grey, 6, 13, mediumGrey, logoUniOpening, 50, 12, 1, 0, "Stargate Universe Opening", "Joel Goldsmith", 4, 51, grey)
- end),
- PrevUT = Button.new(42, 36, 5, 3, "◄───", function()
- computer.beep()
- removeDiscScreen()
- removeDisc(0.5)
- StopPlaying = true
- insertDiscScreen()
- insertDisc(song3, 1, 0.5)
- playScreen(grey, 17, 13, lightGrey, logoUniTheme, 50, 12, 1, 0, "Stargate Universe theme", "Joel Goldsmith", 3, 126, grey)
- end),
- PrevA = Button.new(42, 36, 5, 3, "◄───", function()
- computer.beep()
- removeDiscScreen()
- removeDisc(0.5)
- StopPlaying = true
- insertDiscScreen()
- insertDisc(song2, 1, 0.5)
- playScreen(blue, 7, 15, darkBlue, logoAtlantis, 50, 12, 1, 0, "Stargate SGA theme", "Joel Goldsmith", 2, 61, blue)
- end),
- PrevSG1 = Button.new(42, 36, 5, 3, "◄───", function()
- computer.beep()
- removeDiscScreen()
- removeDisc(0.5)
- StopPlaying = true
- insertDiscScreen()
- insertDisc(song1, 1, 0.5)
- playScreen(red, 20, 13, darkRed, logoSG1, 50, 12, 1, 0, "Stargate SG-1 theme", "David Arnold", 1, 59, red)
- end),
- }
- -- End of buttons -----------------------------------------
- -- Program ------------------------------------------------
- loadingScreen(5)
- mainScreen()
- while mainloop do
- os.sleep(0.1)
- end
- screenClear()
- gpu.setResolution(160, 50)
- for k,v in pairs(Events) do
- print("Canceling Event Listener: "..k) -- For debug
- event.cancel(v)
- end
- io.stderr:write(ErrorMessage.."\n")
- -- End of program -----------------------------------------
Add Comment
Please, Sign In to add comment