mirror of
https://github.com/Relintai/godot_data_editor.git
synced 2025-04-17 14:26:33 +02:00
Fixed set_progress and get_progress
Added a property check which no longer prevents null and zero values from being updated.
This commit is contained in:
parent
980a2219e1
commit
cd56325a52
@ -28,16 +28,16 @@ func load_item_value(item, property):
|
||||
|
||||
|
||||
func get_progress(item_class, id, property):
|
||||
if items[item_class].has(id) and items[item_class][id].has(property):
|
||||
var item_exists = items[item_class].has(id)
|
||||
if item_exists and property in items[item_class][id]:
|
||||
return items[item_class][id][property]
|
||||
|
||||
|
||||
func set_progress(item_class, id, property, value):
|
||||
var item = item_manager.get_item(item_class, id)
|
||||
var has_value = item.get(property)
|
||||
if item and has_value:
|
||||
var item = item_manager.get_item(item_class, id)
|
||||
if item and property in item:
|
||||
item.set(property, value)
|
||||
if has_user_signal("@any_value_changed"):
|
||||
if has_user_signal("@any_value_changed "):
|
||||
emit_signal("@any_value_changed", item, property, value)
|
||||
|
||||
var signal_name = ""
|
||||
@ -130,9 +130,4 @@ func stop_observing_changes(observer):
|
||||
|
||||
|
||||
func set_item_progress(item, property, value):
|
||||
set_progress(item._class, item._id, property, value)
|
||||
|
||||
func get_progress_by_item(item):
|
||||
|
||||
|
||||
|
||||
set_progress(item._class, item._id, property, value)
|
@ -28,16 +28,16 @@ func load_item_value(item, property):
|
||||
|
||||
|
||||
func get_progress(item_class, id, property):
|
||||
if items[item_class].has(id) and items[item_class][id].has(property):
|
||||
var item_exists = items[item_class].has(id)
|
||||
if item_exists and property in items[item_class][id]:
|
||||
return items[item_class][id][property]
|
||||
|
||||
|
||||
func set_progress(item_class, id, property, value):
|
||||
var item = item_manager.get_item(item_class, id)
|
||||
var has_value = item.get(property)
|
||||
if item and has_value:
|
||||
var item = item_manager.get_item(item_class, id)
|
||||
if item and property in item:
|
||||
item.set(property, value)
|
||||
if has_user_signal("@any_value_changed"):
|
||||
if has_user_signal("@any_value_changed "):
|
||||
emit_signal("@any_value_changed", item, property, value)
|
||||
|
||||
var signal_name = ""
|
||||
@ -130,9 +130,4 @@ func stop_observing_changes(observer):
|
||||
|
||||
|
||||
func set_item_progress(item, property, value):
|
||||
set_progress(item._class, item._id, property, value)
|
||||
|
||||
func get_progress_by_item(item):
|
||||
|
||||
|
||||
|
||||
set_progress(item._class, item._id, property, value)
|
Loading…
Reference in New Issue
Block a user