(volume)
| 2191 | } |
| 2192 | |
| 2193 | updateVolume (volume) { |
| 2194 | volume = volume ?? me.get('volume') ?? 1.0 |
| 2195 | const button = $('#volume-button', this.$el) |
| 2196 | button.toggleClass('vol-off', volume <= 0.0) |
| 2197 | button.toggleClass('vol-down', volume > 0.0 && volume < 1.0) |
| 2198 | button.toggleClass('vol-up', volume >= 1.0) |
| 2199 | createjs.Sound.volume = volume === 1 ? 0.6 : volume // Quieter for now until individual sound FX controls work again. |
| 2200 | if (volume !== me.get('volume')) { |
| 2201 | me.set('volume', volume) |
| 2202 | me.patch() |
| 2203 | if (volume) { |
| 2204 | this.playAmbientSound() |
| 2205 | } |
| 2206 | } |
| 2207 | } |
| 2208 | |
| 2209 | onToggleVolume (e) { |
| 2210 | const button = $(e.target).closest('#volume-button') |
no test coverage detected