diff --git a/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/MusicMeta.gd b/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/MusicMeta.gd deleted file mode 100644 index 79242e7..0000000 --- a/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/MusicMeta.gd +++ /dev/null @@ -1,147 +0,0 @@ -extends Node -class_name MusicMeta - -class MusicMetadata: - var error: Error - var bpm: int - var title: String - var album: String - var comments: String - var year: int - var artist: String - var cover: ImageTexture - - func print_info(): - print("bpm: ", bpm) - print("title: ", title) - print("album: ", album) - print("comments: ", comments) - print("year: ", year) - print("cover: ", cover) - print("artist: ", artist) - -func get_mp3_metadata(stream: AudioStreamMP3) -> MusicMetadata: - var meta: MusicMetadata = MusicMetadata.new() - var data: PackedByteArray = stream.data - - meta.error = OK - - if data.size() < 10: - meta.error = FAILED - return meta - - var header = data.slice(0, 10) - var id = header.slice(0, 3).get_string_from_ascii() - if id != "ID3": - meta.error = FAILED - push_error("Error: Stream data's header '%s' is not ID3."%id) - return meta - - var v = "ID3v2.%d.%d" % [header[3], header[4]] - if v == "ID3v2.4.0" or v == "ID3v2.3.0" or v == "ID3v2.2.0": - var flags = header[5] - var _unsync = flags & 0x80 > 0 - var extended = flags & 0x40 > 0 - var _experimental = flags & 0x20 > 0 - var _has_footer = flags & 0x10 > 0 - var idx = 10 - var end = idx + bytes_to_int(header.slice(6, 10)) - if extended: - idx += bytes_to_int(data.slice(idx, idx + 4)) - - while idx < end: - if not data: - meta.error = FAILED - push_error("Error: Stream data is null.") - return meta - - var frame_id = data.slice(idx, idx + 4).get_string_from_ascii() - var size = bytes_to_int(data.slice(idx + 4, idx + 8), frame_id != "APIC") - - # if greater than byte, not sync safe number (0b0111_1111 -> 0x7f) - if size > 0x7f: - size = bytes_to_int(data.slice(idx + 4, idx + 8), false) - idx += 10 - - match frame_id: - "TBPM", 'TBP': - meta.bpm = int(get_string_from_data(data, idx, size)) - "TIT2","TT2": - print("a " + str(Array(data.slice(idx, idx + 3)).hash())) - print([1, 0xff, 0xfe].hash()) - meta.title = get_string_from_data(data, idx, size) - "TALB", 'TAL': - meta.album = get_string_from_data(data, idx, size) - "COMM","COM": - var string:String = get_string_from_data(data, idx, size) - print("got comment " + string) - if string: - meta.comments = string - "TYER","TYE": - meta.year = int(get_string_from_data(data, idx, size)) - "TPE1", 'TP1': - meta.artist = get_string_from_data(data, idx, size) - "APIC","PIC": - var pic_frame = data.slice(idx + 1, idx + size) - var zero1 = pic_frame.find(0) - if zero1 > 0: - var mime_type = pic_frame.slice(0, zero1).get_string_from_ascii() - zero1 += 1 # Picture type - if zero1 < pic_frame.size(): - zero1 += 1 - if zero1 < pic_frame.size(): - var zero2 = pic_frame.find(0, zero1) - var image_bytes = pic_frame.slice(zero2 + 1, pic_frame.size()) - var img = Image.new() - match mime_type: - "image/png": - img.load_png_from_buffer(image_bytes) - "image/jpeg", "image/jpg": - img.load_jpg_from_buffer(image_bytes) - _: - meta.error = FAILED - push_error("MusicMeta.get_metadata_mp3(): ERROR: mime type ", mime_type, " not yet supported...") - return meta - var t: ImageTexture = ImageTexture.new() - t.set_image(img) - meta.cover = t - idx += size - - return meta - else: - meta.error = FAILED - push_error("Error: Found version '%s' from streams data; must be 'ID3v2.4.0'."%v) - return meta - - - - -func get_string_from_data(data, idx, size): - var ret - if size > 3 and Array(data.slice(idx, idx + 3)).hash() == [1, 0xff, 0xfe].hash(): - # Null-terminated string of ucs2 chars - ret = get_string_from_ucs2(data.slice(idx + 3, idx + size)) - if data[idx] == 0: - # Simple utf8 string - ret = data.slice(idx + 1, idx + size).get_string_from_utf8() - if ret: - return ret - else: - return "" - -# Syncsafe uses 0x80 multiplier otherwise use 0x100 multiplier -func bytes_to_int(bytes: Array, is_syncsafe = true): - var mult = 0x80 if is_syncsafe else 0x100 - var n = 0 - for byte in bytes: - n *= mult - n += byte - return n - -func get_string_from_ucs2(bytes: Array): - var s = "" - var idx = 0 - while idx < (bytes.size() - 1): - s += char(bytes[idx] + 256 * bytes[idx + 1]) - idx += 2 - return s diff --git a/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/MusicMeta.gd.uid b/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/MusicMeta.gd.uid deleted file mode 100644 index 8c69f7f..0000000 --- a/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/MusicMeta.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://rnxfmtoo2yn4 diff --git a/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/MusicMetaPlugin.gd b/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/MusicMetaPlugin.gd deleted file mode 100644 index 070d503..0000000 --- a/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/MusicMetaPlugin.gd +++ /dev/null @@ -1,10 +0,0 @@ -@tool -extends EditorPlugin - -const AUTOLOAD_NAME = "MusicMeta" - -func _enter_tree(): - add_autoload_singleton(AUTOLOAD_NAME, "res://addons/MusicMeta/MusicMeta.gd") - -func _exit_tree(): - remove_autoload_singleton(AUTOLOAD_NAME) diff --git a/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/MusicMetaPlugin.gd.uid b/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/MusicMetaPlugin.gd.uid deleted file mode 100644 index 2adc03a..0000000 --- a/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/MusicMetaPlugin.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://cdigfnlqg2r8l diff --git a/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/README.md b/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/README.md deleted file mode 100644 index fbadc7f..0000000 --- a/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# MusicMeta - Godot 4 Plugin - -A plugin for extracting mp3 file metadata. diff --git a/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/examples/get_mp3_metadata.gd b/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/examples/get_mp3_metadata.gd deleted file mode 100644 index 56fe52c..0000000 --- a/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/examples/get_mp3_metadata.gd +++ /dev/null @@ -1,9 +0,0 @@ -extends Node - -@export var Stream: AudioStreamMP3 - -func _ready(): - var metadata := MusicMeta.new().get_mp3_metadata(Stream) - if metadata.error != OK: - return - metadata.print_info() diff --git a/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/examples/get_mp3_metadata.gd.uid b/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/examples/get_mp3_metadata.gd.uid deleted file mode 100644 index c57a604..0000000 --- a/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/examples/get_mp3_metadata.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bs5vnv3baji7f diff --git a/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/plugin.cfg b/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/plugin.cfg deleted file mode 100644 index 6c391a2..0000000 --- a/MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/plugin.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[plugin] - -name="MusicMeta" -description="An extension that allows the extraction of ID3v2.3.0 MP3 metadata." -author="aineejames,wilcockj" -version="1.0" -script="MusicMetaPlugin.gd" diff --git a/Scenes/Metadatatest.cs b/Scenes/Metadatatest.cs index 3326ddb..9818922 100644 --- a/Scenes/Metadatatest.cs +++ b/Scenes/Metadatatest.cs @@ -11,6 +11,6 @@ public partial class Metadatatest : Control public override void _Ready() { base._Ready(); - + URLImageGetter.GetImageURL("https://www.youtube.com/watch?v=ImqhHLlPfZg&list=WL"); } } diff --git a/Scenes/main.tscn b/Scenes/main.tscn index bc3ce9b..d99514c 100644 --- a/Scenes/main.tscn +++ b/Scenes/main.tscn @@ -227,7 +227,7 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 4 max_value = 1.0 -step = 0.0010000000038417056 +step = 0.0010000000038417 tick_count = 5 ticks_position = 3 diff --git a/Scripts/Context.cs b/Scripts/Context.cs index 31719e7..ba6fc66 100644 --- a/Scripts/Context.cs +++ b/Scripts/Context.cs @@ -1,5 +1,4 @@ using Godot; -using Instances; using System; using System.Collections.Generic; using System.Linq; diff --git a/Scripts/Data.cs b/Scripts/Data.cs index 0c58bcb..4624bdd 100644 --- a/Scripts/Data.cs +++ b/Scripts/Data.cs @@ -9,6 +9,7 @@ using Godot; using ATL.AudioData; using ATL; +using System.Net.Http; public class Song{ @@ -90,3 +91,21 @@ public class DirectoryLoader{ return Songs; } } + +class URLImageGetter{ + public static String GetImageURL(String source){ + String cleansource = source; + String ImageURL = ""; + if (cleansource.StartsWith("https://")){ + cleansource = cleansource.Remove(0,7); + } + GD.Print(cleansource); + if (source.StartsWith("www.youtube.com")){ + ImageURL = "https://i.ytimg.com/vi/"; + ImageURL += cleansource.Split("?")[1].Split("?")[0].Replace("v=",""); + ImageURL += "/hqdefault.jpg"; + } + GD.Print("converted ", source, " to ", ImageURL); + return ImageURL; + } +} diff --git a/Scripts/UIManager.cs b/Scripts/UIManager.cs index ce148b7..64f1845 100644 --- a/Scripts/UIManager.cs +++ b/Scripts/UIManager.cs @@ -1,5 +1,4 @@ using Godot; -using Instances; using System; using System.Collections.Generic; using System.Linq; diff --git a/Simplaudio.csproj b/Simplaudio.csproj index 382f7f4..0869428 100644 --- a/Simplaudio.csproj +++ b/Simplaudio.csproj @@ -1,4 +1,4 @@ - + net8.0 true @@ -6,8 +6,9 @@ - + + \ No newline at end of file diff --git a/Simplaudio.csproj.old b/Simplaudio.csproj.old new file mode 100644 index 0000000..03dd491 --- /dev/null +++ b/Simplaudio.csproj.old @@ -0,0 +1,14 @@ + + + net8.0 + true + + + + + + + + + + \ No newline at end of file diff --git a/Simplaudio.csproj.old.1 b/Simplaudio.csproj.old.1 new file mode 100644 index 0000000..3615aaa --- /dev/null +++ b/Simplaudio.csproj.old.1 @@ -0,0 +1,11 @@ + + + net8.0 + true + + + + + + + \ No newline at end of file diff --git a/addons/discord-rpc-gd/Debug.svg b/addons/discord-rpc-gd/Debug.svg deleted file mode 100644 index 7987166..0000000 --- a/addons/discord-rpc-gd/Debug.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/addons/discord-rpc-gd/Debug.svg.import b/addons/discord-rpc-gd/Debug.svg.import deleted file mode 100644 index 4596fbd..0000000 --- a/addons/discord-rpc-gd/Debug.svg.import +++ /dev/null @@ -1,37 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://ufh1hha1ehui" -path="res://.godot/imported/Debug.svg-d4cb8599fa7926b76a2d6e40d2efd949.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/discord-rpc-gd/Debug.svg" -dest_files=["res://.godot/imported/Debug.svg-d4cb8599fa7926b76a2d6e40d2efd949.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 -svg/scale=1.0 -editor/scale_with_editor_scale=false -editor/convert_colors_with_editor_theme=false diff --git a/addons/discord-rpc-gd/Logo_V2_No_Bg.png b/addons/discord-rpc-gd/Logo_V2_No_Bg.png deleted file mode 100644 index fb6c700..0000000 Binary files a/addons/discord-rpc-gd/Logo_V2_No_Bg.png and /dev/null differ diff --git a/addons/discord-rpc-gd/Logo_V2_No_Bg.png.import b/addons/discord-rpc-gd/Logo_V2_No_Bg.png.import deleted file mode 100644 index a1f1230..0000000 --- a/addons/discord-rpc-gd/Logo_V2_No_Bg.png.import +++ /dev/null @@ -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 diff --git a/addons/discord-rpc-gd/READ_ME_PLEASE.txt b/addons/discord-rpc-gd/READ_ME_PLEASE.txt deleted file mode 100644 index a98427b..0000000 --- a/addons/discord-rpc-gd/READ_ME_PLEASE.txt +++ /dev/null @@ -1,7 +0,0 @@ -MINIMUM GODOT VERSION: 4.2 - -PLEASE ACTIVATE THE PLUGIN UNDER Project -> Project Settings... -> Plugins -> DiscordRPC -> Status -IGNORE THE RED ERRORS ON THE FIRST 2 RESTARTS -READ THE TUTORIAL LINKED IN THE WINDOW THAT WILL OPEN ON PLUGIN ENABLE - -If nothing works, enable the plugin and delete /addons/discord-rpc-gd/bin/.gdignore diff --git a/addons/discord-rpc-gd/bin/discord-rpc-gd.gdextension b/addons/discord-rpc-gd/bin/discord-rpc-gd.gdextension deleted file mode 100644 index 27e2845..0000000 --- a/addons/discord-rpc-gd/bin/discord-rpc-gd.gdextension +++ /dev/null @@ -1,29 +0,0 @@ -[configuration] - -entry_symbol = "discordrpcgd_library_init" -compatibility_minimum = 4.1 - -[libraries] - -macos.debug = "macos/libdiscord_game_sdk_binding_debug.dylib" -macos.release = "macos/libdiscord_game_sdk_binding.dylib" -windows.debug.x86_64 = "windows/discord_game_sdk_binding_debug.dll" -windows.release.x86_64 = "windows/discord_game_sdk_binding.dll" -linux.debug.x86_64 = "linux/libdiscord_game_sdk_binding_debug.so" -linux.release.x86_64 = "linux/libdiscord_game_sdk_binding.so" -linux.debug.arm64 = "linux/libdiscord_game_sdk_binding_debug.so" -linux.release.arm64 = "linux/libdiscord_game_sdk_binding.so" -linux.debug.rv64 = "linux/libdiscord_game_sdk_binding_debug.so" -linux.release.rv64 = "linux/libdiscord_game_sdk_binding.so" - -[dependencies] - -macos = { "macos/libdiscord_game_sdk.dylib": "" } -windows.debug.x86_64 = { "windows/discord_game_sdk.dll": "" } -windows.release.x86_64 = { "windows/discord_game_sdk.dll": "" } -linux.debug.x86_64 = { "linux/libdiscord_game_sdk.so": "" } -linux.release.x86_64 = { "linux/libdiscord_game_sdk.so": "" } -linux.debug.arm64 = { "linux/libdiscord_game_sdk.so": "" } -linux.release.arm64 = { "linux/libdiscord_game_sdk.so": "" } -linux.debug.rv64 = { "linux/libdiscord_game_sdk.so": "" } -linux.release.rv64 = { "linux/libdiscord_game_sdk.so": "" } diff --git a/addons/discord-rpc-gd/bin/discord-rpc-gd.gdextension.uid b/addons/discord-rpc-gd/bin/discord-rpc-gd.gdextension.uid deleted file mode 100644 index 64afc99..0000000 --- a/addons/discord-rpc-gd/bin/discord-rpc-gd.gdextension.uid +++ /dev/null @@ -1 +0,0 @@ -uid://0jnn2i3r56m3 diff --git a/addons/discord-rpc-gd/bin/linux/libdiscord_game_sdk.so b/addons/discord-rpc-gd/bin/linux/libdiscord_game_sdk.so deleted file mode 100644 index 9dacf94..0000000 Binary files a/addons/discord-rpc-gd/bin/linux/libdiscord_game_sdk.so and /dev/null differ diff --git a/addons/discord-rpc-gd/bin/linux/libdiscord_game_sdk_binding.so b/addons/discord-rpc-gd/bin/linux/libdiscord_game_sdk_binding.so deleted file mode 100644 index f9863c4..0000000 Binary files a/addons/discord-rpc-gd/bin/linux/libdiscord_game_sdk_binding.so and /dev/null differ diff --git a/addons/discord-rpc-gd/bin/linux/libdiscord_game_sdk_binding_debug.so b/addons/discord-rpc-gd/bin/linux/libdiscord_game_sdk_binding_debug.so deleted file mode 100644 index 89bf7da..0000000 Binary files a/addons/discord-rpc-gd/bin/linux/libdiscord_game_sdk_binding_debug.so and /dev/null differ diff --git a/addons/discord-rpc-gd/bin/macos/libdiscord_game_sdk.dylib b/addons/discord-rpc-gd/bin/macos/libdiscord_game_sdk.dylib deleted file mode 100644 index 2cc726d..0000000 Binary files a/addons/discord-rpc-gd/bin/macos/libdiscord_game_sdk.dylib and /dev/null differ diff --git a/addons/discord-rpc-gd/bin/macos/libdiscord_game_sdk_binding.dylib b/addons/discord-rpc-gd/bin/macos/libdiscord_game_sdk_binding.dylib deleted file mode 100644 index cfcd1a7..0000000 Binary files a/addons/discord-rpc-gd/bin/macos/libdiscord_game_sdk_binding.dylib and /dev/null differ diff --git a/addons/discord-rpc-gd/bin/macos/libdiscord_game_sdk_binding_debug.dylib b/addons/discord-rpc-gd/bin/macos/libdiscord_game_sdk_binding_debug.dylib deleted file mode 100644 index 082e396..0000000 Binary files a/addons/discord-rpc-gd/bin/macos/libdiscord_game_sdk_binding_debug.dylib and /dev/null differ diff --git a/addons/discord-rpc-gd/bin/windows/discord_game_sdk.dll b/addons/discord-rpc-gd/bin/windows/discord_game_sdk.dll deleted file mode 100644 index be946ea..0000000 Binary files a/addons/discord-rpc-gd/bin/windows/discord_game_sdk.dll and /dev/null differ diff --git a/addons/discord-rpc-gd/bin/windows/discord_game_sdk_binding.dll b/addons/discord-rpc-gd/bin/windows/discord_game_sdk_binding.dll deleted file mode 100644 index 77ffef2..0000000 Binary files a/addons/discord-rpc-gd/bin/windows/discord_game_sdk_binding.dll and /dev/null differ diff --git a/addons/discord-rpc-gd/bin/windows/discord_game_sdk_binding_debug.dll b/addons/discord-rpc-gd/bin/windows/discord_game_sdk_binding_debug.dll deleted file mode 100644 index 2b52a76..0000000 Binary files a/addons/discord-rpc-gd/bin/windows/discord_game_sdk_binding_debug.dll and /dev/null differ diff --git a/addons/discord-rpc-gd/bin/windows/discord_game_sdk_x86.dll b/addons/discord-rpc-gd/bin/windows/discord_game_sdk_x86.dll deleted file mode 100644 index 45b9bb1..0000000 Binary files a/addons/discord-rpc-gd/bin/windows/discord_game_sdk_x86.dll and /dev/null differ diff --git a/addons/discord-rpc-gd/bin/windows/~discord_game_sdk_binding_debug.dll b/addons/discord-rpc-gd/bin/windows/~discord_game_sdk_binding_debug.dll deleted file mode 100644 index 2b52a76..0000000 Binary files a/addons/discord-rpc-gd/bin/windows/~discord_game_sdk_binding_debug.dll and /dev/null differ diff --git a/addons/discord-rpc-gd/example.gd b/addons/discord-rpc-gd/example.gd deleted file mode 100644 index 95f2926..0000000 --- a/addons/discord-rpc-gd/example.gd +++ /dev/null @@ -1,38 +0,0 @@ -class_name DiscordRPCTutorial -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] -## 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] -## -## This is your [code]_ready()[/code] function wich could be anywhere -## [codeblock] -## func _ready(): -## # Application ID -## DiscordRPC.app_id = 1099618430065324082 -## # this is boolean if everything worked -## print("Discord working: " + str(DiscordRPC.get_is_discord_working())) -## # Set the first custom text row of the activity here -## DiscordRPC.details = "A demo activity by vaporvee#1231" -## # Set the second custom text row of the activity here -## DiscordRPC.state = "Checkpoint 23/23" -## # Image key for small image from "Art Assets" from the Discord Developer website -## DiscordRPC.large_image = "game" -## # Tooltip text for the large image -## DiscordRPC.large_image_text = "Try it now!" -## # Image key for large image from "Art Assets" from the Discord Developer website -## DiscordRPC.small_image = "boss" -## # Tooltip text for the small image -## DiscordRPC.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()) -## # "59:59 remaining" timestamp for the activity -## DiscordRPC.end_timestamp = int(Time.get_unix_time_from_system()) + 3600 -## # Always refresh after changing the values! -## DiscordRPC.refresh() -## [/codeblock] -## -## @tutorial(More information here): https://github.com/vaporvee/discord-rpc-godot/wiki/Quick-start -## @tutorial(Make your Application ID and else here): https://discord.com/developers/applications diff --git a/addons/discord-rpc-gd/example.gd.uid b/addons/discord-rpc-gd/example.gd.uid deleted file mode 100644 index efa3492..0000000 --- a/addons/discord-rpc-gd/example.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://cu21wq8hdk6mq diff --git a/addons/discord-rpc-gd/logo.png b/addons/discord-rpc-gd/logo.png deleted file mode 100644 index fb6c700..0000000 Binary files a/addons/discord-rpc-gd/logo.png and /dev/null differ diff --git a/addons/discord-rpc-gd/logo.png.import b/addons/discord-rpc-gd/logo.png.import deleted file mode 100644 index 1cce19a..0000000 --- a/addons/discord-rpc-gd/logo.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://csl0e2px0cwc1" -path="res://.godot/imported/logo.png-bacb448eabae556bdb0659359ea4e4af.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/discord-rpc-gd/logo.png" -dest_files=["res://.godot/imported/logo.png-bacb448eabae556bdb0659359ea4e4af.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 diff --git a/addons/discord-rpc-gd/nodes/Debug.tscn b/addons/discord-rpc-gd/nodes/Debug.tscn deleted file mode 100644 index dc5e705..0000000 --- a/addons/discord-rpc-gd/nodes/Debug.tscn +++ /dev/null @@ -1,268 +0,0 @@ -[gd_scene load_steps=9 format=3 uid="uid://c1slhdnlsv2qt"] - -[ext_resource type="Texture2D" uid="uid://dnfq6kug4x6o2" path="res://addons/discord-rpc-gd/nodes/assets/Checked.svg" id="2_q6tao"] -[ext_resource type="Texture2D" uid="uid://compmm3kviqqe" path="res://addons/discord-rpc-gd/nodes/assets/Unchecked.svg" id="3_5cyem"] -[ext_resource type="Texture2D" uid="uid://dtc6ckladq0td" path="res://addons/discord-rpc-gd/nodes/assets/circle.svg" id="3_goflf"] - -[sub_resource type="GDScript" id="GDScript_ak1tp"] -resource_name = "Debug" -script/source = "extends Node - -func _ready(): - DiscordRPC.app_id = 1276916292170809426 - DiscordRPC.connect(\"activity_join_request\",_on_activity_join_request) - -func _process(_delta): - if(DiscordRPC.get_is_discord_working()): - $Panel/TextureRect.self_modulate = Color(\"#3eff8d\") - $Panel/TextureRect/AnimationPlayer.play(\"pulsate\") - debug_text_update() - else: - $Panel/TextureRect.self_modulate = Color(\"#797979\") - $Panel/TextureRect/AnimationPlayer.stop() - debug_text_update() - - -func debug_text_update(): - $Panel/Info.text = \"Application ID : {id} -Details: {details} -State: {state} - -Large image key: {lkey} -Large image text: {ltext} -Small image key: {skey} -Small image text: {stext} - -Start timestamp: {stimestamp} -End timestamp: {etimestamp} - -Party ID: {partyid} -Current party size: {cpartysize} -Max party size: {mpartysize} -Match secret: {msecret} -Join secret: {jsecret} -Spectate secret: {ssecret} -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)) - -var user_request = {}; - -func _on_activity_join_request(user_requesting): - print(user_requesting) - user_request = user_requesting - -func _on_accept_join_request_pressed(): - if(!user_request.is_empty()): - DiscordRPC.accept_join_request(user_request.id) - -func _on_invite_with_user_id_text_submitted(new_text): - DiscordRPC.send_invite(int(new_text),true,\"this is a test invite sent from godot\") - -func _on_accept_with_user_id_text_submitted(new_text): - DiscordRPC.accept_invite(int(new_text)) - -func _on_print_current_user_on_console_pressed(): - print(DiscordRPC.get_current_user()) - -func _on_toggle_sdk_toggled(button_pressed): - if(button_pressed): - DiscordRPC.unclear() - else: - DiscordRPC.clear(false) - -func _on_print_friends_pressed(): - print(DiscordRPC.get_all_relationships()) -" - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_8abo6"] - -[sub_resource type="Animation" id="Animation_mmtmn"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath(".:scale") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0.4), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Vector2(0.5, 0.5)] -} - -[sub_resource type="Animation" id="Animation_5u02v"] -resource_name = "pulsate" -loop_mode = 1 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath(".:scale") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 0.5, 1), -"transitions": PackedFloat32Array(1, 1, 1), -"update": 0, -"values": [Vector2(0.5, 0.5), Vector2(0.8, 0.8), Vector2(0.5, 0.5)] -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_a7ofc"] -_data = { -&"RESET": SubResource("Animation_mmtmn"), -&"pulsate": SubResource("Animation_5u02v") -} - -[node name="DebugNodeGroup" type="Node"] -editor_description = "This is a Debug Node wich will show (only if the project runs) some usefull info and buttons/input" -script = SubResource("GDScript_ak1tp") - -[node name="Panel" type="Panel" parent="."] -anchors_preset = -1 -anchor_right = 0.373 -anchor_bottom = 1.0 -offset_left = -5.0 -offset_right = 0.303955 -grow_horizontal = 2 -grow_vertical = 2 - -[node name="Info" type="RichTextLabel" parent="Panel"] -layout_mode = 0 -offset_left = 12.0 -offset_top = 21.0 -offset_right = 429.0 -offset_bottom = 461.0 -theme_override_font_sizes/normal_font_size = 14 -text = "Application ID : {id} -Details: {details} -State: {state} - -Large image key: {lkey} -Large image text: {ltext} -Small image key: {skey} -Small image text: {stext} - -Start timestamp: {stimestamp} -End timestamp: {etimestamp} - -Party ID: {partyid} -Current party size: {cpartysize} -Max party size: {mpartysize} -Match secret: {msecret} -Join secret: {jsecret} -Spectate secret: {ssecret} -Is party public: {ppublic} (needs to be activated in Discord client settings) - -Is instanced: {instanced} -" -fit_content = true - -[node name="PrintCurrentUserOnConsole" type="Button" parent="Panel"] -layout_mode = 1 -anchors_preset = 4 -anchor_top = 0.5 -anchor_bottom = 0.5 -offset_left = 12.0 -offset_top = 138.375 -offset_right = 245.0 -offset_bottom = 171.375 -grow_vertical = 2 -text = "Print current user on console" - -[node name="PrintFriends" type="Button" parent="Panel"] -layout_mode = 1 -anchors_preset = 4 -anchor_top = 0.5 -anchor_bottom = 0.5 -offset_left = 12.0 -offset_top = 176.5 -offset_right = 204.0 -offset_bottom = 207.5 -grow_vertical = 2 -text = "Print friends on console" - -[node name="AcceptJoinRequest" type="Button" parent="Panel"] -layout_mode = 1 -anchors_preset = 4 -anchor_top = 0.5 -anchor_bottom = 0.5 -offset_left = 12.0 -offset_top = 212.875 -offset_right = 154.0 -offset_bottom = 243.875 -grow_vertical = 2 -text = "ACCEPT REQUEST" - -[node name="InviteWithUserID" type="LineEdit" parent="Panel"] -layout_mode = 1 -anchors_preset = 4 -anchor_top = 0.5 -anchor_bottom = 0.5 -offset_left = 11.0 -offset_top = 250.375 -offset_right = 210.0 -offset_bottom = 281.375 -grow_vertical = 2 -size_flags_horizontal = 0 -placeholder_text = "Invite with user_id here" - -[node name="AcceptWithUserID" type="LineEdit" parent="Panel"] -layout_mode = 1 -anchors_preset = 4 -anchor_top = 0.5 -anchor_bottom = 0.5 -offset_left = 11.0 -offset_top = 286.875 -offset_right = 260.0 -offset_bottom = 317.875 -grow_vertical = 2 -placeholder_text = "Accept Invite with user_id here" - -[node name="ToggleSDK" type="CheckButton" parent="Panel"] -layout_mode = 1 -anchors_preset = 4 -anchor_top = 0.5 -anchor_bottom = 0.5 -offset_left = 298.0 -offset_top = 157.375 -offset_right = 1144.0 -offset_bottom = 665.375 -grow_vertical = 2 -scale = Vector2(0.05, 0.05) -theme_override_styles/focus = SubResource("StyleBoxEmpty_8abo6") -theme_override_icons/checked = ExtResource("2_q6tao") -theme_override_icons/unchecked = ExtResource("3_5cyem") -button_pressed = true - -[node name="TextureRect" type="TextureRect" parent="Panel"] -self_modulate = Color(0.47451, 0.47451, 0.47451, 1) -layout_mode = 1 -anchors_preset = -1 -anchor_left = 0.88 -anchor_top = 0.762 -anchor_right = 0.88 -anchor_bottom = 0.762 -offset_left = -28.8 -offset_top = -28.776 -offset_right = 28.0841 -offset_bottom = 28.1082 -grow_horizontal = 2 -grow_vertical = 2 -scale = Vector2(0.5, 0.5) -pivot_offset = Vector2(29.0693, 29.0693) -texture = ExtResource("3_goflf") - -[node name="AnimationPlayer" type="AnimationPlayer" parent="Panel/TextureRect"] -libraries = { -"": SubResource("AnimationLibrary_a7ofc") -} - -[connection signal="pressed" from="Panel/PrintCurrentUserOnConsole" to="." method="_on_print_current_user_on_console_pressed"] -[connection signal="pressed" from="Panel/PrintFriends" to="." method="_on_print_friends_pressed"] -[connection signal="pressed" from="Panel/AcceptJoinRequest" to="." method="_on_accept_join_request_pressed"] -[connection signal="text_submitted" from="Panel/InviteWithUserID" to="." method="_on_invite_with_user_id_text_submitted"] -[connection signal="text_submitted" from="Panel/AcceptWithUserID" to="." method="_on_accept_with_user_id_text_submitted"] -[connection signal="toggled" from="Panel/ToggleSDK" to="." method="_on_toggle_sdk_toggled"] diff --git a/addons/discord-rpc-gd/nodes/assets/Checked.svg b/addons/discord-rpc-gd/nodes/assets/Checked.svg deleted file mode 100644 index d37a1c2..0000000 --- a/addons/discord-rpc-gd/nodes/assets/Checked.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/addons/discord-rpc-gd/nodes/assets/Checked.svg.import b/addons/discord-rpc-gd/nodes/assets/Checked.svg.import deleted file mode 100644 index 9913c3c..0000000 --- a/addons/discord-rpc-gd/nodes/assets/Checked.svg.import +++ /dev/null @@ -1,37 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://dnfq6kug4x6o2" -path="res://.godot/imported/Checked.svg-80704e37f30c24e2ec3dfc0955f5f21c.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/discord-rpc-gd/nodes/assets/Checked.svg" -dest_files=["res://.godot/imported/Checked.svg-80704e37f30c24e2ec3dfc0955f5f21c.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 -svg/scale=1.0 -editor/scale_with_editor_scale=false -editor/convert_colors_with_editor_theme=false diff --git a/addons/discord-rpc-gd/nodes/assets/Unchecked.svg b/addons/discord-rpc-gd/nodes/assets/Unchecked.svg deleted file mode 100644 index 58cb234..0000000 --- a/addons/discord-rpc-gd/nodes/assets/Unchecked.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/addons/discord-rpc-gd/nodes/assets/Unchecked.svg.import b/addons/discord-rpc-gd/nodes/assets/Unchecked.svg.import deleted file mode 100644 index 7503ec8..0000000 --- a/addons/discord-rpc-gd/nodes/assets/Unchecked.svg.import +++ /dev/null @@ -1,37 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://compmm3kviqqe" -path="res://.godot/imported/Unchecked.svg-b526adfd78f7b1577fc3c10a8ea626ee.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/discord-rpc-gd/nodes/assets/Unchecked.svg" -dest_files=["res://.godot/imported/Unchecked.svg-b526adfd78f7b1577fc3c10a8ea626ee.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 -svg/scale=1.0 -editor/scale_with_editor_scale=false -editor/convert_colors_with_editor_theme=false diff --git a/addons/discord-rpc-gd/nodes/assets/circle.svg b/addons/discord-rpc-gd/nodes/assets/circle.svg deleted file mode 100644 index acd3753..0000000 --- a/addons/discord-rpc-gd/nodes/assets/circle.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/addons/discord-rpc-gd/nodes/assets/circle.svg.import b/addons/discord-rpc-gd/nodes/assets/circle.svg.import deleted file mode 100644 index 509c745..0000000 --- a/addons/discord-rpc-gd/nodes/assets/circle.svg.import +++ /dev/null @@ -1,37 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://dtc6ckladq0td" -path="res://.godot/imported/circle.svg-d0b0579c9433c6250a5869daf4f70024.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://addons/discord-rpc-gd/nodes/assets/circle.svg" -dest_files=["res://.godot/imported/circle.svg-d0b0579c9433c6250a5869daf4f70024.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 -svg/scale=1.0 -editor/scale_with_editor_scale=false -editor/convert_colors_with_editor_theme=false diff --git a/addons/discord-rpc-gd/nodes/debug.gd b/addons/discord-rpc-gd/nodes/debug.gd deleted file mode 100644 index d960441..0000000 --- a/addons/discord-rpc-gd/nodes/debug.gd +++ /dev/null @@ -1,11 +0,0 @@ -## 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. -## -## @tutorial: https://github.com/vaporvee/discord-rpc-godot/wiki -@tool -extends Node - -func _ready() -> void: - const DebugNodeGroup: PackedScene = preload("res://addons/discord-rpc-gd/nodes/Debug.tscn") - add_child(DebugNodeGroup.instantiate()) diff --git a/addons/discord-rpc-gd/nodes/debug.gd.uid b/addons/discord-rpc-gd/nodes/debug.gd.uid deleted file mode 100644 index 50148ae..0000000 --- a/addons/discord-rpc-gd/nodes/debug.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bupnp7dee8k3a diff --git a/addons/discord-rpc-gd/nodes/discord_autoload.gd b/addons/discord-rpc-gd/nodes/discord_autoload.gd deleted file mode 100644 index cfc6e60..0000000 --- a/addons/discord-rpc-gd/nodes/discord_autoload.gd +++ /dev/null @@ -1,13 +0,0 @@ -## 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. -## -## @tutorial: https://github.com/vaporvee/discord-rpc-godot/wiki -extends Node - -func _ready() -> void: - pass - -func _process(_delta) -> void: - DiscordRPC.run_callbacks() diff --git a/addons/discord-rpc-gd/nodes/discord_autoload.gd.uid b/addons/discord-rpc-gd/nodes/discord_autoload.gd.uid deleted file mode 100644 index 9391e56..0000000 --- a/addons/discord-rpc-gd/nodes/discord_autoload.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bb81mf7sks0g4 diff --git a/addons/discord-rpc-gd/plugin.cfg b/addons/discord-rpc-gd/plugin.cfg deleted file mode 100644 index 8eeeb16..0000000 --- a/addons/discord-rpc-gd/plugin.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[plugin] - -name="DiscordRPC" -description="Discord RPC Plugin for GDScript in Godot" -author="vaporvee" -version="1.3.1" -script="plugin.gd" diff --git a/addons/discord-rpc-gd/plugin.gd b/addons/discord-rpc-gd/plugin.gd deleted file mode 100644 index 03985b6..0000000 --- a/addons/discord-rpc-gd/plugin.gd +++ /dev/null @@ -1,56 +0,0 @@ -@tool -extends EditorPlugin - -const DiscordRPCDebug = preload("res://addons/discord-rpc-gd/nodes/debug.gd") -const DiscordRPCDebug_icon = preload("res://addons/discord-rpc-gd/Debug.svg") -var loaded_DiscordRPCDebug = DiscordRPCDebug.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 = "/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)) - -func _exit_tree(): - if get_editor_interface().get_editor_settings().has_setting("DiscordRPC/EditorPresence/enabled"): - get_editor_interface().get_editor_settings().erase("DiscordRPC/EditorPresence/enabled") - -func _enable_plugin() -> void: - 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") - 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") - -func save_and_restart() -> void: - get_editor_interface().restart_editor(true) - -func save_no_restart() -> void: - get_editor_interface().restart_editor(false) - -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.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"): - add_child(editor_presence) - else: - editor_presence.queue_free() diff --git a/addons/discord-rpc-gd/plugin.gd.uid b/addons/discord-rpc-gd/plugin.gd.uid deleted file mode 100644 index 31826cb..0000000 --- a/addons/discord-rpc-gd/plugin.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://ec3hjq1x03oq diff --git a/addons/discord-rpc-gd/restart_window.tscn b/addons/discord-rpc-gd/restart_window.tscn deleted file mode 100644 index d947cb7..0000000 --- a/addons/discord-rpc-gd/restart_window.tscn +++ /dev/null @@ -1,112 +0,0 @@ -[gd_scene load_steps=8 format=3 uid="uid://byc4c6d5tpomq"] - -[ext_resource type="Texture2D" uid="uid://csl0e2px0cwc1" path="res://addons/discord-rpc-gd/Logo_V2_No_Bg.png" id="1_0svbg"] - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_1t7mm"] - -[sub_resource type="Theme" id="Theme_swwco"] -Button/styles/focus = SubResource("StyleBoxEmpty_1t7mm") - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5vqdt"] - -[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", -"height": 16, -"mipmaps": false, -"width": 16 -} - -[sub_resource type="ImageTexture" id="ImageTexture_gdtpn"] -image = SubResource("Image_4rf8i") - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_7v0rg"] - -[node name="RestartWindow" type="ConfirmationDialog"] -title = "Restart required" -initial_position = 2 -size = Vector2i(430, 500) -visible = true -transient = false -unresizable = true -theme = SubResource("Theme_swwco") -ok_button_text = "Restart" -cancel_button_text = "Save and restart" - -[node name="Panel" type="Panel" parent="."] -anchors_preset = 5 -anchor_left = 0.5 -anchor_right = 0.5 -offset_left = 8.0 -offset_top = 8.0 -offset_right = 422.0 -offset_bottom = 451.0 -grow_horizontal = 2 -mouse_filter = 1 - -[node name="VBoxContainer" type="VBoxContainer" parent="Panel"] -custom_minimum_size = Vector2(400, 0) -layout_mode = 1 -anchors_preset = 5 -anchor_left = 0.5 -anchor_right = 0.5 -offset_left = -200.0 -offset_right = 200.0 -offset_bottom = 389.0 -grow_horizontal = 2 - -[node name="HSeparator" type="HSeparator" parent="Panel/VBoxContainer"] -layout_mode = 2 -mouse_filter = 1 -theme_override_constants/separation = 15 -theme_override_styles/separator = SubResource("StyleBoxEmpty_5vqdt") - -[node name="HBoxContainer" type="HBoxContainer" parent="Panel/VBoxContainer"] -layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 -theme_override_constants/separation = 10 - -[node name="DocsIcon" type="TextureRect" parent="Panel/VBoxContainer/HBoxContainer"] -layout_mode = 2 -size_flags_horizontal = 8 -size_flags_vertical = 4 -texture = SubResource("ImageTexture_gdtpn") -stretch_mode = 2 - -[node name="LinkButton" type="LinkButton" parent="Panel/VBoxContainer/HBoxContainer"] -layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 8 -mouse_default_cursor_shape = 16 -theme_override_font_sizes/font_size = 20 -text = "HOW TO USE" -uri = "https://vaporvee.com/docs/discord-rpc-godot#quick-start" - -[node name="TextureRect" type="TextureRect" parent="Panel/VBoxContainer"] -custom_minimum_size = Vector2(128, 128) -layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 0 -texture = ExtResource("1_0svbg") -expand_mode = 1 - -[node name="RichTextLabel" type="RichTextLabel" parent="Panel/VBoxContainer"] -custom_minimum_size = Vector2(400, 250) -layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 0 -mouse_filter = 1 -theme_override_font_sizes/normal_font_size = 16 -theme_override_styles/normal = SubResource("StyleBoxEmpty_7v0rg") -bbcode_enabled = true -text = "[center]Thanks for enabling the -[rainbow]Discord Game SDK Plugin[/rainbow] -made by vaporvee. ❤️ - - -You need to [wave]restart[/wave] the editor to fully enable this plugin! -Do you want to [wave]save[/wave] your project before restarting? - -Error messages after the first two restarts are normal. Please ignore them!" diff --git a/addons/godot-yt-dlp/LICENSE b/addons/godot-yt-dlp/LICENSE deleted file mode 100644 index 404a77d..0000000 --- a/addons/godot-yt-dlp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Noé Le Cam - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/addons/godot-yt-dlp/godot_yt_dlp.gd b/addons/godot-yt-dlp/godot_yt_dlp.gd deleted file mode 100644 index ff3798d..0000000 --- a/addons/godot-yt-dlp/godot_yt_dlp.gd +++ /dev/null @@ -1,13 +0,0 @@ -@tool -extends EditorPlugin - - -const AUTOLOAD_NAME = "YtDlp" - - -func _enter_tree(): - add_autoload_singleton(AUTOLOAD_NAME, "res://addons/godot-yt-dlp/src/yt_dlp.gd") - - -func _exit_tree(): - remove_autoload_singleton(AUTOLOAD_NAME) diff --git a/addons/godot-yt-dlp/godot_yt_dlp.gd.uid b/addons/godot-yt-dlp/godot_yt_dlp.gd.uid deleted file mode 100644 index ced68d7..0000000 --- a/addons/godot-yt-dlp/godot_yt_dlp.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://rxllqh6yapvt diff --git a/addons/godot-yt-dlp/plugin.cfg b/addons/godot-yt-dlp/plugin.cfg deleted file mode 100644 index 3637aa8..0000000 --- a/addons/godot-yt-dlp/plugin.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[plugin] - -name="Godot yt-dlp" -description="A simple API for downloading videos from YouTube (and other websites)." -author="Nolkaloid" -version="3.0" -script="godot_yt_dlp.gd" diff --git a/addons/godot-yt-dlp/src/downloader.gd b/addons/godot-yt-dlp/src/downloader.gd deleted file mode 100644 index 15a8e19..0000000 --- a/addons/godot-yt-dlp/src/downloader.gd +++ /dev/null @@ -1,90 +0,0 @@ -extends RefCounted - -signal download_completed -signal download_failed -signal download_progressed(percentage) - -var _is_downloading: bool = false -var _headers = PackedStringArray([ - "User-Agent: Pirulo/1.0 (Godot)", - "Accept: */*" -]) - -func download(url: String, file_path: String) -> void: - if _is_downloading: - push_error(self, "A download is already in progress.") - - _is_downloading = true - - var url_regex = RegEx.new() - url_regex.compile("^(?((?https?):\\/\\/)?[^\\/]+\\.[a-z]{2,})(?(?>\\/.*)*)$") - - var host: String - var path: String - var protocol: String - - # Validate the URL - match url_regex.search(url) as RegExMatch: - null: - download_failed.emit() - return - - var result: - protocol = result.get_string("protocol") - host = result.get_string("host") - path = result.get_string("path") - - var http_client := HTTPClient.new() - http_client.connect_to_host(host, 80 if protocol == "http" else 443) - - while http_client.get_status() in [HTTPClient.STATUS_CONNECTING, HTTPClient.STATUS_RESOLVING]: - http_client.poll() - await (Engine.get_main_loop() as SceneTree).process_frame - - # Handle connection failure - if http_client.get_status() != HTTPClient.STATUS_CONNECTED: - download_failed.emit() - return - - http_client.request(HTTPClient.METHOD_GET, path, _headers) - - while not http_client.has_response(): - http_client.poll() - await (Engine.get_main_loop() as SceneTree).process_frame - - # Handle the response - match http_client.get_response_code(): - HTTPClient.RESPONSE_FOUND, HTTPClient.RESPONSE_MOVED_PERMANENTLY: - var response_headers := http_client.get_response_headers_as_dictionary() - _is_downloading = false - download(response_headers["Location"], file_path) - return - - HTTPClient.RESPONSE_OK: - await _store_body_to_file(http_client, file_path) - - _: - download_failed.emit() - return - - _is_downloading = false - download_completed.emit() - - -func _store_body_to_file(http_client: HTTPClient, file_path: String) -> void: - var file: FileAccess = FileAccess.open(file_path, FileAccess.WRITE) - var percentage_loaded: float = 0.0 - - while http_client.get_status() == HTTPClient.STATUS_BODY: - http_client.poll() - file.store_buffer(http_client.read_response_body_chunk()) - - var new_percentage = file.get_length() * 100 / http_client.get_response_body_length() - - if percentage_loaded < new_percentage: - percentage_loaded = new_percentage - download_progressed.emit(percentage_loaded) - - await (Engine.get_main_loop() as SceneTree).process_frame - - file.close() diff --git a/addons/godot-yt-dlp/src/downloader.gd.uid b/addons/godot-yt-dlp/src/downloader.gd.uid deleted file mode 100644 index 0c64469..0000000 --- a/addons/godot-yt-dlp/src/downloader.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://osytjsx5x5lb diff --git a/addons/godot-yt-dlp/src/favicon2.ico b/addons/godot-yt-dlp/src/favicon2.ico deleted file mode 100644 index ff290da..0000000 Binary files a/addons/godot-yt-dlp/src/favicon2.ico and /dev/null differ diff --git a/addons/godot-yt-dlp/src/yt_dlp.gd b/addons/godot-yt-dlp/src/yt_dlp.gd deleted file mode 100644 index a107bde..0000000 --- a/addons/godot-yt-dlp/src/yt_dlp.gd +++ /dev/null @@ -1,234 +0,0 @@ -extends Node - -signal setup_completed -signal _update_completed - -enum Video {MP4, WEBM} -enum Audio {AAC, FLAC, MP3, M4A, OPUS, VORBIS, WAV} - -const Downloader = preload("res://addons/godot-yt-dlp/src/downloader.gd") -const yt_dlp_sources: Dictionary = { - "Linux": "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp", - "Windows": "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe", - "macOS": "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos", -} -const ffmpeg_sources: Dictionary = { - "ffmpeg": "https://github.com/Nolkaloid/godot-youtube-dl/releases/latest/download/ffmpeg.exe", - "ffprobe": "https://github.com/Nolkaloid/godot-youtube-dl/releases/latest/download/ffprobe.exe", -} - -var _downloader: Downloader -var _thread: Thread = Thread.new() -var _is_setup: bool = false - - -func is_setup() -> bool: - return _is_setup - - -func download(url: String) -> Download: - if not _is_setup: - push_error(self, "Not set up.") - return null - - return Download.new(url) - -func FilesMissing() -> bool: - var executable_name: String = "yt-dlp.exe" if OS.get_name() == "Windows" else "yt-dlp" - - if OS.get_name() == "Windows": - if not FileAccess.file_exists("user://%s" % executable_name): - return true - if not FileAccess.file_exists("user://ffmpeg.exe"): - return true - if not FileAccess.file_exists("user://ffprobe.exe"): - return true - elif OS.get_name() == "Linux": - var stuff = OS.execute("bash",PackedStringArray(["-c","ffprobe"])) - print(stuff) - if stuff != 1: - return true - var stuff2 = OS.execute("bash",PackedStringArray(["-c","ffmpeg"])) - print(stuff2) - if stuff2 != 1: - return true - return false - -func setup() -> void: - _downloader = Downloader.new() - var executable_name: String = "yt-dlp.exe" if OS.get_name() == "Windows" else "yt-dlp" - - if not FileAccess.file_exists("user://%s" % executable_name): - _downloader.download(yt_dlp_sources[OS.get_name()], "user://%s" % executable_name) - await _downloader.download_completed - else: - _thread.start(_update_yt_dlp.bind(executable_name)) - await _update_completed - # Wait for the next idle frame to join thread - await (Engine.get_main_loop() as SceneTree).process_frame - _thread.wait_to_finish() - - await _setup_ffmpeg() - if OS.get_name() == "Linux": - OS.execute("chmod", PackedStringArray(["+x", OS.get_user_data_dir() + "/yt-dlp"])) - - _is_setup = true - setup_completed.emit() - - -func _setup_ffmpeg() -> void: - if not FileAccess.file_exists("user://ffmpeg.exe"): - if OS.get_name() == "Windows": - _downloader.download(ffmpeg_sources["ffmpeg"], "user://ffmpeg.exe") - await _downloader.download_completed - print(OS.get_distribution_name()) - elif OS.get_distribution_name() in ["Ubuntu","Linux Mint","Debian"]: - var stuff = OS.execute("bash",PackedStringArray(["-c","ffmpeg"])) - print(stuff) - if stuff !=1: - push_error("FFMPEG NOT INSTALLED") - print(OS.get_distribution_name()) - else: - print(OS.get_distribution_name()) - - if not FileAccess.file_exists("user://ffprobe.exe"): - if OS.get_name() == "Windows": - _downloader.download(ffmpeg_sources["ffprobe"], "user://ffprobe.exe") - print(OS.get_distribution_name()) - await _downloader.download_completed - elif OS.get_name() == "Linux": - var stuff = OS.execute("bash",PackedStringArray(["-c","ffprobe"])) - print(stuff) - if stuff != 1: - push_error("FFPROBE NOT INSTALLED") - print(OS.get_distribution_name()) - else: - print(OS.get_distribution_name()) - - - -func _update_yt_dlp(filename: String) -> void: - OS.execute("%s/%s" % [OS.get_user_data_dir(), filename], ["--update"]) - _thread_finished.call_deferred(_update_completed) - - -func _thread_finished(name: Signal) -> void: - if name != null: - name.emit() - - -class Download extends RefCounted: - signal download_completed - signal completely_finished - - enum Status { - READY, - DOWNLOADING, - COMPLETED, - } - - var _status: Status = Status.READY - var _thread: Thread = null - - # Fields - var _url: String - var _destination: String = "user://" - var _file_name: String = "YOUTUBEDOWNLAOD" - var _convert_to_audio: bool = false - var _renameAudioToDiffName:bool = false - var _video_format: Video = Video.WEBM - var _audio_format: Audio = Audio.MP3 - var _download_playlist:bool - - func _init(url: String): - _url = url - _file_name += Time.get_datetime_string_from_system(); - - - func set_destination(destination: String) -> Download: - _destination = destination - print("destination set: " + destination) - return self - - - func set_file_name(file_name: String) -> Download: - _file_name = file_name - _renameAudioToDiffName = true - return self - - - func set_video_format(format: Video) -> Download: - _video_format = format - return self - - - func convert_to_audio(format: Audio) -> Download: - _audio_format = format - _convert_to_audio = true - return self - - - func get_status() -> Status: - return _status - - - func start() -> Download: - if not _status == Status.READY: - push_error(self, "Download previously started.") - return self - - _status = Status.DOWNLOADING - - _destination = ProjectSettings.globalize_path(_destination) - _thread = Thread.new() - _thread.start(_execute_on_thread) - reference() - return self - - - func _execute_on_thread() -> void: - var executable: String = OS.get_user_data_dir() + \ - ("/yt-dlp.exe" if OS.get_name() == "Windows" else "/yt-dlp") - - var options_and_arguments: Array = [] - - if _convert_to_audio: - var format: String = (Audio.keys()[_audio_format] as String).to_lower() - options_and_arguments.append_array(["-x", "--audio-format", format]) - else: - var format: String - - match _video_format: - Video.WEBM: - format = "bestvideo[ext=webm]+bestaudio" - Video.MP4: - format = "bestvideo[ext=mp4]+m4a" - - options_and_arguments.append_array(["--format", format]) - - - var file_path: String = "{destination}" \ - .format({ - "destination": _destination - }) - - options_and_arguments.append_array(["--embed-metadata","--embed-thumbnail",str("-o" + "%(title)s.%(ext)s")]) - options_and_arguments.append_array(["--no-continue", "-P", file_path, _url]) - - if _download_playlist: - options_and_arguments.append("--yes-playlist") - else: - options_and_arguments.append("--no-playlist") - - print(options_and_arguments) - var output: Array = [] - OS.execute(executable, PackedStringArray(options_and_arguments), output) - self._thread_finished.call_deferred() - - - func _thread_finished(): - _status = Status.COMPLETED - self.download_completed.emit() - self.completely_finished.emit() - _thread.wait_to_finish() - unreference() diff --git a/addons/godot-yt-dlp/src/yt_dlp.gd.uid b/addons/godot-yt-dlp/src/yt_dlp.gd.uid deleted file mode 100644 index e04b5cf..0000000 --- a/addons/godot-yt-dlp/src/yt_dlp.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://c0dklnw4cfoe3 diff --git a/project.godot b/project.godot index e1cd8ed..4fa393d 100644 --- a/project.godot +++ b/project.godot @@ -26,8 +26,6 @@ buses/default_bus_layout="res://Audio/default_bus_layout.tres" [autoload] -YtDlp="*res://addons/godot-yt-dlp/src/yt_dlp.gd" -MusicMetadataAutoload="*res://MusicMeta-f98d7384de3e2e658dcba3f5b06fb5b57ac2c73c/MusicMeta.gd" DiscordRPCLoader="*res://addons/discord-rpc-gd/nodes/discord_autoload.gd" [display]