use the resource table for audio samples
This commit is contained in:
parent
f227df0dee
commit
7704c45dd0
|
@ -351,7 +351,7 @@ end
|
||||||
|
|
||||||
local function render(deltaTime)
|
local function render(deltaTime)
|
||||||
if not playedBgm then
|
if not playedBgm then
|
||||||
game.PlaySample("titlescreen/bgm.wav", true)
|
game.PlaySample(resources.audiosamples.bgm, true)
|
||||||
playedBgm = true
|
playedBgm = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -387,15 +387,15 @@ local function onKnobsChange(direction)
|
||||||
if ((cursorIndex > oldCursorIndex and not (cursorIndex == 6 and oldCursorIndex == 1)) or
|
if ((cursorIndex > oldCursorIndex and not (cursorIndex == 6 and oldCursorIndex == 1)) or
|
||||||
(cursorIndex == 1 and oldCursorIndex == 6)) then scrollingUp = true end
|
(cursorIndex == 1 and oldCursorIndex == 6)) then scrollingUp = true end
|
||||||
|
|
||||||
game.PlaySample("titlescreen/cursor_change.wav")
|
game.PlaySample(resources.audiosamples.cursorChange)
|
||||||
|
|
||||||
oldCursorIndex = cursorIndex
|
oldCursorIndex = cursorIndex
|
||||||
end
|
end
|
||||||
|
|
||||||
local function onButtonPressed(button)
|
local function onButtonPressed(button)
|
||||||
if button == game.BUTTON_STA then
|
if button == game.BUTTON_STA then
|
||||||
game.PlaySample("titlescreen/cursor_select.wav")
|
game.PlaySample(resources.audiosamples.cursorSelect)
|
||||||
game.StopSample("titlescreen/bgm.wav")
|
game.StopSample(resources.audiosamples.bgm)
|
||||||
|
|
||||||
callButtonAction()
|
callButtonAction()
|
||||||
|
|
||||||
|
@ -418,8 +418,8 @@ local function onMousePressed(button)
|
||||||
|
|
||||||
if util.areaOverlap(mousePosX, mousePosY,
|
if util.areaOverlap(mousePosX, mousePosY,
|
||||||
miscButtons.mainButton.x, miscButtons.mainButton.y, miscButtons.mainButton.w, miscButtons.mainButton.h) then
|
miscButtons.mainButton.x, miscButtons.mainButton.y, miscButtons.mainButton.w, miscButtons.mainButton.h) then
|
||||||
game.StopSample("titlescreen/bgm.wav")
|
game.StopSample(resources.audiosamples.bgm)
|
||||||
game.PlaySample("titlescreen/cursor_select.wav")
|
game.PlaySample(resources.audiosamples.cursorSelect)
|
||||||
callButtonAction()
|
callButtonAction()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -453,7 +453,7 @@ local function onMousePressed(button)
|
||||||
end
|
end
|
||||||
|
|
||||||
cursorIndex = (cursorIndex - 1 + changeIndex) % #buttons + 1
|
cursorIndex = (cursorIndex - 1 + changeIndex) % #buttons + 1
|
||||||
game.PlaySample("titlescreen/cursor_change.wav")
|
game.PlaySample(resources.audiosamples.cursorChange)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue