Skip to content

Commit

Permalink
Пауза по нажатию esc
Browse files Browse the repository at this point in the history
  • Loading branch information
Allespro committed May 30, 2019
1 parent 8b8bed8 commit 62163e9
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 68 deletions.
1 change: 0 additions & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ ui_use={

[rendering]

quality/driver/fallback_to_gles2=true
quality/intended_usage/framebuffer_allocation.mobile=0
quality/2d/use_pixel_snap=true
environment/default_environment="res://default_env.tres"
4 changes: 0 additions & 4 deletions scenes/GLOBAL.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,4 @@ margin_right = 1330.0
margin_bottom = 720.0
color = Color( 0, 0, 0, 1 )

<<<<<<< HEAD
[node name="tween" type="Tween" parent="."]
=======
[node name="Tween" type="Tween" parent="."]
>>>>>>> master
45 changes: 0 additions & 45 deletions scenes/esc.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<<<<<<< HEAD
[gd_scene load_steps=7 format=2]

[ext_resource path="res://scripts/esc.gd" type="Script" id=1]
Expand Down Expand Up @@ -28,33 +27,13 @@ position = Vector2( 500, 100 )
scale = Vector2( 10, 10 )
texture = ExtResource( 2 )
centered = false
=======
[gd_scene load_steps=3 format=2]

[ext_resource path="res://scripts/esc.gd" type="Script" id=1]
[ext_resource path="res://images/buttons/Button (5).png" type="Texture" id=2]

[node name="esc" type="CanvasLayer"]
script = ExtResource( 1 )

[node name="ColorRect" type="ColorRect" parent="."]
margin_right = 1330.0
margin_bottom = 720.0
color = Color( 0, 0, 0, 1 )

[node name="btn_cancel" type="Sprite" parent="."]
position = Vector2( 670, 160 )
scale = Vector2( 9, 9 )
texture = ExtResource( 2 )
>>>>>>> master
region_enabled = true
region_rect = Rect2( 0, 0, 34, 10 )
__meta__ = {
"_edit_group_": true
}

[node name="Label" type="Label" parent="btn_cancel"]
<<<<<<< HEAD
margin_right = 68.0
margin_bottom = 18.0
rect_scale = Vector2( 0.5, 0.5 )
Expand All @@ -68,23 +47,13 @@ position = Vector2( 500, 250 )
scale = Vector2( 10, 10 )
texture = ExtResource( 2 )
centered = false
=======
margin_right = 40.0
margin_bottom = 14.0

[node name="btn_title" type="Sprite" parent="."]
position = Vector2( 670, 320 )
scale = Vector2( 9, 9 )
texture = ExtResource( 2 )
>>>>>>> master
region_enabled = true
region_rect = Rect2( 0, 0, 34, 10 )
__meta__ = {
"_edit_group_": true
}

[node name="Label" type="Label" parent="btn_title"]
<<<<<<< HEAD
margin_right = 68.0
margin_bottom = 16.0
rect_scale = Vector2( 0.5, 0.5 )
Expand All @@ -98,31 +67,17 @@ position = Vector2( 500, 400 )
scale = Vector2( 10, 10 )
texture = ExtResource( 2 )
centered = false
=======
margin_right = 40.0
margin_bottom = 14.0

[node name="btn_desktop" type="Sprite" parent="."]
position = Vector2( 670, 490 )
scale = Vector2( 9, 9 )
texture = ExtResource( 2 )
>>>>>>> master
region_enabled = true
region_rect = Rect2( 0, 0, 34, 10 )
__meta__ = {
"_edit_group_": true
}

[node name="Label" type="Label" parent="btn_desktop"]
<<<<<<< HEAD
margin_right = 68.0
margin_bottom = 20.0
rect_scale = Vector2( 0.5, 0.5 )
custom_fonts/font = SubResource( 3 )
text = "выйти"
align = 1
valign = 1
=======
margin_right = 40.0
margin_bottom = 14.0
>>>>>>> master
18 changes: 0 additions & 18 deletions scripts/esc.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,18 @@ extends CanvasLayer

var index:int = 0
onready var buttons:Array = [$btn_cancel, $btn_title, $btn_desktop]
<<<<<<< HEAD
func _ready():
for btn in buttons:
btn.modulate = Color(1,1,1,.2)
buttons[0].modulate = Color(1,1,1,1)
=======
>>>>>>> master

func _process(delta:float) -> void:
var up:bool = Input.is_action_just_pressed("ui_up")
var down:bool = Input.is_action_just_pressed("ui_down")
<<<<<<< HEAD
var enter:bool = Input.is_action_just_pressed("ui_accept")

if up || down:
#GLOBAL.get_node("sfx/sfx_esc_select").play()
=======
var right:bool = Input.is_action_just_pressed("ui_right")

if up || down:
GLOBAL.get_node("sfx/sfx_esc_select").play()
>>>>>>> master

for btn in buttons:
btn.modulate = Color(1,1,1,.2)
Expand All @@ -40,22 +30,14 @@ func _process(delta:float) -> void:

buttons[index].modulate = Color(1,1,1,1)

<<<<<<< HEAD
if enter:
=======
if right:
>>>>>>> master
get_tree().paused = false
get_node("/root/esc_scene").queue_free()
match index:
0:
pass
1:
<<<<<<< HEAD
#GLOBAL.save_game()
GLOBAL.next_scene("main_menu")
=======
GLOBAL.next_scene("title")
>>>>>>> master
2:
get_tree().quit()

0 comments on commit 62163e9

Please sign in to comment.