a lot of social sdk progress
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 3.9 KiB |
@@ -1,34 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://csl0e2px0cwc1"
|
||||
path="res://.godot/imported/Logo_V2_No_Bg.png-ed667fb599fe1e17ebcfc361ff7c9c93.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/discord-rpc-gd/Logo_V2_No_Bg.png"
|
||||
dest_files=["res://.godot/imported/Logo_V2_No_Bg.png-ed667fb599fe1e17ebcfc361ff7c9c93.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
@@ -1,6 +1,6 @@
|
||||
MINIMUM GODOT VERSION: 4.2
|
||||
|
||||
PLEASE ACTIVATE THE PLUGIN UNDER Project -> Project Settings... -> Plugins -> DiscordRPC -> Status
|
||||
PLEASE ACTIVATE THE PLUGIN UNDER Project -> Project Settings... -> Plugins -> DiscordUtil -> Status
|
||||
IGNORE THE RED ERRORS ON THE FIRST 2 RESTARTS
|
||||
READ THE TUTORIAL LINKED IN THE WINDOW THAT WILL OPEN ON PLUGIN ENABLE
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[configuration]
|
||||
|
||||
entry_symbol = "discordrpcgd_library_init"
|
||||
entry_symbol = "DiscordUtilgd_library_init"
|
||||
compatibility_minimum = 4.1
|
||||
|
||||
[libraries]
|
||||
|
@@ -1,8 +1,8 @@
|
||||
class_name DiscordRPCTutorial
|
||||
class_name DiscordUtilTutorial
|
||||
extends Node
|
||||
|
||||
## 1. Put the addons/ folder in your Godot project[br]
|
||||
## 2. Enable the addon in your Project Settings under "Plugins" and "DiscordRPC". [br](if it doesn't show up restart your project and try again)[br]
|
||||
## 2. Enable the addon in your Project Settings under "Plugins" and "DiscordUtil". [br](if it doesn't show up restart your project and try again)[br]
|
||||
## 3. Restart your project[br]
|
||||
## 4. Create an Application under https://discord.com/developers/applications and get the Application ID br]
|
||||
## 5. (optional) Set images under "Rich Presence" and "Art Assets" and remember the keys[br]
|
||||
@@ -11,27 +11,27 @@ extends Node
|
||||
## [codeblock]
|
||||
## func _ready():
|
||||
## # Application ID
|
||||
## DiscordRPC.app_id = 1099618430065324082
|
||||
## DiscordUtil.app_id = 1099618430065324082
|
||||
## # this is boolean if everything worked
|
||||
## print("Discord working: " + str(DiscordRPC.get_is_discord_working()))
|
||||
## print("Discord working: " + str(DiscordUtil.get_is_discord_working()))
|
||||
## # Set the first custom text row of the activity here
|
||||
## DiscordRPC.details = "A demo activity by vaporvee#1231"
|
||||
## DiscordUtil.details = "A demo activity by vaporvee#1231"
|
||||
## # Set the second custom text row of the activity here
|
||||
## DiscordRPC.state = "Checkpoint 23/23"
|
||||
## DiscordUtil.state = "Checkpoint 23/23"
|
||||
## # Image key for small image from "Art Assets" from the Discord Developer website
|
||||
## DiscordRPC.large_image = "game"
|
||||
## DiscordUtil.large_image = "game"
|
||||
## # Tooltip text for the large image
|
||||
## DiscordRPC.large_image_text = "Try it now!"
|
||||
## DiscordUtil.large_image_text = "Try it now!"
|
||||
## # Image key for large image from "Art Assets" from the Discord Developer website
|
||||
## DiscordRPC.small_image = "boss"
|
||||
## DiscordUtil.small_image = "boss"
|
||||
## # Tooltip text for the small image
|
||||
## DiscordRPC.small_image_text = "Fighting the end boss! D:"
|
||||
## DiscordUtil.small_image_text = "Fighting the end boss! D:"
|
||||
## # "02:41 elapsed" timestamp for the activity
|
||||
## DiscordRPC.start_timestamp = int(Time.get_unix_time_from_system())
|
||||
## DiscordUtil.start_timestamp = int(Time.get_unix_time_from_system())
|
||||
## # "59:59 remaining" timestamp for the activity
|
||||
## DiscordRPC.end_timestamp = int(Time.get_unix_time_from_system()) + 3600
|
||||
## DiscordUtil.end_timestamp = int(Time.get_unix_time_from_system()) + 3600
|
||||
## # Always refresh after changing the values!
|
||||
## DiscordRPC.refresh()
|
||||
## DiscordUtil.refresh()
|
||||
## [/codeblock]
|
||||
##
|
||||
## @tutorial(More information here): https://github.com/vaporvee/discord-rpc-godot/wiki/Quick-start
|
||||
|
@@ -11,10 +11,10 @@ script/source = "extends Node
|
||||
@onready var animation_player: AnimationPlayer = $Panel/TextureRect/AnimationPlayer
|
||||
|
||||
func _ready():
|
||||
DiscordRPC.connect(\"activity_join_request\",_on_activity_join_request)
|
||||
DiscordUtil.connect(\"activity_join_request\",_on_activity_join_request)
|
||||
|
||||
func _process(_delta) -> void:
|
||||
if(DiscordRPC.get_is_discord_working()):
|
||||
if(DiscordUtil.get_is_discord_working()):
|
||||
$Panel/TextureRect.self_modulate = Color(\"#3eff8d\")
|
||||
if !animation_player.is_playing():
|
||||
animation_player.play(\"pulsate\")
|
||||
@@ -48,7 +48,7 @@ Is party public: {ppublic} (needs to be activated in Discord client settings)
|
||||
|
||||
Is instanced: {instanced}
|
||||
\"
|
||||
#$Panel/Info.text = $Panel/Info.text.replace(\"{ppublic}\",str(DiscordRPC.is_public_party)).replace(\"{instanced}\",str(DiscordRPC.instanced)).replace(\"{ssecret}\",DiscordRPC.spectate_secret).replace(\"{jsecret}\",DiscordRPC.join_secret).replace(\"{msecret}\",DiscordRPC.match_secret).replace(\"{mpartysize}\",str(DiscordRPC.max_party_size)).replace(\"{cpartysize}\",str(DiscordRPC.current_party_size)).replace(\"{partyid}\",DiscordRPC.party_id).replace(\"{id}\",str(DiscordRPC.app_id)).replace(\"{details}\",DiscordRPC.details).replace(\"{state}\",DiscordRPC.state).replace(\"{lkey}\",DiscordRPC.large_image).replace(\"{ltext}\",DiscordRPC.large_image_text).replace(\"{skey}\",DiscordRPC.small_image).replace(\"{stext}\",DiscordRPC.small_image_text).replace(\"{stimestamp}\",str(DiscordRPC.start_timestamp)).replace(\"{etimestamp}\",str(DiscordRPC.end_timestamp))
|
||||
#$Panel/Info.text = $Panel/Info.text.replace(\"{ppublic}\",str(DiscordUtil.is_public_party)).replace(\"{instanced}\",str(DiscordUtil.instanced)).replace(\"{ssecret}\",DiscordUtil.spectate_secret).replace(\"{jsecret}\",DiscordUtil.join_secret).replace(\"{msecret}\",DiscordUtil.match_secret).replace(\"{mpartysize}\",str(DiscordUtil.max_party_size)).replace(\"{cpartysize}\",str(DiscordUtil.current_party_size)).replace(\"{partyid}\",DiscordUtil.party_id).replace(\"{id}\",str(DiscordUtil.app_id)).replace(\"{details}\",DiscordUtil.details).replace(\"{state}\",DiscordUtil.state).replace(\"{lkey}\",DiscordUtil.large_image).replace(\"{ltext}\",DiscordUtil.large_image_text).replace(\"{skey}\",DiscordUtil.small_image).replace(\"{stext}\",DiscordUtil.small_image_text).replace(\"{stimestamp}\",str(DiscordUtil.start_timestamp)).replace(\"{etimestamp}\",str(DiscordUtil.end_timestamp))
|
||||
|
||||
var user_request: Dictionary = {};
|
||||
|
||||
@@ -58,25 +58,25 @@ func _on_activity_join_request(user_requesting: Dictionary) -> void:
|
||||
|
||||
func _on_accept_join_request_pressed() -> void:
|
||||
if(!user_request.is_empty()):
|
||||
DiscordRPC.accept_join_request(user_request.id)
|
||||
DiscordUtil.accept_join_request(user_request.id)
|
||||
|
||||
func _on_invite_with_user_id_text_submitted(new_text: String) -> void:
|
||||
DiscordRPC.send_invite(int(new_text),true,\"this is a test invite sent from godot\")
|
||||
DiscordUtil.send_invite(int(new_text),true,\"this is a test invite sent from godot\")
|
||||
|
||||
func _on_accept_with_user_id_text_submitted(new_text: String) -> void:
|
||||
DiscordRPC.accept_invite(int(new_text))
|
||||
DiscordUtil.accept_invite(int(new_text))
|
||||
|
||||
func _on_print_current_user_on_console_pressed() -> void:
|
||||
print(DiscordRPC.get_current_user())
|
||||
print(DiscordUtil.get_current_user())
|
||||
|
||||
func _on_toggle_sdk_toggled(button_pressed: bool) -> void:
|
||||
if(button_pressed):
|
||||
DiscordRPC.unclear()
|
||||
DiscordUtil.unclear()
|
||||
else:
|
||||
DiscordRPC.clear(false)
|
||||
DiscordUtil.clear(false)
|
||||
|
||||
func _on_print_friends_pressed() -> void:
|
||||
print(DiscordRPC.get_all_relationships())
|
||||
print(DiscordUtil.get_all_relationships())
|
||||
"
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_8abo6"]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
## This is a Debug Node wich will show some usefull info and buttons/input
|
||||
##
|
||||
## The DiscordRPC Debug Node will show info about the current values of its variables and some buttons to change them.
|
||||
## The DiscordUtil Debug Node will show info about the current values of its variables and some buttons to change them.
|
||||
##
|
||||
## @tutorial: https://github.com/vaporvee/discord-rpc-godot/wiki
|
||||
@tool
|
||||
|
@@ -1,7 +1,7 @@
|
||||
## This is a GDscript Node wich gets automatically added as Autoload while installing the addon.
|
||||
##
|
||||
## It can run in the background to comunicate with Discord.
|
||||
## You don't need to use it. If you remove it make sure to run [code]DiscordRPC.run_callbacks()[/code] in a [code]_process[/code] function.
|
||||
## You don't need to use it. If you remove it make sure to run [code]DiscordUtil.run_callbacks()[/code] in a [code]_process[/code] function.
|
||||
##
|
||||
## @tutorial: https://github.com/vaporvee/discord-rpc-godot/wiki
|
||||
extends Node
|
||||
@@ -10,4 +10,4 @@ func _ready() -> void:
|
||||
pass
|
||||
|
||||
func _process(_delta) -> void:
|
||||
DiscordRPC.run_callbacks()
|
||||
DiscordUtil.run_callbacks()
|
||||
|
@@ -1 +1 @@
|
||||
uid://d1ohgxo4k3cdf
|
||||
uid://dc5abjov0ebdr
|
||||
|
@@ -1,7 +1,7 @@
|
||||
[plugin]
|
||||
|
||||
name="DiscordRPC"
|
||||
description="Discord RPC Plugin for GDScript in Godot"
|
||||
name="Discord Social SDK"
|
||||
description="Discord Social SDK Plugin for GDScript in Godot"
|
||||
author="vaporvee"
|
||||
version="1.3.2"
|
||||
script="plugin.gd"
|
||||
|
@@ -1,42 +1,43 @@
|
||||
@tool
|
||||
extends EditorPlugin
|
||||
|
||||
const DiscordRPCDebug: GDScript = preload("res://addons/discord-rpc-gd/nodes/debug.gd")
|
||||
const DiscordRPCDebug_icon: Texture2D = preload("res://addons/discord-rpc-gd/Debug.svg")
|
||||
var loaded_DiscordRPCDebug: DiscordRPCDebug = DiscordRPCDebug.new()
|
||||
const DiscordSocialSDKDebug: GDScript = preload("res://addons/discord-rpc-gd/nodes/debug.gd")
|
||||
const DiscordSocialSDKDebug_icon: Texture2D = preload("res://addons/discord-rpc-gd/Debug.svg")
|
||||
var loaded_DiscordSocialSDKDebug: DiscordSocialSDKDebug = DiscordSocialSDKDebug.new()
|
||||
var restart_window: ConfirmationDialog = preload("res://addons/discord-rpc-gd/restart_window.tscn").instantiate()
|
||||
var plugin_cfg: ConfigFile = ConfigFile.new()
|
||||
const plugin_data_filename: String = "/plugin_data.cfg"
|
||||
|
||||
func _enter_tree() -> void:
|
||||
add_custom_type("DiscordRPCDebug","Node",DiscordRPCDebug,DiscordRPCDebug_icon)
|
||||
get_editor_interface().get_editor_settings().settings_changed.connect(_on_editor_settings_changed)
|
||||
|
||||
func _ready() -> void:
|
||||
await get_tree().create_timer(0.5).timeout
|
||||
plugin_cfg.load(get_editor_interface().get_editor_paths().get_data_dir() + plugin_data_filename)
|
||||
if !get_editor_interface().get_editor_settings().has_setting("DiscordRPC/EditorPresence/enabled"):
|
||||
get_editor_interface().get_editor_settings().set_setting("DiscordRPC/EditorPresence/enabled",plugin_cfg.get_value("Discord","editor_presence",false))
|
||||
if !get_editor_interface().get_editor_settings().has_setting("DiscordSocialSDK/EditorPresence/enabled"):
|
||||
get_editor_interface().get_editor_settings().set_setting("DiscordSocialSDK/EditorPresence/enabled",plugin_cfg.get_value("Discord","editor_presence",false))
|
||||
|
||||
func _enter_tree() -> void:
|
||||
add_custom_type("DiscordSocialSDKDebug","Node",DiscordSocialSDKDebug,DiscordSocialSDKDebug_icon)
|
||||
get_editor_interface().get_editor_settings().settings_changed.connect(_on_editor_settings_changed)
|
||||
|
||||
func _exit_tree() -> void:
|
||||
if get_editor_interface().get_editor_settings().has_setting("DiscordRPC/EditorPresence/enabled"):
|
||||
get_editor_interface().get_editor_settings().erase("DiscordRPC/EditorPresence/enabled")
|
||||
if get_editor_interface().get_editor_settings().has_setting("DiscordSocialSDK/EditorPresence/enabled"):
|
||||
get_editor_interface().get_editor_settings().erase("DiscordSocialSDK/EditorPresence/enabled")
|
||||
|
||||
func _enable_plugin() -> void:
|
||||
add_custom_type("DiscordSocialSDKDebug","Node",DiscordSocialSDKDebug,DiscordSocialSDKDebug_icon)
|
||||
get_editor_interface().get_editor_settings().settings_changed.connect(_on_editor_settings_changed)
|
||||
if FileAccess.file_exists(ProjectSettings.globalize_path("res://") + "addons/discord-rpc-gd/bin/.gdignore"):
|
||||
DirAccess.remove_absolute(ProjectSettings.globalize_path("res://") + "addons/discord-rpc-gd/bin/.gdignore")
|
||||
add_autoload_singleton("DiscordRPCLoader","res://addons/discord-rpc-gd/nodes/discord_autoload.gd")
|
||||
restart_window.connect("confirmed", save_no_restart)
|
||||
restart_window.connect("canceled", save_and_restart)
|
||||
get_editor_interface().popup_dialog_centered(restart_window)
|
||||
print("IGNORE RED ERROR MESSAGES BEFORE THE SECOND RESTART!")
|
||||
|
||||
func _disable_plugin() -> void:
|
||||
remove_autoload_singleton("DiscordRPCLoader")
|
||||
remove_autoload_singleton("DiscordUtilLoader")
|
||||
FileAccess.open("res://addons/discord-rpc-gd/bin/.gdignore",FileAccess.WRITE)
|
||||
remove_custom_type("DiscordRPCDebug")
|
||||
get_editor_interface().get_editor_settings().erase("DiscordRPC/EditorPresence/enabled")
|
||||
push_warning("Please restart the editor to fully disable the DiscordRPC plugin")
|
||||
remove_custom_type("DiscordSocialSDKDebug")
|
||||
get_editor_interface().get_editor_settings().erase("DiscordSocialSDK/EditorPresence/enabled")
|
||||
push_warning("Please restart the editor to fully disable the DiscordUtil plugin")
|
||||
|
||||
func save_and_restart() -> void:
|
||||
get_editor_interface().restart_editor(true)
|
||||
@@ -46,11 +47,11 @@ func save_no_restart() -> void:
|
||||
|
||||
var editor_presence: Node
|
||||
func _on_editor_settings_changed() -> void:
|
||||
plugin_cfg.set_value("Discord","editor_presence",get_editor_interface().get_editor_settings().get_setting("DiscordRPC/EditorPresence/enabled"))
|
||||
plugin_cfg.set_value("Discord","editor_presence",get_editor_interface().get_editor_settings().get_setting("DiscordSocialSDK/EditorPresence/enabled"))
|
||||
plugin_cfg.save(get_editor_interface().get_editor_paths().get_data_dir() + plugin_data_filename)
|
||||
if ClassDB.class_exists("EditorPresence") && editor_presence == null:
|
||||
editor_presence = ClassDB.instantiate("EditorPresence")
|
||||
if get_editor_interface().get_editor_settings().has_setting("DiscordRPC/EditorPresence/enabled") && get_editor_interface().get_editor_settings().get_setting("DiscordRPC/EditorPresence/enabled"):
|
||||
if get_editor_interface().get_editor_settings().has_setting("DiscordSocialSDK/EditorPresence/enabled") && get_editor_interface().get_editor_settings().get_setting("DiscordSocialSDK/EditorPresence/enabled"):
|
||||
add_child(editor_presence)
|
||||
else:
|
||||
editor_presence.queue_free()
|
||||
|
Reference in New Issue
Block a user