From 473ff33b62288e9843cad0d3af1e411d477e6252 Mon Sep 17 00:00:00 2001 From: DKChan <524912269@qq.com> Date: Mon, 5 Oct 2026 02:47:03 +0800 Subject: [PATCH] =?UTF-8?q?M8=20=E6=88=98=E6=96=97=E5=8C=85=E5=9B=9B?= =?UTF-8?q?=E4=BB=B6=EF=BC=88UI=E8=90=BD=E7=A0=81=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=B3=A2=EF=BC=89=E2=80=94=E2=80=94=E2=91=A0=E8=BD=AE=E6=AC=A1?= =?UTF-8?q?=E7=89=8Cplate9=E7=B4=A0=E7=89=8C=E5=8C=96(=E5=A2=A8=E5=AD=97)?= =?UTF-8?q?=E2=91=A1AP/RAP=E7=82=B9=E9=98=B5Dot=E6=A0=B7=E5=BC=8F=E4=BB=B6?= =?UTF-8?q?(=E6=96=B9=E7=82=B9+=E4=BA=AE=E5=BF=83,AP=E7=83=9B=E5=85=89?= =?UTF-8?q?=E9=BB=84/RAP=E5=B0=8F=E4=BA=BA=E8=93=9D)=E2=91=A3=E9=81=93?= =?UTF-8?q?=E5=85=B7=E6=A7=BDglyph=E2=86=92=E6=89=8B=E7=BB=98=E5=83=8F?= =?UTF-8?q?=E7=B4=A0=E5=9B=BE=E6=A0=87(=E6=98=A0=E5=B0=84=E5=9B=9E?= =?UTF-8?q?=E9=80=80=E5=AD=97=E5=BD=A2)=E2=91=A4=E6=A3=8B=E7=9B=98?= =?UTF-8?q?=E5=BA=95=E5=B8=B8=E9=A9=BB=E6=93=8D=E4=BD=9C=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E6=9D=A1(=E5=B7=A6=E9=94=AE=E6=8C=96=E6=8E=98/=E5=8F=B3?= =?UTF-8?q?=E9=94=AE=E5=B0=81=E5=8D=B0/=E5=8F=8C=E5=87=BB=E5=BF=AB?= =?UTF-8?q?=E5=BC=80)=E3=80=82P-C1=20C=E5=8C=BA=E4=B8=A4=E6=AE=B5=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E7=8E=B0=E7=8A=B6=E9=9B=B6=E6=94=B9=EF=BC=9BP-C7?= =?UTF-8?q?=E6=88=98=E6=8A=A5=E5=8D=95=E8=A1=8C=E7=8E=B0=E7=8A=B6+?= =?UTF-8?q?=E5=9B=9E=E7=9C=8B=E9=80=80=E5=BD=B9=E5=BD=92M9=E3=80=82?= =?UTF-8?q?=E9=97=B8=3D=E5=86=92=E7=83=9F747/0+probe=5Fgate=E5=85=A8?= =?UTF-8?q?=E7=BB=BF+layout=200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/presentation/views/ap_bar_view.gd | 40 ++++++++++++++----- game/presentation/views/battle_stage_view.gd | 9 ++++- game/presentation/views/board_zone_view.gd | 10 +++++ .../views/hero_info_panel_view.gd | 40 ++++++++++++++----- 4 files changed, 76 insertions(+), 23 deletions(-) diff --git a/game/presentation/views/ap_bar_view.gd b/game/presentation/views/ap_bar_view.gd index cba6b97b..24ce62f8 100644 --- a/game/presentation/views/ap_bar_view.gd +++ b/game/presentation/views/ap_bar_view.gd @@ -117,8 +117,9 @@ func set_ap(ap: int, ap_max: int) -> void: _dots.remove_child(last) last.queue_free() for i in _dots.get_child_count(): - var d: ColorRect = _dots.get_child(i) - d.color = COL_GOLD if i < ap else COL_DOT_OFF + var d: Dot = _dots.get_child(i) + d.lit = i < ap + d.queue_redraw() _ap_label.text = "AP %d/%d" % [ap, ap_max] @@ -170,8 +171,9 @@ func _render_rap_dots(rap: int) -> void: while _rap_dots.get_child_count() < shown: _rap_dots.add_child(_make_dot(8.0, true)) # RAP 点阵 8px 窄档(随读数字号)——建点单点共用 for i in _rap_dots.get_child_count(): - var d: ColorRect = _rap_dots.get_child(i) - d.color = COL_GOLD if i < shown else COL_DOT_OFF + var d: Dot = _rap_dots.get_child(i) + d.lit = i < shown + d.queue_redraw() # 探针/装配复用:刷新按钮可用性(预判 = RAP 足额 + 上限未到) @@ -227,15 +229,33 @@ func pulse_ap() -> void: # 点阵建点单点(AP 10px / RAP 8px 两套建点参数化合并;初始色=熄灭档——投影循环当拍覆写) -func _make_dot(px := 10.0, shrink_center := false) -> ColorRect: - var d := ColorRect.new() - d.custom_minimum_size = Vector2(px, px) - d.size_flags_vertical = Control.SIZE_SHRINK_CENTER if shrink_center else Control.SIZE_FILL - d.color = COL_DOT_OFF - d.mouse_filter = Control.MOUSE_FILTER_IGNORE +func _make_dot(px := 10.0, shrink_center := false) -> Dot: + var d := Dot.new(px, shrink_center) return d +# M8(UI 落码批):点阵样式件——方点+亮心(像素宝石观感 demo ⑦);AP=烛光黄族 / RAP=小人蓝族 +class Dot: + extends Control + var px := 10.0 + var lit := false + var lit_color := Color8(246, 198, 103) + var core_color := Color8(248, 226, 168) + var off_color := UiKit.DOT_OFF + func _init(p: float, rap := false) -> void: + px = p + custom_minimum_size = Vector2(p, p) + size_flags_vertical = Control.SIZE_SHRINK_CENTER if rap else Control.SIZE_FILL + mouse_filter = Control.MOUSE_FILTER_IGNORE + if rap: + lit_color = Color8(105, 161, 232) + core_color = Color8(156, 194, 240) + func _draw() -> void: + draw_rect(Rect2(Vector2.ZERO, Vector2(px, px)), lit_color if lit else off_color) + if lit: + draw_rect(Rect2(Vector2(px * 0.28, px * 0.28), Vector2(px * 0.3, px * 0.3)), core_color) + + func _emit_stop_pressed() -> void: stop_pressed.emit() diff --git a/game/presentation/views/battle_stage_view.gd b/game/presentation/views/battle_stage_view.gd index abd2e62b..17d8f5a0 100644 --- a/game/presentation/views/battle_stage_view.gd +++ b/game/presentation/views/battle_stage_view.gd @@ -88,9 +88,14 @@ func _init(db_ref) -> void: vb.offset_bottom = -_CONTENT_MARGINS.size.y add_child(vb) - round_label = UiKit.label("第 — 轮 · —", 15, true, UiKit.WARM) # 暗底双色墨制(v3.5 批 B4——原深墨对暗底不可读) + # M8(UI 落码批):轮次牌 plate9 素牌化(demo ⑦——墨字上亮牌 12.3:1,暗底暖字退役) + var narr_plate := PanelContainer.new() + narr_plate.add_theme_stylebox_override("panel", UiKit.panel_skinned(Vector4(12, 4, 12, 4))) + narr_plate.size_flags_horizontal = Control.SIZE_SHRINK_CENTER + vb.add_child(narr_plate) + round_label = UiKit.label("第 — 轮 · —", 15, true, UiKit.INK_TITLE) round_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER - vb.add_child(round_label) + narr_plate.add_child(round_label) _row = HBoxContainer.new() _row.add_theme_constant_override("separation", 10) diff --git a/game/presentation/views/board_zone_view.gd b/game/presentation/views/board_zone_view.gd index 7184358a..f8e4832f 100644 --- a/game/presentation/views/board_zone_view.gd +++ b/game/presentation/views/board_zone_view.gd @@ -41,6 +41,16 @@ func _init() -> void: board_area.add_child(fx) toast = ToastStack.new() board_area.add_child(toast) + # M8(UI 落码批):棋盘底常驻操作提示条(demo ⑦——文案经 board_view 输入代码证实; +# 旧 chord 一次性 toast 提示退役归此常驻条;审计第 7 条用户批) + var hint := PanelContainer.new() + hint.add_theme_stylebox_override("panel", UiKit.panel_flat( + Color(0.09, 0.07, 0.05, 0.82), Color8(74, 62, 48), 0, 1, Vector4(12, 2, 12, 2))) + hint.size_flags_horizontal = Control.SIZE_SHRINK_CENTER + hint.mouse_filter = Control.MOUSE_FILTER_IGNORE + vb.add_child(hint) + var hl := UiKit.label("左键 挖掘 / 移动 · 右键 封印(不可逆) · 同格双击 快开", 12, false, UiKit.WARM_FAINT) + hint.add_child(hl) # 信号转发(组合根只接线一处) board_view.action_requested.connect(_forward_action) board_view.hover_forbidden.connect(_forward_hover) diff --git a/game/presentation/views/hero_info_panel_view.gd b/game/presentation/views/hero_info_panel_view.gd index 513a7701..97c18bb5 100644 --- a/game/presentation/views/hero_info_panel_view.gd +++ b/game/presentation/views/hero_info_panel_view.gd @@ -184,17 +184,35 @@ func set_aux_inventory(items: Array, selected_handle: int) -> void: var used := bool(rec.get("used", false)) var usable := bool(rec.get("usable", true)) var selected := selected_handle != 0 and int(rec.get("handle", 0)) == selected_handle - var glyph := UiKit.label(String(rec.get("glyph", "?")), 20, true) - glyph.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER - glyph.vertical_alignment = VERTICAL_ALIGNMENT_CENTER - glyph.set_anchors_preset(Control.PRESET_FULL_RECT) - glyph.mouse_filter = Control.MOUSE_FILTER_IGNORE - # 墨色随 used/usable 条件赋值——非机械两行式,T4 收口保留原分支 - if used: - glyph.add_theme_color_override("font_color", UiKit.STONE_FAINT) - elif not usable: - glyph.add_theme_color_override("font_color", UiKit.STONE) - slot.add_child(glyph) + # M8(UI 落码批):槽内容=手绘像素图标(demo ⑦;glyph 字符→图标键映射,未映射/used/不可用回退字形+条件墨色——T4 分支保留) + var glyph_ch := String(rec.get("glyph", "?")) + var icon_map := {"爆": UiKit.TEX_ICON_BLAST, "医": UiKit.TEX_ICON_MEDKIT, + "铲": UiKit.TEX_ICON_SHOVEL, "袋": UiKit.TEX_ICON_COINBAG, "钥": UiKit.TEX_ICON_KEYSHARD, + "剑": UiKit.TEX_ICON_SWORD, "盾": UiKit.TEX_ICON_SHIELD, "心": UiKit.TEX_ICON_HEART, + "行": UiKit.TEX_ICON_POUCH} + var icon_path: String = icon_map.get(glyph_ch, "") + var itex := UiKit.load_tex(icon_path) if icon_path != "" else null + if itex != null and not used and usable: + var tr := TextureRect.new() + tr.texture = itex + tr.custom_minimum_size = Vector2(40, 40) + tr.expand_mode = TextureRect.EXPAND_IGNORE_SIZE + tr.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED + tr.texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST + tr.set_anchors_preset(Control.PRESET_FULL_RECT) + tr.mouse_filter = Control.MOUSE_FILTER_IGNORE + slot.add_child(tr) + else: + var glyph := UiKit.label(glyph_ch, 20, true) + glyph.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER + glyph.vertical_alignment = VERTICAL_ALIGNMENT_CENTER + glyph.set_anchors_preset(Control.PRESET_FULL_RECT) + glyph.mouse_filter = Control.MOUSE_FILTER_IGNORE + if used: + glyph.add_theme_color_override("font_color", UiKit.STONE_FAINT) + elif not usable: + glyph.add_theme_color_override("font_color", UiKit.STONE) + slot.add_child(glyph) var border_col: Color = UiKit.GOLD if selected else UiKit.PANEL_BORDER slot.add_theme_stylebox_override("panel", UiKit.panel_flat(UiKit.PANEL_DATA, border_col, 0, 1 if not selected else 2, Vector4(4, 4, 4, 4)))