fix: 装备属性面板避让逻辑 + 多项功能更新
- item_tooltip_view.gd: 新增 avoid_rect 属性,tooltip 与装备窗口重叠时自动推到左侧 - inventory_ui.gd: 悬停装备时传入窗口矩形作为避让区域 - 包含其他累积的功能开发和测试文件
This commit is contained in:
+26
-7
@@ -88,27 +88,30 @@ func _run() -> void:
|
||||
(qd._btnrow.get_child(0) as Button).pressed.emit()
|
||||
_ck(fc.answers == [1, 255], "continue -> script_answer(255)")
|
||||
|
||||
# DONE is a button action in ClientVS22. Parsing / receiving the token must
|
||||
# not fire DoneEvent before the player confirms the close button.
|
||||
# ClientVS22 fires DoneEvent while ProcessEventSet consumes [DONE]. The
|
||||
# resulting BUTTON_TYPE_DONE callback only closes the dialog and sends no
|
||||
# script answer packet.
|
||||
var done_events := 0
|
||||
qd.done_event.connect(func(): done_events += 1)
|
||||
var done_parse: Dictionary = qd.parse_script("Finished.[DONE]")
|
||||
_ck(done_parse.next_button_type == "DONE" and done_events == 0,
|
||||
"DONE parse stays side-effect free")
|
||||
"pure DONE parse stays side-effect free")
|
||||
fc.script_dialog.emit(0, "Finished.[DONE]")
|
||||
await process_frame
|
||||
_ck(done_events == 1 and fc.answers == [1, 255],
|
||||
"DONE processing emits DoneEvent without script_answer")
|
||||
(qd._btnrow.get_child(0) as Button).pressed.emit()
|
||||
_ck(done_events == 1 and fc.answers == [1, 255, 255],
|
||||
"DONE click -> DoneEvent + script_answer(255)")
|
||||
_ck(done_events == 1 and fc.answers == [1, 255],
|
||||
"DONE click only closes without script_answer")
|
||||
|
||||
# ESC dismisses the active script through the legacy QUEST_CANCEL packet.
|
||||
# ESC follows uiquest.py::OnPressEscapeKey: NEXT sends 254 and closes.
|
||||
fc.script_dialog.emit(0, "Cancelable quest.[NEXT]")
|
||||
await process_frame
|
||||
var esc := InputEventKey.new()
|
||||
esc.pressed = true
|
||||
esc.keycode = KEY_ESCAPE
|
||||
qd._unhandled_input(esc)
|
||||
_ck(fc.cancels == 1, "ESC -> quest_cancel()")
|
||||
_ck(fc.answers == [1, 255, 254] and fc.cancels == 0, "ESC on NEXT -> script_answer(254)")
|
||||
_ck(not qd.is_open(), "ESC closes quest dialog")
|
||||
|
||||
# [INPUT] renders a LineEdit and sends the entered text through QUEST_INPUT_STRING.
|
||||
@@ -171,6 +174,22 @@ func _run() -> void:
|
||||
_ck(titles == 1, "quest log shows 1 titled quest (got %d)" % titles)
|
||||
_ck(ql._clock_labels.has(1) and String(ql._clock_labels[1].text).contains("1分5秒"),
|
||||
"quest clock renders minutes and seconds")
|
||||
# 40250 CPythonQuest stores iStartTime independently of window visibility.
|
||||
# Reopening the window must derive the elapsed value from that timestamp,
|
||||
# rather than restoring the original clock_value.
|
||||
fc.quests = [{"index": 77, "title": "Timed quest", "counter_name": "",
|
||||
"counter_value": 0, "clock_name": "Time", "clock_value": 125,
|
||||
"clock_start_ms": Time.get_ticks_msec() - 121000, "icon": ""}]
|
||||
ql.close()
|
||||
ql.toggle()
|
||||
await process_frame
|
||||
_ck(ql._clock_labels.has(77) and String(ql._clock_labels[77].text).contains("4秒"),
|
||||
"quest clock uses captured start after opening")
|
||||
ql.close()
|
||||
ql.toggle()
|
||||
await process_frame
|
||||
_ck(ql._clock_labels.has(77) and String(ql._clock_labels[77].text).contains("4秒"),
|
||||
"quest clock remains elapsed across close and reopen")
|
||||
# ClientVS22 only renders QUEST_MAX_NUM=5 rows and maps the scrollbar to a
|
||||
# discrete questShowingStartIndex. Empty icon paths use the default scroll icon.
|
||||
fc.quests.clear()
|
||||
|
||||
Reference in New Issue
Block a user