This commit is contained in:
cakipaul 2025-07-15 18:45:03 +08:00
parent 254e8a15e0
commit 92cd04847a
2 changed files with 13 additions and 12 deletions

View File

@ -1,7 +1,6 @@
extends Control extends Control
@onready var video_player = $VideoStreamPlayer @onready var video_player = $VideoStreamPlayer
@onready var mask = $"遮罩"
@onready var earplug_notice = $"耳机提示" @onready var earplug_notice = $"耳机提示"
@onready var sfx_click = $SfxClick as Sfx @onready var sfx_click = $SfxClick as Sfx
@ -21,6 +20,7 @@ var first_launching_game := true
func _ready() -> void: func _ready() -> void:
earplug_notice.hide()
if GlobalConfigManager.config: if GlobalConfigManager.config:
var game_launched_times = GlobalConfigManager.config.game_launched_times var game_launched_times = GlobalConfigManager.config.game_launched_times
GlobalConfigManager.config.game_launched_times = game_launched_times + 1 GlobalConfigManager.config.game_launched_times = game_launched_times + 1
@ -41,7 +41,6 @@ var earplug_notice_tween: Tween
func _on_video_finished() -> void: func _on_video_finished() -> void:
mask.visible = true
earplug_notice.visible = true earplug_notice.visible = true
earplug_notice.modulate.a = 0 earplug_notice.modulate.a = 0
earplug_notice_tween = create_tween() earplug_notice_tween = create_tween()
@ -57,6 +56,7 @@ func _on_video_finished() -> void:
func _on_confirm_btn_pressed() -> void: func _on_confirm_btn_pressed() -> void:
confirm_btn.disabled = true
var tween = create_tween() var tween = create_tween()
tween.tween_property(earplug_notice, "modulate:a", 0.0, 1.0) tween.tween_property(earplug_notice, "modulate:a", 0.0, 1.0)
tween.finished.connect(_on_earplug_notice_finished) tween.finished.connect(_on_earplug_notice_finished)

View File

@ -25,6 +25,17 @@ bus = &"game_sfx"
script = ExtResource("5_yb8ks") script = ExtResource("5_yb8ks")
metadata/_custom_type_script = "uid://rq6w1vuhuq1m" metadata/_custom_type_script = "uid://rq6w1vuhuq1m"
[node name="遮罩" type="ColorRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -1.0
offset_bottom = -1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)
[node name="VideoStreamPlayer" type="VideoStreamPlayer" parent="."] [node name="VideoStreamPlayer" type="VideoStreamPlayer" parent="."]
layout_mode = 1 layout_mode = 1
anchors_preset = 15 anchors_preset = 15
@ -37,16 +48,6 @@ volume_db = -8.0
expand = true expand = true
bus = &"game_sfx" bus = &"game_sfx"
[node name="遮罩" type="ColorRect" parent="."]
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)
[node name="耳机提示" type="TextureRect" parent="."] [node name="耳机提示" type="TextureRect" parent="."]
layout_mode = 1 layout_mode = 1
anchors_preset = 15 anchors_preset = 15