From ee8d8bcc2222e1168fc40bf392b43a642c65f4a2 Mon Sep 17 00:00:00 2001 From: Mario Steele Date: Fri, 13 Jun 2025 02:44:25 -0500 Subject: [PATCH 1/3] Add GodotGifLoader Added GodotGifLoader, which uses the GodotGif GDExtension GIF Loader to load GIF files. --- Library/Helpers/godotgif_loader.gd | 21 +++++++++++++++++++++ Library/Helpers/godotgif_loader.gd.uid | 1 + 2 files changed, 22 insertions(+) create mode 100644 Library/Helpers/godotgif_loader.gd create mode 100644 Library/Helpers/godotgif_loader.gd.uid diff --git a/Library/Helpers/godotgif_loader.gd b/Library/Helpers/godotgif_loader.gd new file mode 100644 index 0000000..c6999bb --- /dev/null +++ b/Library/Helpers/godotgif_loader.gd @@ -0,0 +1,21 @@ +@icon("res://addons/twitcher/assets/media-loader-icon.svg") +@tool +extends NativeImageTransformer + +## Godot Addon GIF parser written as GDExtension. Most of the time stable but there +## are GIF's that may not work cause the file didn't follow the GIF specification. +class_name GodotGifTransformer + +func is_supported_animation() -> bool: + return true + +func convert_image(path: String, buffer_in: PackedByteArray, output_path: String) -> SpriteFrames: + var tex: SpriteFrames + if buffer_in.size() > 0: + tex = GifManager.sprite_frames_from_buffer(buffer_in) + else: + tex = GifManager.sprite_frames_from_file(path) + + ResourceSaver.save(tex, output_path, ResourceSaver.SaverFlags.FLAG_COMPRESS) + tex.take_over_path(path) + return tex diff --git a/Library/Helpers/godotgif_loader.gd.uid b/Library/Helpers/godotgif_loader.gd.uid new file mode 100644 index 0000000..b5278a8 --- /dev/null +++ b/Library/Helpers/godotgif_loader.gd.uid @@ -0,0 +1 @@ +uid://cor04lg8wc05p From dcf1c7c5c9861aa8205da2ba3ce814b6da190652 Mon Sep 17 00:00:00 2001 From: Mario Steele Date: Fri, 13 Jun 2025 02:45:31 -0500 Subject: [PATCH 2/3] Updated Globals Autoload Added Twitch services --- Library/Singletons/globals.tscn | 70 ++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/Library/Singletons/globals.tscn b/Library/Singletons/globals.tscn index a8cf05c..8a9d844 100644 --- a/Library/Singletons/globals.tscn +++ b/Library/Singletons/globals.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=12 format=3 uid="uid://b8whblp2hgrp"] +[gd_scene load_steps=22 format=3 uid="uid://b8whblp2hgrp"] [ext_resource type="Script" uid="uid://6nrfqrw53c1s" path="res://Library/Singletons/Globals.cs" id="1_gsl6h"] [ext_resource type="Script" uid="uid://i8st3lv0lidh" path="res://addons/twitcher/twitch_service.gd" id="1_ocehi"] @@ -7,6 +7,13 @@ [ext_resource type="Script" uid="uid://b3n3et8mebjcc" path="res://addons/twitcher/auth/twitch_oauth_scopes.gd" id="4_fcooh"] [ext_resource type="Resource" uid="uid://c4scwuk8q0r40" path="res://addons/twitcher/lib/oOuch/default_key_provider.tres" id="5_65rqk"] [ext_resource type="Script" uid="uid://b52xp7c23ucfk" path="res://addons/twitcher/lib/oOuch/oauth_token.gd" id="6_lppa0"] +[ext_resource type="Script" uid="uid://cw30cwveway65" path="res://addons/twitcher/generated/twitch_api.gd" id="8_3e7ys"] +[ext_resource type="Script" uid="uid://blmhj3j00yk45" path="res://addons/twitcher/eventsub/twitch_eventsub.gd" id="9_qouv8"] +[ext_resource type="Script" uid="uid://d4lyup0vy1wtu" path="res://addons/twitcher/media/twitch_media_loader.gd" id="10_3qd2c"] +[ext_resource type="Texture2D" uid="uid://g1dbcjksbotw" path="res://addons/twitcher/assets/fallback_texture.tres" id="11_cw8vs"] +[ext_resource type="Script" uid="uid://cor04lg8wc05p" path="res://Library/Helpers/godotgif_loader.gd" id="12_3e7ys"] +[ext_resource type="Script" uid="uid://dcq1bvfrqimqq" path="res://addons/twitcher/chat/twitch_chat.gd" id="13_7pyia"] +[ext_resource type="Script" uid="uid://cnmohrdxqihr0" path="res://addons/twitcher/generated/twitch_user.gd" id="14_ai0at"] [sub_resource type="Resource" id="Resource_54bgt"] script = ExtResource("2_gsl6h") @@ -36,6 +43,39 @@ _crypto_key_provider = ExtResource("5_65rqk") _identifier = "EditorToken" _cache_path = "user://auth.conf" +[sub_resource type="Resource" id="Resource_qouv8"] +script = ExtResource("12_3e7ys") +fallback_texture = ExtResource("11_cw8vs") +metadata/_custom_type_script = "uid://cor04lg8wc05p" + +[sub_resource type="Resource" id="Resource_3qd2c"] +script = ExtResource("14_ai0at") +id = "104753997" +login = "casperdragonwolf" +display_name = "CasperDragonWolf" +type = "" +broadcaster_type = "affiliate" +description = "I'm a hobbyist developer dealing in many different languages, currently using Godot and C# to build games, apps, and plugins. I have a semi-decent library of games that I will occasionally play, and I just try to chill, and have fun!" +profile_image_url = "https://static-cdn.jtvnw.net/jtv_user_pictures/b2c4c6bb-9cb4-4433-b664-6431beb040c7-profile_image-300x300.png" +offline_image_url = "https://static-cdn.jtvnw.net/jtv_user_pictures/e80f180c-c6e6-4647-ae76-adb0fbe6c122-channel_offline_image-1920x1080.jpeg" +view_count = 0 +email = "" +created_at = "2015-10-19T21:33:45Z" + +[sub_resource type="Resource" id="Resource_cw8vs"] +script = ExtResource("14_ai0at") +id = "104753997" +login = "casperdragonwolf" +display_name = "CasperDragonWolf" +type = "" +broadcaster_type = "affiliate" +description = "I'm a hobbyist developer dealing in many different languages, currently using Godot and C# to build games, apps, and plugins. I have a semi-decent library of games that I will occasionally play, and I just try to chill, and have fun!" +profile_image_url = "https://static-cdn.jtvnw.net/jtv_user_pictures/b2c4c6bb-9cb4-4433-b664-6431beb040c7-profile_image-300x300.png" +offline_image_url = "https://static-cdn.jtvnw.net/jtv_user_pictures/e80f180c-c6e6-4647-ae76-adb0fbe6c122-channel_offline_image-1920x1080.jpeg" +view_count = 0 +email = "" +created_at = "2015-10-19T21:33:45Z" + [node name="Globals" type="Node"] script = ExtResource("1_gsl6h") @@ -45,3 +85,31 @@ oauth_setting = SubResource("Resource_km1mv") scopes = SubResource("Resource_to4h6") token = SubResource("Resource_3e7ys") metadata/_custom_type_script = "uid://i8st3lv0lidh" + +[node name="TwitchAPI" type="Node" parent="TwitchService"] +script = ExtResource("8_3e7ys") +token = SubResource("Resource_3e7ys") +oauth_setting = SubResource("Resource_km1mv") +metadata/_custom_type_script = "uid://cw30cwveway65" + +[node name="TwitchEventsub" type="Node" parent="TwitchService" node_paths=PackedStringArray("api")] +script = ExtResource("9_qouv8") +api = NodePath("../TwitchAPI") +scopes = SubResource("Resource_to4h6") +metadata/_custom_type_script = "uid://blmhj3j00yk45" + +[node name="TwitchMediaLoader" type="Node" parent="TwitchService" node_paths=PackedStringArray("api")] +script = ExtResource("10_3qd2c") +api = NodePath("../TwitchAPI") +image_transformer = SubResource("Resource_qouv8") +metadata/_custom_type_script = "uid://d4lyup0vy1wtu" + +[node name="TwitchChat" type="Node" parent="TwitchService" node_paths=PackedStringArray("media_loader", "eventsub", "api")] +script = ExtResource("13_7pyia") +broadcaster_user = SubResource("Resource_3qd2c") +sender_user = SubResource("Resource_cw8vs") +media_loader = NodePath("../TwitchMediaLoader") +eventsub = NodePath("../TwitchEventsub") +api = NodePath("../TwitchAPI") +subscribe_on_ready = false +metadata/_custom_type_script = "uid://dcq1bvfrqimqq" From 09c99b6cf58fba9632c3b9c4d4629d5944e6db86 Mon Sep 17 00:00:00 2001 From: Mario Steele Date: Fri, 13 Jun 2025 02:46:20 -0500 Subject: [PATCH 3/3] Updated C# Projects Added EFC to C# Project. Godot Project adds C# Functionality. --- PokePurple.csproj | 2 ++ project.godot | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/PokePurple.csproj b/PokePurple.csproj index c648366..5a4d0f7 100644 --- a/PokePurple.csproj +++ b/PokePurple.csproj @@ -6,6 +6,8 @@ + + \ No newline at end of file diff --git a/project.godot b/project.godot index 0ea8257..6a3096d 100644 --- a/project.godot +++ b/project.godot @@ -12,7 +12,7 @@ config_version=5 config/name="PokePurple" config/description="Poke`mon Twitch Community Game" -config/features=PackedStringArray("4.4") +config/features=PackedStringArray("4.4", "C#") config/icon="res://icon.png" [autoload]