From 418ff134a9b9c4f8c7c2e7603bebe4c31755fe1b Mon Sep 17 00:00:00 2001 From: Joel <62071362+JoelCreatesGames@users.noreply.github.com> Date: Sat, 23 Sep 2023 19:35:04 -0300 Subject: [PATCH] clean up example into its own directory --- Node.gd | 0 README.md | 4 +++- addons/gift/icon.png.import | 2 +- Button.gd => example/Button.gd | 0 ChatContainer.gd => example/ChatContainer.gd | 2 +- ChatMessage.gd => example/ChatMessage.gd | 0 ChatMessage.tscn => example/ChatMessage.tscn | 2 +- Node.tscn => example/Example.tscn | 19 ++++++++------- Gift.gd => example/Gift.gd | 2 +- LineEdit.gd => example/LineEdit.gd | 0 default_env.tres => example/default_env.tres | 0 icon.png => example/icon.png | Bin icon.png.import => example/icon.png.import | 8 +++---- export_presets.cfg | 24 ------------------- project.godot | 8 +++---- 15 files changed, 25 insertions(+), 46 deletions(-) delete mode 100644 Node.gd rename Button.gd => example/Button.gd (100%) rename ChatContainer.gd => example/ChatContainer.gd (95%) rename ChatMessage.gd => example/ChatMessage.gd (100%) rename ChatMessage.tscn => example/ChatMessage.tscn (83%) rename Node.tscn => example/Example.tscn (69%) rename Gift.gd => example/Gift.gd (98%) rename LineEdit.gd => example/LineEdit.gd (100%) rename default_env.tres => example/default_env.tres (100%) rename icon.png => example/icon.png (100%) rename icon.png.import => example/icon.png.import (70%) delete mode 100644 export_presets.cfg diff --git a/Node.gd b/Node.gd deleted file mode 100644 index e69de29..0000000 diff --git a/README.md b/README.md index d9d96c0..6064550 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ Godot IRC For Twitch addon To use this plugin, you need to create a new application on dev.twitch.tv to get a client ID and a client secret. The redirect URL of your App has to be http://localhost:18297. +The example expects an `auth.txt` file in the example folder with 3 lines (client id, client secret, channel to join) + If you require help, feel free to join my >[Discord Server](https://discord.gg/28DQbuwMM2)< and ask your questions <3 - [Examples](https://github.com/MennoMax/gift#Examples) @@ -20,7 +22,7 @@ Below is a working example of this plugin, which is included in this project. A ### Examples -The following code is also [included](https://github.com/MennoMax/gift/blob/master/Gift.gd) in this repository. +The following code is also [included](https://github.com/MennoMax/gift/blob/master/example/Gift.gd) in this repository. ```gdscript extends Gift diff --git a/addons/gift/icon.png.import b/addons/gift/icon.png.import index 91fe9dd..7dfa23c 100644 --- a/addons/gift/icon.png.import +++ b/addons/gift/icon.png.import @@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/icon.png-b5cf707f4ba91fefa5df60a746e02900.cte [params] compress/mode=0 +compress/high_quality=false compress/lossy_quality=0.7 compress/hdr_compression=1 -compress/bptc_ldr=0 compress/normal_map=0 compress/channel_pack=0 mipmaps/generate=false diff --git a/Button.gd b/example/Button.gd similarity index 100% rename from Button.gd rename to example/Button.gd diff --git a/ChatContainer.gd b/example/ChatContainer.gd similarity index 95% rename from ChatContainer.gd rename to example/ChatContainer.gd index 5e16d4f..e98d21a 100644 --- a/ChatContainer.gd +++ b/example/ChatContainer.gd @@ -1,7 +1,7 @@ extends VBoxContainer func put_chat(senderdata : SenderData, msg : String): - var msgnode : Control = preload("res://ChatMessage.tscn").instantiate() + var msgnode : Control = preload("res://example/ChatMessage.tscn").instantiate() var time = Time.get_time_dict_from_system() var badges : String = "" for badge in senderdata.tags["badges"].split(",", false): diff --git a/ChatMessage.gd b/example/ChatMessage.gd similarity index 100% rename from ChatMessage.gd rename to example/ChatMessage.gd diff --git a/ChatMessage.tscn b/example/ChatMessage.tscn similarity index 83% rename from ChatMessage.tscn rename to example/ChatMessage.tscn index df4bedf..32967a0 100644 --- a/ChatMessage.tscn +++ b/example/ChatMessage.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://g4ajgul65cwi"] -[ext_resource type="Script" path="res://ChatMessage.gd" id="1"] +[ext_resource type="Script" path="res://example/ChatMessage.gd" id="1"] [node name="ChatMessage" type="HBoxContainer"] size_flags_horizontal = 3 diff --git a/Node.tscn b/example/Example.tscn similarity index 69% rename from Node.tscn rename to example/Example.tscn index e9abc8c..e4f2616 100644 --- a/Node.tscn +++ b/example/Example.tscn @@ -1,11 +1,11 @@ [gd_scene load_steps=5 format=3 uid="uid://bculs28gstcxk"] -[ext_resource type="Script" path="res://Gift.gd" id="1"] -[ext_resource type="Script" path="res://Button.gd" id="3"] -[ext_resource type="Script" path="res://LineEdit.gd" id="3_6ey00"] -[ext_resource type="Script" path="res://ChatContainer.gd" id="5"] +[ext_resource type="Script" path="res://example/Gift.gd" id="1_yfglq"] +[ext_resource type="Script" path="res://example/ChatContainer.gd" id="2_knohk"] +[ext_resource type="Script" path="res://example/LineEdit.gd" id="3_oafvo"] +[ext_resource type="Script" path="res://example/Button.gd" id="4_wrvcq"] -[node name="Node" type="Control"] +[node name="Example" type="Control"] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -14,14 +14,15 @@ grow_horizontal = 2 grow_vertical = 2 [node name="Gift" type="Node" parent="."] -script = ExtResource("1") +script = ExtResource("1_yfglq") +scopes = Array[String](["chat:edit", "chat:read", "moderator:read:followers"]) [node name="ChatContainer" type="VBoxContainer" parent="."] unique_name_in_owner = true layout_mode = 0 anchor_right = 1.0 anchor_bottom = 1.0 -script = ExtResource("5") +script = ExtResource("2_knohk") [node name="Chat" type="Panel" parent="ChatContainer"] show_behind_parent = true @@ -48,10 +49,10 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 caret_blink = true -script = ExtResource("3_6ey00") +script = ExtResource("3_oafvo") [node name="Button" type="Button" parent="ChatContainer/HBoxContainer"] unique_name_in_owner = true layout_mode = 2 text = "Send" -script = ExtResource("3") +script = ExtResource("4_wrvcq") diff --git a/Gift.gd b/example/Gift.gd similarity index 98% rename from Gift.gd rename to example/Gift.gd index 977792c..5818ec5 100644 --- a/Gift.gd +++ b/example/Gift.gd @@ -12,7 +12,7 @@ func _ready() -> void: # # # - var authfile := FileAccess.open("./auth", FileAccess.READ) + var authfile := FileAccess.open("./example/auth.txt", FileAccess.READ) client_id = authfile.get_line() client_secret = authfile.get_line() var initial_channel = authfile.get_line() diff --git a/LineEdit.gd b/example/LineEdit.gd similarity index 100% rename from LineEdit.gd rename to example/LineEdit.gd diff --git a/default_env.tres b/example/default_env.tres similarity index 100% rename from default_env.tres rename to example/default_env.tres diff --git a/icon.png b/example/icon.png similarity index 100% rename from icon.png rename to example/icon.png diff --git a/icon.png.import b/example/icon.png.import similarity index 70% rename from icon.png.import rename to example/icon.png.import index cb26608..26b4380 100644 --- a/icon.png.import +++ b/example/icon.png.import @@ -3,22 +3,22 @@ importer="texture" type="CompressedTexture2D" uid="uid://ck2181giqo3ep" -path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex" +path="res://.godot/imported/icon.png-5ad2e6e2e39e89ee29d5171fb300a340.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://icon.png" -dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"] +source_file="res://example/icon.png" +dest_files=["res://.godot/imported/icon.png-5ad2e6e2e39e89ee29d5171fb300a340.ctex"] [params] compress/mode=0 +compress/high_quality=false compress/lossy_quality=0.7 compress/hdr_compression=1 -compress/bptc_ldr=0 compress/normal_map=0 compress/channel_pack=0 mipmaps/generate=false diff --git a/export_presets.cfg b/export_presets.cfg deleted file mode 100644 index 7e85c2b..0000000 --- a/export_presets.cfg +++ /dev/null @@ -1,24 +0,0 @@ -[preset.0] - -name="Linux/X11" -platform="Linux/X11" -runnable=true -custom_features="" -export_filter="all_resources" -include_filter="" -exclude_filter="" -export_path="/home/mennomax/Documents/godot/GIFT.x86_64" -patch_list=PoolStringArray( ) -script_export_mode=1 -script_encryption_key="" - -[preset.0.options] - -texture_format/bptc=false -texture_format/s3tc=true -texture_format/etc=false -texture_format/etc2=false -texture_format/no_bptc_fallbacks=true -binary_format/64_bits=true -custom_template/release="" -custom_template/debug="" diff --git a/project.godot b/project.godot index 8aa4e52..a114bb3 100644 --- a/project.godot +++ b/project.godot @@ -11,9 +11,9 @@ config_version=5 [application] config/name="GIFT" -run/main_scene="res://Node.tscn" -config/features=PackedStringArray("4.0") -config/icon="res://icon.png" +run/main_scene="res://example/Example.tscn" +config/features=PackedStringArray("4.1") +config/icon="res://example/icon.png" [debug] @@ -26,7 +26,7 @@ window/size/width=400 [editor_plugins] -enabled=PackedStringArray("gift") +enabled=PackedStringArray("res://addons/gift/plugin.cfg") [rendering]