fixed badge cache, added missing file

This commit is contained in:
mennomax 2021-05-20 23:34:41 +02:00
parent a3740fab4d
commit b107c4901a
5 changed files with 87 additions and 16 deletions

View File

@ -1,5 +1,5 @@
extends Button extends Button
func _pressed(): func _pressed():
$"../Gift".chat($"../LineEdit".text) $"../../../Gift".chat($"../LineEdit".text)
$"../LineEdit".text = "" $"../LineEdit".text = ""

2
LICENSE Normal file → Executable file
View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2019 Max Kross Copyright (c) 2019-2021 Max Kross
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,27 +1,90 @@
[gd_scene load_steps=4 format=2] [gd_scene load_steps=6 format=2]
[ext_resource path="res://Gift.gd" type="Script" id=1] [ext_resource path="res://Gift.gd" type="Script" id=1]
[ext_resource path="res://addons/gift/icon.png" type="Texture" id=2] [ext_resource path="res://addons/gift/icon.png" type="Texture" id=2]
[ext_resource path="res://Button.gd" type="Script" id=3] [ext_resource path="res://Button.gd" type="Script" id=3]
[ext_resource path="res://ChatContainer.gd" type="Script" id=5]
[ext_resource path="res://Node.gd" type="Script" id=6]
[node name="Node" type="Control"] [node name="Node" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 6 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Gift" type="Node" parent="."] [node name="Gift" type="Node" parent="."]
script = ExtResource( 1 ) script = ExtResource( 1 )
__meta__ = { __meta__ = {
"_editor_icon": ExtResource( 2 ) "_editor_icon": ExtResource( 2 )
} }
get_images = true
[node name="LineEdit" type="LineEdit" parent="."] [node name="ChatContainer" type="VBoxContainer" parent="."]
margin_left = 403.0 anchor_right = 1.0
margin_top = 278.0 anchor_bottom = 1.0
margin_right = 531.0 script = ExtResource( 5 )
margin_bottom = 302.0 __meta__ = {
"_edit_use_anchors_": false
}
[node name="Button" type="Button" parent="."] [node name="Chat" type="Panel" parent="ChatContainer"]
margin_left = 539.0 show_behind_parent = true
margin_top = 278.0 margin_right = 400.0
margin_right = 586.0 margin_bottom = 572.0
margin_bottom = 302.0 size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="ScrollContainer" type="ScrollContainer" parent="ChatContainer/Chat"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 10.0
margin_top = 10.0
margin_right = -10.0
margin_bottom = -10.0
follow_focus = true
scroll_horizontal_enabled = false
__meta__ = {
"_edit_use_anchors_": false
}
[node name="ChatMessagesContainer" type="VBoxContainer" parent="ChatContainer/Chat/ScrollContainer"]
margin_right = 380.0
margin_bottom = 552.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/separation = 6
__meta__ = {
"_edit_use_anchors_": false
}
[node name="HBoxContainer" type="HBoxContainer" parent="ChatContainer"]
margin_top = 576.0
margin_right = 400.0
margin_bottom = 600.0
[node name="LineEdit" type="LineEdit" parent="ChatContainer/HBoxContainer"]
margin_right = 296.0
margin_bottom = 24.0
size_flags_horizontal = 3
size_flags_vertical = 3
caret_blink = true
caret_blink_speed = 0.5
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Button" type="Button" parent="ChatContainer/HBoxContainer"]
margin_left = 300.0
margin_right = 400.0
margin_bottom = 24.0
rect_min_size = Vector2( 100, 0 )
text = "Send" text = "Send"
script = ExtResource( 3 ) script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}

View File

@ -112,8 +112,6 @@ func get_badge(badge_name : String, channel_id : String = "_global", scale : Str
return get_badge(badge_name, "_global", scale) return get_badge(badge_name, "_global", scale)
texture.take_over_path(filename) texture.take_over_path(filename)
caches[RequestType.BADGE][channel_id][cachename] = texture caches[RequestType.BADGE][channel_id][cachename] = texture
elif channel_id != "_global":
return get_badge(badge_name, "_global", scale)
return caches[RequestType.BADGE][channel_id][cachename] return caches[RequestType.BADGE][channel_id][cachename]
func get_emote(emote_id : String, scale = "1.0") -> ImageTexture: func get_emote(emote_id : String, scale = "1.0") -> ImageTexture:

View File

@ -24,6 +24,11 @@ _global_script_classes=[ {
"language": "GDScript", "language": "GDScript",
"path": "res://addons/gift/gift_node.gd" "path": "res://addons/gift/gift_node.gd"
}, { }, {
"base": "Resource",
"class": "ImageCache",
"language": "GDScript",
"path": "res://addons/gift/util/image_cache.gd"
}, {
"base": "Reference", "base": "Reference",
"class": "SenderData", "class": "SenderData",
"language": "GDScript", "language": "GDScript",
@ -33,6 +38,7 @@ _global_script_class_icons={
"CommandData": "", "CommandData": "",
"CommandInfo": "", "CommandInfo": "",
"Gift": "", "Gift": "",
"ImageCache": "",
"SenderData": "" "SenderData": ""
} }
@ -47,6 +53,10 @@ config/icon="res://icon.png"
gdscript/warnings/unused_argument=false gdscript/warnings/unused_argument=false
gdscript/warnings/return_value_discarded=false gdscript/warnings/return_value_discarded=false
[display]
window/size/width=400
[editor_plugins] [editor_plugins]
enabled=PoolStringArray( "gift" ) enabled=PoolStringArray( "gift" )