mirror of
https://github.com/Relintai/godot-resources-as-sheets-plugin.git
synced 2025-04-08 17:41:50 +02:00
Fix errors, now for real
This commit is contained in:
parent
31278bea43
commit
ab983d34be
@ -55,6 +55,7 @@ func has_row_names():
|
||||
func import_from_path(folderpath : String, insert_func : Callable, sort_by : String, sort_reverse : bool = false) -> Array:
|
||||
var rows := []
|
||||
var dir := DirAccess.open(folderpath)
|
||||
if dir == null: return []
|
||||
dir.list_dir_begin()
|
||||
|
||||
editor_view.remembered_paths.clear()
|
||||
|
@ -58,18 +58,7 @@ func _input(event : InputEvent):
|
||||
|
||||
# Ctrl + Z (before, and instead of, committing the action!)
|
||||
if Input.is_key_pressed(KEY_CTRL):
|
||||
if event.keycode == KEY_Z:
|
||||
if Input.is_key_pressed(KEY_SHIFT):
|
||||
editor_view.editor_plugin.undo_redo.redo()
|
||||
# Ctrl + z (smol)
|
||||
else:
|
||||
editor_view.editor_plugin.undo_redo.undo()
|
||||
|
||||
return
|
||||
|
||||
# This shortcut is used by Godot as well.
|
||||
if event.keycode == KEY_Y:
|
||||
editor_view.editor_plugin.undo_redo.redo()
|
||||
if event.keycode == KEY_Z || event.keycode == KEY_Y:
|
||||
return
|
||||
|
||||
_key_specific_action(event)
|
||||
|
@ -13,8 +13,8 @@ const EditorView = preload("res://addons/resources_spreadsheet_view/editor_view.
|
||||
|
||||
@onready var editor_view : EditorView = get_parent()
|
||||
|
||||
var edited_cells = []
|
||||
var edited_cells_text : Array[String] = []
|
||||
var edited_cells := []
|
||||
var edited_cells_text := []
|
||||
var edit_cursor_positions : Array[int] = []
|
||||
|
||||
var all_cell_editors : Array[Object]
|
||||
@ -52,7 +52,7 @@ func _draw():
|
||||
|
||||
var char_size := Vector2(0, font.get_ascent(font_size))
|
||||
var cursor_pos := Vector2(label_padding_left, 0)
|
||||
var cell_text := edited_cells_text[i]
|
||||
var cell_text : String = edited_cells_text[i]
|
||||
var cell : Control = edited_cells[i]
|
||||
if cell is Label and cell.horizontal_alignment == HORIZONTAL_ALIGNMENT_RIGHT:
|
||||
cursor_pos.x += cell.size.x - font.get_multiline_string_size(edited_cells[i].text, HORIZONTAL_ALIGNMENT_RIGHT, -1, font_size).x
|
||||
|
Loading…
Reference in New Issue
Block a user