diff --git a/arrow.gd b/arrow.gd index 319ef35..62b8033 100644 --- a/arrow.gd +++ b/arrow.gd @@ -2,7 +2,7 @@ extends Node2D var label = "label" setget label_set var target: String setget target_set -var repository: Container +var repository: Control func _ready(): pass diff --git a/main.tscn b/main.tscn index 1156781..699a0e2 100644 --- a/main.tscn +++ b/main.tscn @@ -73,8 +73,6 @@ __meta__ = { [node name="GoalRepository" parent="HBoxContainer/Repositories" instance=ExtResource( 3 )] anchor_right = 0.0 anchor_bottom = 0.0 -margin_left = 0.0 -margin_top = 0.0 margin_right = 633.0 margin_bottom = 1070.0 size_flags_horizontal = 3 @@ -85,7 +83,6 @@ label = "Goal" anchor_right = 0.0 anchor_bottom = 0.0 margin_left = 633.0 -margin_top = 0.0 margin_right = 1267.0 margin_bottom = 1070.0 size_flags_horizontal = 3 diff --git a/node.gd b/node.gd index 7fdeed0..0d3840e 100644 --- a/node.gd +++ b/node.gd @@ -3,7 +3,7 @@ extends Node2D var id setget id_set var content setget content_set var type setget type_set -var repository: Container +var repository: Control var children = {} setget children_set var id_always_visible = false @@ -106,16 +106,9 @@ func _input(event): if hovered: if event.is_action_pressed("click"): held = true + elif event.is_action_pressed("right_click"): + var input = get_tree().get_current_scene().find_node("Terminal").find_node("Control").find_node("Input") + input.text += id + input.caret_position = input.text.length() if event.is_action_released("click"): held = false - - -func _input_event(_viewport, event, _shape_idx): - if event is InputEventMouseButton: - if event.button_index == BUTTON_LEFT: - held = event.pressed - if event.button_index == BUTTON_RIGHT: - if event.pressed: - var input = get_tree().get_current_scene().find_node("Terminal").find_node("Control").find_node("Input") - input.text += id - input.caret_position = input.text.length() diff --git a/project.godot b/project.godot index afa8255..c830e78 100644 --- a/project.godot +++ b/project.godot @@ -75,6 +75,11 @@ zoom_out={ "events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":5,"pressed":false,"doubleclick":false,"script":null) ] } +right_click={ +"deadzone": 0.5, +"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":2,"pressed":false,"doubleclick":false,"script":null) + ] +} [network] diff --git a/repository.gd b/repository.gd index 84cf4c9..22875e6 100644 --- a/repository.gd +++ b/repository.gd @@ -1,4 +1,4 @@ -extends Container +extends Control export var label: String setget set_label export var path: String setget set_path, get_path diff --git a/repository.tscn b/repository.tscn index 7401cd2..a916150 100644 --- a/repository.tscn +++ b/repository.tscn @@ -4,25 +4,29 @@ [ext_resource path="res://styles/theme.tres" type="Theme" id=2] [ext_resource path="res://fonts/big.tres" type="DynamicFont" id=3] -[node name="Repository" type="Container"] +[node name="Repository" type="Control"] anchor_right = 1.0 anchor_bottom = 1.0 -margin_left = 2.0 -margin_top = 3.0 -margin_right = -6.0 -margin_bottom = -4.0 mouse_filter = 1 theme = ExtResource( 2 ) script = ExtResource( 1 ) + +[node name="Label" type="Label" parent="."] +margin_left = 5.60091 +margin_top = -0.518692 +margin_right = 204.601 +margin_bottom = 48.4813 +custom_fonts/font = ExtResource( 3 ) +text = "Repo name" __meta__ = { "_edit_use_anchors_": false } [node name="Index" type="Label" parent="."] -margin_left = 24.0 -margin_top = 80.0 -margin_right = 375.079 -margin_bottom = 1044.0 +margin_left = 8.64569 +margin_top = 63.8375 +margin_right = 359.725 +margin_bottom = 1027.84 text = "entry1 entry2" __meta__ = { @@ -51,17 +55,13 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="Label" type="Label" parent="."] -margin_left = 20.0 -margin_top = 20.0 -custom_fonts/font = ExtResource( 3 ) -text = "Repo name" - [node name="SimplifyCheckbox" type="CheckBox" parent="."] -anchor_top = 0.968 -anchor_bottom = 0.968 -margin_right = 24.0 -margin_bottom = 24.0 +anchor_top = 1.0 +anchor_bottom = 1.0 +margin_left = 2.87984 +margin_top = -23.2002 +margin_right = 195.88 +margin_bottom = 1.7998 focus_mode = 0 enabled_focus_mode = 0 text = "Hide trees and blobs" diff --git a/styles/theme.tres b/styles/theme.tres index a810a4c..bce7f5a 100644 --- a/styles/theme.tres +++ b/styles/theme.tres @@ -95,9 +95,21 @@ corner_radius_bottom_left = 5 [sub_resource type="StyleBoxFlat" id=15] bg_color = Color( 0.294118, 0.294118, 0.294118, 1 ) +corner_radius_top_left = 5 +corner_radius_top_right = 5 +corner_radius_bottom_right = 5 +corner_radius_bottom_left = 5 [sub_resource type="StyleBoxFlat" id=16] +content_margin_left = 10.0 +content_margin_right = 10.0 +content_margin_top = 10.0 +content_margin_bottom = 10.0 bg_color = Color( 0.172549, 0.172549, 0.172549, 1 ) +corner_radius_top_left = 5 +corner_radius_top_right = 5 +corner_radius_bottom_right = 5 +corner_radius_bottom_left = 5 [sub_resource type="StyleBoxFlat" id=17] content_margin_left = 5.0 diff --git a/terminal.gd b/terminal.gd index 6528692..0a5a31d 100644 --- a/terminal.gd +++ b/terminal.gd @@ -27,21 +27,21 @@ func _ready(): $TextEditor.connect("hide", self, "editor_closed") -#func _input(event): -# if history.size() > 0: -# if event.is_action_pressed("ui_up"): -# if history_position > 0: -# history_position -= 1 -# input.text = history[history_position] -# input.caret_position = input.text.length() -# # This prevents the Input taking the arrow as a "skip to beginning" command. -# get_tree().set_input_as_handled() -# if event.is_action_pressed("ui_down"): -# if history_position < history.size()-1: -# history_position += 1 -# input.text = history[history_position] -# input.caret_position = input.text.length() -# get_tree().set_input_as_handled() +func _input(event): + if history.size() > 0: + if event.is_action_pressed("ui_up"): + if history_position > 0: + history_position -= 1 + input.text = history[history_position] + input.caret_position = input.text.length() + # This prevents the Input taking the arrow as a "skip to beginning" command. + get_tree().set_input_as_handled() + if event.is_action_pressed("ui_down"): + if history_position < history.size()-1: + history_position += 1 + input.text = history[history_position] + input.caret_position = input.text.length() + get_tree().set_input_as_handled() func load_command(id): input.text = premade_commands[id]