Commit 052aa976 authored by Timothée Giet's avatar Timothée Giet

play_piano, add dialog to warn that activity will play audio in any case

parent ff249b70
......@@ -42,6 +42,9 @@ ActivityBase {
signal start
signal stop
// if audio is disabled, we display a dialog to tell users this activity requires audio anyway
property bool audioDisabled: false
Component.onCompleted: {
dialogActivityConfig.initialize()
activity.start.connect(start)
......@@ -102,7 +105,10 @@ ActivityBase {
}
onStart: {
Activity.start(items)
if(!ApplicationSettings.isAudioVoicesEnabled || !ApplicationSettings.isAudioEffectsEnabled) {
background.audioDisabled = true;
}
Activity.start(items);
}
onStop: { Activity.stop() }
......@@ -279,5 +285,24 @@ ActivityBase {
id: bonus
Component.onCompleted: win.connect(Activity.nextSubLevel)
}
Loader {
id: audioNeededDialog
sourceComponent: GCDialog {
parent: activity
isDestructible: false
message: qsTr("This activity requires audio, so it will play some sounds even if the audio voices or effects are disabled in the main configuration.")
button1Text: qsTr("Quit")
button2Text: qsTr("Continue")
onButton1Hit: activity.home();
onClose: {
background.audioDisabled = false;
}
}
anchors.fill: parent
focus: true
active: background.audioDisabled
onStatusChanged: if (status == Loader.Ready) item.start()
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment