diff --git a/addons/resources_speadsheet_view/editor_view.gd b/addons/resources_speadsheet_view/editor_view.gd index edefafa..9e78594 100644 --- a/addons/resources_speadsheet_view/editor_view.gd +++ b/addons/resources_speadsheet_view/editor_view.gd @@ -27,6 +27,7 @@ var all_cell_editors := [] var columns := [] var column_types := [] var column_hints := [] +var column_hint_strings := [] var column_editors := [] var rows := [] var remembered_paths := {} @@ -64,7 +65,7 @@ func _ready(): # Load cell editors and instantiate them for x in cell_editor_classes: 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) @@ -136,12 +137,14 @@ func _load_resources_from_folder(folderpath : String, sort_by : String, sort_rev columns.clear() column_types.clear() column_hints.clear() + column_hint_strings.clear() column_editors.clear() for x in res.get_property_list(): if x["usage"] & PROPERTY_USAGE_EDITOR != 0 and x["name"] != "script": columns.append(x["name"]) 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: if y.can_edit_value(res.get(x["name"]), x["type"], x["hint"]): column_editors.append(y) @@ -437,6 +440,10 @@ func hide_column(column_index : int): _update_column_sizes() +func get_selected_column() -> int: + return _get_cell_column(edited_cells[0]) + + func _add_cell_to_selection(cell : Control): column_editors[_get_cell_column(cell)].set_selected(cell, true) edited_cells.append(cell) @@ -584,7 +591,7 @@ func _input(event : InputEvent): return 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 if event.scancode == KEY_CONTROL or event.scancode == KEY_SHIFT: diff --git a/addons/resources_speadsheet_view/editor_view.tscn b/addons/resources_speadsheet_view/editor_view.tscn index a613687..02d215c 100644 --- a/addons/resources_speadsheet_view/editor_view.tscn +++ b/addons/resources_speadsheet_view/editor_view.tscn @@ -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/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_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/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] data = { @@ -51,7 +53,7 @@ __meta__ = { "_edit_lock_": true } 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_recent_paths = NodePath("HeaderContentSplit/VBoxContainer/HBoxContainer/HBoxContainer2/RecentPaths") path_table_root = NodePath("HeaderContentSplit/MarginContainer/FooterContentSplit/Panel/Scroll/MarginContainer/TableGrid") @@ -357,6 +359,12 @@ anchor_right = 0.0 margin_right = 1020.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"] margin_top = 4.0 margin_right = 1018.0 diff --git a/addons/resources_speadsheet_view/plugin.cfg b/addons/resources_speadsheet_view/plugin.cfg index 859ce68..72b1f51 100644 --- a/addons/resources_speadsheet_view/plugin.cfg +++ b/addons/resources_speadsheet_view/plugin.cfg @@ -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." author="Don Tnowe" -version="1.5.2" +version="1.6" script="plugin.gd" diff --git a/addons/resources_speadsheet_view/typed_cells/cell_editor_array.gd b/addons/resources_speadsheet_view/typed_cells/cell_editor_array.gd index e3341bb..4cbc153 100644 --- a/addons/resources_speadsheet_view/typed_cells/cell_editor_array.gd +++ b/addons/resources_speadsheet_view/typed_cells/cell_editor_array.gd @@ -1,8 +1,9 @@ +class_name CellEditorArray extends CellEditor 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: @@ -16,15 +17,25 @@ func set_value(node : Control, value): while children.size() < value.size(): children.append(Label.new()) 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(): if i >= value.size(): children[i].visible = false else: children[i].visible = true - children[i].text = str(value[i]) - children[i].self_modulate = Color.white if !colored else Color(str(value[i]).hash()) + Color(0.25, 0.25, 0.25, 1.0) + _write_value_to_child(value[i], column_hints, children[i], colored) + + +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(): diff --git a/addons/resources_speadsheet_view/typed_cells/cell_editor_enum.gd b/addons/resources_speadsheet_view/typed_cells/cell_editor_enum.gd index b2959f4..ae21a94 100644 --- a/addons/resources_speadsheet_view/typed_cells/cell_editor_enum.gd +++ b/addons/resources_speadsheet_view/typed_cells/cell_editor_enum.gd @@ -6,7 +6,7 @@ func can_edit_value(value, type, property_hint) -> bool: 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.align = Label.ALIGN_CENTER diff --git a/addons/resources_speadsheet_view/typed_cells/cell_editor_enum_array.gd b/addons/resources_speadsheet_view/typed_cells/cell_editor_enum_array.gd new file mode 100644 index 0000000..f2add8a --- /dev/null +++ b/addons/resources_speadsheet_view/typed_cells/cell_editor_enum_array.gd @@ -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) diff --git a/addons/resources_speadsheet_view/typed_editors/dock_array.gd b/addons/resources_speadsheet_view/typed_editors/dock_array.gd index 8fce4a3..44fa69e 100644 --- a/addons/resources_speadsheet_view/typed_editors/dock_array.gd +++ b/addons/resources_speadsheet_view/typed_editors/dock_array.gd @@ -10,21 +10,17 @@ var _stored_value var _stored_type := 0 -func _ready(): - 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: +func try_edit_value(value, type, property_hint) -> bool: if ( type != TYPE_ARRAY and type != TYPE_STRING_ARRAY and type != TYPE_INT_ARRAY and type != TYPE_REAL_ARRAY ): return false + if property_hint == 26: + # Prefer the specialized dock. + return false + _stored_type = type _stored_value = value.duplicate() # Generic arrays are passed by reference 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(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(4).visible = is_generic_array return true diff --git a/addons/resources_speadsheet_view/typed_editors/dock_array.tscn b/addons/resources_speadsheet_view/typed_editors/dock_array.tscn index 2326b2a..f99280c 100644 --- a/addons/resources_speadsheet_view/typed_editors/dock_array.tscn +++ b/addons/resources_speadsheet_view/typed_editors/dock_array.tscn @@ -100,7 +100,7 @@ margin_right = 231.0 margin_bottom = 26.0 rect_min_size = Vector2( 128, 0 ) 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"] margin_top = 30.0 diff --git a/addons/resources_speadsheet_view/typed_editors/dock_enum_array.gd b/addons/resources_speadsheet_view/typed_editors/dock_enum_array.gd new file mode 100644 index 0000000..2899006 --- /dev/null +++ b/addons/resources_speadsheet_view/typed_editors/dock_enum_array.gd @@ -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) diff --git a/addons/resources_speadsheet_view/typed_editors/dock_enum_array.tscn b/addons/resources_speadsheet_view/typed_editors/dock_enum_array.tscn new file mode 100644 index 0000000..e1871fc --- /dev/null +++ b/addons/resources_speadsheet_view/typed_editors/dock_enum_array.tscn @@ -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"] diff --git a/example/Random Upgrades/upgrade_data.gd b/example/Random Upgrades/upgrade_data.gd index 60b35d2..f85e511 100644 --- a/example/Random Upgrades/upgrade_data.gd +++ b/example/Random Upgrades/upgrade_data.gd @@ -1,10 +1,19 @@ tool extends Resource +enum Attributes { + Strength, + Magic, + Endurance, + Agility, + Luck, +} + export var color1 := Color.white export var max_duplicates := 0 export var tags : Array export(int, "Weapon", "Passive", "Mastery") var type := 0 +export(Array, Attributes) var attributes export var icon : Texture export var custom_scene : PackedScene export var color2 := Color.white diff --git a/example/Random Upgrades/upgrades/elemental.tres b/example/Random Upgrades/upgrades/elemental.tres index 372374a..e12195a 100644 --- a/example/Random Upgrades/upgrades/elemental.tres +++ b/example/Random Upgrades/upgrades/elemental.tres @@ -10,6 +10,7 @@ color1 = Color( 1, 1, 1, 1 ) max_duplicates = 9 tags = [ "elemental" ] type = 1 +attributes = [ 1 ] icon = ExtResource( 1 ) color2 = Color( 0.964706, 0.298039, 0.298039, 1 ) base_weight = 10.0 diff --git a/example/Random Upgrades/upgrades/health.tres b/example/Random Upgrades/upgrades/health.tres index 6137925..c72cbbe 100644 --- a/example/Random Upgrades/upgrades/health.tres +++ b/example/Random Upgrades/upgrades/health.tres @@ -10,6 +10,7 @@ color1 = Color( 1, 1, 1, 1 ) max_duplicates = 9 tags = [ "health", "melee" ] type = 1 +attributes = [ 2 ] icon = ExtResource( 1 ) color2 = Color( 0.129412, 1, 0.243137, 1 ) base_weight = 10.0 diff --git a/example/Random Upgrades/upgrades/mastery_magic.tres b/example/Random Upgrades/upgrades/mastery_magic.tres index a08eb56..8da24e5 100644 --- a/example/Random Upgrades/upgrades/mastery_magic.tres +++ b/example/Random Upgrades/upgrades/mastery_magic.tres @@ -10,6 +10,7 @@ color1 = Color( 1, 0.847059, 0.160784, 1 ) max_duplicates = 9 tags = [ "magic", "mastery" ] type = 2 +attributes = [ 1, 1, 4 ] icon = ExtResource( 1 ) color2 = Color( 0.407843, 0.192157, 0.827451, 1 ) base_weight = 1.0 diff --git a/example/Random Upgrades/upgrades/mastery_strength.tres b/example/Random Upgrades/upgrades/mastery_strength.tres index de3e7c3..fa4855b 100644 --- a/example/Random Upgrades/upgrades/mastery_strength.tres +++ b/example/Random Upgrades/upgrades/mastery_strength.tres @@ -10,6 +10,7 @@ color1 = Color( 1, 0.847059, 0.160784, 1 ) max_duplicates = 9 tags = [ "strength", "mastery" ] type = 2 +attributes = [ 0, 0, 4 ] icon = ExtResource( 1 ) color2 = Color( 0.992157, 0.941176, 0.2, 1 ) base_weight = 1.0 diff --git a/example/Random Upgrades/upgrades/up_aoe.tres b/example/Random Upgrades/upgrades/up_aoe.tres index 0b80879..12715df 100644 --- a/example/Random Upgrades/upgrades/up_aoe.tres +++ b/example/Random Upgrades/upgrades/up_aoe.tres @@ -10,6 +10,7 @@ color1 = Color( 1, 1, 1, 1 ) max_duplicates = 4 tags = [ "aoe" ] type = 1 +attributes = [ 3 ] icon = ExtResource( 1 ) color2 = Color( 0.964706, 0.298039, 0.298039, 1 ) base_weight = 10.0 diff --git a/example/Random Upgrades/upgrades/up_magic.tres b/example/Random Upgrades/upgrades/up_magic.tres index 0b85d14..53b94a0 100644 --- a/example/Random Upgrades/upgrades/up_magic.tres +++ b/example/Random Upgrades/upgrades/up_magic.tres @@ -10,6 +10,7 @@ color1 = Color( 1, 1, 1, 1 ) max_duplicates = 9 tags = [ "magic" ] type = 1 +attributes = [ 1 ] icon = ExtResource( 1 ) color2 = Color( 0.188235, 0.45098, 0.901961, 1 ) base_weight = 10.0 diff --git a/example/Random Upgrades/upgrades/up_strength.tres b/example/Random Upgrades/upgrades/up_strength.tres index f0d31e8..e8c19a9 100644 --- a/example/Random Upgrades/upgrades/up_strength.tres +++ b/example/Random Upgrades/upgrades/up_strength.tres @@ -10,6 +10,7 @@ color1 = Color( 1, 1, 1, 1 ) max_duplicates = 9 tags = [ "strength" ] type = 1 +attributes = [ 0 ] icon = ExtResource( 1 ) color2 = Color( 0.988235, 0.584314, 0.192157, 1 ) base_weight = 10.0 diff --git a/example/Random Upgrades/upgrades/weapon_axe.tres b/example/Random Upgrades/upgrades/weapon_axe.tres index 6e10da4..19a605f 100644 --- a/example/Random Upgrades/upgrades/weapon_axe.tres +++ b/example/Random Upgrades/upgrades/weapon_axe.tres @@ -10,6 +10,7 @@ color1 = Color( 0.635294, 0.760784, 1, 1 ) max_duplicates = 1 tags = [ "strength", "melee", "weapon" ] type = 0 +attributes = [ 0, 2 ] icon = ExtResource( 1 ) color2 = Color( 0.988235, 0.584314, 0.192157, 1 ) base_weight = 10.0 diff --git a/example/Random Upgrades/upgrades/weapon_blizzard.tres b/example/Random Upgrades/upgrades/weapon_blizzard.tres index 8daed26..d8e872a 100644 --- a/example/Random Upgrades/upgrades/weapon_blizzard.tres +++ b/example/Random Upgrades/upgrades/weapon_blizzard.tres @@ -10,6 +10,7 @@ color1 = Color( 0.635294, 0.760784, 1, 1 ) max_duplicates = 1 tags = [ "weapon", "magic", "elemental" ] type = 0 +attributes = [ 1, 2 ] icon = ExtResource( 1 ) color2 = Color( 0.189457, 0.452246, 0.902344, 1 ) base_weight = 10.0 diff --git a/example/Random Upgrades/upgrades/weapon_chaos_blast.tres b/example/Random Upgrades/upgrades/weapon_chaos_blast.tres index 751632c..a90318c 100644 --- a/example/Random Upgrades/upgrades/weapon_chaos_blast.tres +++ b/example/Random Upgrades/upgrades/weapon_chaos_blast.tres @@ -11,6 +11,7 @@ color1 = Color( 0.635294, 0.760784, 1, 1 ) max_duplicates = 1 tags = [ "weapon", "magic", "projectile", "legendary" ] type = 0 +attributes = [ 1, 1, 1, 3 ] icon = ExtResource( 1 ) custom_scene = ExtResource( 2 ) color2 = Color( 0.407843, 0.192157, 0.827451, 1 ) diff --git a/example/Random Upgrades/upgrades/weapon_dagger.tres b/example/Random Upgrades/upgrades/weapon_dagger.tres index 98ba76c..6c420d6 100644 --- a/example/Random Upgrades/upgrades/weapon_dagger.tres +++ b/example/Random Upgrades/upgrades/weapon_dagger.tres @@ -10,6 +10,7 @@ color1 = Color( 0.635294, 0.760784, 1, 1 ) max_duplicates = 1 tags = [ "weapon", "strength", "projectile" ] type = 0 +attributes = [ 0, 3 ] icon = ExtResource( 1 ) color2 = Color( 0.988235, 0.584314, 0.192157, 1 ) base_weight = 10.0 diff --git a/example/Random Upgrades/upgrades/weapon_fireball.tres b/example/Random Upgrades/upgrades/weapon_fireball.tres index d9c837c..0a33a58 100644 --- a/example/Random Upgrades/upgrades/weapon_fireball.tres +++ b/example/Random Upgrades/upgrades/weapon_fireball.tres @@ -10,6 +10,7 @@ color1 = Color( 0.635294, 0.760784, 1, 1 ) max_duplicates = 1 tags = [ "weapon", "magic", "projectile", "elemental" ] type = 0 +attributes = [ 1, 2 ] icon = ExtResource( 1 ) color2 = Color( 0.189457, 0.452246, 0.902344, 1 ) base_weight = 10.0 diff --git a/example/Random Upgrades/upgrades/weapon_giga_sword.tres b/example/Random Upgrades/upgrades/weapon_giga_sword.tres index 5dbc1a2..2993efa 100644 --- a/example/Random Upgrades/upgrades/weapon_giga_sword.tres +++ b/example/Random Upgrades/upgrades/weapon_giga_sword.tres @@ -11,6 +11,7 @@ color1 = Color( 0.635294, 0.760784, 1, 1 ) max_duplicates = 1 tags = [ "weapon", "strength", "melee", "legendary" ] type = 0 +attributes = [ 0, 0, 0, 2 ] icon = ExtResource( 1 ) custom_scene = ExtResource( 2 ) color2 = Color( 0.992157, 0.941176, 0.2, 1 ) diff --git a/example/Random Upgrades/upgrades/weapon_lightning.tres b/example/Random Upgrades/upgrades/weapon_lightning.tres index 46a2f94..f3f7e90 100644 --- a/example/Random Upgrades/upgrades/weapon_lightning.tres +++ b/example/Random Upgrades/upgrades/weapon_lightning.tres @@ -10,6 +10,7 @@ color1 = Color( 0.635294, 0.760784, 1, 1 ) max_duplicates = 1 tags = [ "weapon", "magic", "elemental" ] type = 0 +attributes = [ 1, 3 ] icon = ExtResource( 1 ) color2 = Color( 0.189457, 0.452246, 0.902344, 1 ) base_weight = 10.0 diff --git a/example/Random Upgrades/upgrades/weapon_spear.tres b/example/Random Upgrades/upgrades/weapon_spear.tres index 2cc3dc1..8b16d08 100644 --- a/example/Random Upgrades/upgrades/weapon_spear.tres +++ b/example/Random Upgrades/upgrades/weapon_spear.tres @@ -10,6 +10,7 @@ color1 = Color( 0.635294, 0.760784, 1, 1 ) max_duplicates = 1 tags = [ "weapon", "strength", "melee" ] type = 0 +attributes = [ 0, 3 ] icon = ExtResource( 1 ) color2 = Color( 0.988235, 0.584314, 0.192157, 1 ) base_weight = 10.0 diff --git a/project.godot b/project.godot index 5d7cd69..e2ef342 100644 --- a/project.godot +++ b/project.godot @@ -14,6 +14,11 @@ _global_script_classes=[ { "language": "GDScript", "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", "class": "SettingsGrid", "language": "GDScript", @@ -41,6 +46,7 @@ _global_script_classes=[ { } ] _global_script_class_icons={ "CellEditor": "", +"CellEditorArray": "", "SettingsGrid": "", "SheetsDockEditor": "", "TextEditingUtils": "", @@ -58,6 +64,10 @@ resources_spreadsheet_view/clip_headers=false resources_spreadsheet_view/dupe_arrays=true resources_spreadsheet_view/array_min_width=128.0 +[application] + +config/name="Addon: Resources as Sheets" + [editor_plugins] enabled=PoolStringArray( "res://addons/resources_speadsheet_view/plugin.cfg" )