hide world forground on first frame

This commit is contained in:
Nordup 2025-08-23 20:56:18 +07:00
parent 52588770a4
commit 1ad079704b
3 changed files with 8 additions and 22 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=43 format=3 uid="uid://kywrsqro3d5i"]
[gd_scene load_steps=42 format=3 uid="uid://kywrsqro3d5i"]
[ext_resource type="Script" path="res://scripts/loading/gate_loader.gd" id="1_uxhy6"]
[ext_resource type="Resource" uid="uid://b1xvdym0qh6td" path="res://resources/gate_events.res" id="2_q7cvi"]
@ -24,7 +24,6 @@
[ext_resource type="Script" path="res://scripts/ui/world/vignette_blur.gd" id="19_415fa"]
[ext_resource type="FontFile" uid="uid://do40418waa8w3" path="res://assets/fonts/Inter-Regular.otf" id="19_tkqw6"]
[ext_resource type="FontFile" uid="uid://bjeupg0ikc2kv" path="res://assets/fonts/Monospace.ttf" id="20_hoet7"]
[ext_resource type="LabelSettings" uid="uid://crt4elt055uhg" path="res://assets/styles/text_big.tres" id="20_v1648"]
[ext_resource type="FontFile" uid="uid://b3xb1fpllhnf4" path="res://assets/fonts/Inter-Italic.otf" id="21_lpegk"]
[ext_resource type="FontFile" uid="uid://tfj3o1e1wytn" path="res://assets/fonts/Inter-BoldItalic.otf" id="22_i5khx"]
[ext_resource type="FontFile" uid="uid://c14w1y1r54wgi" path="res://assets/fonts/Inter-Bold.otf" id="23_t1gqo"]
@ -207,7 +206,7 @@ grow_horizontal = 2
grow_vertical = 2
focus_mode = 0
[node name="Foreground" type="Control" parent="." node_paths=PackedStringArray("splash_screen", "vignette_blur", "click_anywhere")]
[node name="Foreground" type="Control" parent="." node_paths=PackedStringArray("splash_screen", "vignette_blur")]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
@ -220,7 +219,6 @@ gate_events = ExtResource("2_q7cvi")
ui_events = ExtResource("9_ir58h")
splash_screen = NodePath("SplashScreen")
vignette_blur = NodePath("VignetteBlur")
click_anywhere = NodePath("ClickAnywhere")
[node name="SplashScreen" type="TextureRect" parent="Foreground"]
layout_mode = 1
@ -249,19 +247,6 @@ blur_amount_started = 1.2
uv_scale = Vector2(0.9, 0.9)
uv_scale_startd = Vector2(0.97, 0.97)
[node name="ClickAnywhere" type="Label" parent="Foreground"]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -175.5
offset_top = 50.0
offset_right = 175.5
offset_bottom = 75.0
grow_horizontal = 2
text = "Click anywhere to play → ESC to exit"
label_settings = ExtResource("20_v1648")
[node name="GateInfo" type="VBoxContainer" parent="Foreground" node_paths=PackedStringArray("image", "image_darken", "title", "description", "gate_status")]
layout_mode = 1
anchors_preset = 2

View file

@ -4,7 +4,6 @@ extends Control
@export var ui_events: UiEvents
@export var splash_screen: TextureRect
@export var vignette_blur: VignetteBlur
@export var click_anywhere: Control
func _ready() -> void:
@ -12,7 +11,6 @@ func _ready() -> void:
gate_events.first_frame.connect(on_first_frame)
ui_events.ui_mode_changed.connect(on_ui_mode_changed)
vignette_blur.hide()
click_anywhere.hide()
func show_thumbnail(gate: Gate) -> void:
@ -24,7 +22,6 @@ func show_thumbnail(gate: Gate) -> void:
func on_first_frame() -> void:
splash_screen.hide()
click_anywhere.show()
vignette_blur.show()
vignette_blur.gate_started_params()
@ -34,5 +31,4 @@ func on_ui_mode_changed(mode: UiEvents.UiMode) -> void:
show()
if mode == UiEvents.UiMode.FOCUSED:
click_anywhere.hide()
hide()

View file

@ -12,7 +12,7 @@ var _visible: bool = true
func _ready() -> void:
command_events.set_mouse_mode.connect(set_mouse_mode)
gate_events.first_frame.connect(func(): gate_started = true)
gate_events.first_frame.connect(on_first_frame)
gate_events.not_responding.connect(func(): set_mouse_mode(Input.MOUSE_MODE_VISIBLE))
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
@ -30,6 +30,11 @@ func _input(event: InputEvent) -> void:
show_ui()
func on_first_frame() -> void:
gate_started = true
hide_ui()
func show_ui() -> void:
if _visible: return
_visible = true