more towards building
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -25,6 +25,9 @@ build/
|
||||
src/lib/discord_social_sdk/*
|
||||
src/lib/godot-cpp/*
|
||||
*.zip
|
||||
*.so
|
||||
*.dll
|
||||
*.dylib
|
||||
|
||||
# release
|
||||
release/
|
||||
|
@@ -21,10 +21,11 @@ elif env["platform"] == "windows":
|
||||
if env["target"] == "template_debug":
|
||||
debugsuffix = "_debug"
|
||||
folder = "debug/"
|
||||
discord_library_target = discord_library.replace(".", f"{debugsuffix}.")
|
||||
else:
|
||||
debugsuffix = ""
|
||||
folder = "release/" #
|
||||
|
||||
folder = "release/"
|
||||
discord_library_target = discord_library
|
||||
|
||||
env.Append(LIBPATH=["src/lib/discord_social_sdk/lib/" + folder])
|
||||
env.Append(LIBS=["discord_partner_sdk"])
|
||||
@@ -41,8 +42,8 @@ library = env.SharedLibrary(
|
||||
env.Depends(
|
||||
library,
|
||||
Command(
|
||||
"project/addons/discord-rpc-gd/bin/" + libexportfolder + discord_library,
|
||||
"src/lib/discord_partner_sdk/bin/" + folder + discord_library,
|
||||
"project/addons/discord-rpc-gd/bin/" + libexportfolder + discord_library_target,
|
||||
"src/lib/discord_social_sdk/lib/" + folder + discord_library,
|
||||
Copy("$TARGET", "$SOURCE"),
|
||||
),
|
||||
)
|
||||
|
@@ -19,11 +19,11 @@ linux.release.rv64 = "linux/libdiscord_partner_sdk_binding.so"
|
||||
[dependencies]
|
||||
|
||||
macos = { "macos/libdiscord_partner_sdk.dylib": "" }
|
||||
windows.debug.x86_64 = { "windows/discord_partner_sdk.dll": "" }
|
||||
windows.debug.x86_64 = { "windows/discord_partner_sdk_debug.dll": "" }
|
||||
windows.release.x86_64 = { "windows/discord_partner_sdk.dll": "" }
|
||||
linux.debug.x86_64 = { "linux/libdiscord_partner_sdk.so": "" }
|
||||
linux.debug.x86_64 = { "linux/libdiscord_partner_sdk_debug.so": "" }
|
||||
linux.release.x86_64 = { "linux/libdiscord_partner_sdk.so": "" }
|
||||
linux.debug.arm64 = { "linux/libdiscord_partner_sdk.so": "" }
|
||||
linux.debug.arm64 = { "linux/libdiscord_partner_sdk_debug.so": "" }
|
||||
linux.release.arm64 = { "linux/libdiscord_partner_sdk.so": "" }
|
||||
linux.debug.rv64 = { "linux/libdiscord_partner_sdk.so": "" }
|
||||
linux.debug.rv64 = { "linux/libdiscord_partner_sdk_debug.so": "" }
|
||||
linux.release.rv64 = { "linux/libdiscord_partner_sdk.so": "" }
|
||||
|
@@ -0,0 +1 @@
|
||||
uid://jcdwy5o1utpj
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1
project/addons/discord-rpc-gd/example.gd.uid
Normal file
1
project/addons/discord-rpc-gd/example.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dkv4pruvla8bn
|
@@ -115,8 +115,8 @@ tracks/0/keys = {
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_a7ofc"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_mmtmn"),
|
||||
"pulsate": SubResource("Animation_5u02v")
|
||||
&"RESET": SubResource("Animation_mmtmn"),
|
||||
&"pulsate": SubResource("Animation_5u02v")
|
||||
}
|
||||
|
||||
[node name="DebugNodeGroup" type="Node"]
|
||||
|
1
project/addons/discord-rpc-gd/nodes/debug.gd.uid
Normal file
1
project/addons/discord-rpc-gd/nodes/debug.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://46tue7u6crd6
|
@@ -0,0 +1 @@
|
||||
uid://d1ohgxo4k3cdf
|
1
project/addons/discord-rpc-gd/plugin.gd.uid
Normal file
1
project/addons/discord-rpc-gd/plugin.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://citpv7uf0k1ku
|
@@ -9,7 +9,7 @@ Button/styles/focus = SubResource("StyleBoxEmpty_1t7mm")
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5vqdt"]
|
||||
|
||||
[sub_resource type="Image" id="Image_f4u3i"]
|
||||
[sub_resource type="Image" id="Image_4rf8i"]
|
||||
data = {
|
||||
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 227, 227, 227, 36, 224, 224, 224, 168, 224, 224, 224, 233, 224, 224, 224, 236, 224, 224, 224, 170, 231, 231, 231, 31, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 227, 227, 227, 36, 224, 224, 224, 234, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 239, 230, 230, 230, 30, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 168, 224, 224, 224, 255, 224, 224, 224, 186, 224, 224, 224, 32, 224, 224, 224, 33, 224, 224, 224, 187, 224, 224, 224, 255, 225, 225, 225, 167, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 237, 224, 224, 224, 255, 224, 224, 224, 33, 255, 255, 255, 0, 255, 255, 255, 0, 227, 227, 227, 36, 224, 224, 224, 255, 224, 224, 224, 234, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 237, 224, 224, 224, 255, 224, 224, 224, 33, 255, 255, 255, 0, 255, 255, 255, 0, 229, 229, 229, 38, 224, 224, 224, 255, 224, 224, 224, 229, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 164, 224, 224, 224, 255, 224, 224, 224, 187, 225, 225, 225, 34, 227, 227, 227, 36, 224, 224, 224, 192, 224, 224, 224, 255, 224, 224, 224, 162, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 24, 225, 225, 225, 215, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 229, 224, 224, 224, 32, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 24, 224, 224, 224, 216, 224, 224, 224, 255, 224, 224, 224, 210, 224, 224, 224, 161, 224, 224, 224, 232, 224, 224, 224, 231, 225, 225, 225, 159, 230, 230, 230, 30, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 107, 224, 224, 224, 255, 224, 224, 224, 210, 230, 230, 230, 20, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 105, 230, 230, 230, 20, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 221, 224, 224, 224, 130, 255, 255, 255, 1, 255, 255, 255, 1, 225, 225, 225, 134, 224, 224, 224, 224, 225, 225, 225, 223, 224, 224, 224, 132, 255, 255, 255, 1, 255, 255, 255, 6, 224, 224, 224, 137, 224, 224, 224, 231, 224, 224, 224, 255, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 130, 225, 225, 225, 133, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 129, 224, 224, 224, 137, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 65, 224, 224, 224, 255, 224, 224, 224, 220, 225, 225, 225, 223, 224, 224, 224, 255, 226, 226, 226, 61, 224, 224, 224, 65, 224, 224, 224, 255, 224, 224, 224, 222, 224, 224, 224, 231, 224, 224, 224, 255, 227, 227, 227, 62, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 225, 225, 225, 67, 224, 224, 224, 255, 224, 224, 224, 219, 224, 224, 224, 222, 224, 224, 224, 255, 227, 227, 227, 63, 225, 225, 225, 67, 224, 224, 224, 255, 224, 224, 224, 219, 224, 224, 224, 230, 224, 224, 224, 255, 227, 227, 227, 63, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 225, 225, 225, 127, 224, 224, 224, 129, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 225, 225, 225, 126, 225, 225, 225, 135, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 221, 225, 225, 225, 127, 255, 255, 255, 0, 255, 255, 255, 1, 224, 224, 224, 128, 224, 224, 224, 220, 224, 224, 224, 219, 225, 225, 225, 127, 255, 255, 255, 0, 255, 255, 255, 5, 225, 225, 225, 134, 224, 224, 224, 229, 224, 224, 224, 255, 255, 255, 255, 0),
|
||||
"format": "RGBA8",
|
||||
@@ -19,7 +19,7 @@ data = {
|
||||
}
|
||||
|
||||
[sub_resource type="ImageTexture" id="ImageTexture_gdtpn"]
|
||||
image = SubResource("Image_f4u3i")
|
||||
image = SubResource("Image_4rf8i")
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_7v0rg"]
|
||||
|
||||
|
1
project/main.gd.uid
Normal file
1
project/main.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://e0nds76y78bx
|
@@ -1,8 +1,8 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dyc3kseph4el7"]
|
||||
|
||||
[ext_resource type="Script" path="res://main.gd" id="1_kl8ri"]
|
||||
[ext_resource type="Script" uid="uid://e0nds76y78bx" path="res://main.gd" id="1_kl8ri"]
|
||||
[ext_resource type="Texture2D" uid="uid://b3qm246m7pnsx" path="res://assets/Logo_V2.png" id="2_gd222"]
|
||||
[ext_resource type="Script" path="res://addons/discord-rpc-gd/nodes/debug.gd" id="6_ujijw"]
|
||||
[ext_resource type="Script" uid="uid://46tue7u6crd6" path="res://addons/discord-rpc-gd/nodes/debug.gd" id="6_ujijw"]
|
||||
|
||||
[node name="Node" type="Node"]
|
||||
script = ExtResource("1_kl8ri")
|
||||
|
1
project/plugin_manager.gd.uid
Normal file
1
project/plugin_manager.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://pi17u5foe8ti
|
@@ -13,15 +13,16 @@ config_version=5
|
||||
config/name="GDExtension DiscordRPC Test Project"
|
||||
config/tags=PackedStringArray("vaporvee")
|
||||
run/main_scene="res://main.tscn"
|
||||
config/features=PackedStringArray("4.3")
|
||||
config/features=PackedStringArray("4.4")
|
||||
boot_splash/bg_color=Color(0.25098, 0.305882, 0.929412, 1)
|
||||
boot_splash/image="res://assets/discordgodot_cover.png"
|
||||
boot_splash/fullsize=false
|
||||
boot_splash/image="res://assets/discordgodot_cover.png"
|
||||
config/icon="res://assets/Logo_V2.png"
|
||||
|
||||
[autoload]
|
||||
|
||||
PluginManager="*res://plugin_manager.gd"
|
||||
DiscordRPCLoader="*res://addons/discord-rpc-gd/nodes/discord_autoload.gd"
|
||||
|
||||
[debug]
|
||||
|
||||
@@ -40,6 +41,10 @@ window/size/resizable=false
|
||||
|
||||
project/assembly_name="GDExtension Test Project"
|
||||
|
||||
[editor_plugins]
|
||||
|
||||
enabled=PackedStringArray("res://addons/discord-rpc-gd/plugin.cfg")
|
||||
|
||||
[filesystem]
|
||||
|
||||
import/blender/enabled=false
|
||||
|
@@ -19,9 +19,7 @@
|
||||
|
||||
DiscordRPC *DiscordRPC::singleton = nullptr;
|
||||
std::shared_ptr<discordpp::Client> client;
|
||||
discordpp::ClientResult result;
|
||||
discordpp::Activity activity;
|
||||
discordpp::UserHandle user;
|
||||
|
||||
void DiscordRPC::_bind_methods()
|
||||
{
|
||||
@@ -52,7 +50,6 @@ void DiscordRPC::_bind_methods()
|
||||
BIND_METHOD(open_server_invite_overlay, "invite_code");
|
||||
BIND_METHOD(open_voice_settings);
|
||||
BIND_METHOD(get_is_discord_working);
|
||||
BIND_METHOD(get_result_int);
|
||||
}
|
||||
SET_GET(state, activity.SetState(value.utf8().get_data()))
|
||||
SET_GET(details, activity.SetDetails(value.utf8().get_data()))
|
||||
@@ -79,7 +76,7 @@ DiscordRPC *DiscordRPC::get_singleton()
|
||||
|
||||
void DiscordRPC::run_callbacks()
|
||||
{
|
||||
if (result.Successful() && app_id > 0)
|
||||
if (app_id > 0) //result.Successful() &&
|
||||
discordpp::RunCallbacks();
|
||||
}
|
||||
void DiscordRPC::debug()
|
||||
@@ -175,16 +172,21 @@ void DiscordRPC::unclear()
|
||||
bool DiscordRPC::get_is_overlay_enabled()
|
||||
{
|
||||
bool ie;
|
||||
if (get_is_discord_working())
|
||||
if (get_is_discord_working()){
|
||||
// core->OverlayManager().IsEnabled(&ie);
|
||||
return ie;
|
||||
}
|
||||
return ie;
|
||||
}
|
||||
bool DiscordRPC::get_is_overlay_locked()
|
||||
{
|
||||
bool il;
|
||||
if (get_is_discord_working())
|
||||
{
|
||||
// core->OverlayManager().IsLocked(&il);
|
||||
return il;
|
||||
}
|
||||
return il;
|
||||
}
|
||||
void DiscordRPC::set_is_overlay_locked(bool value)
|
||||
{
|
||||
@@ -250,20 +252,20 @@ Dictionary DiscordRPC::get_current_user()
|
||||
{
|
||||
// discordpp::User user{};
|
||||
// core->UserManager().GetCurrentUser(&user);
|
||||
return user2dict(user);
|
||||
return userdict; //user2dict(user)
|
||||
}
|
||||
return userdict;
|
||||
}
|
||||
|
||||
Dictionary DiscordRPC::get_relationship(uint64_t user_id)
|
||||
{
|
||||
Dictionary dict;
|
||||
if (get_is_discord_working())
|
||||
{
|
||||
// discordpp::Relationship relationship{};
|
||||
// core->RelationshipManager().Get(user_id, &relationship);
|
||||
return /*relationship2dict(relationship)*/;
|
||||
return dict /*relationship2dict(relationship)*/;
|
||||
}
|
||||
Dictionary dict;
|
||||
return dict;
|
||||
}
|
||||
|
||||
@@ -374,5 +376,5 @@ Dictionary DiscordRPC::relationship2dict(discordpp::RelationshipHandle relations
|
||||
|
||||
bool DiscordRPC::get_is_discord_working()
|
||||
{
|
||||
return result.Successful() && app_id > 0;
|
||||
return app_id > 0; /*result.Successful() &&*/
|
||||
}
|
@@ -59,7 +59,6 @@ public:
|
||||
Dictionary get_relationship(uint64_t user_id);
|
||||
Array get_all_relationships();
|
||||
bool get_is_discord_working();
|
||||
int get_result_int();
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user