Captures the uncommitted parallel-development work (increments 46-49) on the
40250 classic client port, folded into docs/CLIENT-GAP.md + CLIENT-GAP-FIX.md.
Increment 49 (W0 interface-freeze batch, Phase 1 prerequisite) lands the
cross-workflow shared-file scaffolding so the 4 Phase 1 workflows can run in
isolated worktrees without contention:
- entity_store.{h,cpp}: Entity gains empire/affect_flags/owner_vid/state_flags;
new mut_spawn_full() (single-shot two-packet merge, §2.3), mut_ownership()
(§2.5), mut_map_bgm() + take_bgm_dirty()/bgm_name()/bgm_volume() (§9.1),
drain_dirty() (§2.1/§2.5 bare-field-update queue); mut_char_info() now stores
empire; reset_for_map_change() clears m_dirty.
- m2_client.cpp: new bgm_changed(name, volume) signal; classic + m2dev pump
loops drain drain_dirty() -> entity_info and take_bgm_dirty() -> bgm_changed;
entity_dict() exposes the 4 new keys.
- classic/classic_parser.{h,cpp}: GC_MAIN_CHARACTER3_BGM /
GC_MAIN_CHARACTER4_BGM_VOL route bgm_name/bgm_volume to mut_map_bgm() (was
discarded); new m_pending_actor staging map (W1 fills §2.2 merge logic).
- project/bgm_director.gd (new) + game_scene.gd: BGM consumption split out of
net_world.gd so W2/W4 don't collide; §8.6/§4.8 keybind convergence (digits
1-4 -> quickslots 0-3, F1-F4 -> quickslots 4-7, Ctrl+1..9 -> _emote()).
Tests: cmake --build build clean; ctest 16/16; 15 GDScript regressions green
(netbridge, gamescene, netplay, p9, p10, p2b, p8, system_menu_ui, skill,
combat_fx, skill_fx, player_motion, char_status_ui, chat, inventory), no skips.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yvAPqPivoY7vmBbzgqK4W
95 lines
2.8 KiB
GDScript
95 lines
2.8 KiB
GDScript
# QuestLog (P7) —— 任务日志窗:GC_QUEST_INFO 的条目列表。
|
|
#
|
|
# var ql := preload("res://ui/quest_log.gd").new()
|
|
# add_child(ql)
|
|
# ql.setup(m2client, canvas_parent)
|
|
# ql.toggle() # J 键
|
|
#
|
|
# 每条: 图标(占位) + 标题 + counter「名: 值」 + clock「名: 值」。
|
|
# `quest_info` 信号来时刷新。空标题的条目视为「已完成 / 移除」。
|
|
extends Node
|
|
|
|
var client: Node
|
|
var _root: Control
|
|
var _list: VBoxContainer
|
|
|
|
func setup(m2client: Node, parent: Node) -> void:
|
|
client = m2client
|
|
_build(parent)
|
|
if client.has_signal("quest_info"):
|
|
client.quest_info.connect(func(_i): refresh())
|
|
|
|
func is_open() -> bool:
|
|
return _root != null and _root.visible
|
|
|
|
func close() -> void:
|
|
if _root:
|
|
_root.visible = false
|
|
|
|
func toggle() -> void:
|
|
_root.visible = not _root.visible
|
|
if _root.visible:
|
|
refresh()
|
|
|
|
func refresh() -> void:
|
|
if not is_open() or client == null:
|
|
return
|
|
for c in _list.get_children():
|
|
c.queue_free()
|
|
var quests: Array = client.get_quests()
|
|
if quests.is_empty():
|
|
var e := Label.new()
|
|
e.text = "(无进行中的任务)"
|
|
e.add_theme_font_size_override("font_size", 12)
|
|
_list.add_child(e)
|
|
return
|
|
for q in quests:
|
|
if String(q.get("title", "")).strip_edges() == "":
|
|
continue
|
|
var box := VBoxContainer.new()
|
|
box.add_theme_constant_override("separation", 1)
|
|
var t := Label.new()
|
|
t.text = "◆ " + String(q.get("title", ""))
|
|
t.add_theme_font_size_override("font_size", 13)
|
|
box.add_child(t)
|
|
var cn := String(q.get("counter_name", ""))
|
|
if cn != "":
|
|
var cl := Label.new()
|
|
cl.text = " %s: %d" % [cn, int(q.get("counter_value", 0))]
|
|
cl.add_theme_font_size_override("font_size", 11)
|
|
cl.modulate = Color(0.8, 0.85, 0.7)
|
|
box.add_child(cl)
|
|
var kn := String(q.get("clock_name", ""))
|
|
if kn != "":
|
|
var kl := Label.new()
|
|
kl.text = " %s: %d" % [kn, int(q.get("clock_value", 0))]
|
|
kl.add_theme_font_size_override("font_size", 11)
|
|
kl.modulate = Color(0.7, 0.8, 0.9)
|
|
box.add_child(kl)
|
|
_list.add_child(box)
|
|
|
|
func _build(parent: Node) -> void:
|
|
_root = Control.new()
|
|
_root.set_anchors_preset(Control.PRESET_TOP_RIGHT)
|
|
_root.position = Vector2(-320, 60)
|
|
_root.size = Vector2(300, 360)
|
|
_root.visible = false
|
|
_root.set_meta("is_titlebar", true)
|
|
parent.add_child(_root)
|
|
var panel := Panel.new()
|
|
panel.set_anchors_preset(Control.PRESET_FULL_RECT)
|
|
var sb := StyleBoxFlat.new()
|
|
sb.bg_color = Color(0.07, 0.08, 0.1, 0.95)
|
|
sb.set_corner_radius_all(4)
|
|
panel.add_theme_stylebox_override("panel", sb)
|
|
_root.add_child(panel)
|
|
var title := Label.new()
|
|
title.text = "任务日志"
|
|
title.position = Vector2(12, 8)
|
|
_root.add_child(title)
|
|
_list = VBoxContainer.new()
|
|
_list.position = Vector2(12, 34)
|
|
_list.custom_minimum_size = Vector2(276, 0)
|
|
_list.add_theme_constant_override("separation", 8)
|
|
_root.add_child(_list)
|