Commit c9e05c53 authored by Timothée Giet's avatar Timothée Giet

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

if the audio voices or effects are disabled,
tell the user that this activity will play audio anyway

works in both explore_farm_animals and explore_world_music
parent a8cd8430
......@@ -48,6 +48,9 @@ ActivityBase {
sourceSize.width: width
sourceSize.height: height
// if audio is disabled, we display a dialog to tell users this activity requires audio anyway
property bool audioDisabled: false
/* In order to accept any screen ratio the play area is always a 1000x1000
* square and is centered in a big background image that is 3000x3000
*/
......@@ -131,6 +134,8 @@ ActivityBase {
Activity.start(items, url, numberOfLevels)
if(activity.needsVoices === true) {
activity.isMusicalActivity = true
if(!ApplicationSettings.isAudioVoicesEnabled || !ApplicationSettings.isAudioEffectsEnabled)
background.audioDisabled = true
}
}
onStop: { Activity.stop() }
......@@ -330,5 +335,24 @@ ActivityBase {
Bonus {
id: bonus
}
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