mirror of
https://fem.mint.lgbt/m/Rhythmblock.git
synced 2024-08-14 20:27:11 +00:00
added manual mode
This commit is contained in:
parent
8900491c18
commit
77a8d5442f
1 changed files with 19 additions and 16 deletions
|
@ -4,18 +4,18 @@ buttonColor = colors.lightGray
|
||||||
textColor = colors.lightGray
|
textColor = colors.lightGray
|
||||||
altTextColor = colors.gray
|
altTextColor = colors.gray
|
||||||
backgroundColor = colors.black
|
backgroundColor = colors.black
|
||||||
|
if arg[1] == nil then
|
||||||
function round(n) -- We need a function to round the center of the terminal
|
function round(n) -- We need a function to round the center of the terminal
|
||||||
return n % 1 >= 0.5 and math.ceil(n) or math.floor(n)
|
return n % 1 >= 0.5 and math.ceil(n) or math.floor(n)
|
||||||
end
|
end
|
||||||
width, height = term.getSize() -- Gets the terminal size to determine the center
|
width, height = term.getSize() -- Gets the terminal size to determine the center
|
||||||
centerWidth = round(width / 2) -- Defines the horizontal center
|
centerWidth = round(width / 2) -- Defines the horizontal center
|
||||||
centerHeight = round(height / 2) -- Defines the vertical center
|
centerHeight = round(height / 2) -- Defines the vertical center
|
||||||
peripherals = peripheral.getNames() -- Gets peripherals to check if any disk drives are avavailable
|
peripherals = peripheral.getNames() -- Gets peripherals to check if any disk drives are avavailable
|
||||||
if #peripherals < 0 then
|
if #peripherals < 0 then
|
||||||
print "No drive"
|
print "No drive"
|
||||||
return true -- Exits if there's no disk drive
|
return true -- Exits if there's no disk drive
|
||||||
else
|
else
|
||||||
driveCount = 0
|
driveCount = 0
|
||||||
for n = 1, #peripherals do
|
for n = 1, #peripherals do
|
||||||
local driveCheck = peripherals[n]
|
local driveCheck = peripherals[n]
|
||||||
|
@ -28,6 +28,9 @@ else
|
||||||
print("Too many disk drives. Specify where the disk drive is by running rhythmbox [drive position]") -- For safety reasons
|
print("Too many disk drives. Specify where the disk drive is by running rhythmbox [drive position]") -- For safety reasons
|
||||||
os.exit()
|
os.exit()
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
drive = arg[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[ Instead of calling every status by string, we call the variables storing the strings. This may ease translation if we plan to do it in the future.
|
--[[ Instead of calling every status by string, we call the variables storing the strings. This may ease translation if we plan to do it in the future.
|
||||||
|
|
Loading…
Reference in a new issue