Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions [gameplay]/dialogs/sourceC.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function messageBeep(soundType, soundVolume)
error("Bad argument @ 'messageBeep' [Invalid type at argument 1, got '" .. tostring(soundType) .. "']")
end

if not soundVolume or soundVolume > 1 or type(soundVolume) ~= "number" then
if not soundVolume or soundVolume < 0 or soundVolume > 1 or type(soundVolume) ~= "number" then
soundVolume = 1
end

Expand Down Expand Up @@ -103,7 +103,7 @@ function messageBox(messageTitle, messageContent, messageCallback, messageIcon,
if type(messageButtonDefault) ~= "number" then
error("Bad argument @ 'messageBox' [Expected number at argument 6, got " .. type(messageButtonDefault) .. "]")
elseif #messageButtons[messageButton] < messageButtonDefault then
error("Bad argument @ 'messageBox' [Invalid default at argument 6, " .. messageButton .. " only have " .. tostring(#messageButtons[messageButon]) .. " buttons.]")
error("Bad argument @ 'messageBox' [Invalid default at argument 6, " .. messageButton .. " only have " .. tostring(#messageButtons[messageButton]) .. " buttons.]")
end
else
messageButtonDefault = 1
Expand All @@ -122,7 +122,7 @@ function messageBox(messageTitle, messageContent, messageCallback, messageIcon,
if messageSoundVolume then
if type(messageSoundVolume) ~= "number" then
error("Bad argument @ 'messageBox' [Expected number at argument 8, got " .. type(messageSoundVolume) .. "]")
elseif messageSoundVolume > 1 or messageSoundVolume < 1 then
elseif messageSoundVolume > 1 or messageSoundVolume < 0 then
error("Bad argument @ 'messageBox' [Invalid volume at argument 8, got '" .. tostring(messageSoundVolume) .. "']")
end
else
Expand Down Expand Up @@ -222,7 +222,7 @@ function messageBoxEx(messageTitle, messageContent, messageIcon, messageButton,
if type(messageButtonDefault) ~= "number" then
error("Bad argument @ 'messageBoxEx' [Expected number at argument 5, got " .. type(messageButtonDefault) .. "]")
elseif #messageButtons[messageButton] < messageButtonDefault then
error("Bad argument @ 'messageBoxEx' [Invalid default at argument 5, " .. messageButton .. " only have " .. tostring(#messageButtons[messageButon]) .. " buttons.]")
error("Bad argument @ 'messageBoxEx' [Invalid default at argument 5, " .. messageButton .. " only have " .. tostring(#messageButtons[messageButton]) .. " buttons.]")
end
else
messageButtonDefault = 1
Expand Down Expand Up @@ -307,4 +307,4 @@ function messageBoxEx(messageTitle, messageContent, messageIcon, messageButton,
messageBoxWindows[messageWindowElement] = {messageTitle, messageContent, messageIcon, messageButton}

return messageButtonElements[1], messageButtonElements[2], messageButtonElements[3]
end
end