Forums

OverviewV-Play 2 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
    V-Play 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
    V-Play 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.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support