mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-12-22 20:32:38 +01:00
Add a close button to the text editor
This commit is contained in:
parent
764714b24e
commit
a9f096636a
2 changed files with 21 additions and 1 deletions
|
@ -35,6 +35,10 @@ func open(filename):
|
|||
func save():
|
||||
var fixme_path = game.tmp_prefix+"/active/"
|
||||
game.write_file(fixme_path+path, text)
|
||||
_client_connection.disconnect_from_host()
|
||||
close()
|
||||
|
||||
func close():
|
||||
if _client_connection.is_connected_to_host():
|
||||
_client_connection.disconnect_from_host()
|
||||
text = ""
|
||||
hide()
|
||||
|
|
|
@ -30,4 +30,20 @@ text = "Save"
|
|||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="CloseButton" type="Button" parent="."]
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
margin_left = -50.0
|
||||
margin_top = 12.0
|
||||
margin_right = -10.0
|
||||
margin_bottom = 52.0
|
||||
focus_mode = 0
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
enabled_focus_mode = 0
|
||||
text = "x"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
[connection signal="pressed" from="SaveButton" to="." method="save"]
|
||||
[connection signal="pressed" from="CloseButton" to="." method="close"]
|
||||
|
|
Loading…
Reference in a new issue