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
|
extends Resource
|
||||||
class_name WorldGenBaseResource
|
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
|
export(bool) var locked : bool = false
|
||||||
|
|
||||||
func get_rect() -> Rect2:
|
func get_rect() -> Rect2:
|
||||||
@ -36,14 +36,17 @@ func get_editor_rect_border_color() -> Color:
|
|||||||
return Color(1, 1, 1, 1)
|
return Color(1, 1, 1, 1)
|
||||||
|
|
||||||
func get_editor_rect_color() -> Color:
|
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:
|
func get_editor_rect_border_size() -> int:
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
func get_editor_font_color() -> Color:
|
func get_editor_font_color() -> Color:
|
||||||
return Color(0, 0, 0, 1)
|
return Color(0, 0, 0, 1)
|
||||||
|
|
||||||
|
func get_editor_class() -> String:
|
||||||
|
return "WorldGenBaseResource"
|
||||||
|
|
||||||
func get_editor_additional_text() -> String:
|
func get_editor_additional_text() -> String:
|
||||||
return "WorldGenBaseResource"
|
return "WorldGenBaseResource"
|
||||||
|
|
||||||
|
@ -32,9 +32,17 @@ func _draw():
|
|||||||
|
|
||||||
if edited_resource:
|
if edited_resource:
|
||||||
res_name = edited_resource.resource_name
|
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()), 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)
|
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:
|
func refresh() -> void:
|
||||||
if !edited_resource:
|
if !edited_resource:
|
||||||
|
Loading…
Reference in New Issue
Block a user