From 9bbffd849f32aa01bc531d37c02c32263817c36c Mon Sep 17 00:00:00 2001 From: DKChan <524912269@qq.com> Date: Fri, 25 Sep 2026 14:31:42 +0800 Subject: [PATCH] =?UTF-8?q?test(ui):=20=E5=91=88=E7=8E=B0=E5=B1=82?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=96=AD=E8=A8=80=E6=89=B9=EF=BC=88A=20?= =?UTF-8?q?=E6=A1=A3=E6=96=B9=E6=A1=88=E8=90=BD=E5=9C=B0=E2=80=94=E2=80=94?= =?UTF-8?q?ui=5Finput=5Fprobe=20=E4=B8=83=E6=96=AD=E8=A8=80=E2=86=92?= =?UTF-8?q?=E5=8D=81=E4=B8=80=E6=96=AD=E8=A8=80=202026-09-26=20=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=8B=8D=E6=9D=BF=EF=BC=89=EF=BC=9A=E2=91=A7=E5=BD=B1?= =?UTF-8?q?=E5=AD=90=E6=9E=84=E6=88=90=E4=B8=8E=E8=B4=B4=E8=84=9A=EF=BC=88?= =?UTF-8?q?=E8=8B=B1=E9=9B=84=E5=AD=90=E4=BB=B6=E5=94=AF=E4=B8=80=E6=80=A7?= =?UTF-8?q?/=E4=B8=AD=E5=BF=83=E8=B4=B4=E8=84=9A=E9=94=9A=20ZERO/z=20?= =?UTF-8?q?=E7=9B=B8=E5=AF=B9-1/alpha=200.35/GradientTexture2D=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6/=E7=88=B6=E5=AD=90=20use=5Fparent=5Fmaterial=20?= =?UTF-8?q?=E9=93=BE=EF=BC=89=EF=BC=9B=E2=91=A8=E5=8F=B3=E7=A7=BB=E6=9C=9D?= =?UTF-8?q?=E5=90=91=20flip=5Fh=3Dtrue+=E5=88=B0=E4=BD=8D=E5=A2=99?= =?UTF-8?q?=E9=92=9F=E5=9B=9E=E7=AB=99=E5=B8=A7+=E7=BC=A9=E6=94=BE=201.5?= =?UTF-8?q?=20=E5=9D=87=E5=8C=80=E6=A1=A3=EF=BC=88=E6=97=A0=E5=8F=AF?= =?UTF-8?q?=E8=BE=BE=E5=8F=B3=E9=82=BB=E5=B7=B2=E5=BC=80=E6=A0=BC=E6=89=93?= =?UTF-8?q?=E5=8D=B0=20SKIP=20=E4=B8=8D=E5=88=A4=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=EF=BC=89=EF=BC=9B=E2=91=A9=E5=8F=98=E6=A0=BC=E8=BE=B9=E9=95=BF?= =?UTF-8?q?=E5=8D=B3=E6=97=B6=E9=87=8D=E6=8E=92=EF=BC=88set=5Fcell=5Farea?= =?UTF-8?q?=20=E7=BC=A9=E6=A0=BC=E2=86=92=E8=8B=B1=E9=9B=84=E5=8D=B3?= =?UTF-8?q?=E6=97=B6=E8=90=BD=E6=96=B0=E8=84=9A=E9=94=9A+scale=20=E5=9D=87?= =?UTF-8?q?=E5=8C=80=E3=80=81=E8=BF=98=E5=8E=9F=E2=86=9246px=20=E5=A4=8D?= =?UTF-8?q?=E4=BD=8D=E2=80=94=E2=80=94=E7=AA=97=E5=8F=A3=E7=BC=A9=E6=94=BE?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E5=9B=9E=E5=BD=92=E9=97=B8=EF=BC=89=EF=BC=9B?= =?UTF-8?q?=E2=91=AA=E8=B4=B4=E5=9B=BE=E7=BC=BA=E4=BD=8D=E5=9B=9E=E9=80=80?= =?UTF-8?q?=EF=BC=88texture=20=E7=BD=AE=20null+refresh=E2=86=92=E6=95=B0?= =?UTF-8?q?=E5=AD=97=200=20=E6=A0=BC=E5=AD=97=E5=BD=A2=E5=BF=85=E5=9B=9E?= =?UTF-8?q?=E9=80=80=E3=80=8C=E4=BA=BA=E3=80=8D/=E6=95=B0=E5=AD=97?= =?UTF-8?q?=E6=A0=BC=E4=B8=8D=E7=A0=B4=E5=9D=8F=E2=80=94=E2=80=94=E5=9B=9E?= =?UTF-8?q?=E9=80=80=E5=88=A4=E6=8D=AE=E4=B8=8E=E6=8A=91=E5=88=B6=E5=88=A4?= =?UTF-8?q?=E6=8D=AE=E5=90=8C=E6=BA=90=E9=AA=8C=E8=AF=81=EF=BC=89=EF=BC=9B?= =?UTF-8?q?=E8=B8=A9=E5=9D=91=E5=9C=A8=E6=A1=88=EF=BC=9AVariant=20?= =?UTF-8?q?=E9=93=BE=20get=5Fchildren()=20=E7=94=A8=20:=3D=20=E6=8E=A8?= =?UTF-8?q?=E6=96=AD=E5=A4=B1=E8=B4=A5=3D=E6=8E=A2=E9=92=88=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E8=BD=BD=E5=85=A5=E5=A4=B1=E8=B4=A5=E9=9D=99=E9=BB=98?= =?UTF-8?q?=E6=8C=82=E6=AD=BB=EF=BC=88=E6=98=BE=E5=BC=8F=20Array=20?= =?UTF-8?q?=E6=A0=87=E6=B3=A8=E4=BF=AE=E5=A4=8D=E2=80=94=E2=80=94GDScript?= =?UTF-8?q?=20=E6=8E=A2=E9=92=88=E6=96=B0=E5=9D=91=E7=AC=AC=E4=BA=8C?= =?UTF-8?q?=E4=BE=8B=EF=BC=89=EF=BC=9B=E5=86=92=E7=83=9F=20557/0+click=20?= =?UTF-8?q?=E6=8E=A2=E9=92=88=E7=BB=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/smoke/ui_input_probe.gd | 76 +++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 2 deletions(-) diff --git a/game/smoke/ui_input_probe.gd b/game/smoke/ui_input_probe.gd index 31f0661d..c8897433 100644 --- a/game/smoke/ui_input_probe.gd +++ b/game/smoke/ui_input_probe.gd @@ -5,7 +5,9 @@ # 悬停/点选/chord 既有出口 → 组合根信号。四 case:①悬停可挖域(金框+十字光标)②悬停禁入 # (hover_forbidden 信号+灰禁红框)③悬停已开格(路径预览点迹+移动光标)④右键插旗(flag_place # 到达组合根+核心旗态)⑤双击 chord(禁入格双左击,核心拒挖零副作用)⑥左键挖(dig 到达组合根+核心揭格) -# ⑦英雄精灵世界落位(棋盘小人贴图批回归闸——SubViewport 世界坐标判据,素材缺位树跳过)。 +# ⑦英雄精灵世界落位(棋盘小人贴图批回归闸——SubViewport 世界坐标判据,素材缺位树跳过) +# ⑧影子构成与贴脚 ⑨右移朝向+到位回站帧+缩放档 ⑩变格边长即时重排 ⑪贴图缺位回退字形 +#(⑧–⑪=呈现层状态断言批 2026-09-26——Node2D 展示几何/状态面单元化,A 档方案)。 # 事件路径:Viewport.push_input(ev, in_local_coords=true)——落点用 BoardView.cell_center_local # (与 _cell_at 同一公式族)换算画布坐标,SubViewportContainer mouse_filter=IGNORE 不拦截。 # 运行:Godot_console.exe --headless --path . res://smoke/ui_input_probe.tscn @@ -133,8 +135,78 @@ func _ready() -> void: + Vector2(bv.cell_size * 0.5, bv.cell_size * (1.0 - bv.HERO_GROUND_FRAC)) if bv._world.hero.position.distance_to(expect) > 0.5: _problems.append("case⑦ 英雄精灵世界落位偏移 pos=%s expect=%s" % [str(bv._world.hero.position), str(expect)]) + # ---- case⑧ 影子构成与贴脚(小人立体感批回归闸 2026-09-26):椭圆影=英雄子件、中心贴脚锚 + #(上批 (0,2) 下坠脱脚用户报缺陷)、z 相对回落格面之上英雄之下、黑色半透明、渐变纹理组件 + # 合成;父子 use_parent_material 双挂(结算期随世界去饱和与格面同口径)。 ---- + if bv._world.hero != null: + var kids: Array = bv._world.hero.get_children() + if kids.size() != 1 or not (kids[0] is Sprite2D): + _problems.append("case⑧ 影子子件缺失或类型不对(children=%d)" % kids.size()) + else: + var sh: Sprite2D = kids[0] + if sh.position != Vector2.ZERO: + _problems.append("case⑧ 影子未贴脚(pos=%s 应=ZERO)" % str(sh.position)) + if sh.z_index != -1: + _problems.append("case⑧ 影子 z 相对档不对(%d 应=-1)" % sh.z_index) + if absf(sh.modulate.a - 0.35) > 0.01: + _problems.append("case⑧ 影子透明度漂移(%s 应=0.35)" % str(sh.modulate.a)) + if not (sh.texture is GradientTexture2D): + _problems.append("case⑧ 影子纹理非径向渐变组件(%s)" % str(sh.texture)) + if not sh.use_parent_material or not bv._world.hero.use_parent_material: + _problems.append("case⑧ 去饱和材质链漏挂(shadow=%s hero=%s)" % [str(sh.use_parent_material), str(bv._world.hero.use_parent_material)]) + # ---- case⑨ 右移朝向+到位回站帧+缩放档(贴图批回归闸):素材基准朝左——向右移动 flip_h=true; + # 到位(0.3s 墙钟 > 位移 Tween 140ms)纹理回站帧、scale 恒 1.5 均匀档。无可达右邻已开格跳过。 ---- + if bv._world.hero != null: + var hp9: Vector2i = ms.hero_pos() + var mv9 := Vector2i(-9, -9) + for n in bv._board.neighbors8(hp9): + if n.x == hp9.x + 1 and ms.is_revealed(n): + mv9 = n + break + if mv9.x == -9: + print("[ui_input_probe] SKIP case⑨(无可达右邻已开格)") + else: + _push_click(_pos(bv, mv9), MOUSE_BUTTON_LEFT) + await get_tree().create_timer(0.3).timeout + var sp9: Sprite2D = bv._world.hero + if not sp9.flip_h: + _problems.append("case⑨ 右移后未翻转朝向(flip_h=false,素材基准朝左)") + if sp9.texture != bv._hero_tex_idle: + _problems.append("case⑨ 到位未回站帧(texture=%s)" % str(sp9.texture)) + if sp9.scale != Vector2.ONE * bv.HERO_SPRITE_SCALE: + _problems.append("case⑨ 缩放档漂移(%s 应=%s 均匀)" % [str(sp9.scale), str(bv.HERO_SPRITE_SCALE)]) + # ---- case⑩ 变格边长即时重排(窗口缩放路径回归闸):set_cell_area 换小格 → 英雄即时落新脚锚、 + # 缩放均匀不残弹跳形;还原 → 46px 档复验。 ---- + if bv._world.hero != null: + var hp10: Vector2i = ms.hero_pos() + bv.set_cell_area(Vector2(300, 300)) + var expect10: Vector2 = Vector2(hp10) * (bv.cell_size + float(bv.SEP)) \ + + Vector2(bv.cell_size * 0.5, bv.cell_size * (1.0 - bv.HERO_GROUND_FRAC)) + if bv._world.hero.position.distance_to(expect10) > 0.5 or bv._world.hero.scale != Vector2.ONE * bv.HERO_SPRITE_SCALE: + _problems.append("case⑩ 缩格后英雄未即时重排(pos=%s expect=%s scale=%s)" % [str(bv._world.hero.position), str(expect10), str(bv._world.hero.scale)]) + bv.set_cell_area(bv.size) + var expect10b: Vector2 = Vector2(hp10) * (bv.cell_size + float(bv.SEP)) \ + + Vector2(bv.cell_size * 0.5, bv.cell_size * (1.0 - bv.HERO_GROUND_FRAC)) + if bv._world.hero.position.distance_to(expect10b) > 0.5: + _problems.append("case⑩ 还原后英雄未复位(pos=%s expect=%s)" % [str(bv._world.hero.position), str(expect10b)]) + # ---- case⑪ 贴图缺位回退(字形「人」回归闸):texture 置 null + refresh → 英雄格数字 0 时字形 + # 必须回退「人」(数字格仍显数字——回退判据与抑制判据同源);验毕还原纹理重绘。 ---- + if bv._world.hero != null: + var hp11: Vector2i = ms.hero_pos() + var u11 = bv._cells[hp11] + var tex_saved: Texture2D = bv._hero_tex_idle + bv._hero_tex_idle = null + bv.refresh() + var digit11: int = int(ms.reveal_record(hp11).get("digit", 0)) + if digit11 == 0: + if u11.glyph != "人": + _problems.append("case⑪ 贴图缺位未回退字形「人」(glyph=%s)" % u11.glyph) + elif u11.glyph != str(digit11): + _problems.append("case⑪ 缺位态数字格字形被破坏(glyph=%s 应=%d)" % [u11.glyph, digit11]) + bv._hero_tex_idle = tex_saved + bv.refresh() if _problems.is_empty(): - print("[ui_input_probe] PASS — 悬停金框/禁入信号/路径预览/flag_place/chord/dig/英雄落位 七断言全绿(真实 push_input 路径)") + print("[ui_input_probe] PASS — 悬停金框/禁入信号/路径预览/flag_place/chord/dig/英雄落位/影子构成/朝向/缩格重排/缺位回退 十一断言全绿(真实 push_input 路径)") get_tree().quit(0) else: for p in _problems: