+ better way of stopping the results music
This commit is contained in:
parent
d61f63b665
commit
85cad9562c
|
@ -0,0 +1,13 @@
|
|||
|
||||
|
||||
local stopMusic = function ()
|
||||
local musicPlaying = game.GetSkinSetting('_musicPlaying');
|
||||
if musicPlaying and musicPlaying ~= '' then
|
||||
game.StopSample(musicPlaying);
|
||||
game.SetSkinSetting("_musicPlaying", "")
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
stopMusic = stopMusic
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
json = require "json"
|
||||
|
||||
local common = require('common.common');
|
||||
|
||||
local resX,resY = game.GetResolution()
|
||||
|
||||
local mposx = 0;
|
||||
|
@ -742,6 +744,7 @@ render = function(deltaTime)
|
|||
mposx,mposy = game.GetMousePos();
|
||||
portrait = resY > resX
|
||||
|
||||
common.stopMusic();
|
||||
|
||||
doffset = doffset * 0.9
|
||||
ioffset = ioffset * 0.9
|
||||
|
|
|
@ -169,9 +169,8 @@ local handleSfx = function()
|
|||
if not bgSfxPlayed then
|
||||
game.PlaySample("result", true)
|
||||
bgSfxPlayed = true
|
||||
game.SetSkinSetting('_musicPlaying', 'result');
|
||||
end
|
||||
if game.GetButton(game.BUTTON_STA) then game.StopSample("result") end
|
||||
if game.GetButton(game.BUTTON_BCK) then game.StopSample("result") end
|
||||
end
|
||||
|
||||
function drawTimingBar(y, value, max, type)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require('common')
|
||||
local Easing = require('common.easings')
|
||||
local Background = require('components.background');
|
||||
local common = require('common.common')
|
||||
|
||||
local VolforceCalc = require('components.volforceCalc');
|
||||
|
||||
|
@ -749,6 +750,8 @@ render = function (deltaTime)
|
|||
tickTransitions(deltaTime);
|
||||
gfx.Scale(scale, scale);
|
||||
|
||||
common.stopMusic();
|
||||
|
||||
if not difficultyNumbers then
|
||||
difficultyNumbers = load_number_image('diff_num')
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue