| 19 | } |
| 20 | |
| 21 | void PopupInterface::displayMessage(String const& message, String const& title, String const& subtitle, Maybe<String> const& onShowSound) { |
| 22 | setTitleString(title, subtitle); |
| 23 | fetchChild<LabelWidget>("message")->setText(message); |
| 24 | show(); |
| 25 | auto sound = onShowSound.value(Random::randValueFrom(Root::singleton().assets()->json("/interface/windowconfig/popup.config:onShowSound").toArray(), "").toString()); |
| 26 | if (!sound.empty()) |
| 27 | context()->playAudio(sound); |
| 28 | } |
| 29 | |
| 30 | } |