diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/global.gd | 2 | ||||
-rw-r--r-- | client/menu/character_menu.gd | 1 | ||||
-rw-r--r-- | client/menu/ingame_menu.tscn | 2 | ||||
-rw-r--r-- | client/menu/menu_manager.gd | 4 | ||||
-rw-r--r-- | client/menu/menu_manager.tscn | 9 | ||||
-rw-r--r-- | client/menu/scene_transition.gd | 11 |
6 files changed, 21 insertions, 8 deletions
diff --git a/client/global.gd b/client/global.gd index 6e12d0cf..ee1e3e96 100644 --- a/client/global.gd +++ b/client/global.gd @@ -40,6 +40,8 @@ var settings: Dictionary var server_url = "" var error_message = "" +var fade_next := false # Set true when transitioning from another scene (fade in requried) + func _ready(): profile = load_dict("user://profile", DEFAULT_PROFILE) settings = load_dict("user://settings", default_settings) diff --git a/client/menu/character_menu.gd b/client/menu/character_menu.gd index 347a0db1..80fcdcb6 100644 --- a/client/menu/character_menu.gd +++ b/client/menu/character_menu.gd @@ -29,6 +29,7 @@ func _input(event): _on_back_pressed() func _on_back_pressed(): + Global.fade_next = true $SceneTransition.transition_to("res://menu/menu_manager.tscn") func _on_username_text_changed(new_text): diff --git a/client/menu/ingame_menu.tscn b/client/menu/ingame_menu.tscn index eba314ce..7657a1ae 100644 --- a/client/menu/ingame_menu.tscn +++ b/client/menu/ingame_menu.tscn @@ -72,7 +72,7 @@ anchors_preset = 9 anchor_bottom = 1.0 offset_left = -400.0 offset_right = -90.0 -offset_bottom = 3240.0 +offset_bottom = 3888.0 grow_vertical = 2 [node name="Margin" type="MarginContainer" parent="Side"] diff --git a/client/menu/menu_manager.gd b/client/menu/menu_manager.gd index 7c958272..079f6e44 100644 --- a/client/menu/menu_manager.gd +++ b/client/menu/menu_manager.gd @@ -12,6 +12,10 @@ var menu_stack = ["main"] func _ready(): Global.focus_first_button(menus[menu_stack.back()]) + + if Global.fade_next: + Global.fade_next = false + transition.fade_in() func _input(event): if Input.is_action_just_pressed("ui_cancel") && menu_stack.size() > 1: diff --git a/client/menu/menu_manager.tscn b/client/menu/menu_manager.tscn index 6b2d7b33..18e13282 100644 --- a/client/menu/menu_manager.tscn +++ b/client/menu/menu_manager.tscn @@ -30,9 +30,6 @@ visible = false layout_mode = 1 [node name="SceneTransition" parent="." instance=ExtResource("6_p4u45")] -layout_mode = 0 -anchors_preset = 0 -anchor_right = 0.0 -anchor_bottom = 0.0 -grow_horizontal = 1 -grow_vertical = 1 +visible = false +layout_mode = 1 +auto_fade_in = false diff --git a/client/menu/scene_transition.gd b/client/menu/scene_transition.gd index 87a1ec1b..30c7e1df 100644 --- a/client/menu/scene_transition.gd +++ b/client/menu/scene_transition.gd @@ -19,8 +19,16 @@ extends ColorRect @onready var anim = $animation @export var ingame = false +@export var auto_fade_in := true + func _ready(): - self.visible = true + if auto_fade_in: + fade_in() + else: + visible = false + +func fade_in(): + visible = true anim.play("fade_in") func transition_to(path: String): @@ -35,6 +43,7 @@ func quit(): get_tree().quit() func out(): + visible = true if menu.visible: menu.anim.play_backwards("activate") await menu.anim.animation_finished |