Update names to less ambiguous

Cause that's not what a spreadsheet is!
This commit is contained in:
don-tnowe 2023-08-16 23:23:34 +03:00
parent 067c00779f
commit 039b367ee0
25 changed files with 38 additions and 38 deletions

View File

@ -1,4 +1,4 @@
# Edit Resources as Spreadsheet
# Edit Resources as Table
"Welp, it is what it sounds like!"

View File

@ -75,7 +75,7 @@ func display_folder(folderpath : String, sort_by : String = "", sort_reverse : b
if folderpath.get_extension() == "":
folderpath = folderpath.trim_suffix("/") + "/"
if folderpath.ends_with(".tres") and !folderpath.ends_with(SpreadsheetImport.SUFFIX):
if folderpath.ends_with(".tres") and !folderpath.ends_with(ResourceTablesImport.SUFFIX):
folderpath = folderpath.get_base_dir() + "/"
if search_cond == null:
@ -106,15 +106,15 @@ func refresh(force_rebuild : bool = true):
func _load_resources_from_path(path : String, sort_by : String, sort_reverse : bool):
if path.ends_with("/"):
io = SpreadsheetEditFormatTres.new()
io = ResourceTablesEditFormatTres.new()
else:
var loaded = load(path)
if loaded is SpreadsheetImport:
if loaded is ResourceTablesImport:
io = loaded.view_script.new()
else:
io = SpreadsheetEditFormatTres.new()
io = ResourceTablesEditFormatTres.new()
io.editor_view = self
rows = io.import_from_path(path, insert_row_sorted, sort_by, sort_reverse)

View File

@ -475,7 +475,7 @@ layout_mode = 2
[node name="RichTextLabel" type="RichTextLabel" parent="Control/Info/MarginContainer"]
layout_mode = 2
bbcode_enabled = true
text = "Edit Resources as Spreadsheet
text = "Edit Resources as Table 2
\"Welp, it is what it sounds like!\"

View File

@ -1,4 +1,4 @@
class_name SpreadsheetEditFormat
class_name ResourceTablesEditFormat
extends RefCounted
var editor_view : Control

View File

@ -1,5 +1,5 @@
class_name SpreadsheetEditFormatCsv
extends SpreadsheetEditFormatTres
class_name ResourceTablesEditFormatCsv
extends ResourceTablesEditFormatTres
var import_data
var csv_rows = []
@ -70,7 +70,7 @@ func _bump_row_indices(from : int, increment : int = 1):
func import_from_path(path : String, insert_func : Callable, sort_by : String, sort_reverse : bool = false) -> Array:
import_data = load(path)
var file = FileAccess.open(import_data.edited_path, FileAccess.READ)
csv_rows = SpreadsheetImportFormatCsv.import_as_arrays(import_data)
csv_rows = ResourceTablesImportFormatCsv.import_as_arrays(import_data)
var rows := []
var res : Resource

View File

@ -1,5 +1,5 @@
class_name SpreadsheetEditFormatTres
extends SpreadsheetEditFormat
class_name ResourceTablesEditFormatTres
extends ResourceTablesEditFormat
var timer : SceneTreeTimer

View File

@ -1,4 +1,4 @@
class_name SpreadsheetExportFormatCsv
class_name ResourceTablesExportFormatCsv
extends RefCounted

View File

@ -1,4 +1,4 @@
class_name SpreadsheetImportFormatCsv
class_name ResourceTablesImportFormatCsv
extends RefCounted

View File

@ -15,7 +15,7 @@ var format_extension := ".csv"
var entries := []
var property_used_as_filename := 0
var import_data : SpreadsheetImport
var import_data : ResourceTablesImport
func _ready():
@ -48,7 +48,7 @@ func _on_create_file_pressed():
func _on_file_selected(path : String):
import_data = SpreadsheetImport.new()
import_data = ResourceTablesImport.new()
import_data.initialize(path)
_reset_controls()
_open_dialog(path)
@ -88,13 +88,13 @@ func _load_property_names(path):
# Don't guess Ints automatically - further rows might have floats
if entries[1][i].is_valid_float():
prop_types[i] = SpreadsheetImport.PropType.FLOAT
prop_types[i] = ResourceTablesImport.PropType.FLOAT
elif entries[1][i].begins_with("res://"):
prop_types[i] = SpreadsheetImport.PropType.OBJECT
prop_types[i] = ResourceTablesImport.PropType.OBJECT
else:
prop_types[i] = SpreadsheetImport.PropType.STRING
prop_types[i] = ResourceTablesImport.PropType.STRING
filename_options.clear()
for i in import_data.prop_names.size():
@ -167,7 +167,7 @@ func _on_export_csv_pressed():
for x in editor_view.node_columns.hidden_columns[editor_view.current_path].keys():
exported_cols.erase(x)
SpreadsheetExportFormatCsv.export_to_file(editor_view.rows, exported_cols, import_data.edited_path, import_data)
ResourceTablesExportFormatCsv.export_to_file(editor_view.rows, exported_cols, import_data.edited_path, import_data)
await get_tree().process_frame
editor_view.refresh()
close()

View File

@ -1,5 +1,5 @@
@tool
class_name SpreadsheetImport
class_name ResourceTablesImport
extends Resource
enum PropType {
@ -39,7 +39,7 @@ const TYPE_MAP := {
@export var remove_first_row := true
@export var new_script : GDScript
@export var view_script : Script = SpreadsheetEditFormatCsv
@export var view_script : Script = ResourceTablesEditFormatCsv
@export var delimeter := ";"
@export var enum_format : Array = [NameCasing.CAPS_WORD, " ", "Yes", "No"]

View File

@ -1,9 +1,9 @@
[plugin]
name="Edit Resources as Spreadsheet"
name="Edit Resources as Table"
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="2.3"
version="2.7"
script="plugin.gd"

View File

@ -20,7 +20,7 @@ func _exit_tree() -> void:
func _get_plugin_name():
return "Sheets"
return "ResourceTables"
func _make_visible(visible):

View File

@ -1,4 +1,4 @@
class_name SheetsCellEditor
class_name ResourceTablesCellEditor
extends RefCounted
const TextEditingUtilsClass := preload("res://addons/resources_spreadsheet_view/text_editing_utils.gd")

View File

@ -1,4 +1,4 @@
extends SheetsCellEditor
extends ResourceTablesCellEditor
const TablesPluginSettingsClass := preload("res://addons/resources_spreadsheet_view/settings_grid.gd")

View File

@ -1,4 +1,4 @@
extends SheetsCellEditor
extends ResourceTablesCellEditor
func can_edit_value(value, type, property_hint, column_index) -> bool:

View File

@ -1,4 +1,4 @@
extends SheetsCellEditor
extends ResourceTablesCellEditor
var _cached_color := Color.WHITE

View File

@ -1,4 +1,4 @@
extends SheetsCellEditor
extends ResourceTablesCellEditor
func can_edit_value(value, type, property_hint, column_index) -> bool:

View File

@ -1,4 +1,4 @@
extends SheetsCellEditor
extends ResourceTablesCellEditor
const TablesPluginSettingsClass := preload("res://addons/resources_spreadsheet_view/settings_grid.gd")

View File

@ -1,4 +1,4 @@
extends SheetsCellEditor
extends ResourceTablesCellEditor
func set_color(node : Control, color : Color):

View File

@ -1,5 +1,5 @@
@tool
extends SheetsDockEditor
extends ResourceTablesDockEditor
@onready var recent_container := $"HBoxContainer/Control2/HBoxContainer/HFlowContainer"
@onready var contents_label := $"HBoxContainer/HBoxContainer/Panel/Label"

View File

@ -1,5 +1,5 @@
@tool
class_name SheetsDockEditor
class_name ResourceTablesDockEditor
extends Control
const TablesPluginSettingsClass := preload("res://addons/resources_spreadsheet_view/settings_grid.gd")

View File

@ -1,5 +1,5 @@
@tool
extends SheetsDockEditor
extends ResourceTablesDockEditor
@onready var _value_rect := $"EditColor/ColorProper/ColorRect"
@onready var _color_picker_panel := $"EditColor/VSeparator6/Panel"

View File

@ -1,5 +1,5 @@
@tool
extends SheetsDockEditor
extends ResourceTablesDockEditor
@onready var options_container := $"HBoxContainer/Control2/HBoxContainer/HFlowContainer"
@onready var contents_label := $"HBoxContainer/HBoxContainer/Panel/Label"

View File

@ -1,5 +1,5 @@
@tool
extends SheetsDockEditor
extends ResourceTablesDockEditor
@onready var _value_label := $"HBoxContainer/HBoxContainer/NumberPanel/Label"
@onready var _button_grid := $"HBoxContainer/HBoxContainer/GridContainer"

View File

@ -1,5 +1,5 @@
@tool
extends SheetsDockEditor
extends ResourceTablesDockEditor
var _stored_value : Texture2D