Multiple columns support.

This commit is contained in:
Relintai 2022-04-27 15:03:20 +02:00
parent e006794655
commit b99e2bbaef
3 changed files with 16 additions and 6 deletions

View File

@ -82,6 +82,9 @@ func _process_state_next(delta):
content = content.replace("\r\n", "\n")
var lines : Array = content.split("\n")
var current_content_container : VBoxContainer = VBoxContainer.new()
current_content_container.set("custom_constants/separation", 0)
_content_container.add_child(current_content_container)
var in_class : bool = false
var current_class_access_modifier : int = AccessModifierState.ACCESS_MODIFIER_PRIVATE
var class_control : Control = null
@ -96,13 +99,19 @@ func _process_state_next(delta):
if l[0] == "#":
continue
if l.begins_with("new_column"):
current_content_container = VBoxContainer.new()
current_content_container.set("custom_constants/separation", 0)
_content_container.add_child(current_content_container)
continue
if l.begins_with("base_class "):
var base_class : String = l.trim_prefix("base_class ")
var bcc = BaseClassControl.instance()
bcc.set_base_class_name(base_class)
_content_container.add_child(bcc)
current_content_container.add_child(bcc)
continue
if l.begins_with("class "):
@ -110,7 +119,7 @@ func _process_state_next(delta):
current_class_access_modifier = AccessModifierState.ACCESS_MODIFIER_PRIVATE
class_control = ClassControl.instance()
class_control.set_class_name(l.trim_prefix("class "))
_content_container.add_child(class_control)
current_content_container.add_child(class_control)
continue
if l.begins_with("struct "):
@ -118,7 +127,7 @@ func _process_state_next(delta):
current_class_access_modifier = AccessModifierState.ACCESS_MODIFIER_PUBLIC
class_control = ClassControl.instance()
class_control.set_class_name(l.trim_prefix("struct "))
_content_container.add_child(class_control)
current_content_container.add_child(class_control)
continue
if l.begins_with("public:"):

View File

@ -14,6 +14,4 @@ content_container_path = NodePath("ScrollContainer/Content")
margin_right = 1024.0
margin_bottom = 600.0
[node name="Content" type="VBoxContainer" parent="ScrollContainer"]
custom_constants/separation = 0
alignment = 1
[node name="Content" type="HBoxContainer" parent="ScrollContainer"]

View File

@ -1,4 +1,7 @@
class ASd
current_content_container.set("custom_constants/separation", 0)
new_column
base_class Object
base_class Reference
class Directory