mirror of
https://github.com/Relintai/godot-resources-as-sheets-plugin.git
synced 2025-04-08 17:41:50 +02:00
Allow dictionary multi-edit
This commit is contained in:
parent
8250fdcef3
commit
ac45cf42be
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=28 format=3 uid="uid://tmleonv20aqk"]
|
||||
[gd_scene load_steps=29 format=3 uid="uid://tmleonv20aqk"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/resources_spreadsheet_view/editor_view.gd" id="1_wfx75"]
|
||||
[ext_resource type="Script" path="res://addons/resources_spreadsheet_view/editor_color_setter.gd" id="2_t2s7k"]
|
||||
@ -10,9 +10,10 @@
|
||||
[ext_resource type="PackedScene" uid="uid://ddqak780cwwfj" path="res://addons/resources_spreadsheet_view/typed_editors/dock_enum_array.tscn" id="8_234wn"]
|
||||
[ext_resource type="PackedScene" uid="uid://c3a2cip8ffccv" path="res://addons/resources_spreadsheet_view/typed_editors/dock_array.tscn" id="9_nts08"]
|
||||
[ext_resource type="PackedScene" uid="uid://b3a3bo6cfyh5t" path="res://addons/resources_spreadsheet_view/typed_editors/dock_color.tscn" id="10_nsma2"]
|
||||
[ext_resource type="PackedScene" path="res://addons/resources_spreadsheet_view/typed_editors/dock_number.tscn" id="11_q1ao4"]
|
||||
[ext_resource type="PackedScene" uid="uid://gtbf7b0wptv" path="res://addons/resources_spreadsheet_view/typed_editors/dock_number.tscn" id="11_q1ao4"]
|
||||
[ext_resource type="PackedScene" uid="uid://rww3gpl052bn" path="res://addons/resources_spreadsheet_view/typed_editors/dock_texture.tscn" id="12_4kr6q"]
|
||||
[ext_resource type="PackedScene" uid="uid://dhunxgcae6h1" path="res://addons/resources_spreadsheet_view/settings_grid.tscn" id="13_as1sh"]
|
||||
[ext_resource type="PackedScene" uid="uid://p6x03dbvhnqw" path="res://addons/resources_spreadsheet_view/typed_editors/dock_dict.tscn" id="13_il556"]
|
||||
[ext_resource type="Script" path="res://addons/resources_spreadsheet_view/main_screen/input_handler.gd" id="14_2t57a"]
|
||||
[ext_resource type="PackedScene" uid="uid://b413igx28kkvb" path="res://addons/resources_spreadsheet_view/import_export/import_export_dialog.tscn" id="14_3p12b"]
|
||||
[ext_resource type="Script" path="res://addons/resources_spreadsheet_view/main_screen/selection_manager.gd" id="15_mx6qn"]
|
||||
@ -414,6 +415,10 @@ layout_mode = 2
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="EditDict" parent="HeaderContentSplit/MarginContainer/FooterContentSplit/Footer/PropertyEditors" instance=ExtResource("13_il556")]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="EditColor" parent="HeaderContentSplit/MarginContainer/FooterContentSplit/Footer/PropertyEditors" instance=ExtResource("10_nsma2")]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
@ -104,9 +104,18 @@ func _add_recent(value):
|
||||
if x.text == str(value):
|
||||
return
|
||||
|
||||
if value is Resource and x.tooltip_text == value.resource_path:
|
||||
return
|
||||
|
||||
var node := Button.new()
|
||||
node.text = str(value)
|
||||
node.self_modulate = Color(value.hash()) + Color(0.25, 0.25, 0.25, 1.0)
|
||||
var value_str : String = str(value)
|
||||
if value is Resource:
|
||||
value_str = value.resource_path.get_file()
|
||||
node.tooltip_text = value.resource_path
|
||||
value = value.resource_path
|
||||
|
||||
node.text = value_str
|
||||
node.self_modulate = Color(value_str.hash()) + Color(0.25, 0.25, 0.25, 1.0)
|
||||
node.pressed.connect(_on_recent_clicked.bind(node, value))
|
||||
recent_container.add_child(node)
|
||||
|
||||
@ -166,7 +175,6 @@ func _on_Int_pressed():
|
||||
|
||||
|
||||
func _on_String_pressed():
|
||||
if value_input.text == "": return
|
||||
_add_value(value_input.text)
|
||||
_add_recent(value_input.text)
|
||||
|
||||
|
131
addons/resources_spreadsheet_view/typed_editors/dock_dict.gd
Normal file
131
addons/resources_spreadsheet_view/typed_editors/dock_dict.gd
Normal file
@ -0,0 +1,131 @@
|
||||
@tool
|
||||
extends "res://addons/resources_spreadsheet_view/typed_editors/dock_array.gd"
|
||||
|
||||
enum {
|
||||
KEY_TYPE_STRINGNAME = 0,
|
||||
KEY_TYPE_INT,
|
||||
KEY_TYPE_FLOAT,
|
||||
KEY_TYPE_OBJECT,
|
||||
KEY_TYPE_VARIANT,
|
||||
}
|
||||
|
||||
@onready var key_input := $"HBoxContainer/HBoxContainer/Control/VBoxContainer/KeyEdit/KeyEdit"
|
||||
@onready var key_type := $"HBoxContainer/HBoxContainer/Control/VBoxContainer/KeyEdit/KeyType"
|
||||
|
||||
var _key_type_selected := 0
|
||||
|
||||
|
||||
func try_edit_value(value, type, property_hint) -> bool:
|
||||
if type != TYPE_DICTIONARY and type != TYPE_OBJECT:
|
||||
return false
|
||||
|
||||
if value is Texture2D:
|
||||
# For textures, prefer the specialized dock.
|
||||
return false
|
||||
|
||||
key_type.visible = type != TYPE_OBJECT
|
||||
|
||||
_stored_type = type
|
||||
if type == TYPE_DICTIONARY:
|
||||
_stored_value = value.duplicate()
|
||||
|
||||
contents_label.text = str(value)
|
||||
|
||||
return true
|
||||
|
||||
|
||||
func _add_value(value):
|
||||
var key = _get_key_from_box()
|
||||
_stored_value[key] = value
|
||||
|
||||
var values = sheet.get_edited_cells_values()
|
||||
var cur_value
|
||||
var dupe_value : bool = ProjectSettings.get_setting(SettingsGrid.SETTING_PREFIX + "dupe_arrays")
|
||||
for i in values.size():
|
||||
cur_value = values[i]
|
||||
if dupe_value and (_stored_type == TYPE_DICTIONARY or cur_value.resource_path.rfind("::") != -1):
|
||||
cur_value = cur_value.duplicate()
|
||||
|
||||
cur_value[key] = value
|
||||
values[i] = cur_value
|
||||
|
||||
sheet.set_edited_cells_values(values)
|
||||
super._add_recent(key)
|
||||
|
||||
|
||||
func _remove_value(_value):
|
||||
var key = _get_key_from_box()
|
||||
_stored_value.erase(key)
|
||||
|
||||
var values = sheet.get_edited_cells_values()
|
||||
var cur_value
|
||||
var dupe_value : bool = ProjectSettings.get_setting(SettingsGrid.SETTING_PREFIX + "dupe_arrays")
|
||||
for i in values.size():
|
||||
cur_value = values[i]
|
||||
if dupe_value and (_stored_type == TYPE_DICTIONARY or cur_value.resource_path.rfind("::") != -1):
|
||||
cur_value = cur_value.duplicate()
|
||||
|
||||
cur_value.erase(key)
|
||||
values[i] = cur_value
|
||||
|
||||
sheet.set_edited_cells_values(values)
|
||||
|
||||
|
||||
func _get_key_from_box():
|
||||
if _stored_type == TYPE_OBJECT:
|
||||
return StringName(key_input.text)
|
||||
|
||||
match _key_type_selected:
|
||||
KEY_TYPE_STRINGNAME:
|
||||
return StringName(key_input.text)
|
||||
|
||||
KEY_TYPE_INT:
|
||||
return key_input.text.to_int()
|
||||
|
||||
KEY_TYPE_FLOAT:
|
||||
return key_input.text.to_float()
|
||||
|
||||
KEY_TYPE_OBJECT:
|
||||
return load(key_input.text)
|
||||
|
||||
KEY_TYPE_VARIANT:
|
||||
return str_to_var(key_input.text)
|
||||
|
||||
|
||||
func _on_Replace_pressed():
|
||||
# TODO
|
||||
pass
|
||||
|
||||
|
||||
func _add_recent(_value):
|
||||
pass
|
||||
|
||||
|
||||
func _on_recent_clicked(button, value):
|
||||
var val = recent_container.get_child(1).selected
|
||||
key_input.text = str(value)
|
||||
if val == 0:
|
||||
# Do nothing! What if the value for the key doesn't match?
|
||||
pass
|
||||
|
||||
if val == 1:
|
||||
_remove_value(value)
|
||||
|
||||
if val == 2:
|
||||
button.queue_free()
|
||||
|
||||
|
||||
func _on_key_type_selected(index : int):
|
||||
_key_type_selected = index
|
||||
|
||||
|
||||
func _on_AddRecentFromSel_pressed():
|
||||
for x in sheet.get_edited_cells_values():
|
||||
if _stored_type == TYPE_OBJECT:
|
||||
for y in x.get_property_list():
|
||||
if y[&"usage"] & PROPERTY_USAGE_EDITOR != 0:
|
||||
super._add_recent(y[&"name"])
|
||||
|
||||
else:
|
||||
for y in x:
|
||||
super._add_recent(y)
|
215
addons/resources_spreadsheet_view/typed_editors/dock_dict.tscn
Normal file
215
addons/resources_spreadsheet_view/typed_editors/dock_dict.tscn
Normal file
@ -0,0 +1,215 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://p6x03dbvhnqw"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/resources_spreadsheet_view/typed_editors/dock_dict.gd" id="1_2yivi"]
|
||||
[ext_resource type="Script" path="res://addons/resources_spreadsheet_view/editor_icon_button.gd" id="2_yck0k"]
|
||||
|
||||
[sub_resource type="Image" id="Image_aiqvb"]
|
||||
data = {
|
||||
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 131, 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, 93, 93, 131, 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, 93, 93, 131, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 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, 93, 93, 55, 255, 97, 97, 58, 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, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 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, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 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, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 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_3oshq"]
|
||||
image = SubResource("Image_aiqvb")
|
||||
|
||||
[node name="EditArray" type="VBoxContainer"]
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
grow_horizontal = 2
|
||||
mouse_filter = 0
|
||||
script = ExtResource("1_2yivi")
|
||||
|
||||
[node name="Header" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Header"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="Label" parent="Header/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "EDIT: Dict/Object"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="Header/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="Label" parent="Header"]
|
||||
layout_mode = 2
|
||||
text = "PROPERTY NAME"
|
||||
|
||||
[node name="HSeparator2" type="HSeparator" parent="Header"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="HBoxContainer" type="HSplitContainer" parent="."]
|
||||
layout_mode = 2
|
||||
split_offset = 520
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 2
|
||||
|
||||
[node name="Panel" type="MarginContainer" parent="HBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="TextEdit" parent="HBoxContainer/HBoxContainer/Panel"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 5
|
||||
text = "[]"
|
||||
|
||||
[node name="VSeparator2" type="VSeparator" parent="HBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Control" type="HBoxContainer" parent="HBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer/HBoxContainer/Control"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="KeyEdit" type="HBoxContainer" parent="HBoxContainer/HBoxContainer/Control/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="KeyEdit" type="LineEdit" parent="HBoxContainer/HBoxContainer/Control/VBoxContainer/KeyEdit"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
placeholder_text = "Input key to add/change/erase..."
|
||||
clear_button_enabled = true
|
||||
|
||||
[node name="KeyType" type="OptionButton" parent="HBoxContainer/HBoxContainer/Control/VBoxContainer/KeyEdit"]
|
||||
layout_mode = 2
|
||||
item_count = 5
|
||||
selected = 0
|
||||
fit_to_longest_item = false
|
||||
popup/item_0/text = "Stringname"
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "Int"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "Float"
|
||||
popup/item_2/id = 2
|
||||
popup/item_3/text = "Resource path"
|
||||
popup/item_3/id = 4
|
||||
popup/item_4/text = "Guess type"
|
||||
popup/item_4/id = 3
|
||||
|
||||
[node name="LineEdit" type="LineEdit" parent="HBoxContainer/HBoxContainer/Control/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
placeholder_text = "Input value..."
|
||||
clear_button_enabled = true
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer/HBoxContainer/Control/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="HBoxContainer/HBoxContainer/Control/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Set value with type:"
|
||||
|
||||
[node name="String" type="Button" parent="HBoxContainer/HBoxContainer/Control/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Set to string"
|
||||
icon = SubResource("ImageTexture_3oshq")
|
||||
script = ExtResource("2_yck0k")
|
||||
icon_name = "String"
|
||||
|
||||
[node name="Int" type="Button" parent="HBoxContainer/HBoxContainer/Control/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Set to integer"
|
||||
icon = SubResource("ImageTexture_3oshq")
|
||||
script = ExtResource("2_yck0k")
|
||||
icon_name = "int"
|
||||
|
||||
[node name="Float" type="Button" parent="HBoxContainer/HBoxContainer/Control/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Set to float"
|
||||
icon = SubResource("ImageTexture_3oshq")
|
||||
script = ExtResource("2_yck0k")
|
||||
icon_name = "float"
|
||||
|
||||
[node name="Variant" type="Button" parent="HBoxContainer/HBoxContainer/Control/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Guess type and set"
|
||||
icon = SubResource("ImageTexture_3oshq")
|
||||
script = ExtResource("2_yck0k")
|
||||
icon_name = "Variant"
|
||||
|
||||
[node name="Object" type="Button" parent="HBoxContainer/HBoxContainer/Control/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Set to resource (by path if string)"
|
||||
icon = SubResource("ImageTexture_3oshq")
|
||||
script = ExtResource("2_yck0k")
|
||||
icon_name = "Object"
|
||||
|
||||
[node name="Label2" type="Label" parent="HBoxContainer/HBoxContainer/Control/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Key:"
|
||||
|
||||
[node name="Remove" type="Button" parent="HBoxContainer/HBoxContainer/Control/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Erase keys in Key textbox"
|
||||
icon = SubResource("ImageTexture_3oshq")
|
||||
script = ExtResource("2_yck0k")
|
||||
icon_name = "Remove"
|
||||
|
||||
[node name="Replace" type="Button" parent="HBoxContainer/HBoxContainer/Control/VBoxContainer/HBoxContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
tooltip_text = "Replace Keys with key in Value box"
|
||||
icon = SubResource("ImageTexture_3oshq")
|
||||
script = ExtResource("2_yck0k")
|
||||
icon_name = "Override"
|
||||
|
||||
[node name="VSeparator" type="VSeparator" parent="HBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Control2" type="MarginContainer" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer/Control2"]
|
||||
layout_mode = 2
|
||||
alignment = 2
|
||||
|
||||
[node name="VSeparator2" type="VSeparator" parent="HBoxContainer/Control2/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HFlowContainer" type="HFlowContainer" parent="HBoxContainer/Control2/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="Label" parent="HBoxContainer/Control2/HBoxContainer/HFlowContainer"]
|
||||
layout_mode = 2
|
||||
text = "Recent:"
|
||||
|
||||
[node name="OptionButton" type="OptionButton" parent="HBoxContainer/Control2/HBoxContainer/HFlowContainer"]
|
||||
layout_mode = 2
|
||||
item_count = 3
|
||||
selected = 0
|
||||
fit_to_longest_item = false
|
||||
popup/item_0/text = "Add"
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "Erase"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "Remove From Recent"
|
||||
popup/item_2/id = 2
|
||||
|
||||
[node name="AddRecentFromSel" type="Button" parent="HBoxContainer/Control2/HBoxContainer/HFlowContainer"]
|
||||
layout_mode = 2
|
||||
tooltip_text = "Add from selected cells"
|
||||
icon = SubResource("ImageTexture_3oshq")
|
||||
script = ExtResource("2_yck0k")
|
||||
icon_name = "ListSelect"
|
||||
|
||||
[connection signal="item_selected" from="HBoxContainer/HBoxContainer/Control/VBoxContainer/KeyEdit/KeyType" to="." method="_on_key_type_selected"]
|
||||
[connection signal="pressed" from="HBoxContainer/HBoxContainer/Control/VBoxContainer/HBoxContainer/String" to="." method="_on_String_pressed"]
|
||||
[connection signal="pressed" from="HBoxContainer/HBoxContainer/Control/VBoxContainer/HBoxContainer/Int" to="." method="_on_Int_pressed"]
|
||||
[connection signal="pressed" from="HBoxContainer/HBoxContainer/Control/VBoxContainer/HBoxContainer/Float" to="." method="_on_Float_pressed"]
|
||||
[connection signal="pressed" from="HBoxContainer/HBoxContainer/Control/VBoxContainer/HBoxContainer/Variant" to="." method="_on_Variant_pressed"]
|
||||
[connection signal="pressed" from="HBoxContainer/HBoxContainer/Control/VBoxContainer/HBoxContainer/Object" to="." method="_on_Resource_pressed"]
|
||||
[connection signal="pressed" from="HBoxContainer/HBoxContainer/Control/VBoxContainer/HBoxContainer/Remove" to="." method="_on_Remove_pressed"]
|
||||
[connection signal="pressed" from="HBoxContainer/HBoxContainer/Control/VBoxContainer/HBoxContainer/Replace" to="." method="_on_Replace_pressed"]
|
||||
[connection signal="pressed" from="HBoxContainer/Control2/HBoxContainer/HFlowContainer/AddRecentFromSel" to="." method="_on_AddRecentFromSel_pressed"]
|
@ -1,70 +1,52 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
[gd_scene load_steps=2 format=3 uid="uid://gtbf7b0wptv"]
|
||||
|
||||
[ext_resource path="res://addons/resources_spreadsheet_view/typed_editors/dock_number.gd" type="Script" id=1]
|
||||
[ext_resource type="Script" path="res://addons/resources_spreadsheet_view/typed_editors/dock_number.gd" id="1"]
|
||||
|
||||
[node name="EditNumber" type="VBoxContainer"]
|
||||
margin_bottom = 86.0
|
||||
rect_pivot_offset = Vector2( -460, -28 )
|
||||
mouse_filter = 0
|
||||
script = ExtResource( 1 )
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="Header" type="HBoxContainer" parent="."]
|
||||
margin_right = 1024.0
|
||||
margin_bottom = 14.0
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Header"]
|
||||
margin_right = 455.0
|
||||
margin_bottom = 14.0
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="Label" parent="Header/HBoxContainer"]
|
||||
margin_right = 89.0
|
||||
margin_bottom = 14.0
|
||||
layout_mode = 2
|
||||
text = "EDIT: Number"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="Header/HBoxContainer"]
|
||||
margin_left = 93.0
|
||||
margin_right = 455.0
|
||||
margin_bottom = 14.0
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="Label" parent="Header"]
|
||||
margin_left = 459.0
|
||||
margin_right = 565.0
|
||||
margin_bottom = 14.0
|
||||
layout_mode = 2
|
||||
text = "PROPERTY NAME"
|
||||
|
||||
[node name="HSeparator2" type="HSeparator" parent="Header"]
|
||||
margin_left = 569.0
|
||||
margin_right = 1024.0
|
||||
margin_bottom = 14.0
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
margin_top = 18.0
|
||||
margin_right = 1024.0
|
||||
margin_bottom = 84.0
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="CustomX2" type="VBoxContainer" parent="HBoxContainer"]
|
||||
margin_left = 202.0
|
||||
margin_right = 384.0
|
||||
margin_bottom = 66.0
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer3" type="HBoxContainer" parent="HBoxContainer/CustomX2"]
|
||||
margin_right = 182.0
|
||||
margin_bottom = 14.0
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="HBoxContainer/CustomX2/HBoxContainer3"]
|
||||
margin_right = 116.0
|
||||
margin_bottom = 14.0
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 6
|
||||
text = "Fill with Sequence"
|
||||
|
||||
[node name="Label2" type="Label" parent="HBoxContainer/CustomX2/HBoxContainer3"]
|
||||
margin_left = 120.0
|
||||
margin_right = 134.0
|
||||
margin_bottom = 14.0
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 6
|
||||
tooltip_text = "Fill selected cells with a number sequence. Order is the same as the cells were selected.
|
||||
- You must specify Start.
|
||||
- If all values specified, selected cells will have a repeating sequence
|
||||
@ -75,192 +57,127 @@ of numbers from Start to End, with increment of Step, not including End.
|
||||
step based on cell count."
|
||||
mouse_filter = 0
|
||||
mouse_default_cursor_shape = 16
|
||||
size_flags_vertical = 6
|
||||
text = "(?)"
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer/CustomX2"]
|
||||
margin_top = 18.0
|
||||
margin_right = 182.0
|
||||
margin_bottom = 42.0
|
||||
layout_mode = 2
|
||||
|
||||
[node name="LineEdit" type="LineEdit" parent="HBoxContainer/CustomX2/HBoxContainer"]
|
||||
margin_right = 58.0
|
||||
margin_bottom = 24.0
|
||||
layout_mode = 2
|
||||
tooltip_text = "Start (must not be blank)"
|
||||
placeholder_text = "Start *"
|
||||
|
||||
[node name="LineEdit2" type="LineEdit" parent="HBoxContainer/CustomX2/HBoxContainer"]
|
||||
margin_left = 62.0
|
||||
margin_right = 120.0
|
||||
margin_bottom = 24.0
|
||||
layout_mode = 2
|
||||
tooltip_text = "End"
|
||||
placeholder_text = "End"
|
||||
|
||||
[node name="LineEdit3" type="LineEdit" parent="HBoxContainer/CustomX2/HBoxContainer"]
|
||||
margin_left = 124.0
|
||||
margin_right = 182.0
|
||||
margin_bottom = 24.0
|
||||
layout_mode = 2
|
||||
tooltip_text = "End"
|
||||
placeholder_text = "Step"
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="HBoxContainer/CustomX2"]
|
||||
margin_top = 46.0
|
||||
margin_right = 182.0
|
||||
margin_bottom = 66.0
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SequenceFill" type="Button" parent="HBoxContainer/CustomX2/HBoxContainer2"]
|
||||
margin_right = 89.0
|
||||
margin_bottom = 20.0
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Replace"
|
||||
|
||||
[node name="SequenceFill2" type="Button" parent="HBoxContainer/CustomX2/HBoxContainer2"]
|
||||
margin_left = 93.0
|
||||
margin_right = 182.0
|
||||
margin_bottom = 20.0
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Add"
|
||||
|
||||
[node name="VSeparator2" type="VSeparator" parent="HBoxContainer"]
|
||||
margin_left = 388.0
|
||||
margin_right = 392.0
|
||||
margin_bottom = 66.0
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="VBoxContainer" parent="HBoxContainer"]
|
||||
margin_left = 396.0
|
||||
margin_right = 620.0
|
||||
margin_bottom = 66.0
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="NumberPanel" type="MarginContainer" parent="HBoxContainer/HBoxContainer"]
|
||||
margin_right = 224.0
|
||||
margin_bottom = 18.0
|
||||
rect_min_size = Vector2( 96, 0 )
|
||||
mouse_default_cursor_shape = 10
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
custom_constants/margin_right = 0
|
||||
custom_constants/margin_top = 0
|
||||
custom_constants/margin_left = 0
|
||||
custom_constants/margin_bottom = 0
|
||||
mouse_default_cursor_shape = 10
|
||||
|
||||
[node name="Panel" type="Panel" parent="HBoxContainer/HBoxContainer/NumberPanel"]
|
||||
margin_right = 224.0
|
||||
margin_bottom = 18.0
|
||||
layout_mode = 2
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="Label" type="Label" parent="HBoxContainer/HBoxContainer/NumberPanel"]
|
||||
margin_top = 2.0
|
||||
margin_right = 224.0
|
||||
margin_bottom = 16.0
|
||||
layout_mode = 2
|
||||
text = "1"
|
||||
valign = 1
|
||||
clip_text = true
|
||||
|
||||
[node name="GridContainer" type="GridContainer" parent="HBoxContainer/HBoxContainer"]
|
||||
margin_top = 22.0
|
||||
margin_right = 224.0
|
||||
margin_bottom = 66.0
|
||||
layout_mode = 2
|
||||
columns = 6
|
||||
|
||||
[node name="Button15" type="Button" parent="HBoxContainer/HBoxContainer/GridContainer"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 20.0
|
||||
layout_mode = 2
|
||||
text = "+0.1"
|
||||
|
||||
[node name="Button12" type="Button" parent="HBoxContainer/HBoxContainer/GridContainer"]
|
||||
margin_left = 44.0
|
||||
margin_right = 72.0
|
||||
margin_bottom = 20.0
|
||||
layout_mode = 2
|
||||
text = "+1"
|
||||
|
||||
[node name="Button8" type="Button" parent="HBoxContainer/HBoxContainer/GridContainer"]
|
||||
margin_left = 76.0
|
||||
margin_right = 112.0
|
||||
margin_bottom = 20.0
|
||||
layout_mode = 2
|
||||
text = "+10"
|
||||
|
||||
[node name="Button13" type="Button" parent="HBoxContainer/HBoxContainer/GridContainer"]
|
||||
margin_left = 116.0
|
||||
margin_right = 160.0
|
||||
margin_bottom = 20.0
|
||||
layout_mode = 2
|
||||
text = "+100"
|
||||
|
||||
[node name="Button9" type="Button" parent="HBoxContainer/HBoxContainer/GridContainer"]
|
||||
margin_left = 164.0
|
||||
margin_right = 192.0
|
||||
margin_bottom = 20.0
|
||||
layout_mode = 2
|
||||
text = "+X"
|
||||
|
||||
[node name="Button16" type="Button" parent="HBoxContainer/HBoxContainer/GridContainer"]
|
||||
margin_left = 196.0
|
||||
margin_right = 224.0
|
||||
margin_bottom = 20.0
|
||||
layout_mode = 2
|
||||
text = "*X"
|
||||
|
||||
[node name="Button14" type="Button" parent="HBoxContainer/HBoxContainer/GridContainer"]
|
||||
margin_top = 24.0
|
||||
margin_right = 40.0
|
||||
margin_bottom = 44.0
|
||||
layout_mode = 2
|
||||
text = "-0.1"
|
||||
|
||||
[node name="Button11" type="Button" parent="HBoxContainer/HBoxContainer/GridContainer"]
|
||||
margin_left = 44.0
|
||||
margin_top = 24.0
|
||||
margin_right = 72.0
|
||||
margin_bottom = 44.0
|
||||
layout_mode = 2
|
||||
text = "-1"
|
||||
|
||||
[node name="Button7" type="Button" parent="HBoxContainer/HBoxContainer/GridContainer"]
|
||||
margin_left = 76.0
|
||||
margin_top = 24.0
|
||||
margin_right = 112.0
|
||||
margin_bottom = 44.0
|
||||
layout_mode = 2
|
||||
text = "-10"
|
||||
|
||||
[node name="Button10" type="Button" parent="HBoxContainer/HBoxContainer/GridContainer"]
|
||||
margin_left = 116.0
|
||||
margin_top = 24.0
|
||||
margin_right = 160.0
|
||||
margin_bottom = 44.0
|
||||
layout_mode = 2
|
||||
text = "-100"
|
||||
|
||||
[node name="Button4" type="Button" parent="HBoxContainer/HBoxContainer/GridContainer"]
|
||||
margin_left = 164.0
|
||||
margin_top = 24.0
|
||||
margin_right = 192.0
|
||||
margin_bottom = 44.0
|
||||
layout_mode = 2
|
||||
text = "-X"
|
||||
|
||||
[node name="Button5" type="Button" parent="HBoxContainer/HBoxContainer/GridContainer"]
|
||||
margin_left = 196.0
|
||||
margin_top = 24.0
|
||||
margin_right = 224.0
|
||||
margin_bottom = 44.0
|
||||
layout_mode = 2
|
||||
text = "/X"
|
||||
|
||||
[node name="VSeparator" type="VSeparator" parent="HBoxContainer"]
|
||||
margin_left = 624.0
|
||||
margin_right = 628.0
|
||||
margin_bottom = 66.0
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CustomX" type="VBoxContainer" parent="HBoxContainer"]
|
||||
margin_left = 632.0
|
||||
margin_right = 822.0
|
||||
margin_bottom = 66.0
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="HBoxContainer/CustomX"]
|
||||
margin_top = 12.0
|
||||
margin_right = 190.0
|
||||
margin_bottom = 26.0
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 6
|
||||
text = "Custom Value (for +X buttons)"
|
||||
|
||||
[node name="LineEdit" type="LineEdit" parent="HBoxContainer/CustomX"]
|
||||
margin_top = 42.0
|
||||
margin_right = 190.0
|
||||
margin_bottom = 66.0
|
||||
layout_mode = 2
|
||||
text = "1000"
|
||||
|
||||
[connection signal="pressed" from="HBoxContainer/CustomX2/HBoxContainer2/SequenceFill" to="." method="_on_SequenceFill_pressed"]
|
||||
[connection signal="pressed" from="HBoxContainer/CustomX2/HBoxContainer2/SequenceFill2" to="." method="_on_SequenceFill_pressed" binds= [ true ]]
|
||||
[connection signal="pressed" from="HBoxContainer/CustomX2/HBoxContainer2/SequenceFill2" to="." method="_on_SequenceFill_pressed" binds= [true]]
|
||||
[connection signal="gui_input" from="HBoxContainer/HBoxContainer/NumberPanel" to="." method="_on_NumberPanel_gui_input"]
|
||||
|
Loading…
Reference in New Issue
Block a user