diff --git a/assets/props/column/sm_column.mesh b/assets/props/column/sm_column.mesh index 40bf4d6..26e3b95 100644 Binary files a/assets/props/column/sm_column.mesh and b/assets/props/column/sm_column.mesh differ diff --git a/scenes/UI/UI_back.tscn b/scenes/UI/UI_back.tscn index 16aa406..0a788b7 100644 --- a/scenes/UI/UI_back.tscn +++ b/scenes/UI/UI_back.tscn @@ -13,6 +13,7 @@ __meta__ = { [node name="TextureButton" type="TextureButton" parent="."] margin_right = 40.0 margin_bottom = 40.0 +mouse_default_cursor_shape = 2 texture_normal = ExtResource( 1 ) texture_hover = ExtResource( 2 ) texture_focused = ExtResource( 2 ) diff --git a/scenes/levels/levels.gd b/scenes/levels/levels.gd index 3035d9d..63d8dfa 100644 --- a/scenes/levels/levels.gd +++ b/scenes/levels/levels.gd @@ -18,15 +18,9 @@ func _ready(): _load_meshes() func _process(_delta): - _check_quit_scene() _check_dissolve_mesh() _check_change_angle_camera() -func _check_quit_scene(): - # Event key "escape" and "godot event" ui_end - if Input.is_action_just_pressed("ui_end"): - _confirm_before_quit() - func _check_dissolve_mesh(): # Event dissolve in object searched by gamer for key in meshes: @@ -109,29 +103,13 @@ func _gyroscope_changed_up(gyroscope): (gyroscope.abs().x - gyroscope_value_old.abs().x) > GYROSCOPE_MAX_DIFF and \ gyroscope.x < gyroscope_value_old.x -func _notification(what): - # Notification for android back action - if what == MainLoop.NOTIFICATION_WM_GO_BACK_REQUEST: - _confirm_before_quit() - -func _confirm_before_quit(): - $Dialog/ConfirmEscape.popup() - -# Back to main scene -func _quit_to_menu(): - Global.goto_scene("res://scenes/main.tscn") - func _start_dissolve(key): if meshes[key].lock() == false: meshes[key].set_lock(true) -func _on_ConfirmEscape_confirmed(): - _quit_to_menu() - ## PRIVATE func _load_translations(): - $Dialog/ConfirmEscape.set_title(tr("SCENE_WARCRAFT_DIALOG_QUIT_TITLE")) - $Dialog/ConfirmEscape.set_text(tr("SCENE_WARCRAFT_DIALOG_QUIT_QUESTION")) + pass func _load_meshes(): var scene_detail = null diff --git a/scenes/levels/warcraft/WarCraft.gd b/scenes/levels/warcraft/WarCraft.gd index 681b9fd..f2baa79 100644 --- a/scenes/levels/warcraft/WarCraft.gd +++ b/scenes/levels/warcraft/WarCraft.gd @@ -1,4 +1,6 @@ extends "res://scenes/levels/levels.gd" -func _ready(): - pass +# Back to main scene +func _on_TextureButton_pressed(): + print("[levels#_on_TextureButton_pressed] quit to menu") + Global.goto_scene("res://scenes/main.tscn") diff --git a/scenes/levels/warcraft/WarCraft.tscn b/scenes/levels/warcraft/WarCraft.tscn index bec94a6..f76ccce 100644 --- a/scenes/levels/warcraft/WarCraft.tscn +++ b/scenes/levels/warcraft/WarCraft.tscn @@ -544,23 +544,6 @@ use_in_baked_light = true mesh = ExtResource( 9 ) material/0 = null -[node name="Dialog" type="Control" parent="."] -margin_right = 40.0 -margin_bottom = 40.0 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="ConfirmEscape" type="ConfirmationDialog" parent="Dialog"] -visible = true -margin_right = 200.0 -margin_bottom = 70.0 -rect_min_size = Vector2( 400, 140 ) -window_title = "Veuillez confirmer…" -__meta__ = { -"_edit_use_anchors_": false -} - [node name="sm_gabarit_male" type="MeshInstance" parent="."] transform = Transform( 0.534795, 0, 0.844982, 0, 1, 0, -0.844982, 0, 0.534795, -4.02751, 0.0561329, -0.889434 ) mesh = ExtResource( 20 ) @@ -754,8 +737,10 @@ collision_mask = 2 transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0358186, 0, 0.0109152 ) shape = SubResource( 18 ) -[node name="Control" parent="." instance=ExtResource( 44 )] +[node name="ListObjects" parent="." instance=ExtResource( 44 )] -[node name="Control2" parent="." instance=ExtResource( 45 )] +[node name="Quit" parent="." instance=ExtResource( 45 )] -[connection signal="confirmed" from="Dialog/ConfirmEscape" to="." method="_on_ConfirmEscape_confirmed"] +[connection signal="pressed" from="Quit/TextureButton" to="." method="_on_TextureButton_pressed"] + +[editable path="Quit"]