mirror of
https://github.com/Relintai/godot-resources-as-sheets-plugin.git
synced 2025-04-08 17:41:50 +02:00
Codestyle and resource fixes
This commit is contained in:
parent
e123e8d08a
commit
686d59bc6e
@ -324,7 +324,7 @@ func duplicate_selected_rows(new_name : String):
|
||||
func delete_selected_rows():
|
||||
io.delete_rows(_get_row_resources(_selection.get_edited_rows()))
|
||||
refresh()
|
||||
call_deferred(&"refresh")
|
||||
refresh.call_deferred()
|
||||
|
||||
|
||||
func has_row_names():
|
||||
|
@ -54,7 +54,7 @@ func initialize(path):
|
||||
|
||||
func save():
|
||||
resource_path = edited_path.get_basename() + SUFFIX
|
||||
ResourceSaver.call_deferred("save", self)
|
||||
ResourceSaver.save.call_deferred(self)
|
||||
|
||||
|
||||
func string_to_property(string : String, col_index : int):
|
||||
|
@ -84,13 +84,6 @@ func _key_specific_action(event : InputEvent):
|
||||
elif event.keycode == KEY_TAB:
|
||||
_move_selection_on_grid((1 if !ctrl_pressed else 10), 0)
|
||||
|
||||
# Non-text and paths can't be edited.
|
||||
if editor_view.columns[column] == "resource_path":
|
||||
return
|
||||
|
||||
if !selection.column_editors[column].is_text():
|
||||
return
|
||||
|
||||
# CURSOR MOVEMENT
|
||||
if event.keycode == KEY_LEFT:
|
||||
TextEditingUtilsClass.multi_move_left(
|
||||
|
@ -175,11 +175,11 @@ func can_select_cell(cell : Control) -> bool:
|
||||
return !cell in edited_cells
|
||||
|
||||
|
||||
func get_cell_column(cell) -> int:
|
||||
func get_cell_column(cell : Control) -> int:
|
||||
return cell.get_index() % editor_view.columns.size()
|
||||
|
||||
|
||||
func get_cell_row(cell) -> int:
|
||||
func get_cell_row(cell : Control) -> int:
|
||||
return cell.get_index() / editor_view.columns.size() + editor_view.first_row
|
||||
|
||||
|
||||
|
@ -65,7 +65,7 @@ static func multi_erase_right(values : Array, cursor_positions : Array, ctrl_pre
|
||||
return values
|
||||
|
||||
|
||||
static func multi_erase_left(values : Array, cursor_positions : Array, ctrl_pressed):
|
||||
static func multi_erase_left(values : Array, cursor_positions : Array, ctrl_pressed : bool):
|
||||
for i in values.size():
|
||||
var start_pos = cursor_positions[i]
|
||||
|
||||
@ -78,12 +78,12 @@ static func multi_erase_left(values : Array, cursor_positions : Array, ctrl_pres
|
||||
return values
|
||||
|
||||
|
||||
static func multi_move_left(values : Array, cursor_positions : Array, ctrl_pressed):
|
||||
static func multi_move_left(values : Array, cursor_positions : Array, ctrl_pressed : bool):
|
||||
for i in cursor_positions.size():
|
||||
cursor_positions[i] = _step_cursor(values[i], cursor_positions[i], -1, ctrl_pressed)
|
||||
|
||||
|
||||
static func multi_move_right(values : Array, cursor_positions : Array, ctrl_pressed):
|
||||
static func multi_move_right(values : Array, cursor_positions : Array, ctrl_pressed : bool):
|
||||
for i in cursor_positions.size():
|
||||
cursor_positions[i] = _step_cursor(values[i], cursor_positions[i], 1, ctrl_pressed)
|
||||
|
||||
|
@ -10,7 +10,7 @@ func create_cell(caller : Control) -> Control:
|
||||
node.custom_minimum_size.x = 56
|
||||
node.add_child(color)
|
||||
color.name = "Color"
|
||||
call_deferred(&"_resize_color_rect", color)
|
||||
_resize_color_rect.call_deferred(color)
|
||||
return node
|
||||
|
||||
|
||||
|
@ -169,7 +169,7 @@ func var_to_str_no_sort(value, indent = " ", cur_indent = ""):
|
||||
cur_indent += indent
|
||||
lines.resize(value.size())
|
||||
for i in lines.size():
|
||||
if value[i] is Array || value[i] is Dictionary:
|
||||
if value[i] is Array or value[i] is Dictionary:
|
||||
lines[i] = "%s%s" % [cur_indent, var_to_str_no_sort(value[i])]
|
||||
|
||||
else:
|
||||
@ -184,7 +184,7 @@ func var_to_str_no_sort(value, indent = " ", cur_indent = ""):
|
||||
cur_indent += indent
|
||||
lines.resize(keys.size())
|
||||
for i in lines.size():
|
||||
if values[i] is Array || values[i] is Dictionary:
|
||||
if values[i] is Array or values[i] is Dictionary:
|
||||
lines[i] = "%s%s : %s" % [cur_indent, var_to_str(keys[i]), var_to_str_no_sort(values[i])]
|
||||
|
||||
else:
|
||||
|
@ -15,7 +15,7 @@ icon = ExtResource("1_utkae")
|
||||
prerequisites = Array[ExtResource("2")]([])
|
||||
color2 = Color(0.964706, 0.298039, 0.298039, 1)
|
||||
base_weight = 10.0
|
||||
is_notable = true
|
||||
is_notable = false
|
||||
multiplier_per_tag = ""
|
||||
multiplier_if_tag_present = ""
|
||||
multiplier_if_tag_not_present = "elemental 0"
|
||||
|
@ -15,7 +15,7 @@ icon = ExtResource("1")
|
||||
prerequisites = Array[ExtResource("2")]([])
|
||||
color2 = Color(0.129412, 1, 0.243137, 1)
|
||||
base_weight = 10.0
|
||||
is_notable = true
|
||||
is_notable = false
|
||||
multiplier_per_tag = "strength 1.5 melee 2.0"
|
||||
multiplier_if_tag_present = ""
|
||||
multiplier_if_tag_not_present = ""
|
||||
|
@ -19,7 +19,7 @@ prerequisites = Array[ExtResource("2")]([ExtResource("2_kb33p"), ExtResource("3_
|
||||
color2 = Color(0.992157, 0.941176, 0.2, 1)
|
||||
base_weight = 1.0
|
||||
is_notable = true
|
||||
multiplier_per_tag = ""
|
||||
multiplier_per_tag = "strength 1.2"
|
||||
multiplier_if_tag_present = ""
|
||||
multiplier_if_tag_not_present = "strength 0"
|
||||
max_tags_present = ""
|
||||
|
@ -15,7 +15,7 @@ icon = ExtResource("1_prpsx")
|
||||
prerequisites = Array[ExtResource("2")]([])
|
||||
color2 = Color(0.964706, 0.298039, 0.298039, 1)
|
||||
base_weight = 10.0
|
||||
is_notable = true
|
||||
is_notable = false
|
||||
multiplier_per_tag = ""
|
||||
multiplier_if_tag_present = ""
|
||||
multiplier_if_tag_not_present = "aoe 0"
|
||||
|
Loading…
Reference in New Issue
Block a user