Well I am using gamejolt_api_v2 and I thought this was the version to work with Godot 3. I backed up the main.gd from v2 and replaced it with the pastebin code.
But my main problem is that I do not know to get things connected. Button, API, Label (with the score) and LineEdit.
I found a youtube Video
but this is spanish (I am German) I will see what I can understand :)
EDIT:
Thanks to this Video I have come a huge step further. This is for Godot 3 and GameJoltAPI v2 works with it's original script.
So first I separated the API from the scene and put it into a new scene
Next I work on my level script:
First I set the Button disable false after a change in the LineEdit (signal from the LineEdit):
func _on_LineEdit_text_changed(new_text):
get_node("Player/Camera2D/highscoretable/submitbutton").set_disabled(false)
Than I load the new scene via my global setScene variable(signal from the Button):
func _on_submitbutton_pressed():
get_node("/root/globals").setScene("res://uploadscore.tscn")
Here I have set up a test string in the script (signal from the api):
func _on_GameJoltAPI_api_session_opened(success):
$GameJoltAPI.add_score("12 test", 128, "MithosMoon", "MyToken")
... and get the precoded data uploaded.
But now I have to get the string working, with getting the texts from the labels ingame and make the Guest working, so everyone can upload the score.
And this is where my journy ends at the moment xD
So I still need help __