diff --git a/game/addons/world_generator/resources/world_gen_base_resource.gd b/game/addons/world_generator/resources/world_gen_base_resource.gd index a275d943..7cd45098 100644 --- a/game/addons/world_generator/resources/world_gen_base_resource.gd +++ b/game/addons/world_generator/resources/world_gen_base_resource.gd @@ -2,7 +2,7 @@ tool extends Resource class_name WorldGenBaseResource -export(Rect2) var rect : Rect2 = Rect2(0, 0, 1, 1) +export(Rect2) var rect : Rect2 = Rect2(0, 0, 100, 100) export(bool) var locked : bool = false func get_rect() -> Rect2: @@ -36,14 +36,17 @@ func get_editor_rect_border_color() -> Color: return Color(1, 1, 1, 1) func get_editor_rect_color() -> Color: - return Color(0.8, 0.8, 0.8, 0.9) + return Color(1, 1, 1, 0.9) func get_editor_rect_border_size() -> int: return 2 func get_editor_font_color() -> Color: return Color(0, 0, 0, 1) - + +func get_editor_class() -> String: + return "WorldGenBaseResource" + func get_editor_additional_text() -> String: return "WorldGenBaseResource" diff --git a/game/addons/world_generator/ui/RectViewNode.gd b/game/addons/world_generator/ui/RectViewNode.gd index 038959eb..3b4a13bc 100644 --- a/game/addons/world_generator/ui/RectViewNode.gd +++ b/game/addons/world_generator/ui/RectViewNode.gd @@ -32,9 +32,17 @@ func _draw(): if edited_resource: res_name = edited_resource.resource_name + + var res_cls : String = "" + + if edited_resource: + res_cls = edited_resource.get_editor_class() draw_string(font, Vector2(_editor_rect_border_size, font.get_height()), res_name, _edited_resource_font_color) draw_string(font, Vector2(_editor_rect_border_size, font.get_height() * 2), _editor_additional_text, _edited_resource_font_color, get_rect().size.x) + + if res_cls != "": + draw_string(font, Vector2(_editor_rect_border_size, font.get_height() * 3), res_cls, _edited_resource_font_color, get_rect().size.x) func refresh() -> void: if !edited_resource: