-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use math.min/max and increase volume limit #3
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
local base = "https://raw.github.com/Ale32bit/Quartz/main/" | ||
local base = "https://raw.githubusercontent.com/Bioscreeper/Quartz/main/" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change back to original URL. |
||
local files = { | ||
"player.lua", | ||
"quartz/lib/ui.lua", | ||
|
@@ -33,4 +33,4 @@ for i, file in ipairs(files) do | |
download(base .. file, file) | ||
end | ||
|
||
print("Quartz downloaded!") | ||
print("Quartz downloaded!") |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -269,23 +269,13 @@ function quartz.loadTrack(tr, src) | |
end | ||
|
||
function quartz.setVolume(vol) | ||
if vol > 1 then | ||
vol = 1 | ||
end | ||
if vol < 0 then | ||
vol = 0 | ||
end | ||
vol = math.min(math.max(vol, 0), 5) | ||
speakers.volume = vol | ||
os.queueEvent("quartz_volume", vol) | ||
end | ||
|
||
function quartz.setDistance(dist) | ||
if dist > 128 then | ||
dist = 128 | ||
end | ||
if dist < 0 then | ||
dist = 0 | ||
end | ||
dist = math.min(math.max(dist, 1), 3) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Set minimum to 0 instead of 1. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should also update the relevant documentation to reflect the range change |
||
speakers.distance = dist | ||
os.queueEvent("quartz_distance", dist) | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "bit" is lowercase.