mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-13 09:26:11 -04:00
audio: don't play sound if muted
This commit is contained in:
parent
6f2153cba3
commit
6a4771bd47
@ -45,6 +45,7 @@ object FileUtil {
|
|||||||
return readFile(path.toFile(), compressed)
|
return readFile(path.toFile(), compressed)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated("kutil 1.26.3")
|
||||||
fun File.mkdirParent() {
|
fun File.mkdirParent() {
|
||||||
val parent = this.parentFile
|
val parent = this.parentFile
|
||||||
if (parent.exists()) {
|
if (parent.exists()) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Minosoft
|
* Minosoft
|
||||||
* Copyright (C) 2020-2023 Moritz Zwerger
|
* Copyright (C) 2020-2024 Moritz Zwerger
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
@ -193,7 +193,7 @@ class AudioPlayer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun playSound(sound: Sound, position: Vec3d? = null, volume: Float = 1.0f, pitch: Float = 1.0f) {
|
private fun playSound(sound: Sound, position: Vec3d? = null, volume: Float = 1.0f, pitch: Float = 1.0f) {
|
||||||
if (!profile.enabled) {
|
if (!profile.enabled || profile.volume.master <= 0.0f) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
position?.let { if (!shouldPlay(sound, position)) return }
|
position?.let { if (!shouldPlay(sound, position)) return }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user