Merge remote-tracking branch 'origin/demo'

This commit is contained in:
cakipaul 2025-07-24 17:29:24 +08:00
commit 4d0b174266
2 changed files with 5 additions and 4 deletions

View File

@ -547,7 +547,7 @@ func enable_prop_item(prop_key: String, inspect := true) -> void:
push_error("PropItem not found! key=" + prop_key) push_error("PropItem not found! key=" + prop_key)
return return
inventory.enable_item(prop_key) inventory.enable_item(prop_key, inspect)
_reload_cache_and_realign_display() _reload_cache_and_realign_display()
if GlobalConfig.DEBUG: if GlobalConfig.DEBUG:

View File

@ -53,12 +53,13 @@ func current_item_key() -> String:
return enabled_items[current_index] return enabled_items[current_index]
func enable_item(prop_key: String) -> void: func enable_item(prop_key: String, inspect := true) -> void:
# 重复 enable 无负面影响 # 重复 enable 无负面影响
if not enabled_items.has(prop_key): if not enabled_items.has(prop_key):
enabled_items.append(prop_key) enabled_items.append(prop_key)
# 新增后直接选中 # 如果 inspect, 则直接选中为当前条目
if inspect:
current_index = enabled_items.find(prop_key) current_index = enabled_items.find(prop_key)