Merge remote-tracking branch 'origin/demo'
This commit is contained in:
commit
8185e85464
@ -1,4 +1,4 @@
|
||||
[gd_resource type="SpriteFrames" load_steps=853 format=3 uid="uid://b7fhheih1hbvf"]
|
||||
[gd_resource type="SpriteFrames" load_steps=845 format=3 uid="uid://b7fhheih1hbvf"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dvq64espa37lx" path="res://asset/art/animation/c00_吕萍_idle_left/zhhx1.png" id="1_ekv0l"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcp4gk5lib4bl" path="res://asset/art/animation/c00_吕萍_idle_left/zhhx2.png" id="2_fq076"]
|
||||
@ -371,16 +371,12 @@
|
||||
[ext_resource type="Texture2D" uid="uid://ybj4hg6cvh4a" path="res://asset/art/gif/c01_书店外街道/小蝶看向橱窗/20.png" id="183_kirv5"]
|
||||
[ext_resource type="Texture2D" uid="uid://15ij6tgncpfn" path="res://asset/art/gif/c01_书店外街道/小蝶看向橱窗/21.png" id="184_30nqm"]
|
||||
[ext_resource type="Texture2D" uid="uid://cc0eb4ycclo1f" path="res://asset/art/animation/c02_吕萍_看小猫玩具_right/看玩具动作右5.png" id="184_jrug8"]
|
||||
[ext_resource type="Texture2D" uid="uid://cp71rayg8ynfr" path="res://asset/art/gif/c01_书店/小蝶拿报纸/0.png" id="184_tsskx"]
|
||||
[ext_resource type="Texture2D" uid="uid://cjgj5oq5e2qt6" path="res://asset/art/gif/c01_书店/小蝶拿报纸/1.png" id="185_adpbv"]
|
||||
[ext_resource type="Texture2D" uid="uid://bdbx3uylvnn78" path="res://asset/art/animation/c02_吕萍_看小猫玩具_right/看玩具动作右6.png" id="185_in30h"]
|
||||
[ext_resource type="Texture2D" uid="uid://dtt8xb0gkufps" path="res://asset/art/gif/c01_书店外街道/小蝶看向橱窗/22.png" id="185_ncltk"]
|
||||
[ext_resource type="Texture2D" uid="uid://emtd3r72ewhv" path="res://asset/art/animation/c02_吕萍_看小猫玩具_right/看玩具动作右7.png" id="186_ecyns"]
|
||||
[ext_resource type="Texture2D" uid="uid://lc6luwpq22il" path="res://asset/art/gif/c01_书店外街道/小蝶看向橱窗/23.png" id="186_if2a6"]
|
||||
[ext_resource type="Texture2D" uid="uid://jk7vua3s68q0" path="res://asset/art/gif/c01_书店/小蝶拿报纸/2.png" id="186_xaqjo"]
|
||||
[ext_resource type="Texture2D" uid="uid://x0xakx6gceq3" path="res://asset/art/animation/c00_过道小猫/过道小猫1.png" id="186_yiibj"]
|
||||
[ext_resource type="Texture2D" uid="uid://lsx7qqkkka0b" path="res://asset/art/gif/c01_书店外街道/小蝶看向橱窗/24.png" id="187_7hrrj"]
|
||||
[ext_resource type="Texture2D" uid="uid://cwakyp1uwatvc" path="res://asset/art/gif/c01_书店/小蝶拿报纸/3.png" id="187_exmgj"]
|
||||
[ext_resource type="Texture2D" uid="uid://1untb3vqajxc" path="res://asset/art/animation/c00_过道小猫/过道小猫2.png" id="187_qhkmm"]
|
||||
[ext_resource type="Texture2D" uid="uid://b6y8ggopkh8me" path="res://asset/art/gif/c01_书店外街道/小蝶看向橱窗/25.png" id="188_f1lc0"]
|
||||
[ext_resource type="Texture2D" uid="uid://dqdnrlwq5wreh" path="res://asset/art/gif/c01_书店/小蝶拿报纸/4.png" id="188_glo3y"]
|
||||
@ -430,13 +426,9 @@
|
||||
[ext_resource type="Texture2D" uid="uid://cxein2tgxbmpd" path="res://asset/art/gif/c01_书店/小蝶拿报纸/22.png" id="206_dlydb"]
|
||||
[ext_resource type="Texture2D" uid="uid://coiloe2kfxt3f" path="res://asset/art/gif/c01_公寓过道/小蝶探头/11.png" id="206_jtaix"]
|
||||
[ext_resource type="Texture2D" uid="uid://q5kqwixoexgc" path="res://asset/art/gif/c01_公寓过道/小蝶探头/12.png" id="207_rf1ax"]
|
||||
[ext_resource type="Texture2D" uid="uid://cf16ivik5eico" path="res://asset/art/gif/c01_书店/小蝶拿报纸/23.png" id="207_xewty"]
|
||||
[ext_resource type="Texture2D" uid="uid://l1mfvgty8v12" path="res://asset/art/gif/c01_公寓过道/小蝶探头/13.png" id="208_ku7j2"]
|
||||
[ext_resource type="Texture2D" uid="uid://du6u3l6v6ip88" path="res://asset/art/gif/c01_书店/小蝶拿报纸/24.png" id="208_yjsfv"]
|
||||
[ext_resource type="Texture2D" uid="uid://b5u6lc238aqah" path="res://asset/art/gif/c01_公寓过道/小蝶探头/14.png" id="209_37eje"]
|
||||
[ext_resource type="Texture2D" uid="uid://clo66qwjl0naq" path="res://asset/art/gif/c01_书店/小蝶拿报纸/25.png" id="209_253oi"]
|
||||
[ext_resource type="Texture2D" uid="uid://m8ecqan6e2qk" path="res://asset/art/gif/c01_公寓过道/小蝶探头/15.png" id="210_ave4u"]
|
||||
[ext_resource type="Texture2D" uid="uid://cuwflapilvolw" path="res://asset/art/gif/c01_书店/小蝶拿报纸/26.png" id="210_mlkjm"]
|
||||
[ext_resource type="Texture2D" uid="uid://duw51q2gu7cyu" path="res://asset/art/gif/c01_公寓过道/小蝶探头/16.png" id="211_o38qq"]
|
||||
[ext_resource type="Texture2D" uid="uid://bt2wosw7pdhmj" path="res://asset/art/gif/c01_公寓过道/小蝶探头/17.png" id="212_ddhdg"]
|
||||
[ext_resource type="Texture2D" uid="uid://cespji827yo4y" path="res://asset/art/animation/c02_吕萍_蹲下来查看/1.png" id="213_mydup"]
|
||||
@ -1892,18 +1884,6 @@ animations = [{
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("184_tsskx")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("185_adpbv")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("186_xaqjo")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("187_exmgj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("188_glo3y")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
@ -1959,18 +1939,6 @@ animations = [{
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("206_dlydb")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("207_xewty")
|
||||
}, {
|
||||
"duration": 2.0,
|
||||
"texture": ExtResource("208_yjsfv")
|
||||
}, {
|
||||
"duration": 2.0,
|
||||
"texture": ExtResource("209_253oi")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("210_mlkjm")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"c01_小小蝶_书店递报纸",
|
||||
|
@ -155,6 +155,7 @@ func get_prop_hud() -> PropHud:
|
||||
func toggle_hud_display(display_hud: bool) -> void:
|
||||
var prop_hud = get_prop_hud() as PropHud
|
||||
if prop_hud:
|
||||
print("[hud] toggle_hud_display:", display_hud)
|
||||
if display_hud:
|
||||
prop_hud.display_hud()
|
||||
else:
|
||||
@ -189,6 +190,7 @@ func has_prop(prop_key: String) -> bool:
|
||||
func enable_prop_item_silently(prop_key: String) -> void:
|
||||
var prop_hud = get_prop_hud()
|
||||
if prop_hud:
|
||||
print("[prop] enable_prop_item_silently prop:", prop_key)
|
||||
prop_hud.enable_prop_item(prop_key, false)
|
||||
else:
|
||||
printerr("enable_prop_item_silently: PropHud node not found")
|
||||
@ -197,6 +199,7 @@ func enable_prop_item_silently(prop_key: String) -> void:
|
||||
func enable_prop_item(prop_key: String) -> void:
|
||||
var prop_hud = get_prop_hud()
|
||||
if prop_hud:
|
||||
print("[prop] enable_prop_item prop:", prop_key)
|
||||
prop_hud.enable_prop_item(prop_key)
|
||||
else:
|
||||
printerr("enable_prop_item PropHud node not found")
|
||||
@ -206,6 +209,7 @@ func enable_prop_item(prop_key: String) -> void:
|
||||
func enable_important_item(prop_key: String, display_inspector = true) -> void:
|
||||
var prop_hud = get_prop_hud()
|
||||
if prop_hud:
|
||||
print("[prop] enable_important_item prop:", prop_key)
|
||||
prop_hud.enable_important_item(prop_key, display_inspector)
|
||||
else:
|
||||
printerr("enable_important_item PropHud node not found")
|
||||
@ -214,6 +218,7 @@ func enable_important_item(prop_key: String, display_inspector = true) -> void:
|
||||
func disable_prop_item(prop_key: String) -> void:
|
||||
var prop_hud = get_prop_hud()
|
||||
if prop_hud:
|
||||
print("[prop] disable_prop_item prop:", prop_key)
|
||||
prop_hud.disable_prop_item(prop_key)
|
||||
else:
|
||||
printerr("disable_prop_item PropHud node not found")
|
||||
@ -327,7 +332,9 @@ func _jump_back_to_index_and_quit_main() -> void:
|
||||
await get_tree().process_frame
|
||||
get_tree().change_scene_to_packed(packed_index_page)
|
||||
# 防止游戏卡死 reset pause counter
|
||||
pause_counter = 0
|
||||
if pause_counter_arr.size() > 0:
|
||||
printerr("checkout_index_page: pause_counter_arr is not empty, resetting pause counter")
|
||||
pause_counter_arr.clear()
|
||||
get_tree().paused = false
|
||||
|
||||
|
||||
@ -339,7 +346,9 @@ func enter_main_scene() -> void:
|
||||
await get_tree().process_frame
|
||||
get_tree().change_scene_to_packed.call_deferred(main_scene)
|
||||
# get_tree().change_scene_to_file.call_deferred("uid://dygvcmykn02n8")
|
||||
pause_counter = 0
|
||||
if pause_counter_arr.size() > 0:
|
||||
printerr("enter_main_scene: pause_counter_arr is not empty, resetting pause counter")
|
||||
pause_counter_arr.clear()
|
||||
get_tree().paused = false
|
||||
|
||||
|
||||
@ -381,16 +390,20 @@ func show_settings() -> void:
|
||||
|
||||
|
||||
#### 游戏场景树暂停计数器,设置、memory、bag 等菜单都会导致 pause
|
||||
var pause_counter := 0
|
||||
## 目前有(5类): settings, panel, bag, note, memory
|
||||
var pause_counter_arr: Array[String] = []
|
||||
var pause_counter_mutex := Mutex.new()
|
||||
|
||||
|
||||
func toggle_pause_counter(plus := true) -> void:
|
||||
func toggle_pause_counter(plus := true, from := "") -> void:
|
||||
# 若不 lock,会导致快速切换菜单时出现并发问题(pause_counter 成为负数)
|
||||
pause_counter_mutex.lock()
|
||||
pause_counter += 1 if plus else -1
|
||||
print("SceneTree pause_counter: ", pause_counter)
|
||||
get_tree().paused = pause_counter > 0
|
||||
if plus:
|
||||
pause_counter_arr.append(from)
|
||||
else:
|
||||
pause_counter_arr.erase(from)
|
||||
print("SceneTree pause_counter_arr: ", pause_counter_arr)
|
||||
get_tree().paused = len(pause_counter_arr) > 0
|
||||
pause_counter_mutex.unlock()
|
||||
|
||||
|
||||
|
@ -279,7 +279,6 @@ func _on_freeze_changed(count: int, is_add: bool):
|
||||
|
||||
# 非首次 freeze 不改变动画状态,因为在动画演出中可能多次 freeze 与 release
|
||||
func _on_first_frozen() -> void:
|
||||
if GlobalConfig.DEBUG:
|
||||
print("player _on_first_frozen. current_status=", current_status)
|
||||
# reset status to idle or stay
|
||||
velocity = Vector2.ZERO
|
||||
@ -372,8 +371,7 @@ func walk_to_x(global_pos_x: float) -> Tween:
|
||||
func walk_to(global_pos: Vector2) -> Tween:
|
||||
var tween = create_tween()
|
||||
velocity = Vector2.ZERO
|
||||
if GlobalConfig.DEBUG:
|
||||
print("walk_to:", global_pos, " from:", global_position)
|
||||
print("player walk_to:", global_pos, " from:", global_position)
|
||||
# 不同距离下,行走时长略做自适应
|
||||
var time_cost = absf(global_pos.distance_to(global_position) / 50.0)
|
||||
# 忽略过小的位移
|
||||
@ -406,8 +404,7 @@ func toggle_pause_state(pause := true) -> void:
|
||||
func _after_walk_to() -> void:
|
||||
current_status = PlayerAnimationConfig.MOVEMENT_IDLE
|
||||
_play_animation()
|
||||
if GlobalConfig.DEBUG:
|
||||
print("walk_to end. unlock player")
|
||||
print("player walk_to end. unlock player")
|
||||
SceneManager.unlock_player()
|
||||
|
||||
|
||||
|
@ -57,8 +57,8 @@ func freeze(duration := 0.0) -> void:
|
||||
_freeze_requests += 1
|
||||
var f_requests = _freeze_requests
|
||||
_request_mutex.unlock()
|
||||
if GlobalConfig.DEBUG:
|
||||
print("[Lock] Freeze applied: ", _freeze_requests)
|
||||
if GlobalConfig.DEBUG:
|
||||
print("freeze from: ", _get_stack_info())
|
||||
freeze_changed.emit(f_requests, true)
|
||||
|
||||
@ -77,8 +77,8 @@ func release() -> void:
|
||||
_freeze_requests = 0
|
||||
var f_requests = _freeze_requests
|
||||
_request_mutex.unlock()
|
||||
if GlobalConfig.DEBUG:
|
||||
print("[Lock] Release applied: ", _freeze_requests)
|
||||
if GlobalConfig.DEBUG:
|
||||
print("release from: ", _get_stack_info())
|
||||
freeze_changed.emit(f_requests, false)
|
||||
|
||||
@ -90,8 +90,8 @@ func hold(duration := 0.0) -> void:
|
||||
_request_mutex.lock()
|
||||
_hold_requests += 1
|
||||
_request_mutex.unlock()
|
||||
if GlobalConfig.DEBUG:
|
||||
print("[Lock] Hold applied: ", _hold_requests)
|
||||
if GlobalConfig.DEBUG:
|
||||
print("hold from: ", _get_stack_info())
|
||||
hold_changed.emit(_hold_requests, true)
|
||||
|
||||
@ -110,8 +110,8 @@ func unhold() -> void:
|
||||
_hold_requests = 0
|
||||
var h_requests = _hold_requests
|
||||
_request_mutex.unlock()
|
||||
if GlobalConfig.DEBUG:
|
||||
print("[Lock] Unhold applied: ", _hold_requests)
|
||||
if GlobalConfig.DEBUG:
|
||||
print("unhold from: ", _get_stack_info())
|
||||
hold_changed.emit(h_requests, true)
|
||||
|
||||
@ -143,8 +143,8 @@ func lock_all(duration := 0.0) -> void:
|
||||
var h_requests = _hold_requests
|
||||
var f_requests = _freeze_requests
|
||||
_request_mutex.unlock()
|
||||
if GlobalConfig.DEBUG:
|
||||
prints("[Lock] LockAll applied (hold, freeze): ", _hold_requests, _freeze_requests)
|
||||
if GlobalConfig.DEBUG:
|
||||
print("lock_all from: ", _get_stack_info())
|
||||
hold_changed.emit(h_requests, true)
|
||||
freeze_changed.emit(f_requests, true)
|
||||
@ -177,8 +177,8 @@ func unlock_all() -> void:
|
||||
_request_mutex.unlock()
|
||||
hold_changed.emit(h_requests, false)
|
||||
freeze_changed.emit(f_requests, false)
|
||||
if GlobalConfig.DEBUG:
|
||||
prints("[Lock] UnlockAll applied (hold, freeze): ", _hold_requests, _freeze_requests)
|
||||
if GlobalConfig.DEBUG:
|
||||
print("unlock_all from: ", _get_stack_info())
|
||||
|
||||
|
||||
|
@ -206,7 +206,7 @@ func apply_dialogue_line() -> void:
|
||||
if audio_stream_player.playing:
|
||||
audio_stream_player.stop()
|
||||
if GlobalConfig.DEBUG:
|
||||
printerr("Dialogue no audio found! audio_path = %s audio_import_path = %s" % [audio_path, audio_import_path])
|
||||
print_rich("[color=orange]Dialogue no audio found! audio_path = %s audio_import_path = %s" % [audio_path, audio_import_path])
|
||||
|
||||
# if dialogue_label.is_typing:
|
||||
# await dialogue_label.finished_typing
|
||||
|
@ -33,7 +33,7 @@ func display() -> void:
|
||||
if current_child.has_signal("exit"):
|
||||
current_child.connect("exit", _exit)
|
||||
elif GlobalConfig.DEBUG:
|
||||
print("[特写界面] no exit signal, packed_scene:", packed_scene)
|
||||
print_rich("[color=orange][特写界面] no exit signal, packed_scene:", packed_scene)
|
||||
|
||||
|
||||
func _exit(arg = null):
|
||||
|
@ -139,8 +139,8 @@ var interact_mutex = Mutex.new()
|
||||
|
||||
func is_key_matched(key) -> bool:
|
||||
return (
|
||||
# 第一个 prop_key 若空,则表示不需要匹配
|
||||
not prop_key
|
||||
# prop_key 皆空,则表示不需要匹配
|
||||
(not prop_key and not prop_key2 and not prop_key3)
|
||||
or (
|
||||
# 只要有一个 prop_key 匹配即可
|
||||
(prop_key and key == prop_key)
|
||||
@ -150,6 +150,14 @@ func is_key_matched(key) -> bool:
|
||||
)
|
||||
|
||||
|
||||
func check_if_disable_prop(key) -> void:
|
||||
# prop_key 若空, 则表示不需要匹配, 也就不需要 disable 当前道具
|
||||
if not disable_prop_after_interacted or (not prop_key and not prop_key2 and not prop_key3):
|
||||
return
|
||||
if key:
|
||||
SceneManager.disable_prop_item(key)
|
||||
|
||||
|
||||
func _pre_interacted() -> void:
|
||||
SceneManager.lock_player(0, action_key)
|
||||
if icount == 0 and first_interact_os_key:
|
||||
@ -177,8 +185,7 @@ func _on_interacted() -> void:
|
||||
return
|
||||
if not mute_when_interacted:
|
||||
sfx_success.play()
|
||||
if disable_prop_after_interacted and key:
|
||||
SceneManager.disable_prop_item(key)
|
||||
check_if_disable_prop(key)
|
||||
interacted_times += 1
|
||||
if interacted_texture:
|
||||
texture = interacted_texture
|
||||
|
@ -121,8 +121,7 @@ func _interacted():
|
||||
else:
|
||||
SceneManager.enable_prop_item(prop_key)
|
||||
triggered.emit()
|
||||
if GlobalConfig.DEBUG:
|
||||
print("pickable triggered! name=", name)
|
||||
print("pickable triggered! prop_key=", prop_key, ",as_important_item=", as_important_item)
|
||||
_check_display()
|
||||
|
||||
|
||||
|
@ -95,7 +95,6 @@ func _ready() -> void:
|
||||
ground_archive = ArchiveManager.archive.ground_archive()
|
||||
icount = ground_archive.get_value(name, "icount", 0)
|
||||
status = ground_archive.get_value(name, "status", status)
|
||||
if GlobalConfig.DEBUG:
|
||||
print("Portal read status [", name, "] status=", status)
|
||||
_check_sign_mark_and_texture()
|
||||
area2d.body_entered.connect(_reset)
|
||||
@ -198,8 +197,7 @@ func _on_interacted() -> void:
|
||||
before_pre_transport_wait.emit()
|
||||
if pre_transport_wait_time > 0.0:
|
||||
await get_tree().create_timer(pre_transport_wait_time).timeout
|
||||
if GlobalConfig.DEBUG:
|
||||
print("传送前往", target_scene, target_portal, " immediately=", immediately)
|
||||
prints("[portal] transition to scene:", target_scene, target_portal, "immediately=", immediately)
|
||||
var ground_loader = SceneManager.get_ground_loader() as GroundLoader
|
||||
if ground_loader:
|
||||
if immediately:
|
||||
|
@ -142,9 +142,9 @@ func align_activation() -> bool:
|
||||
activated,
|
||||
"[/color]",
|
||||
" occupied:[color=khaki]",
|
||||
_get_name_from_path(occupied),
|
||||
Sign.get_name_from_path(occupied),
|
||||
"[/color] touching:[color=coral]",
|
||||
_get_name_from_paths(_touching_sign_arr),
|
||||
Sign.get_name_from_paths(_touching_sign_arr),
|
||||
"[/color]"
|
||||
)
|
||||
return activated
|
||||
@ -193,7 +193,7 @@ func _try_activate() -> bool:
|
||||
return activated
|
||||
|
||||
|
||||
func _get_name_from_path(path: NodePath) -> String:
|
||||
static func get_name_from_path(path: NodePath) -> String:
|
||||
if not path:
|
||||
return ""
|
||||
# return -2 idx
|
||||
@ -206,12 +206,12 @@ func _get_name_from_path(path: NodePath) -> String:
|
||||
return ""
|
||||
|
||||
|
||||
func _get_name_from_paths(paths: Array[NodePath]) -> String:
|
||||
static func get_name_from_paths(paths: Array[NodePath]) -> String:
|
||||
if len(paths) == 0:
|
||||
return ""
|
||||
var names = []
|
||||
for path in paths:
|
||||
names.append(_get_name_from_path(path))
|
||||
names.append(Sign.get_name_from_path(path))
|
||||
return ", ".join(names)
|
||||
|
||||
|
||||
@ -225,7 +225,6 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
if activated:
|
||||
if event.is_action_pressed("interact"):
|
||||
get_viewport().set_input_as_handled()
|
||||
if GlobalConfig.DEBUG:
|
||||
print("Sign interacted:", get_parent().name)
|
||||
interacted.emit()
|
||||
if is_inside_tree():
|
||||
@ -235,7 +234,6 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
grab_focus()
|
||||
elif event.is_action_pressed("cancel"):
|
||||
get_viewport().set_input_as_handled()
|
||||
if GlobalConfig.DEBUG:
|
||||
print("Sign cancel:", get_parent().name)
|
||||
cancel.emit()
|
||||
release_focus()
|
||||
|
@ -180,8 +180,7 @@ func move_player_to_portal(portal_name: String) -> void:
|
||||
elif portal_name == "right":
|
||||
mov_player.set_facing_direction(Vector2.LEFT)
|
||||
reset_player_y()
|
||||
if GlobalConfig.DEBUG:
|
||||
print("move player to portal:", portal_name, portal_node.global_position)
|
||||
print("[ground] move player to portal:", portal_name, portal_node.global_position)
|
||||
elif mov_player:
|
||||
printerr(scene_name, " portal not found: ", node_path)
|
||||
else:
|
||||
|
@ -128,7 +128,6 @@ func transition_to_scene(scene_name: String, portal: String, wait_time := 1.4) -
|
||||
# 先发送,再暂停,允许 sfx 等节点执行 ease out
|
||||
SceneManager.ground_transition_pre_paused.emit()
|
||||
ground.process_mode = Node.PROCESS_MODE_DISABLED
|
||||
if GlobalConfig.DEBUG:
|
||||
# print reenter lock status
|
||||
print("GroundLoader transition_to_scene: reenter lock status: ", ground.reenter_lock)
|
||||
var scene_path = GROUND_SCENE_PATH_DICT.get(scene_name)
|
||||
@ -214,14 +213,13 @@ func _add_ground():
|
||||
else:
|
||||
# move player to portal
|
||||
ground.move_player_to_portal(entrance_portal)
|
||||
if GlobalConfig.DEBUG:
|
||||
add_child(ground)
|
||||
print(
|
||||
"GroundLoader add_ground finished:",
|
||||
ground.scene_name,
|
||||
" player.pos=",
|
||||
ground.get_player().global_position
|
||||
)
|
||||
add_child(ground)
|
||||
# ready 后,再整体重置 camera 位置
|
||||
if not Engine.is_editor_hint():
|
||||
ground.get_camera().reset_position_immediately()
|
||||
|
@ -11,7 +11,6 @@ extends Control
|
||||
|
||||
|
||||
func _ready():
|
||||
if GlobalConfig.DEBUG:
|
||||
print("Index Page Ready")
|
||||
newgame_btn.pressed.connect(_on_newgame_pressed)
|
||||
resume_btn.pressed.connect(_on_resume_pressed)
|
||||
@ -37,8 +36,7 @@ func _on_newgame_pressed():
|
||||
func _on_resume_pressed():
|
||||
sfx_click.global_play()
|
||||
# 继续一号存档
|
||||
if GlobalConfig.DEBUG:
|
||||
print("Resume")
|
||||
print("Resume Game")
|
||||
if ArchiveManager.archives.has(1):
|
||||
# 设置 current_selected_archive_id 后,存档会自动加载
|
||||
GlobalConfigManager.config.current_selected_archive_id = 1
|
||||
|
@ -95,7 +95,7 @@ func _ready():
|
||||
# return
|
||||
return_btn.pressed.connect(_on_return_btn_pressed)
|
||||
return_btn.grab_focus()
|
||||
SceneManager.toggle_pause_counter(true)
|
||||
SceneManager.toggle_pause_counter(true, "settings")
|
||||
# open
|
||||
$"Sfx打开".play()
|
||||
# # resize
|
||||
@ -200,5 +200,5 @@ func _unhandled_key_input(event: InputEvent) -> void:
|
||||
|
||||
func exit_settings() -> void:
|
||||
$"Sfx关闭".global_play()
|
||||
SceneManager.toggle_pause_counter(false)
|
||||
SceneManager.toggle_pause_counter(false, "settings")
|
||||
queue_free()
|
||||
|
@ -8,7 +8,7 @@ extends CanvasLayer
|
||||
|
||||
func _ready():
|
||||
layer = GlobalConfig.CANVAS_LAYER_UX_PANEL
|
||||
SceneManager.toggle_pause_counter(true)
|
||||
SceneManager.toggle_pause_counter(true, "bag")
|
||||
_load_item_buttons()
|
||||
# fisplay first item
|
||||
var hud = SceneManager.get_prop_hud()
|
||||
@ -76,5 +76,5 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
|
||||
|
||||
func quit() -> void:
|
||||
SceneManager.toggle_pause_counter(false)
|
||||
SceneManager.toggle_pause_counter(false, "bag")
|
||||
queue_free()
|
||||
|
@ -3,7 +3,7 @@ class_name Memory extends CanvasLayer
|
||||
|
||||
func _ready() -> void:
|
||||
layer = GlobalConfig.CANVAS_LAYER_UX_PANEL
|
||||
SceneManager.toggle_pause_counter(true)
|
||||
SceneManager.toggle_pause_counter(true, "memory")
|
||||
update_display()
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
|
||||
|
||||
func quit() -> void:
|
||||
SceneManager.toggle_pause_counter(false)
|
||||
SceneManager.toggle_pause_counter(false, "memory")
|
||||
queue_free()
|
||||
|
||||
|
||||
|
@ -3,7 +3,7 @@ extends CanvasLayer
|
||||
|
||||
func _ready() -> void:
|
||||
layer = GlobalConfig.CANVAS_LAYER_UX_PANEL
|
||||
SceneManager.toggle_pause_counter(true)
|
||||
SceneManager.toggle_pause_counter(true, "note")
|
||||
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
@ -18,5 +18,5 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
|
||||
|
||||
func quit() -> void:
|
||||
SceneManager.toggle_pause_counter(false)
|
||||
SceneManager.toggle_pause_counter(false, "note")
|
||||
queue_free()
|
||||
|
@ -11,7 +11,7 @@ extends CanvasLayer
|
||||
func _ready() -> void:
|
||||
$SfxOpen.play()
|
||||
layer = GlobalConfig.CANVAS_LAYER_UX_PANEL
|
||||
SceneManager.toggle_pause_counter(true)
|
||||
SceneManager.toggle_pause_counter(true, "panel")
|
||||
continue_btn.pressed.connect(_continue)
|
||||
note_btn.pressed.connect(SceneManager.show_note)
|
||||
settings_btn.pressed.connect(SceneManager.show_settings)
|
||||
@ -27,7 +27,7 @@ func _quit_game() -> void:
|
||||
|
||||
func _continue():
|
||||
$SfxClose.global_play()
|
||||
SceneManager.toggle_pause_counter(false)
|
||||
SceneManager.toggle_pause_counter(false, "panel")
|
||||
queue_free()
|
||||
|
||||
|
||||
|
@ -223,7 +223,7 @@ func _update_prop_display_with_texture():
|
||||
var player = SceneManager.get_player()
|
||||
if player:
|
||||
player.set_catty_light(key == "prop_小猫玩具完整")
|
||||
|
||||
print("[PropHud] current display prop:", key)
|
||||
# 选中标记 select_mark; 如果被 free 掉,则重新创建
|
||||
if select_mark and is_instance_valid(select_mark):
|
||||
var parent = select_mark.get_parent()
|
||||
@ -319,6 +319,7 @@ func _on_prop_inspected(id := 0) -> void:
|
||||
prop_key = inventory.current_item_key()
|
||||
if prop_key:
|
||||
sfx_inspect.play()
|
||||
print("[PropHud] inspect prop:", prop_key)
|
||||
inspect_item(prop_key, false)
|
||||
|
||||
|
||||
|
@ -215,6 +215,7 @@ offset_right = 65.0
|
||||
offset_bottom = 65.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
texture = ExtResource("7_53yeo")
|
||||
|
||||
[node name="RightMargin" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
|
||||
|
@ -62,7 +62,7 @@ func _hide():
|
||||
func _post_hide():
|
||||
status = STATUS_HIDDEN
|
||||
scroll_container.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
locking = false
|
||||
holding = false
|
||||
origin_texture.texture = null
|
||||
full_texture.texture = null
|
||||
texture_cover = null
|
||||
@ -96,7 +96,7 @@ func pop_standard_inspection(
|
||||
content_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT
|
||||
if status != STATUS_HIDDEN:
|
||||
_hide()
|
||||
locking = true
|
||||
holding = true
|
||||
status = STATUS_INSPECTING_COVER
|
||||
visible = true
|
||||
full_texture.texture = cover_texture
|
||||
@ -115,14 +115,17 @@ func pop_standard_inspection(
|
||||
_blink_label()
|
||||
|
||||
|
||||
var locking = false:
|
||||
var _lock_mutex := Mutex.new()
|
||||
var holding = false:
|
||||
set(val):
|
||||
if val != locking:
|
||||
locking = val
|
||||
_lock_mutex.lock()
|
||||
if val != holding:
|
||||
holding = val
|
||||
if val:
|
||||
SceneManager.lock_player()
|
||||
SceneManager.hold_player()
|
||||
else:
|
||||
SceneManager.unlock_player()
|
||||
SceneManager.unhold_player()
|
||||
_lock_mutex.unlock()
|
||||
|
||||
var balloon
|
||||
|
||||
@ -136,7 +139,7 @@ func pop_prop_inspection(
|
||||
# STATUS_INSPECTING_PROP 状态下不 hide,跳过重复 lock
|
||||
if status != STATUS_HIDDEN and status != STATUS_INSPECTING_PROP:
|
||||
_hide()
|
||||
locking = true
|
||||
holding = true
|
||||
status = STATUS_INSPECTING_PROP
|
||||
visible = true
|
||||
var tween = create_tween()
|
||||
|
Loading…
Reference in New Issue
Block a user