added the game

This commit is contained in:
JHDev2006
2025-09-13 16:30:32 +01:00
parent 5ef689109b
commit 3773bdaf64
3616 changed files with 263702 additions and 0 deletions

View File

@@ -0,0 +1 @@
uid://d1yeemsw0ujl7

View File

@@ -0,0 +1,35 @@
@tool
extends Window
signal dir_selected(dir_path)
@onready var directory_list: VBoxContainer = $"%DirectoryList"
func generate_dir_buttons(dir_path: String) -> void:
clear_directory_list()
var dir_paths := _ModLoaderPath.get_dir_paths_in_dir(dir_path)
for path in dir_paths:
var dir_name: String = path.split('/')[-1]
var dir_btn := Button.new()
dir_btn.text = dir_name
directory_list.add_child(dir_btn)
dir_btn.pressed.connect(_on_dir_btn_dir_selected.bind(path))
func clear_directory_list() -> void:
for child in directory_list.get_children():
directory_list.remove_child(child)
child.queue_free()
func _on_dir_btn_dir_selected(path: String) -> void:
dir_selected.emit(path)
func _on_close_requested() -> void:
hide()

View File

@@ -0,0 +1 @@
uid://dyxgsmyqpv8e2

View File

@@ -0,0 +1,31 @@
[gd_scene load_steps=2 format=3 uid="uid://du17jjwqtopix"]
[ext_resource type="Script" path="res://addons/mod_tool/interface/global/directory_selection/select_directory.gd" id="1"]
[node name="SelectDirectory" type="Window"]
initial_position = 2
size = Vector2i(400, 250)
script = ExtResource("1")
[node name="MarginContainer" type="MarginContainer" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 25
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10
[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="DirectoryList" type="VBoxContainer" parent="MarginContainer/ScrollContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
[connection signal="close_requested" from="." to="." method="_on_close_requested"]

View File

@@ -0,0 +1,66 @@
@tool
class_name ModToolInterfaceInput
extends HBoxContainer
signal value_changed(new_value, input_node)
@export var is_required: bool:
set = set_is_required
@export var key: String
@export var label_text: String:
set = set_label_text
@export var editor_icon_name: String = "NodeWarning"
@export var hint_text: String:
set = set_hint_text
var is_valid := true: set = set_is_valid
func _ready() -> void:
# Set up warning icons to show if a field is invalid
set_editor_icon(editor_icon_name)
func set_is_required(required: bool) -> void:
is_required = required
set_label_text(label_text)
func set_is_valid(new_is_valid: bool) -> void:
is_valid = new_is_valid
show_error_if_not(is_valid)
func set_label_text(new_text: String) -> void:
label_text = new_text
$Label.text = new_text if is_required else new_text + " (optional)"
func set_hint_text(new_text: String) -> void:
hint_text = new_text
tooltip_text = new_text
mouse_default_cursor_shape = CURSOR_ARROW if new_text == "" else CURSOR_HELP
func set_editor_icon(icon_name: String) -> void:
var mod_tool_store: ModToolStore = get_node_or_null("/root/ModToolStore")
if icon_name and mod_tool_store:
set_error_icon(mod_tool_store.editor_base_control.get_theme_icon(icon_name, "EditorIcons"))
func set_error_icon(icon: Texture2D) -> void:
$"%ErrorIcon".texture = icon
func show_error_if_not(condition: bool) -> void:
if not condition:
$"%ErrorIcon".self_modulate = Color.WHITE
else:
$"%ErrorIcon".self_modulate = Color.TRANSPARENT
func validate(_condition: bool) -> bool:
printerr("Implement a validation method")
return false

View File

@@ -0,0 +1 @@
uid://rtvobwnj2vbx

View File

@@ -0,0 +1,42 @@
@tool
class_name ModToolInterfaceInputOptions
extends ModToolInterfaceInput
@export var input_options: Array[String]: set = set_input_options
func set_input_options(new_options: Array[String]) -> void:
input_options = new_options
var input: OptionButton = get_node_or_null("%Input") as OptionButton
if not input or new_options.is_empty(): return # node can't be found directly after reloading the plugin
input.clear()
for option in input_options:
input.add_item(option)
input.select(0)
func get_input_value() -> int:
return ($"%Input" as OptionButton).get_selected_id()
func get_input_string() -> String:
if get_input_value() == -1:
return ""
return input_options[get_input_value()]
func validate(condition: bool) -> bool:
# Check if input is required and empty
if is_required and get_input_value() == -1:
is_valid = false
return false
# Invalidate field if the condition is not met
is_valid = condition
return is_valid
func _on_Input_item_selected(index: int) -> void:
emit_signal("value_changed", get_input_string(), self)

View File

@@ -0,0 +1 @@
uid://8rtbm4ypixcs

View File

@@ -0,0 +1,43 @@
[gd_scene load_steps=4 format=3 uid="uid://dyunxqcmy4esi"]
[ext_resource type="Script" path="res://addons/mod_tool/interface/global/input_options.gd" id="1"]
[sub_resource type="Image" id="Image_43403"]
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_xi7aw"]
image = SubResource("Image_43403")
[node name="InputOptions" type="HBoxContainer"]
anchors_preset = 10
anchor_right = 1.0
offset_bottom = 32.0
script = ExtResource("1")
[node name="Label" type="Label" parent="."]
layout_mode = 2
size_flags_horizontal = 3
text = " (optional)"
clip_text = true
[node name="ErrorIcon" type="TextureRect" parent="."]
unique_name_in_owner = true
self_modulate = Color(1, 1, 1, 0)
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
texture = SubResource("ImageTexture_xi7aw")
expand_mode = 1
stretch_mode = 6
[node name="Input" type="OptionButton" parent="."]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
[connection signal="item_selected" from="Input" to="." method="_on_Input_item_selected"]

View File

@@ -0,0 +1,63 @@
@tool
class_name ModToolInterfaceInputString
extends ModToolInterfaceInput
@export var is_editable := true: set = set_is_editable
@export var input_text: String: set = set_input_text
@export var input_placeholder: String: set = set_input_placeholder
func set_input_text(new_text: String) -> void:
input_text = new_text
$"%Input".text = new_text
emit_signal("value_changed", new_text, self)
func set_input_placeholder(new_text: String) -> void:
input_placeholder = new_text
$"%Input".placeholder_text = new_text
func set_is_editable(new_is_editable: bool) -> void:
is_editable = new_is_editable
$"%Input".editable = new_is_editable
func get_input_value() -> String:
return $"%Input".text.strip_edges()
# Gets the values of a comma separated string as an Array,
# strips any white space contained in this values.
func get_input_as_array_from_comma_separated_string() -> Array:
var string_split := get_input_value().split(",", false)
var array := []
for string in string_split:
array.append(string.strip_edges())
return array
func validate(condition: bool) -> bool:
# Check if input is required and empty
if is_required and get_input_value() == "":
is_valid = false
return false
# Invalidate field if the condition is not met
self.is_valid = condition
return is_valid
func emit_value_changed() -> void:
emit_signal("value_changed", get_input_value(), self)
func _on_Input_text_changed(new_text: String) -> void:
emit_value_changed()
func _on_Mutiline_Input_text_changed() -> void:
emit_value_changed()

View File

@@ -0,0 +1 @@
uid://itwpownujndt

View File

@@ -0,0 +1,43 @@
[gd_scene load_steps=4 format=3 uid="uid://icwo58h0rdb5"]
[ext_resource type="Script" path="res://addons/mod_tool/interface/global/input_string.gd" id="1"]
[sub_resource type="Image" id="Image_6wlu1"]
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, 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, 255, 255, 0, 255, 255, 255, 0, 255, 255, 43, 6, 255, 250, 10, 183, 255, 252, 10, 179, 255, 255, 0, 5, 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, 250, 14, 123, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 115, 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, 8, 30, 255, 250, 10, 245, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 242, 255, 255, 19, 26, 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, 250, 10, 174, 255, 250, 10, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 250, 10, 255, 255, 250, 12, 166, 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, 252, 13, 71, 255, 250, 10, 255, 255, 250, 10, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 250, 10, 255, 255, 250, 10, 255, 255, 254, 10, 65, 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, 43, 6, 255, 252, 10, 218, 255, 250, 10, 255, 255, 250, 10, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 213, 255, 255, 0, 5, 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, 250, 14, 123, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 115, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 8, 30, 255, 250, 10, 245, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 242, 255, 255, 19, 26, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 250, 10, 174, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 12, 166, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 252, 13, 71, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 254, 10, 65, 255, 255, 255, 0, 255, 255, 255, 0, 255, 250, 10, 213, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 207, 255, 255, 255, 0, 255, 255, 255, 0, 255, 250, 12, 191, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 250, 10, 255, 255, 252, 10, 187, 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, 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_5jdd3"]
image = SubResource("Image_6wlu1")
[node name="InputString" type="HBoxContainer"]
anchors_preset = 10
anchor_right = 1.0
offset_bottom = 24.0
script = ExtResource("1")
[node name="Label" type="Label" parent="."]
layout_mode = 2
size_flags_horizontal = 3
text = " (optional)"
clip_text = true
[node name="ErrorIcon" type="TextureRect" parent="."]
unique_name_in_owner = true
self_modulate = Color(1, 1, 1, 0)
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
texture = SubResource("ImageTexture_5jdd3")
expand_mode = 1
stretch_mode = 6
[node name="Input" type="LineEdit" parent="."]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
[connection signal="text_changed" from="Input" to="." method="_on_Input_text_changed"]

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,5 @@
@tool
class_name ModToolInterfaceInputStringWithButton
extends ModToolInterfaceInputString
signal button_pressed

View File

@@ -0,0 +1 @@
uid://dkdwnp05n1vy6

View File

@@ -0,0 +1,65 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/mod_tool/interface/global/input_string_with_button.gd" type="Script" id=1]
[sub_resource type="Image" id=3]
data = {
"data": PackedByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 204, 51, 0, 255, 220, 100, 0, 255, 219, 100, 0, 255, 204, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 204, 51, 0, 255, 204, 51, 5, 255, 220, 100, 178, 255, 219, 100, 182, 255, 204, 51, 5, 255, 204, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 217, 98, 0, 255, 219, 99, 115, 255, 221, 101, 255, 255, 221, 101, 255, 255, 219, 99, 115, 255, 216, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 215, 98, 0, 255, 215, 98, 26, 255, 220, 100, 241, 255, 221, 101, 255, 255, 221, 101, 255, 255, 220, 100, 241, 255, 214, 91, 25, 255, 214, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 221, 98, 0, 255, 221, 100, 165, 255, 221, 101, 255, 255, 221, 101, 0, 255, 221, 101, 0, 255, 221, 101, 255, 255, 221, 100, 165, 255, 221, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 206, 80, 0, 255, 221, 97, 60, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 0, 255, 221, 101, 0, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 97, 60, 255, 206, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 191, 63, 0, 255, 191, 63, 4, 255, 221, 100, 210, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 0, 255, 221, 101, 0, 255, 221, 101, 255, 255, 221, 101, 255, 255, 220, 100, 209, 255, 191, 63, 4, 255, 191, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 219, 98, 0, 255, 220, 99, 110, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 0, 255, 221, 101, 0, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 220, 99, 110, 255, 219, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 218, 97, 0, 255, 218, 97, 21, 255, 220, 100, 239, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 0, 255, 221, 101, 0, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 220, 100, 239, 255, 218, 97, 21, 255, 218, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 218, 100, 0, 255, 219, 100, 160, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 219, 100, 160, 255, 218, 100, 0, 0, 0, 0, 0, 255, 218, 100, 0, 255, 218, 100, 56, 255, 220, 100, 254, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 0, 255, 221, 101, 0, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 220, 100, 254, 255, 218, 100, 56, 255, 218, 100, 0, 255, 220, 100, 0, 255, 220, 100, 193, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 0, 255, 221, 101, 0, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 220, 100, 193, 255, 220, 100, 0, 255, 221, 100, 0, 255, 221, 100, 165, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 101, 255, 255, 221, 100, 165, 255, 221, 100, 0, 0, 0, 0, 0, 255, 221, 100, 0, 255, 221, 101, 0, 255, 221, 101, 0, 255, 221, 101, 0, 255, 221, 101, 0, 255, 221, 101, 0, 255, 221, 101, 0, 255, 221, 101, 0, 255, 221, 101, 0, 255, 221, 101, 0, 255, 221, 101, 0, 255, 221, 101, 0, 255, 221, 101, 0, 255, 221, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
"format": "RGBA8",
"height": 16,
"mipmaps": false,
"width": 16
}
[sub_resource type="ImageTexture" id=2]
flags = 0
flags = 0
image = SubResource( 3 )
size = Vector2( 16, 16 )
[node name="InputStringWithButton" type="HBoxContainer"]
anchor_right = 1.0
offset_bottom = 24.0
script = ExtResource( 1 )
[node name="Label" type="Label" parent="."]
offset_top = 9.0
offset_right = 492.0
offset_bottom = 23.0
size_flags_horizontal = 3
text = " (optional)"
clip_text = true
[node name="ErrorIcon" type="TextureRect" parent="."]
unique_name_in_owner = true
self_modulate = Color( 1, 1, 1, 0 )
offset_left = 496.0
offset_right = 528.0
offset_bottom = 32.0
custom_minimum_size = Vector2( 32, 32 )
texture = SubResource( 2 )
expand = true
stretch_mode = 6
[node name="HBoxContainer" type="HBoxContainer" parent="."]
offset_left = 532.0
offset_right = 1024.0
offset_bottom = 32.0
size_flags_horizontal = 3
[node name="Input" type="LineEdit" parent="HBoxContainer"]
unique_name_in_owner = true
offset_right = 456.0
offset_bottom = 32.0
size_flags_horizontal = 3
placeholder_alpha = 0.5
[node name="Button" type="Button" parent="HBoxContainer"]
offset_left = 460.0
offset_right = 492.0
offset_bottom = 32.0
size_flags_vertical = 3
text = " ... "
[connection signal="text_changed" from="HBoxContainer/Input" to="." method="_on_Input_text_changed"]
[connection signal="pressed" from="HBoxContainer/Button" to="." method="emit_signal" binds= [ "button_pressed" ]]

View File

@@ -0,0 +1,40 @@
@tool
extends VSplitContainer
var previous_size := 0
var is_pressed := false
@onready var text_edit := get_child(0) as TextEdit
@onready var min_size_y := text_edit.custom_minimum_size.y as int
func _ready() -> void:
connect("dragged", Callable(self, "_on_dragged"))
connect("gui_input", Callable(self, "_on_gui_input"))
if get_child_count() < 2:
add_child(Control.new())
func _on_dragged(offset: int) -> void:
# offset is cumulative for the whole drag move
var new_size := previous_size + offset
if new_size < min_size_y:
text_edit.custom_minimum_size.y = min_size_y
else:
text_edit.custom_minimum_size.y = new_size
func _on_gui_input(event: InputEvent) -> void:
if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_LEFT:
if event.pressed and not is_pressed:
is_pressed = true
previous_size = text_edit.custom_minimum_size.y
else:
is_pressed = false
func _get_configuration_warnings() -> PackedStringArray:
if not get_child(0) is TextEdit:
return ["First child needs to be a TextEdit"]
return [""]

View File

@@ -0,0 +1 @@
uid://d0mkr0c6ga1va