mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 04:09:01 -06:00
Remove the print statement
and also fix a logic issue
This commit is contained in:
parent
71ecd51cde
commit
cf8ba16eb1
@ -1,4 +1,4 @@
|
|||||||
sounds = {
|
sound_paths = {
|
||||||
blocks = {
|
blocks = {
|
||||||
I = "res/se/piece_i.wav",
|
I = "res/se/piece_i.wav",
|
||||||
J = "res/se/piece_j.wav",
|
J = "res/se/piece_j.wav",
|
||||||
@ -33,25 +33,22 @@ sounds = {
|
|||||||
welcome = "res/se/welcomeToCambridge.wav",
|
welcome = "res/se/welcomeToCambridge.wav",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sounds = {}
|
||||||
-- Replace each sound effect string with its love audiosource counterpart, but only if it exists. This lets the game handle missing SFX.
|
-- Replace each sound effect string with its love audiosource counterpart, but only if it exists. This lets the game handle missing SFX.
|
||||||
for k,v in pairs(sounds) do
|
for k,v in pairs(sound_paths) do
|
||||||
if(type(v) == "table") then
|
if(type(v) == "table") then
|
||||||
-- list of subsounds
|
-- list of subsounds
|
||||||
for k2,v2 in pairs(v) do
|
for k2,v2 in pairs(v) do
|
||||||
if(love.filesystem.getInfo(sounds[k][k2])) then
|
if(love.filesystem.getInfo(sound_paths[k][k2])) then
|
||||||
-- this file exists
|
-- this file exists
|
||||||
sounds[k][k2] = love.audio.newSource(sounds[k][k2], "static")
|
sounds[k] = sounds[k] or {}
|
||||||
else
|
sounds[k][k2] = love.audio.newSource(sound_paths[k][k2], "static")
|
||||||
sounds[k][k2] = nil
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if(love.filesystem.getInfo(sounds[k])) then
|
if(love.filesystem.getInfo(sound_paths[k])) then
|
||||||
-- this file exists
|
-- this file exists
|
||||||
print("Successfully converted " .. v)
|
sounds[k] = love.audio.newSource(sound_paths[k], "static")
|
||||||
sounds[k] = love.audio.newSource(sounds[k], "static")
|
|
||||||
else
|
|
||||||
sounds[k] = nil
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user