reset_temp_disabled_props

This commit is contained in:
cakipaul 2025-07-31 04:27:08 +08:00
parent 2c466c923b
commit 521f250885
2 changed files with 18 additions and 0 deletions

View File

@ -248,6 +248,16 @@ func disable_prop_item_temp(prop_key: String) -> void:
printerr("disable_prop_item_temp PropHud node not found")
# 恢复临时禁用的 prop
func reset_temp_disabled_props() -> void:
var prop_hud = get_prop_hud()
if prop_hud:
print("[prop] reset_temp_disabled_props prop:")
prop_hud.reset_temp_disabled_props()
else:
printerr("reset_temp_disabled_props PropHud node not found")
func pop_os_with_str(translation_key: String) -> void:
var player = get_player() as MainPlayer
if player:

View File

@ -614,6 +614,14 @@ func disable_prop_item_temp(prop_key: String) -> void:
_reload_cache_and_realign_display()
# 恢复临时禁用的 prop
func reset_temp_disabled_props() -> void:
if not inventory:
return
inventory.virtual_enabled_items(true, true)
_reload_cache_and_realign_display()
func _align_container_size() -> void:
if not inventory:
return