diff --git a/arrow.gd b/arrow.gd index 6a88f01..a76b9e9 100644 --- a/arrow.gd +++ b/arrow.gd @@ -19,8 +19,8 @@ func _process(_delta): $Target.text = ""#$Target.text.substr(0,8) $Target.show() $Line.points[1] = end - global_position - $Label.position = ($Line.points[0] + $Line.points[1])/2 - $Tip.position = ($Line.points[0] + $Line.points[1])/2 + $Label.position = ($Line.points[0] + $Line.points[1])/1.3 + $Tip.position = ($Line.points[0] + $Line.points[1])/1.3 $Tip.rotation = PI+$Line.points[0].angle_to($Line.points[1]) func label_set(new_label): diff --git a/arrow.tscn b/arrow.tscn index 31cd3f2..3eaa6cf 100644 --- a/arrow.tscn +++ b/arrow.tscn @@ -20,7 +20,14 @@ z_index = 1 position = Vector2( -9.66138, -2.89842 ) z_index = -1 color = Color( 0.2, 0.2, 0.2, 1 ) -polygon = PoolVector2Array( -19.8744, 17.0372, 47.7551, 11.8845, -10.5351, -21.2861 ) +polygon = PoolVector2Array( -8.50021, 20.4619, 36.1874, 8.44903, 0.869781, -21.8232 ) + +[node name="Polygon2" type="Polygon2D" parent="Tip"] +visible = false +position = Vector2( -9.66138, -2.89842 ) +z_index = -1 +color = Color( 0.2, 0.2, 0.2, 1 ) +polygon = PoolVector2Array( -8.50021, 20.4619, 22.2526, 5.80623, 2.31131, -19.9012, -12.104, -23.7453, 4.95413, 1.72188, -21.9546, 16.1372 ) [node name="Label" type="Node2D" parent="."] visible = false @@ -40,6 +47,7 @@ __meta__ = { } [node name="Target" type="Label" parent="."] +visible = false margin_left = -229.024 margin_top = 63.3118 margin_right = 232.976 diff --git a/node.gd b/node.gd index 330dac8..7fdeed0 100644 --- a/node.gd +++ b/node.gd @@ -55,18 +55,24 @@ func type_set(new_type): #$ID.text = $ID.text.replace("refs/", "") match new_type: "blob": - $Rect.color = Color("#333333") + $Sprite.texture = preload("res://nodes/blob.svg") + #$Rect.color = Color("#333333") "tree": - $Rect.color = Color.darkgreen + $Sprite.texture = preload("res://nodes/tree.svg") + #$Rect.color = Color.darkgreen "commit": - $Rect.color = Color.orange + $Sprite.texture = preload("res://nodes/commit.svg") + #$Rect.color = Color.orange "tag": - $Rect.color = Color.blue + $Sprite.texture = preload("res://nodes/blob.svg") + #$Rect.color = Color.blue "ref": - $Rect.color = Color("#6680ff") + $Sprite.texture = preload("res://nodes/ref.svg") + #$Rect.color = Color("#6680ff") id_always_visible = true "head": - $Rect.color = Color.red + $Sprite.texture = preload("res://nodes/ref.svg") + #$Rect.color = Color.red id_always_visible = true if id_always_visible: $ID.show() diff --git a/node.tscn b/node.tscn index 9fdf821..ccb46f9 100644 --- a/node.tscn +++ b/node.tscn @@ -2,6 +2,7 @@ [ext_resource path="res://node.gd" type="Script" id=1] [ext_resource path="res://fonts/default.tres" type="DynamicFont" id=2] +[ext_resource path="res://nodes/blob.svg" type="Texture" id=3] [sub_resource type="StyleBoxFlat" id=1] content_margin_left = 5.0 @@ -14,9 +15,6 @@ corner_radius_top_right = 5 corner_radius_bottom_right = 5 corner_radius_bottom_left = 5 -[sub_resource type="RectangleShape2D" id=2] -extents = Vector2( 30.4838, 29.9015 ) - [node name="Node" type="Node2D"] z_index = 1 script = ExtResource( 1 ) @@ -25,13 +23,17 @@ script = ExtResource( 1 ) margin_left = -29.0 margin_top = -28.0 margin_right = 29.0 -margin_bottom = 30.0 +margin_bottom = 29.0 mouse_filter = 1 -color = Color( 0.984314, 0, 0, 1 ) +color = Color( 1, 1, 1, 0 ) __meta__ = { "_edit_use_anchors_": false } +[node name="Sprite" type="Sprite" parent="."] +scale = Vector2( 0.5, 0.5 ) +texture = ExtResource( 3 ) + [node name="ID" type="Label" parent="."] visible = false margin_left = -19.9265 @@ -47,10 +49,10 @@ __meta__ = { [node name="Content" type="Label" parent="."] visible = false -margin_left = -30.0 -margin_top = 37.0 -margin_right = -20.0 -margin_bottom = 72.0 +margin_left = -22.2898 +margin_top = 30.1969 +margin_right = -12.2898 +margin_bottom = 65.1969 custom_styles/normal = SubResource( 1 ) custom_fonts/font = ExtResource( 2 ) custom_colors/font_color = Color( 1, 1, 1, 1 ) @@ -58,14 +60,6 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="Area" type="Area2D" parent="."] - -[node name="CollisionShape2D" type="CollisionShape2D" parent="Area"] -shape = SubResource( 2 ) - [node name="Arrows" type="Node2D" parent="."] [connection signal="mouse_entered" from="Rect" to="." method="_on_hover"] [connection signal="mouse_exited" from="Rect" to="." method="_on_unhover"] -[connection signal="input_event" from="Area" to="." method="_input_event"] -[connection signal="mouse_entered" from="Area" to="." method="_on_hover"] -[connection signal="mouse_exited" from="Area" to="." method="_on_unhover"] diff --git a/nodes/blob.svg b/nodes/blob.svg new file mode 100644 index 0000000..33f42dd --- /dev/null +++ b/nodes/blob.svg @@ -0,0 +1,62 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/nodes/blob.svg.import b/nodes/blob.svg.import new file mode 100644 index 0000000..725b562 --- /dev/null +++ b/nodes/blob.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/blob.svg-32176d6d674206dbc69554456f0ea720.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://nodes/blob.svg" +dest_files=[ "res://.import/blob.svg-32176d6d674206dbc69554456f0ea720.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/nodes/commit.svg b/nodes/commit.svg new file mode 100644 index 0000000..9d830e2 --- /dev/null +++ b/nodes/commit.svg @@ -0,0 +1,64 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/nodes/commit.svg.import b/nodes/commit.svg.import new file mode 100644 index 0000000..d47ebc6 --- /dev/null +++ b/nodes/commit.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/commit.svg-e84b6d5f0dcf8ee449788a8c35e799e5.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://nodes/commit.svg" +dest_files=[ "res://.import/commit.svg-e84b6d5f0dcf8ee449788a8c35e799e5.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/nodes/ref.svg b/nodes/ref.svg new file mode 100644 index 0000000..6bc5c79 --- /dev/null +++ b/nodes/ref.svg @@ -0,0 +1,78 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/nodes/ref.svg.import b/nodes/ref.svg.import new file mode 100644 index 0000000..1ad858d --- /dev/null +++ b/nodes/ref.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/ref.svg-ba1531cc32a42d39c1bb1fbb28f745fb.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://nodes/ref.svg" +dest_files=[ "res://.import/ref.svg-ba1531cc32a42d39c1bb1fbb28f745fb.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/nodes/tree.svg b/nodes/tree.svg new file mode 100644 index 0000000..0b997f1 --- /dev/null +++ b/nodes/tree.svg @@ -0,0 +1,72 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/nodes/tree.svg.import b/nodes/tree.svg.import new file mode 100644 index 0000000..8192b20 --- /dev/null +++ b/nodes/tree.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/tree.svg-3883bff21a1825dc9656cd06abe52ea6.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://nodes/tree.svg" +dest_files=[ "res://.import/tree.svg-3883bff21a1825dc9656cd06abe52ea6.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0