mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-11-13 20:47:19 +01:00
Added a new get_editor_class to the WoirldGeneratorBaseResource, and now the RectViewNode will also render it if it's not an empty string.
This commit is contained in:
parent
f739cca1f4
commit
9cac983ff5
@ -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,7 +36,7 @@ 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
|
||||
@ -44,6 +44,9 @@ func get_editor_rect_border_size() -> int:
|
||||
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"
|
||||
|
||||
|
@ -33,9 +33,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:
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user