From 4e8e8605629f820411232b041b13929b0a164036 Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 5 Aug 2022 13:42:22 +0200 Subject: [PATCH] Now WorldGenBaseResources can draw additional graphics to the RectViewNodes. --- .../world_generator/resources/world_gen_base_resource.gd | 6 ++++++ game/addons/world_generator/ui/RectViewNode.gd | 2 ++ 2 files changed, 8 insertions(+) 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 122e1ae7..204f4446 100644 --- a/game/addons/world_generator/resources/world_gen_base_resource.gd +++ b/game/addons/world_generator/resources/world_gen_base_resource.gd @@ -197,6 +197,12 @@ func get_editor_class() -> String: func get_editor_additional_text() -> String: return "" + +func eitor_draw_additional(rect_view_node : MarginContainer) -> void: + _eitor_draw_additional(rect_view_node) + +func _eitor_draw_additional(rect_view_node : MarginContainer) -> void: + pass func setup_property_inspector(inspector) -> void: inspector.add_slot_line_edit("get_name", "set_name", "Name") diff --git a/game/addons/world_generator/ui/RectViewNode.gd b/game/addons/world_generator/ui/RectViewNode.gd index 5580615b..6d5c1808 100644 --- a/game/addons/world_generator/ui/RectViewNode.gd +++ b/game/addons/world_generator/ui/RectViewNode.gd @@ -58,6 +58,8 @@ func _draw(): if _editor_additional_text != "": draw_string(font, Vector2(_editor_rect_border_size, font.get_height() * 3), _editor_additional_text, _edited_resource_font_color, get_rect().size.x) + if edited_resource: + edited_resource.eitor_draw_additional(self) func refresh() -> void: if !edited_resource: