整理代码,删除无用文件
This commit is contained in:
parent
eaa51620e1
commit
9e1e7f82f5
@ -1,5 +0,0 @@
|
||||
extends Node
|
||||
|
||||
|
||||
func play_cg(cg_name: String) -> void:
|
||||
print("play_cg: ", cg_name)
|
@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dfbmctdmc4ue6"]
|
||||
|
||||
[ext_resource type="Script" path="res://manager/deploy/deployer/deployer_window.gd" id="1_rhcam"]
|
||||
[ext_resource type="Script" path="res://manager/deploy/deployer_window.gd" id="1_rhcam"]
|
||||
|
||||
[node name="DeployerWindow" type="Window"]
|
||||
auto_translate_mode = 1
|
@ -1,8 +1,8 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://jveao8k40jp1"]
|
||||
|
||||
[ext_resource type="Script" path="res://manager/deploy/deployer/section_deployer.gd" id="1_komad"]
|
||||
[ext_resource type="Script" path="res://manager/deploy/section_deployer.gd" id="1_komad"]
|
||||
[ext_resource type="PackedScene" uid="uid://dygvcmykn02n8" path="res://scene/main.tscn" id="2_si45r"]
|
||||
[ext_resource type="PackedScene" uid="uid://dfbmctdmc4ue6" path="res://manager/deploy/deployer/deployer_window.tscn" id="3_iq8me"]
|
||||
[ext_resource type="PackedScene" uid="uid://dfbmctdmc4ue6" path="res://manager/deploy/deployer_window.tscn" id="3_iq8me"]
|
||||
|
||||
[node name="SectionDeployer" type="Node2D"]
|
||||
script = ExtResource("1_komad")
|
@ -1,12 +0,0 @@
|
||||
extends Node
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|
@ -39,11 +39,9 @@ buses/default_bus_layout="res://config/default_bus_layout.tres"
|
||||
DebugMenu="*res://addons/debug_menu/debug_menu.tscn"
|
||||
GlobalConfigManager="*res://manager/config_manager/global_config_manager.gd"
|
||||
ArchiveManager="*res://manager/archive_manager/archive_manager.gd"
|
||||
SceneManager="*res://manager/deploy/scene/scene_manager.gd"
|
||||
SceneManager="*res://manager/scene/scene_manager.gd"
|
||||
AudioManager="*res://manager/audio_manager/audio_manager.gd"
|
||||
EventManager="*res://manager/event_manager/event_manager.gd"
|
||||
CgManager="*res://manager/cg_manager/cg_manager.gd"
|
||||
InputManager="res://manager/input/input_manager.gd"
|
||||
DialogueManager="*res://addons/dialogue_manager/dialogue_manager.gd"
|
||||
|
||||
[debug]
|
||||
|
@ -1,87 +0,0 @@
|
||||
extends Control
|
||||
|
||||
@onready var label = %RichTextLabel as RichTextLabel
|
||||
|
||||
var pending_bbcode = []
|
||||
var tweening := false
|
||||
|
||||
|
||||
func _ready():
|
||||
label.clear()
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
# test notification in editor
|
||||
# if GlobalConfig.DEBUG:
|
||||
# call_deferred("test")
|
||||
|
||||
|
||||
# func test():
|
||||
# # append_dialog("吕萍", "Hello, 2! very very long message, very very loooonnnggggggg!")
|
||||
# append_note("Hello, 3!")
|
||||
# # append_note("Hello, blue!", "blue", 1)
|
||||
# append_dialog("车夫", "你好!", "green")
|
||||
# pass
|
||||
|
||||
|
||||
func append_note(note: String, note_color := "white", duration := 2.5) -> void:
|
||||
pending_bbcode.append(
|
||||
["[center][color=" + note_color + "]" + note + "[/color][/center]", duration, false]
|
||||
)
|
||||
_show()
|
||||
|
||||
|
||||
func append_dialog(
|
||||
character: String,
|
||||
content: String,
|
||||
character_color := "orange",
|
||||
content_color := "white",
|
||||
duration := 2.5
|
||||
) -> void:
|
||||
# remove non-dialog notifications
|
||||
for _i in range(pending_bbcode.size()):
|
||||
var triple = pending_bbcode.pop_front()
|
||||
if not triple[2]:
|
||||
continue
|
||||
pending_bbcode.append(triple)
|
||||
pending_bbcode.append(
|
||||
[
|
||||
(
|
||||
"[center][color="
|
||||
+ character_color
|
||||
+ "][b]"
|
||||
+ character
|
||||
+ ":[/b][/color][color="
|
||||
+ content_color
|
||||
+ "]"
|
||||
+ content
|
||||
+ "[/color][/center]"
|
||||
),
|
||||
duration,
|
||||
true
|
||||
]
|
||||
)
|
||||
_show()
|
||||
|
||||
|
||||
func _show() -> void:
|
||||
if not tweening and pending_bbcode.size() > 0:
|
||||
var triple = pending_bbcode.pop_front()
|
||||
label.parse_bbcode(triple[0])
|
||||
if triple[2]:
|
||||
label.add_theme_color_override("font_shadow_color", Color(0.2, 0.2, 0.2, 0.6))
|
||||
else:
|
||||
label.remove_theme_color_override("font_shadow_color")
|
||||
tweening = true
|
||||
var tween = create_tween()
|
||||
# 0.5s to show the notification
|
||||
tween.tween_property(self, "modulate:a", 1, 0.2).set_trans(Tween.TRANS_CUBIC)
|
||||
# keep the notification
|
||||
tween.tween_interval(max(triple[1] - 0.4, 0))
|
||||
# 0.5s to hide the notification
|
||||
tween.tween_property(self, "modulate:a", 0, 0.2).set_trans(Tween.TRANS_CUBIC)
|
||||
# callback
|
||||
tween.tween_callback(_check_next)
|
||||
|
||||
|
||||
func _check_next():
|
||||
tweening = false
|
||||
_show()
|
@ -1,33 +0,0 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dmkt1roqc4he7"]
|
||||
|
||||
[ext_resource type="Script" path="res://scene/dialog/dialog.gd" id="1_s1ka3"]
|
||||
|
||||
[node name="Dialog" type="MarginContainer"]
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -250.0
|
||||
offset_top = -58.0
|
||||
offset_right = 250.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
size_flags_vertical = 8
|
||||
mouse_filter = 2
|
||||
theme_override_constants/margin_bottom = 42
|
||||
script = ExtResource("1_s1ka3")
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="."]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(460, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
mouse_filter = 2
|
||||
theme_override_colors/font_shadow_color = Color(0.174626, 0.174626, 0.174626, 1)
|
||||
theme_override_constants/shadow_offset_y = 1
|
||||
theme_override_constants/shadow_offset_x = 1
|
||||
bbcode_enabled = true
|
||||
text = " [center][b][color=orange]吕萍:[/color][/b]「你好呀」[/center]"
|
||||
fit_content = true
|
@ -16,7 +16,6 @@ height = 20.0
|
||||
|
||||
[node name="NaturalPointLight2D" type="PointLight2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
scale = Vector2(1e-05, 1e-05)
|
||||
shadow_color = Color(0, 0, 0, 1)
|
||||
texture = ExtResource("3_w1x1y")
|
||||
height = 40.0
|
||||
|
@ -28,7 +28,7 @@ var hook_animation = ""
|
||||
dialogue_res = dialogue_c01
|
||||
"c02":
|
||||
dialogue_res = dialogue_c02
|
||||
if is_node_ready():
|
||||
if is_node_ready() and Engine.is_editor_hint():
|
||||
notify_property_list_changed()
|
||||
var hook_dialogue_title = ""
|
||||
|
||||
@ -54,11 +54,11 @@ var played: bool:
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
var animation_player = _get_animation_player()
|
||||
# 更新 hook_animation 的可选项
|
||||
if animation_player:
|
||||
animation_player.animation_libraries_updated.connect(notify_property_list_changed)
|
||||
if Engine.is_editor_hint():
|
||||
var animation_player = _get_animation_player()
|
||||
# 更新 hook_animation 的可选项
|
||||
if animation_player:
|
||||
animation_player.animation_libraries_updated.connect(notify_property_list_changed)
|
||||
return
|
||||
_check_sign_display()
|
||||
if one_shot and played:
|
||||
|
@ -15,11 +15,10 @@ enum { STATUS_NORAML, STATUS_INSPECTING_COVER, STATUS_INSPECTING_NOTES }
|
||||
@export_enum("none", "c01", "c02", "c03", "c04", "c05", "c06") var editor_filter := "none":
|
||||
set(val):
|
||||
editor_filter = val
|
||||
if is_node_ready():
|
||||
if is_node_ready() and Engine.is_editor_hint():
|
||||
notify_property_list_changed()
|
||||
var content_key: String = ""
|
||||
|
||||
@onready var sprite2d = %AnimatedSoundSprite2D as AnimatedSoundSprite2D
|
||||
@onready var sign_mark = %Sign as Sign
|
||||
@onready var area2d = %Area2D as Area2D
|
||||
|
||||
|
@ -1,12 +1,10 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://ci5anaxsa1apl"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://ci5anaxsa1apl"]
|
||||
|
||||
[ext_resource type="Script" path="res://scene/entity/local_inspectable.gd" id="1_85el0"]
|
||||
[ext_resource type="PackedScene" uid="uid://c85t6stvytvjn" path="res://scene/entity/ux/sfx.tscn" id="2_h0c2s"]
|
||||
[ext_resource type="AudioStream" uid="uid://byjcmxy5crce5" path="res://asset/audio/sfx/ui/纸条.mp3" id="3_3ldx7"]
|
||||
[ext_resource type="Texture2D" uid="uid://bei1s1uucktso" path="res://asset/art/tool/neutral_point_light.webp" id="3_o562w"]
|
||||
[ext_resource type="PackedScene" uid="uid://c4tipnj1cr1j3" path="res://scene/entity/ux/sign.tscn" id="4_do8tr"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://b7fhheih1hbvf" path="res://config/animation/entity_sprite_frames.tres" id="6_e77p4"]
|
||||
[ext_resource type="Script" path="res://scene/entity/ux/animated_sound_sprite_2d.gd" id="7_bhwlx"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4fuic"]
|
||||
resource_local_to_scene = true
|
||||
@ -38,13 +36,6 @@ energy = 0.0
|
||||
texture = ExtResource("3_o562w")
|
||||
texture_scale = 0.5
|
||||
|
||||
[node name="AnimatedSoundSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
sprite_frames = ExtResource("6_e77p4")
|
||||
animation = &"c00_吕萍_记笔记_right"
|
||||
script = ExtResource("7_bhwlx")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
collision_layer = 0
|
||||
|
@ -19,13 +19,13 @@ signal read_note
|
||||
dialogue_res = dialogue_c01
|
||||
"c02":
|
||||
dialogue_res = dialogue_c02
|
||||
if is_node_ready():
|
||||
if is_node_ready() and Engine.is_editor_hint():
|
||||
notify_property_list_changed()
|
||||
var note_key := ""
|
||||
@export_enum("none", "notes", "c01", "c02", "c03", "c04", "c05", "c06") var title_filter := "none":
|
||||
set(val):
|
||||
title_filter = val
|
||||
if is_node_ready():
|
||||
if is_node_ready() and Engine.is_editor_hint():
|
||||
notify_property_list_changed()
|
||||
|
||||
@onready var sign_mark = %Sign as Sign
|
||||
|
@ -27,6 +27,8 @@ func _init() -> void:
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
if animation:
|
||||
play()
|
||||
area2d.body_entered.connect(_reset)
|
||||
|
@ -9,7 +9,6 @@ extends Sprite2D
|
||||
@export var texture_cover: Texture2D
|
||||
@export var texture_note: Texture2D
|
||||
|
||||
@onready var sprite2d = %AnimatedSoundSprite2D as AnimatedSoundSprite2D
|
||||
@onready var sign_mark = %Sign as Sign
|
||||
@onready var area2d = %Area2D as Area2D
|
||||
|
||||
|
@ -1,12 +1,10 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://wyj4qdjyn4ql"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://wyj4qdjyn4ql"]
|
||||
|
||||
[ext_resource type="Script" path="res://scene/entity/old/inspectable.gd" id="1_0pc4s"]
|
||||
[ext_resource type="PackedScene" uid="uid://c85t6stvytvjn" path="res://scene/entity/ux/sfx.tscn" id="2_wrnix"]
|
||||
[ext_resource type="AudioStream" uid="uid://dky3j8lwcy5sk" path="res://asset/audio/sfx/ui/物品查看.mp3" id="3_kilnm"]
|
||||
[ext_resource type="Texture2D" uid="uid://bei1s1uucktso" path="res://asset/art/tool/neutral_point_light.webp" id="3_vbivp"]
|
||||
[ext_resource type="PackedScene" uid="uid://c4tipnj1cr1j3" path="res://scene/entity/ux/sign.tscn" id="4_1yty8"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://b7fhheih1hbvf" path="res://config/animation/entity_sprite_frames.tres" id="7_njjhh"]
|
||||
[ext_resource type="Script" path="res://scene/entity/ux/animated_sound_sprite_2d.gd" id="8_wntgt"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4fuic"]
|
||||
resource_local_to_scene = true
|
||||
@ -35,13 +33,6 @@ energy = 0.0
|
||||
texture = ExtResource("3_vbivp")
|
||||
texture_scale = 0.5
|
||||
|
||||
[node name="AnimatedSoundSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
sprite_frames = ExtResource("7_njjhh")
|
||||
animation = &"c00_吕萍_记笔记_right"
|
||||
script = ExtResource("8_wntgt")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
collision_layer = 0
|
||||
|
@ -13,6 +13,8 @@ var played_time = 0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
area2d.body_entered.connect(_reset)
|
||||
area2d.body_exited.connect(_on_cancel)
|
||||
sign_mark.interacted.connect(_on_interacted)
|
||||
|
@ -1,7 +0,0 @@
|
||||
class_name AnimatedSoundSprite2D extends AnimatedSprite2D
|
||||
|
||||
|
||||
func play_with_sound(animation_name: String) -> void:
|
||||
super.play(animation_name)
|
||||
AudioManager.play_animation_sound(animation_name)
|
||||
|
@ -1,2 +0,0 @@
|
||||
extends AnimationPlayer
|
||||
|
@ -1,6 +0,0 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bpouwlfacjjdb"]
|
||||
|
||||
[ext_resource type="Script" path="res://scene/entity/ux/cg_event.gd" id="1_cugx1"]
|
||||
|
||||
[node name="CGEvent" type="AnimationPlayer"]
|
||||
script = ExtResource("1_cugx1")
|
@ -1,2 +0,0 @@
|
||||
extends Node
|
||||
|
@ -1,6 +0,0 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dyelo1dwkvlf"]
|
||||
|
||||
[ext_resource type="Script" path="res://scene/entity/ux/journal_event.gd" id="1_5w7ov"]
|
||||
|
||||
[node name="JournalEvent" type="Node"]
|
||||
script = ExtResource("1_5w7ov")
|
@ -10,15 +10,17 @@ class_name Sfx extends AudioStreamPlayer
|
||||
#set(val):
|
||||
#if val and current_files.has(val):
|
||||
#file = val
|
||||
var sfx: AudioStream
|
||||
|
||||
var file: String
|
||||
var sfx_root_path = "res://asset/audio/sfx/"
|
||||
var current_files := PackedStringArray()
|
||||
var sfx: AudioStream
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
_update_files()
|
||||
if Engine.is_editor_hint():
|
||||
_update_files()
|
||||
_reload_sfx()
|
||||
bus = &"game_sfx"
|
||||
|
||||
|
||||
@ -88,10 +90,12 @@ func _set(property: StringName, value: Variant) -> bool:
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
# func play() -> void:
|
||||
# if sfx:
|
||||
# AudioManager.play_sfx(sfx, volume_db)
|
||||
|
||||
|
||||
# queue free 导致 sfx 无法播放,使用全局声源
|
||||
func global_play() -> void:
|
||||
if sfx:
|
||||
|
@ -151,7 +151,7 @@ func disactivate(_body: Node2D) -> void:
|
||||
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if not enabled:
|
||||
if Engine.is_editor_hint() or not enabled:
|
||||
return
|
||||
if activated:
|
||||
if event.is_action_pressed("interact"):
|
||||
|
@ -3,7 +3,8 @@ class_name Ground2D extends Node2D
|
||||
|
||||
@export var scene_name := ""
|
||||
# 用于在 debug 时态下,指定进入的 portal
|
||||
@export_enum("left", "right", "1", "2", "3", "4", "5", "6", "7", "8", "9") var default_portal := "left"
|
||||
@export_enum("left", "right", "1", "2", "3", "4", "5", "6", "7", "8", "9")
|
||||
var default_portal := "left"
|
||||
@export_group("Player", "player_")
|
||||
@export var player_y_fixed := true
|
||||
@export var player_y := 70:
|
||||
@ -15,6 +16,7 @@ class_name Ground2D extends Node2D
|
||||
set(val):
|
||||
reset_player_pos = false
|
||||
_reset_player_positon()
|
||||
@export var camera_focus_marker: CameraFocusMarker
|
||||
@export_group("Sound")
|
||||
@export_enum("none", "ghost", "walking", "running", "crawling", "concrete")
|
||||
var footstep_type: String = "concrete":
|
||||
@ -27,7 +29,6 @@ var footstep_type: String = "concrete":
|
||||
@onready var directional_light := %DirectionalLight2D as DirectionalLight2D
|
||||
@onready var bg_sprite = %BGSprite2D as Sprite2D
|
||||
@onready var foreground = %ParallaxForeground as ParallaxBackground
|
||||
@onready var camera_focus_marker = %CameraFocusMarker as CameraFocusMarker
|
||||
@onready var camera = %Camera2D as Camera2D
|
||||
|
||||
@onready var footstep_audio = %FootstepAudioPlayer as RandomAudioStreamPlayer
|
||||
@ -72,11 +73,12 @@ func _restart_from_main():
|
||||
# if not main.is_node_ready():
|
||||
# await main.ready
|
||||
var ground_loader = main.get_node("./GroundLoader") as GroundLoader
|
||||
# ground_loader.ignore_archive = true
|
||||
ground_loader.ignore_archive = false
|
||||
ground_loader.archive_scene = scene_name
|
||||
ground_loader.archive_portal = default_portal
|
||||
# ground_loader.transition_to_scene(scene_name, default_portal, true)
|
||||
ground_loader.force_archive_scene = scene_name
|
||||
ground_loader.force_archive_portal = default_portal
|
||||
get_node("/root").add_child(main)
|
||||
# ground_loader.transition_to_scene(scene_name, default_portal, true)
|
||||
get_parent().queue_free()
|
||||
|
||||
|
||||
|
@ -14,9 +14,9 @@ func _ready() -> void:
|
||||
layer = GlobalConfig.CANVAS_LAYER_HD_ENTITY
|
||||
"
|
||||
|
||||
[node name="Ground" type="Node2D"]
|
||||
[node name="Ground" type="Node2D" node_paths=PackedStringArray("camera_focus_marker")]
|
||||
script = ExtResource("1_0vrlo")
|
||||
default_portal = "left"
|
||||
camera_focus_marker = NodePath("MainPlayer/CameraFocusMarker")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
|
||||
@ -50,9 +50,10 @@ portal_name = "right"
|
||||
|
||||
[node name="AmbientLayer" type="Node2D" parent="."]
|
||||
|
||||
[node name="MainPlayer" parent="." instance=ExtResource("3_atha7")]
|
||||
[node name="MainPlayer" parent="." node_paths=PackedStringArray("camera_marker") instance=ExtResource("3_atha7")]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(26, 88)
|
||||
camera_marker = NodePath("CameraFocusMarker")
|
||||
|
||||
[node name="CameraFocusMarker" parent="MainPlayer" node_paths=PackedStringArray("camera") instance=ExtResource("4_mgk0a")]
|
||||
unique_name_in_owner = true
|
||||
|
@ -11,8 +11,8 @@ class_name GroundLoader extends Node2D
|
||||
if is_node_ready() and current_scene and entrance_portal:
|
||||
transition_to_scene(current_scene, entrance_portal, true)
|
||||
# 强制覆盖 archive 记录
|
||||
@export var archive_scene := ""
|
||||
@export var archive_portal := ""
|
||||
@export var force_archive_scene := ""
|
||||
@export var force_archive_portal := ""
|
||||
|
||||
@onready var mask_layer := %MaskLayer as CanvasLayer
|
||||
@onready var mask := %Mask as ColorRect
|
||||
@ -60,15 +60,16 @@ func _read_grounds() -> void:
|
||||
|
||||
|
||||
func _load_save():
|
||||
if not Engine.is_editor_hint() and ArchiveManager.archive:
|
||||
if ArchiveManager.archive.current_scene:
|
||||
archive_scene = ArchiveManager.archive.current_scene
|
||||
if ArchiveManager.archive.entrance_portal:
|
||||
archive_portal = ArchiveManager.archive.entrance_portal
|
||||
# 强制覆盖 archive 记录
|
||||
if archive_scene or archive_portal:
|
||||
current_scene = archive_scene
|
||||
entrance_portal = archive_portal
|
||||
if force_archive_scene or force_archive_portal:
|
||||
current_scene = force_archive_scene
|
||||
entrance_portal = force_archive_portal
|
||||
return
|
||||
if not Engine.is_editor_hint():
|
||||
if ArchiveManager.archive.current_scene:
|
||||
current_scene = ArchiveManager.archive.current_scene
|
||||
if ArchiveManager.archive.entrance_portal:
|
||||
entrance_portal = ArchiveManager.archive.entrance_portal
|
||||
|
||||
|
||||
func _toggle_mask(display: bool, _immediately: bool) -> Tween:
|
||||
@ -106,8 +107,6 @@ func transition_to_scene(scene_name: String, portal: String, immediately: bool)
|
||||
func _update_archive():
|
||||
ArchiveManager.archive.current_scene = current_scene
|
||||
ArchiveManager.archive.entrance_portal = entrance_portal
|
||||
archive_scene = current_scene
|
||||
archive_portal = entrance_portal
|
||||
|
||||
|
||||
func _do_transition(scene_name: String):
|
||||
@ -145,7 +144,7 @@ func _update_player_position_from_archive():
|
||||
if ignore_archive or Engine.is_editor_hint():
|
||||
return
|
||||
var player = SceneManager.get_player() as MainPlayer
|
||||
if player and ArchiveManager.archive:
|
||||
if player:
|
||||
# if GlobalConfig.DEBUG:
|
||||
# print("update player position", ArchiveManager.archive.player_global_position)
|
||||
if ArchiveManager.archive.player_global_position_x >= 0:
|
||||
|
@ -6,7 +6,7 @@ var ambush: Ambush2D
|
||||
var frame: Note2D
|
||||
var paper: Interactable2D
|
||||
var right_door: Portal2D
|
||||
|
||||
var piano: Interactable2D
|
||||
|
||||
# 覆盖该方法
|
||||
func _default_data() -> Dictionary:
|
||||
@ -29,31 +29,42 @@ func _on_deploy_layer_ready() -> void:
|
||||
frame = $"../DeployLayer/画框"
|
||||
paper = $"../DeployLayer/oneshot纸片"
|
||||
right_door = $"../DeployLayer/portal_right"
|
||||
# 画框
|
||||
piano = $"../DeployLayer/钢琴"
|
||||
# 画框是否已经正位
|
||||
frame_relocated = ambush.played and ambush.one_shot
|
||||
# 禁用鸡毛掸子
|
||||
ambush.enabled = false
|
||||
# 画框已经正位时,重制画框状态
|
||||
if frame_relocated:
|
||||
frame.rotation_degrees = 0.0
|
||||
frame.note_key = "c01_摆正的洋相片"
|
||||
if GlobalConfig.DEBUG:
|
||||
print("重置画框位置")
|
||||
else:
|
||||
# 画框未正位时,首先允许互动相框
|
||||
frame.read_note.connect(_on_note_read, CONNECT_ONE_SHOT)
|
||||
ambush.triggered.connect(_on_ambush_triggered)
|
||||
|
||||
# 纸片状态
|
||||
if frame_relocated:
|
||||
# 画框已经正位,纸片已经被拾取
|
||||
if paper.interacted_times > 0:
|
||||
paper.visible = false
|
||||
paper.enabled = false
|
||||
right_door.enabled = true
|
||||
else:
|
||||
# 画框已经正位,纸片未被拾取,直接掉落
|
||||
paper.visible = true
|
||||
paper.enabled = true
|
||||
paper.interacted.connect(_on_paper_interacted, CONNECT_ONE_SHOT)
|
||||
else:
|
||||
# 画框未正位,纸片未掉落
|
||||
paper.visible = false
|
||||
paper.enabled = true
|
||||
paper.enabled = false
|
||||
paper.interacted.connect(_on_paper_interacted, CONNECT_ONE_SHOT)
|
||||
|
||||
piano.interacted.connect(_on_piano_interacted)
|
||||
|
||||
|
||||
func _on_note_read():
|
||||
frame.enabled = false
|
||||
@ -71,8 +82,8 @@ func _on_ambush_triggered():
|
||||
|
||||
func _play_paper_animation():
|
||||
# 播放纸片动画
|
||||
play("纸片飘落")
|
||||
paper.enabled = true
|
||||
play("纸片飘落")
|
||||
|
||||
|
||||
func _on_paper_interacted():
|
||||
@ -82,3 +93,6 @@ func _on_paper_interacted():
|
||||
right_door.enabled = true
|
||||
SceneManager.pop_debug_dialog_info("音效", "开门声")
|
||||
$"../sfx_door_open".play()
|
||||
|
||||
func _on_piano_interacted():
|
||||
SceneManager.freeze_and_play(0.0, "钢琴")
|
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=32 format=3 uid="uid://dlx5xxbg53rb8"]
|
||||
[gd_scene load_steps=33 format=3 uid="uid://dlx5xxbg53rb8"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_ff4yb"]
|
||||
[ext_resource type="Script" path="res://scene/ground/scene/c01/s05_animation.gd" id="2_j5oim"]
|
||||
@ -20,6 +20,7 @@
|
||||
[ext_resource type="AudioStream" uid="uid://dky3j8lwcy5sk" path="res://asset/audio/sfx/ui/物品查看.mp3" id="15_2jvyd"]
|
||||
[ext_resource type="Texture2D" uid="uid://bloct6cpdt2qi" path="res://asset/art/scene/c01/s05_院长房间/l_墙.png" id="16_qh7fg"]
|
||||
[ext_resource type="Texture2D" uid="uid://df30bmtgdoqc3" path="res://asset/art/scene/c01/s05_院长房间/l_窗户光源.png" id="17_qqw2v"]
|
||||
[ext_resource type="AudioStream" uid="uid://cvttds81trcoc" path="res://asset/audio/sfx/ui/click.wav" id="19_5i4lj"]
|
||||
[ext_resource type="PackedScene" uid="uid://dw0s23v7qmj28" path="res://ui/vertical_label.tscn" id="20_t1dxj"]
|
||||
[ext_resource type="AudioStream" uid="uid://inmdv5gqqius" path="res://asset/audio/sfx/ui/门锁互动.mp3" id="22_4c44k"]
|
||||
[ext_resource type="Script" path="res://scene/entity/ux/sfx.gd" id="23_o1482"]
|
||||
@ -689,6 +690,14 @@ position = Vector2(414, 51)
|
||||
texture = ExtResource("8_mnduo")
|
||||
one_shot = false
|
||||
|
||||
[node name="SfxInvalid" parent="Ground/DeployLayer/钢琴" index="0"]
|
||||
stream = ExtResource("19_5i4lj")
|
||||
file = "click.wav"
|
||||
|
||||
[node name="SfxSuccess" parent="Ground/DeployLayer/钢琴" index="1"]
|
||||
stream = ExtResource("19_5i4lj")
|
||||
file = "click.wav"
|
||||
|
||||
[node name="Sign" parent="Ground/DeployLayer/钢琴" index="2"]
|
||||
offset_left = -1.0
|
||||
offset_top = -8.0
|
||||
|
@ -22,8 +22,9 @@ size = Vector2(40, 70)
|
||||
|
||||
[node name="S03" type="Node2D"]
|
||||
|
||||
[node name="Ground" parent="." instance=ExtResource("1_lheeb")]
|
||||
[node name="Ground" parent="." node_paths=PackedStringArray("camera_focus_marker") instance=ExtResource("1_lheeb")]
|
||||
scene_name = "c02_s03"
|
||||
camera_focus_marker = NodePath("MainPlayer/CameraFocusMarker")
|
||||
|
||||
[node name="AnimationPlayer" parent="Ground" index="0"]
|
||||
script = ExtResource("2_l2oec")
|
||||
|
@ -3,6 +3,7 @@ extends CharacterBody2D
|
||||
|
||||
class_name MainPlayer
|
||||
|
||||
@export var camera_marker: CameraFocusMarker
|
||||
@export_enum("吕萍", "吕萍爬行", "吕萍带小猫", "小小蝶") var character := "吕萍":
|
||||
set(val):
|
||||
character = val
|
||||
@ -191,7 +192,8 @@ func _physics_process(_delta: float) -> void:
|
||||
# drag the camera marker against the player movement
|
||||
# so there will be a better vision in front of the player.
|
||||
func _tweak_camera_marker():
|
||||
SceneManager.get_camera_marker().tweak_position(velocity, facing_direction)
|
||||
if camera_marker != null:
|
||||
camera_marker.tweak_position(velocity, facing_direction)
|
||||
|
||||
|
||||
var lock_mutex = Mutex.new()
|
||||
|
@ -1,6 +0,0 @@
|
||||
[gd_scene format=3 uid="uid://782ur70tsfi2"]
|
||||
|
||||
[node name="ItemList" type="ScrollContainer"]
|
||||
custom_minimum_size = Vector2(50, 0)
|
||||
offset_right = 68.0
|
||||
offset_bottom = 20.0
|
@ -1,37 +0,0 @@
|
||||
@tool
|
||||
extends TextureButton
|
||||
|
||||
class_name SoundTextureButton
|
||||
|
||||
@export var generate_click_mask := false:
|
||||
set(val):
|
||||
generate_click_mask = false
|
||||
if val and texture_normal:
|
||||
var mask_image := texture_normal.get_image()
|
||||
texture_click_mask = BitMap.new()
|
||||
texture_click_mask.create_from_image_alpha(mask_image)
|
||||
@export var audio_streams := [preload("res://asset/audio/sfx/ui/click.wav")] as Array[AudioStream]
|
||||
@export var audio_collections = [] as Array[AudioStreamCollection]
|
||||
|
||||
|
||||
func _ready():
|
||||
if audio_streams:
|
||||
var collection := AudioStreamCollection.new()
|
||||
collection.audios = audio_streams
|
||||
audio_collections.append(collection)
|
||||
if audio_collections:
|
||||
#print("sound button load audio_collections into audio_player")
|
||||
var audio_player := RandomAudioStreamPlayer.new()
|
||||
audio_player.audio_collections = audio_collections
|
||||
button_down.connect(audio_player.play_random)
|
||||
add_child(audio_player)
|
||||
else:
|
||||
push_warning("sound button has no audio_collections! ignore initialization of audio_player")
|
||||
#button_down.connect(_on_press_down)
|
||||
#button_up.connect(_on_press_up)
|
||||
|
||||
#func _on_press_down():
|
||||
#InputUtil.set_cursor_hand_patting()
|
||||
#
|
||||
#func _on_press_up():
|
||||
#InputUtil.set_cursor_hand_rest()
|
@ -1,8 +0,0 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cef5mgr1hgpmr"]
|
||||
|
||||
[ext_resource type="Script" path="res://ui/button/sound_texture_button.gd" id="1_k7j4d"]
|
||||
|
||||
[node name="SoundButton" type="TextureButton"]
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
script = ExtResource("1_k7j4d")
|
@ -1,4 +1,3 @@
|
||||
@tool
|
||||
class_name LRU extends RefCounted
|
||||
|
||||
# LRU 算法
|
||||
|
Loading…
Reference in New Issue
Block a user