mirror of
https://github.com/sr229/metastruct-experiments.git
synced 2024-09-20 14:40:35 +00:00
Properly implement everything in PAC
Signed-off-by: Ayane Satomi <ayane@vignetteapp.org>
This commit is contained in:
parent
ff6c079fd4
commit
57b3f69d27
1 changed files with 15 additions and 6 deletions
|
@ -36,12 +36,14 @@ function playMusic(music)
|
|||
-- FIXME: This doesn't know how to clean out music
|
||||
local audio = pac.CreatePart("mmd_audio_" .. tostring(music))
|
||||
|
||||
audio:SetURL(tostring(music))
|
||||
audio:SetVolume(1)
|
||||
audio:SetPitch(1)
|
||||
audio:SetStopOnHide(true)
|
||||
audio:SetPauseOnHide(true)
|
||||
audio:SetPath(tostring(music))
|
||||
audio:SetParent(self)
|
||||
|
||||
for _, part in pairs(pac.GetLocalParts()) do
|
||||
if part.ClassName == "group" then
|
||||
part:SetParent(part)
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
function cleanupAudio(music)
|
||||
|
@ -63,5 +65,12 @@ function custom_taunts:OnDanceChanged(sid64, newdata)
|
|||
--FIXME: find a way to clean this out!
|
||||
playMusic(music)
|
||||
end
|
||||
|
||||
if newdata.type == INFO_TYPES.Stop then
|
||||
|
||||
for _, part in pairs(pac.GetLocalParts()) do
|
||||
if string.find(part:Name(), "/mmd_music_([A-zA0-9])+/") == true pac.RemovePart(part) end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue