GameNetworkExample
import Felgo 3.0
import QtQuick 2.0
TestBase {
property string currentAchievementKey: "achievement01"
property string textInputState
Column {
Text {
text: "currentAchievementKey: " + currentAchievementKey
color: "white"
}
SimpleButton {
text: "Change Current Achievement"
onClicked: {
textInputState = "achievementKey"
nativeUtils.displayTextInput("Enter Achievement Key", "", "", currentAchievementKey )
}
}
SimpleButton {
text: "Increase Achievement progress"
onClicked: {
gameNetwork.incrementAchievement(currentAchievementKey)
}
}
SimpleButton {
text: "Unlock Achievement"
onClicked: {
gameNetwork.unlockAchievement(currentAchievementKey)
}
}
SimpleButton {
text: "Get All Achievements"
onClicked: {
gameNetwork.api.getAllAchievements()
}
}
SimpleButton {
text: "Get User Achievements with progress"
onClicked: {
gameNetwork.api.getAchievementProgress()
}
}
SimpleButton {
text: "Show AchievementView"
onClicked: {
gameNetwork.showAchievements()
}
}
}
Connections {
target: nativeUtils
onTextInputFinished: {
if(textInputState === "achievementKey" && accepted) {
currentAchievementKey = enteredText
}
textInputState = ""
}