mirror of
https://github.com/Relintai/godot_data_editor.git
synced 2025-04-17 14:26:33 +02:00
Fixed number fields bug
Added a check to prevent null values from causing issues with number fields.
This commit is contained in:
parent
c6e642f00b
commit
3f2b8c4bf5
@ -469,12 +469,13 @@ func delete_class(item_class):
|
||||
directory.remove(config_class_directory + "/" + item_class + ".png")
|
||||
|
||||
func create_class(name, icon_path):
|
||||
name = sanitize_string(name)
|
||||
|
||||
# Check if the classes folder already exists. If not, create it-
|
||||
var directory = Directory.new()
|
||||
if not directory.dir_exists(config_class_directory):
|
||||
directory.make_dir(config_class_directory)
|
||||
|
||||
name = sanitize_string(name)
|
||||
if name == "":
|
||||
emit_signal("class_insertion_failed", tr("Invalid name"), tr("The class name cannot be empty."))
|
||||
return
|
||||
|
@ -130,6 +130,8 @@ func create_bool():
|
||||
control.connect("toggled", self, "property_value_changed", [])
|
||||
|
||||
func create_number():
|
||||
if value == null:
|
||||
value = 0
|
||||
if hint == PROPERTY_HINT_RANGE:
|
||||
var control_min = -16777216
|
||||
var control_max = 16777216
|
||||
|
@ -130,6 +130,8 @@ func create_bool():
|
||||
control.connect("toggled", self, "property_value_changed", [])
|
||||
|
||||
func create_number():
|
||||
if value == null:
|
||||
value = 0
|
||||
if hint == PROPERTY_HINT_RANGE:
|
||||
var control_min = -16777216
|
||||
var control_max = 16777216
|
||||
|
Loading…
Reference in New Issue
Block a user