removed old sdk code
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include "editor_presence.h"
|
||||
#include "lib/discord_game_sdk/cpp/discord.h"
|
||||
#include "discordpp.h"
|
||||
#include <godot_cpp/core/class_db.hpp>
|
||||
#include <godot_cpp/variant/utility_functions.hpp>
|
||||
#include <godot_cpp/classes/scene_tree.hpp>
|
||||
@@ -16,8 +16,6 @@ EditorPresence::EditorPresence()
|
||||
EditorPresence::~EditorPresence()
|
||||
{
|
||||
singleton = nullptr;
|
||||
delete core; // couldn't use destructor because it would not compile on linux
|
||||
core = nullptr;
|
||||
}
|
||||
EditorPresence *EditorPresence::get_singleton()
|
||||
{
|
||||
@@ -26,24 +24,22 @@ EditorPresence *EditorPresence::get_singleton()
|
||||
|
||||
void EditorPresence::_ready()
|
||||
{
|
||||
result = discord::Core::Create(1108142249990176808, DiscordCreateFlags_NoRequireDiscord, &core);
|
||||
activity.SetState("Editing a project...");
|
||||
activity.SetDetails(String(project_settings->get_setting("application/config/name")).utf8());
|
||||
if (project_settings->has_setting("application/config/name"))
|
||||
{
|
||||
activity.GetAssets().SetLargeImage("godot");
|
||||
//activity.GetAssets().SetLargeImage("godot");
|
||||
return;
|
||||
}
|
||||
activity.GetAssets().SetLargeText(String(engine->get_version_info()["string"]).utf8());
|
||||
/*activity.GetAssets().SetLargeText(String(engine->get_version_info()["string"]).utf8());
|
||||
activity.GetTimestamps().SetStart(time->get_unix_time_from_system());
|
||||
if (result == discord::Result::Ok)
|
||||
core->ActivityManager().UpdateActivity(activity, [](discord::Result result) {});
|
||||
//core->ActivityManager().UpdateActivity(activity, [](discord::Result result) {});
|
||||
else
|
||||
UtilityFunctions::push_warning("EditorPresence couldn't be loaded! Maybe your Discord isn't running?");
|
||||
UtilityFunctions::push_warning("EditorPresence couldn't be loaded! Maybe your Discord isn't running?");*/
|
||||
}
|
||||
|
||||
void EditorPresence::_process(double delta)
|
||||
{
|
||||
if (state_string.utf8() != activity.GetState())
|
||||
/*if (state_string.utf8() != activity.GetState())
|
||||
{
|
||||
godot::Node *edited_scene_root = get_tree()->get_edited_scene_root();
|
||||
activity.SetState(String("Editing: \"" + edited_scene_root->get_scene_file_path() + "\"").replace("res://", "").utf8());
|
||||
@@ -51,5 +47,6 @@ void EditorPresence::_process(double delta)
|
||||
core->ActivityManager().UpdateActivity(activity, [](discord::Result result) {});
|
||||
}
|
||||
if (result == discord::Result::Ok)
|
||||
core->RunCallbacks();
|
||||
core->RunCallbacks();*/
|
||||
return;
|
||||
}
|
Reference in New Issue
Block a user