mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-24 16:20:08 +01:00
New File Popup (no function)
This commit is contained in:
parent
563f6ba835
commit
39e62eb8cf
3 changed files with 11 additions and 1 deletions
|
@ -24,6 +24,7 @@ func _ready():
|
|||
update()
|
||||
_set_mode(mode)
|
||||
_set_title(title)
|
||||
$PopupMenu.add_item("New file", 1)
|
||||
|
||||
func _input(event):
|
||||
if event.is_action_pressed("save"):
|
||||
|
@ -177,6 +178,11 @@ func _set_title(new_title):
|
|||
if title_label:
|
||||
title_label.text = new_title
|
||||
|
||||
func _gui_input(event):
|
||||
if event is InputEventMouseButton and event.is_pressed() and event.button_index == BUTTON_RIGHT:
|
||||
$PopupMenu.set_position(get_global_mouse_position())
|
||||
$PopupMenu.popup()
|
||||
|
||||
func very_best_sort(a,b):
|
||||
if a[0] == "." and b[0] != ".":
|
||||
return false
|
||||
|
|
|
@ -125,5 +125,9 @@ text = "x"
|
|||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="PopupMenu" type="PopupMenu" parent="."]
|
||||
margin_right = 20.0
|
||||
margin_bottom = 20.0
|
||||
[connection signal="pressed" from="Panel/TextEdit/SaveButton" to="." method="save"]
|
||||
[connection signal="pressed" from="Panel/TextEdit/CloseButton" to="." method="close"]
|
||||
|
|
|
@ -15,7 +15,7 @@ onready var status_icon = $VBoxContainer/Control/TextureRect/StatusIcon
|
|||
func _ready():
|
||||
_set_label(label)
|
||||
_set_status(status)
|
||||
$PopupMenu.add_item("Delete File", 0)
|
||||
$PopupMenu.add_item("Delete file", 0)
|
||||
|
||||
func _set_label(new_label):
|
||||
label = new_label
|
||||
|
|
Loading…
Reference in a new issue