Add Wuchao camp conversations
This commit is contained in:
@@ -3541,7 +3541,7 @@ func _rebuild_talk_menu() -> void:
|
||||
_clear_talk_list()
|
||||
var conversations := _camp_conversation_entries()
|
||||
if talk_status_label != null:
|
||||
talk_status_label.text = "Camp conversations | %d available" % conversations.size()
|
||||
talk_status_label.text = _format_talk_status_text(conversations)
|
||||
if conversations.is_empty():
|
||||
var empty_label := Label.new()
|
||||
empty_label.text = "No camp conversations"
|
||||
@@ -3555,6 +3555,35 @@ func _rebuild_talk_menu() -> void:
|
||||
talk_list.add_child(button)
|
||||
|
||||
|
||||
func _format_talk_status_text(conversations: Array) -> String:
|
||||
var supply_available := 0
|
||||
var supply_claimed := 0
|
||||
for conversation in conversations:
|
||||
if typeof(conversation) != TYPE_DICTIONARY:
|
||||
continue
|
||||
var effects: Array = conversation.get("effects", [])
|
||||
if effects.is_empty():
|
||||
continue
|
||||
var has_supply := false
|
||||
for effect in effects:
|
||||
if typeof(effect) == TYPE_DICTIONARY and str(effect.get("type", "")) == "grant_item":
|
||||
has_supply = true
|
||||
break
|
||||
if not has_supply:
|
||||
continue
|
||||
var conversation_id := str(conversation.get("id", ""))
|
||||
if campaign_state.has_claimed_camp_conversation_effects(active_scenario_id, conversation_id):
|
||||
supply_claimed += 1
|
||||
else:
|
||||
supply_available += 1
|
||||
var parts := ["Camp conversations", "%d topics" % conversations.size()]
|
||||
if supply_available > 0:
|
||||
parts.append("%d supplies ready" % supply_available)
|
||||
if supply_claimed > 0:
|
||||
parts.append("%d claimed" % supply_claimed)
|
||||
return _join_strings(parts, " | ")
|
||||
|
||||
|
||||
func _clear_talk_list() -> void:
|
||||
for child in talk_list.get_children():
|
||||
talk_list.remove_child(child)
|
||||
|
||||
Reference in New Issue
Block a user