2023-03-23 05:16:35 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Module for managing and interacting with sounds.
|
|
|
|
module Sound
|
|
|
|
class << self
|
|
|
|
def for(key)
|
|
|
|
SOUNDS.fetch(key)
|
|
|
|
end
|
|
|
|
|
|
|
|
def play(args, key, opts = {})
|
2023-03-27 02:09:28 +00:00
|
|
|
SOUNDS.fetch(key).play(args, opts) if args.state.setting.sfx
|
2023-03-23 05:16:35 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def stop(args, key)
|
|
|
|
SOUNDS.fetch(key).stop(args)
|
|
|
|
end
|
|
|
|
|
|
|
|
def pause(args, key)
|
|
|
|
SOUNDS.fetch(key).pause(args)
|
|
|
|
end
|
|
|
|
|
|
|
|
def resume(args, key)
|
|
|
|
SOUNDS.fetch(key).resume(args)
|
|
|
|
end
|
2023-03-08 03:06:29 +00:00
|
|
|
end
|
2023-03-27 03:13:39 +00:00
|
|
|
end
|