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

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

parent fe8f1b5e
...@@ -38,6 +38,9 @@ ActivityBase { ...@@ -38,6 +38,9 @@ ActivityBase {
sourceSize.width: Math.max(parent.width, parent.height) sourceSize.width: Math.max(parent.width, parent.height)
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
// if audio is disabled, we display a dialog to tell users this activity requires audio anyway
property bool audioDisabled: false
signal start signal start
signal stop signal stop
...@@ -62,9 +65,13 @@ ActivityBase { ...@@ -62,9 +65,13 @@ ActivityBase {
bar.level = 1 bar.level = 1
score.numberOfSubLevels = 5 score.numberOfSubLevels = 5
score.currentSubLevel = 1 score.currentSubLevel = 1
initLevel() if(!ApplicationSettings.isAudioVoicesEnabled || !ApplicationSettings.isAudioEffectsEnabled) {
items.running = true background.audioDisabled = true;
introDelay.start() } else {
initLevel();
items.running = true;
introDelay.start();
}
} }
onStop: { onStop: {
...@@ -271,5 +278,27 @@ ActivityBase { ...@@ -271,5 +278,27 @@ ActivityBase {
else if(items.answer.length >= items.question.length) else if(items.answer.length >= items.question.length)
bonus.bad('lion') bonus.bad('lion')
} }
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;
initLevel();
items.running = true;
introDelay.start();
}
}
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