tried fixing getsetter
This commit is contained in:
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
DiscordActivity.coreupdate()
|
DiscordSDK.coreupdate()
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
DiscordActivity.set_app_id(918857075105349632)
|
DiscordSDK.set_app_id(918857075105349632)
|
||||||
DiscordActivity.set_details("Made with GDExtension")
|
DiscordSDK.set_details("Made with GDExtension")
|
||||||
DiscordActivity.set_state("This is a test from GDScript in Godot 4") #TODO:Change functions to variables if possible
|
DiscordSDK.set_state("This is a test from GDScript in Godot 4") #TODO:Change functions to variables if possible
|
||||||
DiscordActivity.refresh()
|
DiscordSDK.refresh()
|
||||||
|
@@ -16,6 +16,11 @@ class DiscordSDK : public Object
|
|||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|
||||||
|
private:
|
||||||
|
int app_id;
|
||||||
|
String state;
|
||||||
|
String details;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static DiscordSDK *get_singleton();
|
static DiscordSDK *get_singleton();
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@ void gdextension_initialize(ModuleInitializationLevel p_level)
|
|||||||
ClassDB::register_class<DiscordSDK>();
|
ClassDB::register_class<DiscordSDK>();
|
||||||
|
|
||||||
discordsdk = memnew(DiscordSDK);
|
discordsdk = memnew(DiscordSDK);
|
||||||
Engine::get_singleton()->register_singleton("DiscordActivity", DiscordSDK::get_singleton()); // Cant change the class name in the cpp files for some reason
|
Engine::get_singleton()->register_singleton("DiscordSDK", DiscordSDK::get_singleton()); // Cant change the class name in the cpp files for some reason
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user