twitch addon

This commit is contained in:
Tabby 2025-04-21 00:17:07 +10:00
parent 2cd7af98a1
commit 07de7179c9
254 changed files with 18420 additions and 1 deletions

View file

@ -0,0 +1,62 @@
@tool
extends Control
@onready var copy_button: Button = %CopyButton
@onready var redirect_uri = %RedirectURI
@onready var client_id_line_edit = %ClientIDLineEdit
@onready var client_id_warning = %ClientIDWarning
@onready var help_icon = %HelpIcon
@onready var warning_icon = %WarningIcon
func _ready():
help_icon.texture = get_theme_icon("Help", "EditorIcons")
warning_icon.texture = get_theme_icon("StatusWarning", "EditorIcons")
copy_button.icon = get_theme_icon("ActionCopy", "EditorIcons")
copy_button.tooltip_text = "Copy Redirect URL to clipboard"
client_id_warning.add_theme_color_override(
"font_color",
EditorInterface.get_editor_settings()\
.get_setting("text_editor/theme/highlighting/comment_markers/warning_color")
)
visibility_changed.connect(on_visibility_changed)
func on_visibility_changed():
if visible:
update_visuals()
ProjectSettings.settings_changed.connect(update_visuals)
else:
if ProjectSettings.settings_changed.is_connected(update_visuals):
ProjectSettings.settings_changed.disconnect(update_visuals)
func update_visuals():
var client_id = VSTSettings.get_setting(VSTSettings.settings.client_id)
var redirect_host = VSTSettings.get_setting(VSTSettings.settings.redirect_host)
var redirect_port = VSTSettings.get_setting(VSTSettings.settings.redirect_port)
var uuid = VSTSettings.get_setting(VSTSettings.settings.uuid)
redirect_uri.text = redirect_host + str(redirect_port) + "/" + uuid
client_id_line_edit.text = client_id
if client_id == "":
client_id_warning.show()
warning_icon.show()
else:
client_id_warning.hide()
warning_icon.hide()
func copy_redirect_uri():
DisplayServer.clipboard_set(redirect_uri.text)
func client_id_submitted():
ProjectSettings.set_setting(
"very_simple_twitch/"+VSTSettings.settings.client_id.path,
client_id_line_edit.text
)
ProjectSettings.save()
func open_url(meta):
OS.shell_open(meta)

View file

@ -0,0 +1 @@
uid://76gikg821exj

View file

@ -0,0 +1,111 @@
[gd_scene load_steps=4 format=3 uid="uid://m77ohpfa7qef"]
[ext_resource type="Script" path="res://addons/very-simple-twitch/dock/vst-dock.gd" id="1_kyfdh"]
[sub_resource type="Image" id="Image_cb0pc"]
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, 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, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 94, 94, 127, 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, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 94, 94, 127, 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, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 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, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 44, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 44, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 94, 94, 234, 255, 95, 95, 43, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 94, 94, 234, 255, 95, 95, 43, 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, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 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, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0),
"format": "RGBA8",
"height": 16,
"mipmaps": false,
"width": 16
}
[sub_resource type="ImageTexture" id="ImageTexture_oh773"]
image = SubResource("Image_cb0pc")
[node name="vst-dock" type="VBoxContainer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_kyfdh")
[node name="HBoxContainer" type="HBoxContainer" parent="."]
layout_mode = 2
[node name="HelpIcon" type="TextureRect" parent="HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
texture = SubResource("ImageTexture_oh773")
stretch_mode = 5
[node name="RichTextLabel2" type="RichTextLabel" parent="HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
focus_mode = 2
bbcode_enabled = true
text = " [url=https://github.com/rothiotome/godot-very-simple-twitch?tab=readme-ov-file#quick-setup]Quick Setup section in the readme[/url] and follow the steps in there.
"
fit_content = true
selection_enabled = true
[node name="Label" type="Label" parent="."]
layout_mode = 2
text = "Quick Start Guide"
[node name="RedirectURI" type="HBoxContainer" parent="."]
layout_mode = 2
[node name="Label" type="Label" parent="RedirectURI"]
layout_mode = 2
size_flags_horizontal = 3
text = "Redirect URI: "
[node name="RedirectURIContainer" type="HBoxContainer" parent="RedirectURI"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 2.0
[node name="RedirectURI" type="RichTextLabel" parent="RedirectURI/RedirectURIContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
focus_mode = 2
text = "Value"
fit_content = true
selection_enabled = true
[node name="CopyButton" type="Button" parent="RedirectURI/RedirectURIContainer"]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "Copy Redirect URL to clipboard"
icon = SubResource("ImageTexture_oh773")
[node name="ClientID" type="HBoxContainer" parent="."]
layout_mode = 2
[node name="Label" type="Label" parent="ClientID"]
layout_mode = 2
size_flags_horizontal = 3
text = "Client ID:"
[node name="ClientIDLineEdit" type="LineEdit" parent="ClientID"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 2.0
placeholder_text = "YOUR CLIENT ID HERE"
[node name="Warning" type="HBoxContainer" parent="."]
layout_mode = 2
alignment = 1
[node name="WarningIcon" type="TextureRect" parent="Warning"]
unique_name_in_owner = true
layout_mode = 2
texture = SubResource("ImageTexture_oh773")
stretch_mode = 5
[node name="ClientIDWarning" type="Label" parent="Warning"]
unique_name_in_owner = true
visible = false
layout_mode = 2
theme_override_colors/font_color = Color(0.72, 0.61, 0.48, 1)
text = "To use VST, you need a Client ID. Check the readme above for how to get one."
[connection signal="meta_clicked" from="HBoxContainer/RichTextLabel2" to="." method="open_url"]
[connection signal="pressed" from="RedirectURI/RedirectURIContainer/CopyButton" to="." method="copy_redirect_uri"]
[connection signal="focus_exited" from="ClientID/ClientIDLineEdit" to="." method="client_id_submitted"]
[connection signal="text_submitted" from="ClientID/ClientIDLineEdit" to="." method="client_id_submitted"]