first add 2 sounds to
Quote: "audiobank\misc\"
name 1
Quote: "menu_hover_sound.ogg"
and the other
Quote: "menu_select_sound.ogg"
then...
video guide ;
text guide;
now find the main(e) part of the menu script you want to add sound to (title.lua etc)
and look for
Quote: "if iHighlightButton == i then
SetSpriteImage ( g_sprButton[i], g_imgButtonH[i] )"
add a new line directly below it and paste
local hover_sound = 998
if last_hover == nil then
last_hover = 0
end
if GetGlobalSoundExist(hover_sound) == 0 then
LoadGlobalSound("audiobank\\misc\\menu_hover_sound.ogg",hover_sound)
else
if last_hover ~= i then
PlayGlobalSound(hover_sound)
last_hover = i
end
end
now look a couple lines down for
Quote: "else
SetSpriteImage ( g_sprButton[i], g_imgButton[i] )"
add a new line directly below and paste
if last_hover ~= nil then
if last_hover == i then
StopGlobalSound(hover_sound)
DeleteGlobalSound(hover_sound)
end
end
that's your moving onto a button sound done.
now find (should be just below the previous code again)
Quote: " if g_MouseClick == 1 then"
add a new line and paste
if iHighlightButton > 0 then
local select_sound = 999
if GetGlobalSoundExist(select_sound) == 0 then
LoadGlobalSound("audiobank\\misc\\menu_select_sound.ogg",select_sound)
end
PlayGlobalSound(select_sound)
end
and that's the adding a sound when clicking a button done.