mirror of
https://github.com/Relintai/uml_generator.git
synced 2024-11-20 10:57:28 +01:00
Instead of a base class keyword with a support for only a name, added an inherit keyword, which just adds an inherit arrow below the current class.
This commit is contained in:
parent
b99e2bbaef
commit
0344192367
36
project/BaseClassArrow.tscn
Normal file
36
project/BaseClassArrow.tscn
Normal file
@ -0,0 +1,36 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://inherits.png" type="Texture" id=1]
|
||||
[ext_resource path="res://line.png" type="Texture" id=2]
|
||||
|
||||
[node name="BaseClassArrow" type="VBoxContainer"]
|
||||
margin_right = 51.0
|
||||
margin_bottom = 62.0
|
||||
custom_constants/separation = 0
|
||||
alignment = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
margin_top = 18.0
|
||||
margin_right = 51.0
|
||||
margin_bottom = 44.0
|
||||
alignment = 1
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"]
|
||||
margin_left = 16.0
|
||||
margin_right = 35.0
|
||||
margin_bottom = 26.0
|
||||
custom_constants/separation = 0
|
||||
alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="HBoxContainer/VBoxContainer"]
|
||||
margin_right = 19.0
|
||||
margin_bottom = 16.0
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="TextureRect2" type="TextureRect" parent="HBoxContainer/VBoxContainer"]
|
||||
margin_top = 16.0
|
||||
margin_right = 19.0
|
||||
margin_bottom = 26.0
|
||||
rect_min_size = Vector2( 0, 10 )
|
||||
texture = ExtResource( 2 )
|
||||
expand = true
|
@ -1,4 +0,0 @@
|
||||
extends VBoxContainer
|
||||
|
||||
func set_base_class_name(text):
|
||||
$Container/PanelContainer/Label.text = text
|
@ -1,54 +0,0 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://BaseClassControl.gd" type="Script" id=1]
|
||||
[ext_resource path="res://inherits.png" type="Texture" id=2]
|
||||
[ext_resource path="res://line.png" type="Texture" id=3]
|
||||
|
||||
[node name="BaseClassControl" type="VBoxContainer"]
|
||||
margin_right = 51.0
|
||||
margin_bottom = 62.0
|
||||
custom_constants/separation = 0
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Container" type="CenterContainer" parent="."]
|
||||
margin_right = 57.0
|
||||
margin_bottom = 28.0
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="Container"]
|
||||
margin_right = 57.0
|
||||
margin_bottom = 28.0
|
||||
|
||||
[node name="Label" type="Label" parent="Container/PanelContainer"]
|
||||
margin_left = 7.0
|
||||
margin_top = 7.0
|
||||
margin_right = 50.0
|
||||
margin_bottom = 21.0
|
||||
text = "Object"
|
||||
align = 1
|
||||
valign = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
margin_top = 28.0
|
||||
margin_right = 57.0
|
||||
margin_bottom = 54.0
|
||||
alignment = 1
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"]
|
||||
margin_left = 19.0
|
||||
margin_right = 38.0
|
||||
margin_bottom = 26.0
|
||||
custom_constants/separation = 0
|
||||
alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="HBoxContainer/VBoxContainer"]
|
||||
margin_right = 19.0
|
||||
margin_bottom = 16.0
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="TextureRect2" type="TextureRect" parent="HBoxContainer/VBoxContainer"]
|
||||
margin_top = 16.0
|
||||
margin_right = 19.0
|
||||
margin_bottom = 26.0
|
||||
rect_min_size = Vector2( 0, 10 )
|
||||
texture = ExtResource( 3 )
|
||||
expand = true
|
@ -1,6 +1,6 @@
|
||||
extends Control
|
||||
|
||||
var BaseClassControl = preload("res://BaseClassControl.tscn")
|
||||
var BaseClassArrow = preload("res://BaseClassArrow.tscn")
|
||||
var ClassControl = preload("res://ClassControl.tscn")
|
||||
|
||||
export(NodePath) var content_container_path : NodePath
|
||||
@ -105,12 +105,8 @@ func _process_state_next(delta):
|
||||
_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)
|
||||
|
||||
if l.begins_with("inherit"):
|
||||
var bcc = BaseClassArrow.instance()
|
||||
current_content_container.add_child(bcc)
|
||||
continue
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
|
||||
class ASd
|
||||
current_content_container.set("custom_constants/separation", 0)
|
||||
new_column
|
||||
base_class Object
|
||||
base_class Reference
|
||||
class Object
|
||||
inherit
|
||||
class Reference
|
||||
inherit
|
||||
class Directory
|
||||
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user