Fix validation bug and improve color contrast
- Fixed validation error by checking TYPE_DICTIONARY instead of is_empty() - Removed hardcoded colors, using Godot's built-in theme colors instead
This commit is contained in:
@@ -77,7 +77,6 @@ func _ready() -> void:
|
|||||||
|
|
||||||
room_filter_label = Label.new()
|
room_filter_label = Label.new()
|
||||||
room_filter_label.text = "Showing all rooms"
|
room_filter_label.text = "Showing all rooms"
|
||||||
room_filter_label.add_theme_color_override("font_color", Color(0.7, 0.7, 0.7))
|
|
||||||
left_vbox.add_child(room_filter_label)
|
left_vbox.add_child(room_filter_label)
|
||||||
|
|
||||||
room_list = ItemList.new()
|
room_list = ItemList.new()
|
||||||
@@ -105,7 +104,6 @@ func _ready() -> void:
|
|||||||
# Status label
|
# Status label
|
||||||
status_label = Label.new()
|
status_label = Label.new()
|
||||||
status_label.text = ""
|
status_label.text = ""
|
||||||
status_label.add_theme_color_override("font_color", Color(1, 0.5, 0.2))
|
|
||||||
content_vbox.add_child(status_label)
|
content_vbox.add_child(status_label)
|
||||||
|
|
||||||
# Buttons
|
# Buttons
|
||||||
@@ -208,7 +206,7 @@ func _validate_selection() -> void:
|
|||||||
return
|
return
|
||||||
|
|
||||||
var arrival_data = arrival_list.get_item_metadata(arrival_idx[0])
|
var arrival_data = arrival_list.get_item_metadata(arrival_idx[0])
|
||||||
if arrival_data == null or arrival_data.is_empty():
|
if arrival_data == null or typeof(arrival_data) != TYPE_DICTIONARY:
|
||||||
apply_button.disabled = true
|
apply_button.disabled = true
|
||||||
status_label.text = "Invalid arrival point selected"
|
status_label.text = "Invalid arrival point selected"
|
||||||
return
|
return
|
||||||
@@ -266,7 +264,11 @@ func _update_bidirectional_connection(dest_scene_path: String, arrival_node_name
|
|||||||
Update the destination scene to create/update the return transition.
|
Update the destination scene to create/update the return transition.
|
||||||
Returns empty string on success, error message on failure.
|
Returns empty string on success, error message on failure.
|
||||||
"""
|
"""
|
||||||
var current_scene_path = transition_piece.get_tree().edited_scene_root.scene_file_path
|
var current_scene = EditorInterface.get_edited_scene_root()
|
||||||
|
if current_scene == null:
|
||||||
|
return "Could not determine current scene"
|
||||||
|
|
||||||
|
var current_scene_path = current_scene.scene_file_path
|
||||||
var current_room_name = transition_piece.name
|
var current_room_name = transition_piece.name
|
||||||
|
|
||||||
# Load destination packed scene
|
# Load destination packed scene
|
||||||
|
|||||||
Reference in New Issue
Block a user