diff --git a/HanoiTowers/client/Game.qml b/HanoiTowers/client/Game.qml index 1693a60..6b89a1a 100644 --- a/HanoiTowers/client/Game.qml +++ b/HanoiTowers/client/Game.qml @@ -182,8 +182,10 @@ Item { popUp.open() const action = function () { + showAdMobBanner() stateData.unlockNextLvl(); start(stateData.lvl) + } popUp.action = action; @@ -202,13 +204,13 @@ Item { popUp.open() const action = function () { + showAdMobBanner() start(++stateWidget.tumbler.spin.value) } popUp.action = action; } - showAdMobBanner() } diff --git a/HanoiTowers/client/admod/AdMobInterstitialAndroid.qml b/HanoiTowers/client/admod/AdMobInterstitialAndroid.qml index e128fb7..a30c02e 100644 --- a/HanoiTowers/client/admod/AdMobInterstitialAndroid.qml +++ b/HanoiTowers/client/admod/AdMobInterstitialAndroid.qml @@ -1,12 +1,66 @@ import QtQuick 2.15 import QtAndroidTools 1.0 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 1.15 QtAndroidAdMobInterstitial { id: interstitial unitId: "ca-app-pub-5799112356811682/5211864198" nonPersonalizedAds: false + onLoading: { + loadDialog.open(); + } + onLoaded: { show() + loadDialog.close(); + } + + onLoadError: { + loadDialog.close(); + } + + + Dialog { + id: loadDialog + x: (gameWindow.width - width) / 2 + y: (gameWindow.height - height) / 2 + + width: gameWindow.width * 0.9 + height: gameWindow.height * 0.9 + + header: Label { + id: title + text: qsTr("Load ads") + font.capitalization: Font.AllUppercase + font.bold: true + + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignTop + } + + contentItem: ColumnLayout { + BusyIndicator { + Layout.fillWidth: true + running: true + } + + Label { + id: textContainer + Layout.fillWidth: true + Layout.fillHeight: true + + anchors.fill: parent + text: qsTr("Sorry, but we need to show you an ad. We want to eat too 😇"); + + horizontalAlignment: Qt.AlignLeft + verticalAlignment: Qt.AlignTop + } + } + + closePolicy: Popup.NoAutoClose } } + + diff --git a/HanoiTowers/client/languages/de.ts b/HanoiTowers/client/languages/de.ts index e03700b..b9d8250 100644 --- a/HanoiTowers/client/languages/de.ts +++ b/HanoiTowers/client/languages/de.ts @@ -33,6 +33,17 @@ * Copyright (C) 2019-2021 QuasarApp-Gruppe.</translation> </message> </context> +<context> + <name>AdMobInterstitialAndroid</name> + <message> + <source>Load ads</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Sorry, but we need to show you an ad. We want to eat too 😇</source> + <translation type="unfinished"></translation> + </message> +</context> <context> <name>Config</name> <message> diff --git a/HanoiTowers/client/languages/en.ts b/HanoiTowers/client/languages/en.ts index 451e5db..99b0e39 100644 --- a/HanoiTowers/client/languages/en.ts +++ b/HanoiTowers/client/languages/en.ts @@ -34,6 +34,17 @@ * Copyright (C) 2019-2021 QuasarApp group.</translation> </message> </context> +<context> + <name>AdMobInterstitialAndroid</name> + <message> + <source>Load ads</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Sorry, but we need to show you an ad. We want to eat too 😇</source> + <translation type="unfinished"></translation> + </message> +</context> <context> <name>BackEnd</name> <message> diff --git a/HanoiTowers/client/languages/es.ts b/HanoiTowers/client/languages/es.ts index b94703c..9f535b7 100644 --- a/HanoiTowers/client/languages/es.ts +++ b/HanoiTowers/client/languages/es.ts @@ -34,6 +34,17 @@ * Copyright (C) 2019-2021 Grupo QuasarApp.</translation> </message> </context> +<context> + <name>AdMobInterstitialAndroid</name> + <message> + <source>Load ads</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Sorry, but we need to show you an ad. We want to eat too 😇</source> + <translation type="unfinished"></translation> + </message> +</context> <context> <name>Config</name> <message> diff --git a/HanoiTowers/client/languages/fr.ts b/HanoiTowers/client/languages/fr.ts index 9017563..2dc32a4 100644 --- a/HanoiTowers/client/languages/fr.ts +++ b/HanoiTowers/client/languages/fr.ts @@ -34,6 +34,17 @@ * Copyright (C) 2019-2021 Groupe QuasarApp.</translation> </message> </context> +<context> + <name>AdMobInterstitialAndroid</name> + <message> + <source>Load ads</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Sorry, but we need to show you an ad. We want to eat too 😇</source> + <translation type="unfinished"></translation> + </message> +</context> <context> <name>Config</name> <message> diff --git a/HanoiTowers/client/languages/ja.ts b/HanoiTowers/client/languages/ja.ts index edcc000..a44c180 100644 --- a/HanoiTowers/client/languages/ja.ts +++ b/HanoiTowers/client/languages/ja.ts @@ -48,6 +48,17 @@ * Copyright(C)2018-2019 Yankovich N. Andrei。 {3 ?} {2018-2019 ?}</translation> </message> </context> +<context> + <name>AdMobInterstitialAndroid</name> + <message> + <source>Load ads</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Sorry, but we need to show you an ad. We want to eat too 😇</source> + <translation type="unfinished"></translation> + </message> +</context> <context> <name>BackEnd</name> <message> diff --git a/HanoiTowers/client/languages/pl.ts b/HanoiTowers/client/languages/pl.ts index 6dc072c..ded8c15 100644 --- a/HanoiTowers/client/languages/pl.ts +++ b/HanoiTowers/client/languages/pl.ts @@ -34,6 +34,17 @@ * Prawa autorskie (C) 2019-2021 grupa QuasarApp.</translation> </message> </context> +<context> + <name>AdMobInterstitialAndroid</name> + <message> + <source>Load ads</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Sorry, but we need to show you an ad. We want to eat too 😇</source> + <translation type="unfinished"></translation> + </message> +</context> <context> <name>Config</name> <message> diff --git a/HanoiTowers/client/languages/ru.ts b/HanoiTowers/client/languages/ru.ts index 55877a5..f9bbb28 100644 --- a/HanoiTowers/client/languages/ru.ts +++ b/HanoiTowers/client/languages/ru.ts @@ -48,6 +48,17 @@ * Copyright (C) 2018-2019 Янкович А. Н.</translation> </message> </context> +<context> + <name>AdMobInterstitialAndroid</name> + <message> + <source>Load ads</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Sorry, but we need to show you an ad. We want to eat too 😇</source> + <translation type="unfinished"></translation> + </message> +</context> <context> <name>BackEnd</name> <message> diff --git a/HanoiTowers/client/languages/tr.ts b/HanoiTowers/client/languages/tr.ts index 108e7b8..e5517c1 100644 --- a/HanoiTowers/client/languages/tr.ts +++ b/HanoiTowers/client/languages/tr.ts @@ -48,6 +48,17 @@ * Telif Hakkı (C) 2018-2019 Yankovich N. Andrei.</translation> </message> </context> +<context> + <name>AdMobInterstitialAndroid</name> + <message> + <source>Load ads</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Sorry, but we need to show you an ad. We want to eat too 😇</source> + <translation type="unfinished"></translation> + </message> +</context> <context> <name>BackEnd</name> <message> diff --git a/HanoiTowers/client/languages/uk.ts b/HanoiTowers/client/languages/uk.ts index 0738f8a..7fb229b 100644 --- a/HanoiTowers/client/languages/uk.ts +++ b/HanoiTowers/client/languages/uk.ts @@ -50,6 +50,17 @@ * Авторське право (C) 2018-2019 Янкович Н. Андрій.</translation> </message> </context> +<context> + <name>AdMobInterstitialAndroid</name> + <message> + <source>Load ads</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Sorry, but we need to show you an ad. We want to eat too 😇</source> + <translation type="unfinished"></translation> + </message> +</context> <context> <name>BackEnd</name> <message> diff --git a/HanoiTowers/client/languages/zh.ts b/HanoiTowers/client/languages/zh.ts index bee65ab..97ebf17 100644 --- a/HanoiTowers/client/languages/zh.ts +++ b/HanoiTowers/client/languages/zh.ts @@ -34,6 +34,17 @@ * 版权所有 (C) 2019-2021 QuasarApp group 。</translation> </message> </context> +<context> + <name>AdMobInterstitialAndroid</name> + <message> + <source>Load ads</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Sorry, but we need to show you an ad. We want to eat too 😇</source> + <translation type="unfinished"></translation> + </message> +</context> <context> <name>Config</name> <message>