mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-12-02 10:52:00 +03:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
a0abd40308
@ -4,7 +4,6 @@
|
||||
[ext_resource path="res://fonts/default.tres" type="DynamicFont" id=2]
|
||||
[ext_resource path="res://styles/theme.tres" type="Theme" id=3]
|
||||
|
||||
|
||||
[node name="FileBrowser" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
@ -81,7 +80,6 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
custom_constants/vseparation = 16
|
||||
custom_constants/hseparation = 16
|
||||
columns = 4
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
@ -78,6 +78,9 @@ func load_level(level_id):
|
||||
new_repo.path = repo.path
|
||||
new_repo.label = repo.slug
|
||||
new_repo.size_flags_horizontal = SIZE_EXPAND_FILL
|
||||
new_repo.size_flags_vertical = SIZE_EXPAND_FILL
|
||||
if new_repo.label != "yours":
|
||||
new_repo.file_browser_active = false
|
||||
repositories_node.add_child(new_repo)
|
||||
repositories[r] = new_repo
|
||||
|
||||
|
@ -60,16 +60,13 @@ margin_bottom = 784.0
|
||||
mouse_filter = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Repositories" type="HBoxContainer" parent="Rows/Columns"]
|
||||
[node name="Repositories" type="VBoxContainer" parent="Rows/Columns"]
|
||||
margin_right = 1266.0
|
||||
margin_bottom = 784.0
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 2.0
|
||||
custom_constants/separation = 8
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="LevelInfo" type="VBoxContainer" parent="Rows/Columns"]
|
||||
margin_left = 1271.0
|
||||
|
@ -35,15 +35,17 @@ func _process(_delta):
|
||||
apply_forces()
|
||||
|
||||
func apply_forces():
|
||||
var offset = Vector2(0, 80)
|
||||
var offset = Vector2(-80, 0)
|
||||
|
||||
for c in children.keys():
|
||||
if type == "ref" or type == "head":
|
||||
offset = Vector2(0, 80)
|
||||
if repository.objects.has(c):
|
||||
var other = repository.objects[c]
|
||||
if other.visible:
|
||||
var d = other.position.distance_to(position+offset)
|
||||
var dir = (other.position - (position+offset)).normalized()
|
||||
var f = (d*0.03)
|
||||
var f = (d*0.12)
|
||||
position += dir*f
|
||||
other.position -= dir*f
|
||||
|
||||
@ -98,15 +100,16 @@ func children_set(new_children):
|
||||
|
||||
func _on_hover():
|
||||
hovered = true
|
||||
if not id_always_visible:
|
||||
content_label.visible = true
|
||||
if not id_always_visible and type != "head":
|
||||
if not file_browser.visible:
|
||||
content_label.visible = true
|
||||
#$ID.visible = true
|
||||
|
||||
func _on_unhover():
|
||||
hovered = false
|
||||
if not id_always_visible:
|
||||
if not id_always_visible and type != "head":
|
||||
content_label.visible = false
|
||||
$ID.visible = false
|
||||
#$ID.visible = false
|
||||
|
||||
func _input(event):
|
||||
if hovered:
|
||||
@ -126,5 +129,6 @@ func _input(event):
|
||||
var state = file_browser.visible
|
||||
repository.close_all_file_browsers()
|
||||
file_browser.visible = not state
|
||||
content_label.visible = state
|
||||
|
||||
start_pos = null
|
||||
|
@ -70,10 +70,10 @@ z_index = 1
|
||||
|
||||
[node name="ContentLabel" type="Label" parent="Content"]
|
||||
visible = false
|
||||
margin_left = 31.3944
|
||||
margin_top = -22.8078
|
||||
margin_right = 41.3944
|
||||
margin_bottom = 12.1922
|
||||
margin_left = -22.057
|
||||
margin_top = 31.1738
|
||||
margin_right = -12.057
|
||||
margin_bottom = 66.1738
|
||||
custom_styles/normal = SubResource( 2 )
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
custom_colors/font_color = Color( 1, 1, 1, 1 )
|
||||
@ -88,10 +88,10 @@ z_index = 2
|
||||
visible = false
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = -460.672
|
||||
margin_top = -23.6409
|
||||
margin_right = -32.6716
|
||||
margin_bottom = 118.359
|
||||
margin_left = -23.2915
|
||||
margin_top = 30.6967
|
||||
margin_right = 404.709
|
||||
margin_bottom = 172.697
|
||||
mouse_filter = 1
|
||||
mode = 1
|
||||
[connection signal="mouse_entered" from="Rect" to="." method="_on_hover"]
|
||||
|
@ -1,8 +1,8 @@
|
||||
extends Control
|
||||
|
||||
onready var index = $Rows/Browsers/Index
|
||||
onready var index = $Browsers/Index
|
||||
onready var nodes = $Rows/RepoVis/Nodes
|
||||
onready var file_browser = $Rows/Browsers/FileBrowser
|
||||
onready var file_browser = $Browsers/FileBrowser
|
||||
onready var label_node = $Rows/RepoVis/Label
|
||||
onready var path_node = $Rows/RepoVis/Path
|
||||
onready var simplify_checkbox = $Rows/RepoVis/SimplifyCheckbox
|
||||
@ -148,7 +148,7 @@ func update_node_positions():
|
||||
var hash_regex = RegEx.new()
|
||||
hash_regex.compile("[a-f0-9]+")
|
||||
var regex_match = hash_regex.search(line)
|
||||
objects[regex_match.get_string()].position = Vector2(star_idx * 100 + 500, line_count * 100 + 500)
|
||||
objects[regex_match.get_string()].position = Vector2((graph_lines.size()-line_count) * 100 + 500, star_idx * 100 + 500)
|
||||
|
||||
for ref in all_refs():
|
||||
var target_reference = objects[ref].children.keys()[0]
|
||||
@ -159,9 +159,6 @@ func update_node_positions():
|
||||
if objects.has(target_reference):
|
||||
var target = objects[target_reference]
|
||||
objects["HEAD"].position = Vector2(target.position.x ,target.position.y - 100)
|
||||
|
||||
|
||||
|
||||
|
||||
func update_refs():
|
||||
for r in all_refs():
|
||||
@ -193,7 +190,7 @@ func apply_forces():
|
||||
var center_of_gravity = nodes.rect_size/2
|
||||
var d = o.position.distance_to(center_of_gravity)
|
||||
var dir = (o.position - center_of_gravity).normalized()
|
||||
var f = (d+0.00001)*(Vector2(nodes.rect_size.y, nodes.rect_size.x/3).normalized()/30)
|
||||
var f = (d+0.00001)*(Vector2(nodes.rect_size.y/10, nodes.rect_size.x/3).normalized()/30)
|
||||
o.position -= dir*f
|
||||
|
||||
func find_position(n):
|
||||
|
@ -15,18 +15,16 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Rows" type="VSplitContainer" parent="."]
|
||||
[node name="Rows" type="HSplitContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
mouse_filter = 2
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="RepoVis" type="Control" parent="Rows"]
|
||||
margin_right = 1920.0
|
||||
margin_bottom = 926.0
|
||||
margin_bottom = 1080.0
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
@ -99,26 +97,37 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Browsers" type="VBoxContainer" parent="Rows"]
|
||||
margin_top = 938.0
|
||||
margin_right = 1920.0
|
||||
margin_bottom = 1080.0
|
||||
[node name="Browsers" type="VBoxContainer" parent="."]
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 6.0
|
||||
margin_top = -356.0
|
||||
margin_right = 635.0
|
||||
margin_bottom = -5.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 0.2
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Index" parent="Rows/Browsers" instance=ExtResource( 4 )]
|
||||
visible = false
|
||||
[node name="Index" parent="Browsers" instance=ExtResource( 4 )]
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_right = 1920.0
|
||||
margin_bottom = 142.0
|
||||
margin_right = 629.0
|
||||
margin_bottom = 173.0
|
||||
size_flags_vertical = 3
|
||||
title = "Index"
|
||||
mode = 2
|
||||
|
||||
[node name="FileBrowser" parent="Rows/Browsers" instance=ExtResource( 4 )]
|
||||
[node name="FileBrowser" parent="Browsers" instance=ExtResource( 4 )]
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_right = 1920.0
|
||||
margin_bottom = 142.0
|
||||
margin_top = 178.0
|
||||
margin_right = 629.0
|
||||
margin_bottom = 351.0
|
||||
size_flags_vertical = 3
|
||||
title = "Working directory"
|
||||
[connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"]
|
||||
|
Loading…
Reference in New Issue
Block a user