mirror of
https://github.com/Relintai/godot-resources-as-sheets-plugin.git
synced 2025-02-21 08:34:26 +01:00
Implement enum editing
This commit is contained in:
parent
29359a1596
commit
50b6916352
@ -27,6 +27,7 @@ var all_cell_editors := []
|
|||||||
var columns := []
|
var columns := []
|
||||||
var column_types := []
|
var column_types := []
|
||||||
var column_hints := []
|
var column_hints := []
|
||||||
|
var column_hint_strings := []
|
||||||
var column_editors := []
|
var column_editors := []
|
||||||
var rows := []
|
var rows := []
|
||||||
var remembered_paths := {}
|
var remembered_paths := {}
|
||||||
@ -64,7 +65,7 @@ func _ready():
|
|||||||
# Load cell editors and instantiate them
|
# Load cell editors and instantiate them
|
||||||
for x in cell_editor_classes:
|
for x in cell_editor_classes:
|
||||||
all_cell_editors.append(x.new())
|
all_cell_editors.append(x.new())
|
||||||
all_cell_editors[all_cell_editors.size() - 1].hint_strings_array = column_hints
|
all_cell_editors[all_cell_editors.size() - 1].hint_strings_array = column_hint_strings
|
||||||
|
|
||||||
display_folder(recent_paths[0], "resource_name", false, true)
|
display_folder(recent_paths[0], "resource_name", false, true)
|
||||||
|
|
||||||
@ -136,12 +137,14 @@ func _load_resources_from_folder(folderpath : String, sort_by : String, sort_rev
|
|||||||
columns.clear()
|
columns.clear()
|
||||||
column_types.clear()
|
column_types.clear()
|
||||||
column_hints.clear()
|
column_hints.clear()
|
||||||
|
column_hint_strings.clear()
|
||||||
column_editors.clear()
|
column_editors.clear()
|
||||||
for x in res.get_property_list():
|
for x in res.get_property_list():
|
||||||
if x["usage"] & PROPERTY_USAGE_EDITOR != 0 and x["name"] != "script":
|
if x["usage"] & PROPERTY_USAGE_EDITOR != 0 and x["name"] != "script":
|
||||||
columns.append(x["name"])
|
columns.append(x["name"])
|
||||||
column_types.append(x["type"])
|
column_types.append(x["type"])
|
||||||
column_hints.append(x["hint_string"].split(","))
|
column_hints.append(x["hint"])
|
||||||
|
column_hint_strings.append(x["hint_string"].split(","))
|
||||||
for y in all_cell_editors:
|
for y in all_cell_editors:
|
||||||
if y.can_edit_value(res.get(x["name"]), x["type"], x["hint"]):
|
if y.can_edit_value(res.get(x["name"]), x["type"], x["hint"]):
|
||||||
column_editors.append(y)
|
column_editors.append(y)
|
||||||
@ -437,6 +440,10 @@ func hide_column(column_index : int):
|
|||||||
_update_column_sizes()
|
_update_column_sizes()
|
||||||
|
|
||||||
|
|
||||||
|
func get_selected_column() -> int:
|
||||||
|
return _get_cell_column(edited_cells[0])
|
||||||
|
|
||||||
|
|
||||||
func _add_cell_to_selection(cell : Control):
|
func _add_cell_to_selection(cell : Control):
|
||||||
column_editors[_get_cell_column(cell)].set_selected(cell, true)
|
column_editors[_get_cell_column(cell)].set_selected(cell, true)
|
||||||
edited_cells.append(cell)
|
edited_cells.append(cell)
|
||||||
@ -584,7 +591,7 @@ func _input(event : InputEvent):
|
|||||||
return
|
return
|
||||||
|
|
||||||
var column = _get_cell_column(edited_cells[0])
|
var column = _get_cell_column(edited_cells[0])
|
||||||
if column_types[column] == TYPE_OBJECT || columns[column] == "resource_path":
|
if column_types[column] == TYPE_OBJECT or columns[column] == "resource_path":
|
||||||
return
|
return
|
||||||
|
|
||||||
if event.scancode == KEY_CONTROL or event.scancode == KEY_SHIFT:
|
if event.scancode == KEY_CONTROL or event.scancode == KEY_SHIFT:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=17 format=2]
|
[gd_scene load_steps=19 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://addons/resources_speadsheet_view/editor_view.gd" type="Script" id=1]
|
[ext_resource path="res://addons/resources_speadsheet_view/editor_view.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://addons/resources_speadsheet_view/typed_cells/cell_editor_string.gd" type="Script" id=2]
|
[ext_resource path="res://addons/resources_speadsheet_view/typed_cells/cell_editor_string.gd" type="Script" id=2]
|
||||||
@ -14,6 +14,8 @@
|
|||||||
[ext_resource path="res://addons/resources_speadsheet_view/typed_editors/dock_array.tscn" type="PackedScene" id=12]
|
[ext_resource path="res://addons/resources_speadsheet_view/typed_editors/dock_array.tscn" type="PackedScene" id=12]
|
||||||
[ext_resource path="res://addons/resources_speadsheet_view/typed_cells/cell_editor_enum.gd" type="Script" id=13]
|
[ext_resource path="res://addons/resources_speadsheet_view/typed_cells/cell_editor_enum.gd" type="Script" id=13]
|
||||||
[ext_resource path="res://addons/resources_speadsheet_view/settings_grid.gd" type="Script" id=14]
|
[ext_resource path="res://addons/resources_speadsheet_view/settings_grid.gd" type="Script" id=14]
|
||||||
|
[ext_resource path="res://addons/resources_speadsheet_view/typed_cells/cell_editor_enum_array.gd" type="Script" id=15]
|
||||||
|
[ext_resource path="res://addons/resources_speadsheet_view/typed_editors/dock_enum_array.tscn" type="PackedScene" id=16]
|
||||||
|
|
||||||
[sub_resource type="Image" id=3]
|
[sub_resource type="Image" id=3]
|
||||||
data = {
|
data = {
|
||||||
@ -51,7 +53,7 @@ __meta__ = {
|
|||||||
"_edit_lock_": true
|
"_edit_lock_": true
|
||||||
}
|
}
|
||||||
table_header_scene = ExtResource( 6 )
|
table_header_scene = ExtResource( 6 )
|
||||||
cell_editor_classes = [ ExtResource( 13 ), ExtResource( 11 ), ExtResource( 3 ), ExtResource( 5 ), ExtResource( 9 ), ExtResource( 2 ) ]
|
cell_editor_classes = [ ExtResource( 15 ), ExtResource( 13 ), ExtResource( 11 ), ExtResource( 3 ), ExtResource( 5 ), ExtResource( 9 ), ExtResource( 2 ) ]
|
||||||
path_folder_path = NodePath("HeaderContentSplit/VBoxContainer/HBoxContainer/HBoxContainer/Path")
|
path_folder_path = NodePath("HeaderContentSplit/VBoxContainer/HBoxContainer/HBoxContainer/Path")
|
||||||
path_recent_paths = NodePath("HeaderContentSplit/VBoxContainer/HBoxContainer/HBoxContainer2/RecentPaths")
|
path_recent_paths = NodePath("HeaderContentSplit/VBoxContainer/HBoxContainer/HBoxContainer2/RecentPaths")
|
||||||
path_table_root = NodePath("HeaderContentSplit/MarginContainer/FooterContentSplit/Panel/Scroll/MarginContainer/TableGrid")
|
path_table_root = NodePath("HeaderContentSplit/MarginContainer/FooterContentSplit/Panel/Scroll/MarginContainer/TableGrid")
|
||||||
@ -357,6 +359,12 @@ anchor_right = 0.0
|
|||||||
margin_right = 1020.0
|
margin_right = 1020.0
|
||||||
margin_bottom = 84.0
|
margin_bottom = 84.0
|
||||||
|
|
||||||
|
[node name="EditEnumArray" parent="HeaderContentSplit/MarginContainer/FooterContentSplit/Footer/PropertyEditors" instance=ExtResource( 16 )]
|
||||||
|
visible = false
|
||||||
|
anchor_right = 0.0
|
||||||
|
margin_right = 1018.0
|
||||||
|
margin_bottom = 38.0
|
||||||
|
|
||||||
[node name="HBoxContainer" type="HBoxContainer" parent="HeaderContentSplit/MarginContainer/FooterContentSplit/Footer"]
|
[node name="HBoxContainer" type="HBoxContainer" parent="HeaderContentSplit/MarginContainer/FooterContentSplit/Footer"]
|
||||||
margin_top = 4.0
|
margin_top = 4.0
|
||||||
margin_right = 1018.0
|
margin_right = 1018.0
|
||||||
|
@ -5,5 +5,5 @@ description="Edit Many Resources from one Folder as a table.
|
|||||||
|
|
||||||
Heavily inspired by Multi-Cursor-Editing in text editors, so after selecting multiple cells (in the same column!) using Ctrl+Click or Shift+Click, most Basic-to-Intermediate movements should be available."
|
Heavily inspired by Multi-Cursor-Editing in text editors, so after selecting multiple cells (in the same column!) using Ctrl+Click or Shift+Click, most Basic-to-Intermediate movements should be available."
|
||||||
author="Don Tnowe"
|
author="Don Tnowe"
|
||||||
version="1.5.2"
|
version="1.6"
|
||||||
script="plugin.gd"
|
script="plugin.gd"
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
class_name CellEditorArray
|
||||||
extends CellEditor
|
extends CellEditor
|
||||||
|
|
||||||
|
|
||||||
func can_edit_value(value, type, property_hint) -> bool:
|
func can_edit_value(value, type, property_hint) -> bool:
|
||||||
return type == TYPE_STRING_ARRAY || type == TYPE_ARRAY
|
return type == TYPE_STRING_ARRAY or type == TYPE_ARRAY
|
||||||
|
|
||||||
|
|
||||||
func create_cell(caller : Control) -> Control:
|
func create_cell(caller : Control) -> Control:
|
||||||
@ -16,15 +17,25 @@ func set_value(node : Control, value):
|
|||||||
while children.size() < value.size():
|
while children.size() < value.size():
|
||||||
children.append(Label.new())
|
children.append(Label.new())
|
||||||
node.get_node("Box").add_child(children[children.size() - 1])
|
node.get_node("Box").add_child(children[children.size() - 1])
|
||||||
|
|
||||||
|
var column_hints = hint_strings_array[node.get_position_in_parent() % hint_strings_array.size()]
|
||||||
for i in children.size():
|
for i in children.size():
|
||||||
if i >= value.size():
|
if i >= value.size():
|
||||||
children[i].visible = false
|
children[i].visible = false
|
||||||
|
|
||||||
else:
|
else:
|
||||||
children[i].visible = true
|
children[i].visible = true
|
||||||
children[i].text = str(value[i])
|
_write_value_to_child(value[i], column_hints, children[i], colored)
|
||||||
children[i].self_modulate = Color.white if !colored else Color(str(value[i]).hash()) + Color(0.25, 0.25, 0.25, 1.0)
|
|
||||||
|
|
||||||
|
func _write_value_to_child(value, hint_arr : PoolStringArray, child : Label, colored : bool):
|
||||||
|
child.text = str(value)
|
||||||
|
child.self_modulate = (
|
||||||
|
Color.white
|
||||||
|
if !colored else
|
||||||
|
Color(str(value).hash()) + Color(0.25, 0.25, 0.25, 1.0)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func is_text():
|
func is_text():
|
||||||
|
@ -6,7 +6,7 @@ func can_edit_value(value, type, property_hint) -> bool:
|
|||||||
|
|
||||||
|
|
||||||
func set_value(node : Control, value):
|
func set_value(node : Control, value):
|
||||||
node.text = "<" + hint_strings_array[node.get_position_in_parent() % hint_strings_array.size()][value] + ">"
|
node.text = hint_strings_array[node.get_position_in_parent() % hint_strings_array.size()][value]
|
||||||
node.self_modulate = Color(node.text.hash()) + Color(0.25, 0.25, 0.25, 1.0)
|
node.self_modulate = Color(node.text.hash()) + Color(0.25, 0.25, 0.25, 1.0)
|
||||||
node.align = Label.ALIGN_CENTER
|
node.align = Label.ALIGN_CENTER
|
||||||
|
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
extends CellEditorArray
|
||||||
|
|
||||||
|
|
||||||
|
func can_edit_value(value, type, property_hint) -> bool:
|
||||||
|
return (type == TYPE_INT_ARRAY or type == TYPE_ARRAY) and property_hint == 26
|
||||||
|
|
||||||
|
|
||||||
|
func _write_value_to_child(value, hint_arr : PoolStringArray, child : Label, colored : bool):
|
||||||
|
if value == 0:
|
||||||
|
# Enum array hints have "2/3:" before list.
|
||||||
|
var found := hint_arr[0].find(":") + 1
|
||||||
|
._write_value_to_child(hint_arr[0].substr(hint_arr[0].find(":") + 1), hint_arr, child, colored)
|
||||||
|
|
||||||
|
else:
|
||||||
|
._write_value_to_child(hint_arr[value], hint_arr, child, colored)
|
@ -10,21 +10,17 @@ var _stored_value
|
|||||||
var _stored_type := 0
|
var _stored_type := 0
|
||||||
|
|
||||||
|
|
||||||
func _ready():
|
func try_edit_value(value, type, property_hint) -> bool:
|
||||||
if recent_container.get_child(1).get_item_count() < 3:
|
|
||||||
recent_container.get_child(1).add_item("Add")
|
|
||||||
recent_container.get_child(1).add_item("Erase")
|
|
||||||
recent_container.get_child(1).add_item("Delete From Recent")
|
|
||||||
recent_container.get_child(1).select(0)
|
|
||||||
|
|
||||||
|
|
||||||
func try_edit_value(value, type, propert_hint) -> bool:
|
|
||||||
if (
|
if (
|
||||||
type != TYPE_ARRAY and type != TYPE_STRING_ARRAY
|
type != TYPE_ARRAY and type != TYPE_STRING_ARRAY
|
||||||
and type != TYPE_INT_ARRAY and type != TYPE_REAL_ARRAY
|
and type != TYPE_INT_ARRAY and type != TYPE_REAL_ARRAY
|
||||||
):
|
):
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
if property_hint == 26:
|
||||||
|
# Prefer the specialized dock.
|
||||||
|
return false
|
||||||
|
|
||||||
_stored_type = type
|
_stored_type = type
|
||||||
_stored_value = value.duplicate() # Generic arrays are passed by reference
|
_stored_value = value.duplicate() # Generic arrays are passed by reference
|
||||||
contents_label.text = str(value)
|
contents_label.text = str(value)
|
||||||
@ -33,7 +29,6 @@ func try_edit_value(value, type, propert_hint) -> bool:
|
|||||||
button_box.get_child(1).visible = is_generic_array or _stored_type == TYPE_STRING_ARRAY
|
button_box.get_child(1).visible = is_generic_array or _stored_type == TYPE_STRING_ARRAY
|
||||||
button_box.get_child(2).visible = is_generic_array or _stored_type == TYPE_INT_ARRAY
|
button_box.get_child(2).visible = is_generic_array or _stored_type == TYPE_INT_ARRAY
|
||||||
button_box.get_child(3).visible = is_generic_array or _stored_type == TYPE_REAL_ARRAY
|
button_box.get_child(3).visible = is_generic_array or _stored_type == TYPE_REAL_ARRAY
|
||||||
button_box.get_child(4).visible = is_generic_array
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ margin_right = 231.0
|
|||||||
margin_bottom = 26.0
|
margin_bottom = 26.0
|
||||||
rect_min_size = Vector2( 128, 0 )
|
rect_min_size = Vector2( 128, 0 )
|
||||||
clear_button_enabled = true
|
clear_button_enabled = true
|
||||||
placeholder_text = "Input value to add/remove..."
|
placeholder_text = "Input value to add/erase..."
|
||||||
|
|
||||||
[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer/HBoxContainer/Control/VBoxContainer"]
|
[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer/HBoxContainer/Control/VBoxContainer"]
|
||||||
margin_top = 30.0
|
margin_top = 30.0
|
||||||
|
@ -0,0 +1,107 @@
|
|||||||
|
tool
|
||||||
|
extends SheetsDockEditor
|
||||||
|
|
||||||
|
onready var options_container := $"HBoxContainer/Control2/HBoxContainer/HFlowContainer"
|
||||||
|
onready var contents_label := $"HBoxContainer/HBoxContainer/Panel/Label"
|
||||||
|
|
||||||
|
onready var _init_nodes_in_options_container := options_container.get_child_count()
|
||||||
|
|
||||||
|
var _stored_value
|
||||||
|
var _last_column := -1
|
||||||
|
|
||||||
|
|
||||||
|
func try_edit_value(value, type, property_hint) -> bool:
|
||||||
|
if property_hint != 26:
|
||||||
|
return false
|
||||||
|
|
||||||
|
_stored_value = value.duplicate() # Generic arrays are passed by reference
|
||||||
|
if _last_column != sheet.get_selected_column():
|
||||||
|
_last_column = sheet.get_selected_column()
|
||||||
|
for x in options_container.get_children():
|
||||||
|
x.visible = x.get_position_in_parent() < _init_nodes_in_options_container
|
||||||
|
|
||||||
|
for i in sheet.column_hint_strings[sheet.get_selected_column()].size():
|
||||||
|
_create_option_button(i)
|
||||||
|
|
||||||
|
contents_label.text = str(value)
|
||||||
|
return true
|
||||||
|
|
||||||
|
|
||||||
|
func _create_option_button(index : int):
|
||||||
|
var value = sheet.column_hint_strings[sheet.get_selected_column()][index]
|
||||||
|
if index == 0:
|
||||||
|
# Enum array hints have "2/3:" before list.
|
||||||
|
value = value.substr(value.find(":") + 1)
|
||||||
|
|
||||||
|
var node
|
||||||
|
if index >= options_container.get_child_count() - _init_nodes_in_options_container:
|
||||||
|
node = Button.new()
|
||||||
|
options_container.add_child(node)
|
||||||
|
node.connect("pressed", self, "_on_option_clicked", [index])
|
||||||
|
|
||||||
|
else:
|
||||||
|
node = options_container.get_child(index + _init_nodes_in_options_container)
|
||||||
|
node.visible = true
|
||||||
|
|
||||||
|
node.text = str(value)
|
||||||
|
node.self_modulate = Color(value.hash()) + Color(0.25, 0.25, 0.25, 1.0)
|
||||||
|
return node
|
||||||
|
|
||||||
|
|
||||||
|
func _add_value(option_value):
|
||||||
|
_stored_value.append(option_value)
|
||||||
|
var values = sheet.get_edited_cells_values()
|
||||||
|
var cur_value
|
||||||
|
var dupe_array : bool = ProjectSettings.get_setting(SettingsGrid.SETTING_PREFIX + "dupe_arrays")
|
||||||
|
for i in values.size():
|
||||||
|
cur_value = values[i]
|
||||||
|
if dupe_array:
|
||||||
|
cur_value = cur_value.duplicate()
|
||||||
|
|
||||||
|
cur_value.append(option_value)
|
||||||
|
values[i] = cur_value
|
||||||
|
|
||||||
|
sheet.set_edited_cells_values(values)
|
||||||
|
|
||||||
|
|
||||||
|
func _remove_value(option_value):
|
||||||
|
_stored_value.append(option_value)
|
||||||
|
var values = sheet.get_edited_cells_values()
|
||||||
|
var cur_value
|
||||||
|
var dupe_array : bool = ProjectSettings.get_setting(SettingsGrid.SETTING_PREFIX + "dupe_arrays")
|
||||||
|
for i in values.size():
|
||||||
|
cur_value = values[i]
|
||||||
|
if dupe_array:
|
||||||
|
cur_value = cur_value.duplicate()
|
||||||
|
|
||||||
|
if cur_value.has(option_value):
|
||||||
|
cur_value.remove(cur_value.find(option_value))
|
||||||
|
|
||||||
|
values[i] = cur_value
|
||||||
|
|
||||||
|
sheet.set_edited_cells_values(values)
|
||||||
|
|
||||||
|
|
||||||
|
func _on_option_clicked(value : int):
|
||||||
|
var val = options_container.get_child(1).selected
|
||||||
|
if val == 0:
|
||||||
|
_add_value(value)
|
||||||
|
|
||||||
|
if val == 1:
|
||||||
|
_remove_value(value)
|
||||||
|
|
||||||
|
|
||||||
|
func _on_Remove_pressed():
|
||||||
|
_stored_value.remove(_stored_value.size() - 1)
|
||||||
|
var values = sheet.get_edited_cells_values()
|
||||||
|
var cur_value
|
||||||
|
var dupe_array : bool = ProjectSettings.get_setting(SettingsGrid.SETTING_PREFIX + "dupe_arrays")
|
||||||
|
for i in values.size():
|
||||||
|
cur_value = values[i]
|
||||||
|
if dupe_array:
|
||||||
|
cur_value = cur_value.duplicate()
|
||||||
|
|
||||||
|
cur_value.remove(cur_value.size() - 1)
|
||||||
|
values[i] = cur_value
|
||||||
|
|
||||||
|
sheet.set_edited_cells_values(values)
|
@ -0,0 +1,147 @@
|
|||||||
|
[gd_scene load_steps=5 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://addons/resources_speadsheet_view/typed_editors/dock_enum_array.gd" type="Script" id=1]
|
||||||
|
[ext_resource path="res://addons/resources_speadsheet_view/editor_icon_button.gd" type="Script" id=2]
|
||||||
|
|
||||||
|
[sub_resource type="Image" id=3]
|
||||||
|
data = {
|
||||||
|
"data": PoolByteArray( 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, 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, 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, 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, 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, 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 ),
|
||||||
|
"format": "LumAlpha8",
|
||||||
|
"height": 16,
|
||||||
|
"mipmaps": false,
|
||||||
|
"width": 16
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="ImageTexture" id=2]
|
||||||
|
flags = 4
|
||||||
|
flags = 4
|
||||||
|
image = SubResource( 3 )
|
||||||
|
size = Vector2( 16, 16 )
|
||||||
|
|
||||||
|
[node name="EditEnumArray" type="VBoxContainer"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
margin_bottom = 62.0
|
||||||
|
rect_pivot_offset = Vector2( -460, -28 )
|
||||||
|
mouse_filter = 0
|
||||||
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="Header" type="HBoxContainer" parent="."]
|
||||||
|
margin_right = 1024.0
|
||||||
|
margin_bottom = 14.0
|
||||||
|
|
||||||
|
[node name="HBoxContainer" type="HBoxContainer" parent="Header"]
|
||||||
|
margin_right = 455.0
|
||||||
|
margin_bottom = 14.0
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="Header/HBoxContainer"]
|
||||||
|
margin_right = 110.0
|
||||||
|
margin_bottom = 14.0
|
||||||
|
text = "EDIT: Enum Array"
|
||||||
|
|
||||||
|
[node name="HSeparator" type="HSeparator" parent="Header/HBoxContainer"]
|
||||||
|
margin_left = 114.0
|
||||||
|
margin_right = 455.0
|
||||||
|
margin_bottom = 14.0
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="Header"]
|
||||||
|
margin_left = 459.0
|
||||||
|
margin_right = 565.0
|
||||||
|
margin_bottom = 14.0
|
||||||
|
text = "PROPERTY NAME"
|
||||||
|
|
||||||
|
[node name="HSeparator2" type="HSeparator" parent="Header"]
|
||||||
|
margin_left = 569.0
|
||||||
|
margin_right = 1024.0
|
||||||
|
margin_bottom = 14.0
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
|
[node name="HBoxContainer" type="HSplitContainer" parent="."]
|
||||||
|
margin_top = 18.0
|
||||||
|
margin_right = 1024.0
|
||||||
|
margin_bottom = 40.0
|
||||||
|
split_offset = 64
|
||||||
|
|
||||||
|
[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer"]
|
||||||
|
margin_right = 363.0
|
||||||
|
margin_bottom = 22.0
|
||||||
|
alignment = 2
|
||||||
|
|
||||||
|
[node name="Panel" type="MarginContainer" parent="HBoxContainer/HBoxContainer"]
|
||||||
|
margin_right = 192.0
|
||||||
|
margin_bottom = 22.0
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
|
[node name="Label" type="TextEdit" parent="HBoxContainer/HBoxContainer/Panel"]
|
||||||
|
margin_right = 192.0
|
||||||
|
margin_bottom = 22.0
|
||||||
|
rect_min_size = Vector2( 128, 0 )
|
||||||
|
size_flags_vertical = 5
|
||||||
|
text = "[]"
|
||||||
|
readonly = true
|
||||||
|
|
||||||
|
[node name="VSeparator2" type="VSeparator" parent="HBoxContainer/HBoxContainer"]
|
||||||
|
margin_left = 196.0
|
||||||
|
margin_right = 200.0
|
||||||
|
margin_bottom = 22.0
|
||||||
|
|
||||||
|
[node name="Control" type="MarginContainer" parent="HBoxContainer/HBoxContainer"]
|
||||||
|
margin_left = 204.0
|
||||||
|
margin_right = 355.0
|
||||||
|
margin_bottom = 22.0
|
||||||
|
|
||||||
|
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer/HBoxContainer/Control"]
|
||||||
|
margin_right = 151.0
|
||||||
|
margin_bottom = 22.0
|
||||||
|
|
||||||
|
[node name="Remove" type="Button" parent="HBoxContainer/HBoxContainer/Control/VBoxContainer"]
|
||||||
|
margin_right = 151.0
|
||||||
|
margin_bottom = 22.0
|
||||||
|
hint_tooltip = "Erase Value from Array"
|
||||||
|
text = "Remove Last Value"
|
||||||
|
icon = SubResource( 2 )
|
||||||
|
script = ExtResource( 2 )
|
||||||
|
icon_name = "Remove"
|
||||||
|
|
||||||
|
[node name="VSeparator" type="VSeparator" parent="HBoxContainer/HBoxContainer"]
|
||||||
|
margin_left = 359.0
|
||||||
|
margin_right = 363.0
|
||||||
|
margin_bottom = 22.0
|
||||||
|
|
||||||
|
[node name="Control2" type="MarginContainer" parent="HBoxContainer"]
|
||||||
|
margin_left = 375.0
|
||||||
|
margin_right = 1024.0
|
||||||
|
margin_bottom = 22.0
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
|
[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer/Control2"]
|
||||||
|
margin_right = 649.0
|
||||||
|
margin_bottom = 22.0
|
||||||
|
alignment = 2
|
||||||
|
|
||||||
|
[node name="VSeparator2" type="VSeparator" parent="HBoxContainer/Control2/HBoxContainer"]
|
||||||
|
margin_right = 4.0
|
||||||
|
margin_bottom = 22.0
|
||||||
|
|
||||||
|
[node name="HFlowContainer" type="HFlowContainer" parent="HBoxContainer/Control2/HBoxContainer"]
|
||||||
|
margin_left = 8.0
|
||||||
|
margin_right = 649.0
|
||||||
|
margin_bottom = 22.0
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="HBoxContainer/Control2/HBoxContainer/HFlowContainer"]
|
||||||
|
margin_top = 3.0
|
||||||
|
margin_right = 55.0
|
||||||
|
margin_bottom = 17.0
|
||||||
|
text = "Options:"
|
||||||
|
|
||||||
|
[node name="OptionButton" type="OptionButton" parent="HBoxContainer/Control2/HBoxContainer/HFlowContainer"]
|
||||||
|
margin_left = 59.0
|
||||||
|
margin_right = 113.0
|
||||||
|
margin_bottom = 20.0
|
||||||
|
text = "Add"
|
||||||
|
items = [ "Add", null, false, 0, null, "Erase", null, false, 1, null ]
|
||||||
|
selected = 0
|
||||||
|
|
||||||
|
[connection signal="pressed" from="HBoxContainer/HBoxContainer/Control/VBoxContainer/Remove" to="." method="_on_Remove_pressed"]
|
@ -1,10 +1,19 @@
|
|||||||
tool
|
tool
|
||||||
extends Resource
|
extends Resource
|
||||||
|
|
||||||
|
enum Attributes {
|
||||||
|
Strength,
|
||||||
|
Magic,
|
||||||
|
Endurance,
|
||||||
|
Agility,
|
||||||
|
Luck,
|
||||||
|
}
|
||||||
|
|
||||||
export var color1 := Color.white
|
export var color1 := Color.white
|
||||||
export var max_duplicates := 0
|
export var max_duplicates := 0
|
||||||
export var tags : Array
|
export var tags : Array
|
||||||
export(int, "Weapon", "Passive", "Mastery") var type := 0
|
export(int, "Weapon", "Passive", "Mastery") var type := 0
|
||||||
|
export(Array, Attributes) var attributes
|
||||||
export var icon : Texture
|
export var icon : Texture
|
||||||
export var custom_scene : PackedScene
|
export var custom_scene : PackedScene
|
||||||
export var color2 := Color.white
|
export var color2 := Color.white
|
||||||
|
@ -10,6 +10,7 @@ color1 = Color( 1, 1, 1, 1 )
|
|||||||
max_duplicates = 9
|
max_duplicates = 9
|
||||||
tags = [ "elemental" ]
|
tags = [ "elemental" ]
|
||||||
type = 1
|
type = 1
|
||||||
|
attributes = [ 1 ]
|
||||||
icon = ExtResource( 1 )
|
icon = ExtResource( 1 )
|
||||||
color2 = Color( 0.964706, 0.298039, 0.298039, 1 )
|
color2 = Color( 0.964706, 0.298039, 0.298039, 1 )
|
||||||
base_weight = 10.0
|
base_weight = 10.0
|
||||||
|
@ -10,6 +10,7 @@ color1 = Color( 1, 1, 1, 1 )
|
|||||||
max_duplicates = 9
|
max_duplicates = 9
|
||||||
tags = [ "health", "melee" ]
|
tags = [ "health", "melee" ]
|
||||||
type = 1
|
type = 1
|
||||||
|
attributes = [ 2 ]
|
||||||
icon = ExtResource( 1 )
|
icon = ExtResource( 1 )
|
||||||
color2 = Color( 0.129412, 1, 0.243137, 1 )
|
color2 = Color( 0.129412, 1, 0.243137, 1 )
|
||||||
base_weight = 10.0
|
base_weight = 10.0
|
||||||
|
@ -10,6 +10,7 @@ color1 = Color( 1, 0.847059, 0.160784, 1 )
|
|||||||
max_duplicates = 9
|
max_duplicates = 9
|
||||||
tags = [ "magic", "mastery" ]
|
tags = [ "magic", "mastery" ]
|
||||||
type = 2
|
type = 2
|
||||||
|
attributes = [ 1, 1, 4 ]
|
||||||
icon = ExtResource( 1 )
|
icon = ExtResource( 1 )
|
||||||
color2 = Color( 0.407843, 0.192157, 0.827451, 1 )
|
color2 = Color( 0.407843, 0.192157, 0.827451, 1 )
|
||||||
base_weight = 1.0
|
base_weight = 1.0
|
||||||
|
@ -10,6 +10,7 @@ color1 = Color( 1, 0.847059, 0.160784, 1 )
|
|||||||
max_duplicates = 9
|
max_duplicates = 9
|
||||||
tags = [ "strength", "mastery" ]
|
tags = [ "strength", "mastery" ]
|
||||||
type = 2
|
type = 2
|
||||||
|
attributes = [ 0, 0, 4 ]
|
||||||
icon = ExtResource( 1 )
|
icon = ExtResource( 1 )
|
||||||
color2 = Color( 0.992157, 0.941176, 0.2, 1 )
|
color2 = Color( 0.992157, 0.941176, 0.2, 1 )
|
||||||
base_weight = 1.0
|
base_weight = 1.0
|
||||||
|
@ -10,6 +10,7 @@ color1 = Color( 1, 1, 1, 1 )
|
|||||||
max_duplicates = 4
|
max_duplicates = 4
|
||||||
tags = [ "aoe" ]
|
tags = [ "aoe" ]
|
||||||
type = 1
|
type = 1
|
||||||
|
attributes = [ 3 ]
|
||||||
icon = ExtResource( 1 )
|
icon = ExtResource( 1 )
|
||||||
color2 = Color( 0.964706, 0.298039, 0.298039, 1 )
|
color2 = Color( 0.964706, 0.298039, 0.298039, 1 )
|
||||||
base_weight = 10.0
|
base_weight = 10.0
|
||||||
|
@ -10,6 +10,7 @@ color1 = Color( 1, 1, 1, 1 )
|
|||||||
max_duplicates = 9
|
max_duplicates = 9
|
||||||
tags = [ "magic" ]
|
tags = [ "magic" ]
|
||||||
type = 1
|
type = 1
|
||||||
|
attributes = [ 1 ]
|
||||||
icon = ExtResource( 1 )
|
icon = ExtResource( 1 )
|
||||||
color2 = Color( 0.188235, 0.45098, 0.901961, 1 )
|
color2 = Color( 0.188235, 0.45098, 0.901961, 1 )
|
||||||
base_weight = 10.0
|
base_weight = 10.0
|
||||||
|
@ -10,6 +10,7 @@ color1 = Color( 1, 1, 1, 1 )
|
|||||||
max_duplicates = 9
|
max_duplicates = 9
|
||||||
tags = [ "strength" ]
|
tags = [ "strength" ]
|
||||||
type = 1
|
type = 1
|
||||||
|
attributes = [ 0 ]
|
||||||
icon = ExtResource( 1 )
|
icon = ExtResource( 1 )
|
||||||
color2 = Color( 0.988235, 0.584314, 0.192157, 1 )
|
color2 = Color( 0.988235, 0.584314, 0.192157, 1 )
|
||||||
base_weight = 10.0
|
base_weight = 10.0
|
||||||
|
@ -10,6 +10,7 @@ color1 = Color( 0.635294, 0.760784, 1, 1 )
|
|||||||
max_duplicates = 1
|
max_duplicates = 1
|
||||||
tags = [ "strength", "melee", "weapon" ]
|
tags = [ "strength", "melee", "weapon" ]
|
||||||
type = 0
|
type = 0
|
||||||
|
attributes = [ 0, 2 ]
|
||||||
icon = ExtResource( 1 )
|
icon = ExtResource( 1 )
|
||||||
color2 = Color( 0.988235, 0.584314, 0.192157, 1 )
|
color2 = Color( 0.988235, 0.584314, 0.192157, 1 )
|
||||||
base_weight = 10.0
|
base_weight = 10.0
|
||||||
|
@ -10,6 +10,7 @@ color1 = Color( 0.635294, 0.760784, 1, 1 )
|
|||||||
max_duplicates = 1
|
max_duplicates = 1
|
||||||
tags = [ "weapon", "magic", "elemental" ]
|
tags = [ "weapon", "magic", "elemental" ]
|
||||||
type = 0
|
type = 0
|
||||||
|
attributes = [ 1, 2 ]
|
||||||
icon = ExtResource( 1 )
|
icon = ExtResource( 1 )
|
||||||
color2 = Color( 0.189457, 0.452246, 0.902344, 1 )
|
color2 = Color( 0.189457, 0.452246, 0.902344, 1 )
|
||||||
base_weight = 10.0
|
base_weight = 10.0
|
||||||
|
@ -11,6 +11,7 @@ color1 = Color( 0.635294, 0.760784, 1, 1 )
|
|||||||
max_duplicates = 1
|
max_duplicates = 1
|
||||||
tags = [ "weapon", "magic", "projectile", "legendary" ]
|
tags = [ "weapon", "magic", "projectile", "legendary" ]
|
||||||
type = 0
|
type = 0
|
||||||
|
attributes = [ 1, 1, 1, 3 ]
|
||||||
icon = ExtResource( 1 )
|
icon = ExtResource( 1 )
|
||||||
custom_scene = ExtResource( 2 )
|
custom_scene = ExtResource( 2 )
|
||||||
color2 = Color( 0.407843, 0.192157, 0.827451, 1 )
|
color2 = Color( 0.407843, 0.192157, 0.827451, 1 )
|
||||||
|
@ -10,6 +10,7 @@ color1 = Color( 0.635294, 0.760784, 1, 1 )
|
|||||||
max_duplicates = 1
|
max_duplicates = 1
|
||||||
tags = [ "weapon", "strength", "projectile" ]
|
tags = [ "weapon", "strength", "projectile" ]
|
||||||
type = 0
|
type = 0
|
||||||
|
attributes = [ 0, 3 ]
|
||||||
icon = ExtResource( 1 )
|
icon = ExtResource( 1 )
|
||||||
color2 = Color( 0.988235, 0.584314, 0.192157, 1 )
|
color2 = Color( 0.988235, 0.584314, 0.192157, 1 )
|
||||||
base_weight = 10.0
|
base_weight = 10.0
|
||||||
|
@ -10,6 +10,7 @@ color1 = Color( 0.635294, 0.760784, 1, 1 )
|
|||||||
max_duplicates = 1
|
max_duplicates = 1
|
||||||
tags = [ "weapon", "magic", "projectile", "elemental" ]
|
tags = [ "weapon", "magic", "projectile", "elemental" ]
|
||||||
type = 0
|
type = 0
|
||||||
|
attributes = [ 1, 2 ]
|
||||||
icon = ExtResource( 1 )
|
icon = ExtResource( 1 )
|
||||||
color2 = Color( 0.189457, 0.452246, 0.902344, 1 )
|
color2 = Color( 0.189457, 0.452246, 0.902344, 1 )
|
||||||
base_weight = 10.0
|
base_weight = 10.0
|
||||||
|
@ -11,6 +11,7 @@ color1 = Color( 0.635294, 0.760784, 1, 1 )
|
|||||||
max_duplicates = 1
|
max_duplicates = 1
|
||||||
tags = [ "weapon", "strength", "melee", "legendary" ]
|
tags = [ "weapon", "strength", "melee", "legendary" ]
|
||||||
type = 0
|
type = 0
|
||||||
|
attributes = [ 0, 0, 0, 2 ]
|
||||||
icon = ExtResource( 1 )
|
icon = ExtResource( 1 )
|
||||||
custom_scene = ExtResource( 2 )
|
custom_scene = ExtResource( 2 )
|
||||||
color2 = Color( 0.992157, 0.941176, 0.2, 1 )
|
color2 = Color( 0.992157, 0.941176, 0.2, 1 )
|
||||||
|
@ -10,6 +10,7 @@ color1 = Color( 0.635294, 0.760784, 1, 1 )
|
|||||||
max_duplicates = 1
|
max_duplicates = 1
|
||||||
tags = [ "weapon", "magic", "elemental" ]
|
tags = [ "weapon", "magic", "elemental" ]
|
||||||
type = 0
|
type = 0
|
||||||
|
attributes = [ 1, 3 ]
|
||||||
icon = ExtResource( 1 )
|
icon = ExtResource( 1 )
|
||||||
color2 = Color( 0.189457, 0.452246, 0.902344, 1 )
|
color2 = Color( 0.189457, 0.452246, 0.902344, 1 )
|
||||||
base_weight = 10.0
|
base_weight = 10.0
|
||||||
|
@ -10,6 +10,7 @@ color1 = Color( 0.635294, 0.760784, 1, 1 )
|
|||||||
max_duplicates = 1
|
max_duplicates = 1
|
||||||
tags = [ "weapon", "strength", "melee" ]
|
tags = [ "weapon", "strength", "melee" ]
|
||||||
type = 0
|
type = 0
|
||||||
|
attributes = [ 0, 3 ]
|
||||||
icon = ExtResource( 1 )
|
icon = ExtResource( 1 )
|
||||||
color2 = Color( 0.988235, 0.584314, 0.192157, 1 )
|
color2 = Color( 0.988235, 0.584314, 0.192157, 1 )
|
||||||
base_weight = 10.0
|
base_weight = 10.0
|
||||||
|
@ -14,6 +14,11 @@ _global_script_classes=[ {
|
|||||||
"language": "GDScript",
|
"language": "GDScript",
|
||||||
"path": "res://addons/resources_speadsheet_view/typed_cells/cell_editor.gd"
|
"path": "res://addons/resources_speadsheet_view/typed_cells/cell_editor.gd"
|
||||||
}, {
|
}, {
|
||||||
|
"base": "CellEditor",
|
||||||
|
"class": "CellEditorArray",
|
||||||
|
"language": "GDScript",
|
||||||
|
"path": "res://addons/resources_speadsheet_view/typed_cells/cell_editor_array.gd"
|
||||||
|
}, {
|
||||||
"base": "GridContainer",
|
"base": "GridContainer",
|
||||||
"class": "SettingsGrid",
|
"class": "SettingsGrid",
|
||||||
"language": "GDScript",
|
"language": "GDScript",
|
||||||
@ -41,6 +46,7 @@ _global_script_classes=[ {
|
|||||||
} ]
|
} ]
|
||||||
_global_script_class_icons={
|
_global_script_class_icons={
|
||||||
"CellEditor": "",
|
"CellEditor": "",
|
||||||
|
"CellEditorArray": "",
|
||||||
"SettingsGrid": "",
|
"SettingsGrid": "",
|
||||||
"SheetsDockEditor": "",
|
"SheetsDockEditor": "",
|
||||||
"TextEditingUtils": "",
|
"TextEditingUtils": "",
|
||||||
@ -58,6 +64,10 @@ resources_spreadsheet_view/clip_headers=false
|
|||||||
resources_spreadsheet_view/dupe_arrays=true
|
resources_spreadsheet_view/dupe_arrays=true
|
||||||
resources_spreadsheet_view/array_min_width=128.0
|
resources_spreadsheet_view/array_min_width=128.0
|
||||||
|
|
||||||
|
[application]
|
||||||
|
|
||||||
|
config/name="Addon: Resources as Sheets"
|
||||||
|
|
||||||
[editor_plugins]
|
[editor_plugins]
|
||||||
|
|
||||||
enabled=PoolStringArray( "res://addons/resources_speadsheet_view/plugin.cfg" )
|
enabled=PoolStringArray( "res://addons/resources_speadsheet_view/plugin.cfg" )
|
||||||
|
Loading…
Reference in New Issue
Block a user