added "is discord working" bool back
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -5,9 +5,9 @@ const ExportPlugin = preload("res://addons/discord-sdk-gd/export.gd")
|
||||
var loaded_exportplugin = ExportPlugin.new()
|
||||
|
||||
func _enter_tree():
|
||||
add_autoload_singleton("DiscordSDK", "res://addons/discord-sdk-gd/sdk_utility.gd")
|
||||
add_autoload_singleton("updater_discordsdk", "res://addons/discord-sdk-gd/sdk_utility.gd")
|
||||
add_export_plugin(loaded_exportplugin)
|
||||
|
||||
func disable_plugin():
|
||||
remove_autoload_singleton("DiscordSDK")
|
||||
remove_autoload_singleton("updater_discordsdk")
|
||||
remove_export_plugin(loaded_exportplugin)
|
||||
|
@@ -1,55 +1,4 @@
|
||||
extends Node
|
||||
|
||||
const result: Array[String] = [
|
||||
"Ok",
|
||||
"ServiceUnavailable",
|
||||
"InvalidVersion",
|
||||
"LockFailed",
|
||||
"InternalError",
|
||||
"InvalidPayload",
|
||||
"InvalidCommand",
|
||||
"InvalidPermissions",
|
||||
"NotFetched",
|
||||
"NotFound",
|
||||
"Conflict",
|
||||
"InvalidSecret",
|
||||
"InvalidJoinSecret",
|
||||
"NoEligibleActivity",
|
||||
"InvalidInvite",
|
||||
"NotAuthenticated",
|
||||
"InvalidAccessToken",
|
||||
"ApplicationMismatch",
|
||||
"InvalidDataUrl",
|
||||
"InvalidBase64",
|
||||
"NotFiltered",
|
||||
"LobbyFull",
|
||||
"InvalidLobbySecret",
|
||||
"InvalidFilename",
|
||||
"InvalidFileSize",
|
||||
"InvalidEntitlement",
|
||||
"NotInstalled",
|
||||
"NotRunning",
|
||||
"InsufficientBuffer",
|
||||
"PurchaseCanceled",
|
||||
"InvalidGuild",
|
||||
"InvalidEvent",
|
||||
"InvalidChannel",
|
||||
"InvalidOrigin",
|
||||
"RateLimited",
|
||||
"OAuth2Error",
|
||||
"SelectChannelTimeout",
|
||||
"GetGuildTimeout",
|
||||
"SelectVoiceForceRequired",
|
||||
"CaptureShortcutAlreadyListening",
|
||||
"UnauthorizedForAchievement",
|
||||
"InvalidGiftCode",
|
||||
"PurchaseError",
|
||||
"TransactionAborted",
|
||||
"DrawingInitFailed"
|
||||
]
|
||||
|
||||
func _process(delta):
|
||||
Discord_SDK.coreupdate()
|
||||
|
||||
func get_sdk_info():
|
||||
return result[Discord_SDK.get_result_int()]
|
||||
|
@@ -16,4 +16,4 @@ func _ready():
|
||||
|
||||
Discord_SDK.refresh()
|
||||
|
||||
$Info.text = $Info.text.replace("{discordinfo}",DiscordSDK.get_sdk_info()).replace("{id}",str(Discord_SDK.app_id)).replace("{details}",Discord_SDK.details).replace("{state}",Discord_SDK.state).replace("{lkey}",Discord_SDK.large_image).replace("{ltext}",Discord_SDK.large_image_text).replace("{skey}",Discord_SDK.small_image).replace("{stext}",Discord_SDK.small_image_text).replace("{stimestamp}",str(Discord_SDK.start_timestamp)).replace("{etimestamp}",str(Discord_SDK.end_timestamp))
|
||||
$Info.text = $Info.text.replace("{discordinfo}",str(Discord_SDK.get_is_discord_working())).replace("{id}",str(Discord_SDK.app_id)).replace("{details}",Discord_SDK.details).replace("{state}",Discord_SDK.state).replace("{lkey}",Discord_SDK.large_image).replace("{ltext}",Discord_SDK.large_image_text).replace("{skey}",Discord_SDK.small_image).replace("{stext}",Discord_SDK.small_image_text).replace("{stimestamp}",str(Discord_SDK.start_timestamp)).replace("{etimestamp}",str(Discord_SDK.end_timestamp))
|
||||
|
@@ -46,7 +46,7 @@ offset_left = 7.0
|
||||
offset_top = 6.0
|
||||
offset_right = 514.0
|
||||
offset_bottom = 722.0
|
||||
text = "Discord info: {discordinfo}
|
||||
text = "Discord working: {discordinfo}
|
||||
|
||||
Application ID : {id}
|
||||
Details: {details}
|
||||
|
@@ -20,7 +20,7 @@ config/icon="res://assets/Logo_V2.png"
|
||||
|
||||
[autoload]
|
||||
|
||||
DiscordSDK="*res://addons/discord-sdk-gd/sdk_utility.gd"
|
||||
updater_discordsdk="*res://addons/discord-sdk-gd/sdk_utility.gd"
|
||||
|
||||
[dotnet]
|
||||
|
||||
|
@@ -51,6 +51,8 @@ void Discord_SDK::_bind_methods()
|
||||
|
||||
ClassDB::bind_method(D_METHOD("refresh"), &Discord_SDK::refresh);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_is_discord_working"), &Discord_SDK::get_is_discord_working);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_result_int"), &Discord_SDK::get_result_int);
|
||||
}
|
||||
|
||||
@@ -192,6 +194,11 @@ int64_t Discord_SDK::get_end_timestamp() const
|
||||
return activity.GetTimestamps().GetEnd();
|
||||
}
|
||||
|
||||
bool Discord_SDK::get_is_discord_working() const
|
||||
{
|
||||
return result == discord::Result::Ok && app_id > 0;
|
||||
}
|
||||
|
||||
int Discord_SDK::get_result_int() const
|
||||
{
|
||||
return static_cast<int>(result);
|
||||
|
@@ -63,6 +63,7 @@ public:
|
||||
int64_t get_end_timestamp() const;
|
||||
void set_end_timestamp(const int64_t &value);
|
||||
|
||||
bool get_is_discord_working() const;
|
||||
int get_result_int() const;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user