Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › QTD on "Leaderboard info OK"

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #8820

    Martin

    Both in the Android simulator, and on my android device, when I select “info” from the VPlayGameNetworkView, then press “OK” on the resulting dialog, the game quits to the desktop.

     

    This seems like a bug.

     

    #8827

    Christian
    Felgo Team

    Hi Martin,

    you might have an issue in your game code, where you handle to the onMessageBoxFinished dialog of nativeUtils, and then call Qt.exit().

    Do you check if the dialog was opened from the back-button handling? I

    In the sample games, we do set a bool property to true or check if this is the active scene. This code is copied from the Flappy Bird demo for example:

    Connections {
          // nativeUtils should only be connected, when this is the active scene
          target: window.activeScene === menuScene ? nativeUtils : null
          onMessageBoxFinished: {
            if(accepted) {
                Qt.quit()
            }
          }
        }

     

    Cheers, Chris

    #8830

    Martin

    Thanks you’re right – I’m missing that target condition.

     

    I think I inherited this oversimplification from Multi-Level-Multi-Scene demo 😀

     

      // menu scene
      MenuScene {
        id: menuScene
        // listen to the button signals of the scene and change the state according to it
        onSelectLevelPressed: gameWindow.state = "selectLevel"
        onCreditsPressed: gameWindow.state = "credits"
        // the menu scene is our start scene, so if back is pressed there we ask the user if he wants to quit the application
        onBackButtonPressed: {
          nativeUtils.displayMessageBox("Really quit the game?", "", 2);
        }
        // listen to the return value of the MessageBox
        Connections {
          target: nativeUtils
          onMessageBoxFinished: {
            if(accepted)
              Qt.quit()
          }
        }
      }

     

     

    #8833

    Martin

    How can I deal with the fact that the no internet connection dialog comes while I’m on the same screen that is using the dialog for the back button dialog?

    #8834

    Christian
    Felgo Team

    Yes it is not there, because it is the only place in this application where a messageBox is shown. We added it to the sample & the wizard now and it will be available with the next update, thanks for pointing it out!

    Cheers, Chris

Viewing 5 posts - 1 through 5 (of 5 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded