M8 战斗包四件(UI落码第三波)——①轮次牌plate9素牌化(墨字)②AP/RAP点阵Dot样式件(方点+亮心,AP烛光黄/RAP小人蓝)④道具槽glyph→手绘像素图标(映射回退字形)⑤棋盘底常驻操作提示条(左键挖掘/右键封印/双击快开)。P-C1 C区两段保留现状零改;P-C7战报单行现状+回看退役归M9。闸=冒烟747/0+probe_gate全绿+layout 0

This commit is contained in:
DKChan committed 2026-10-05 02:47:03 +08:00
1 parent 8f029cc618
commit 473ff33b62
4 files changed
+76 -23

No files matched your search

+30 -10
View File
@@ -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()
+7 -2
View File
@@ -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)
@@ -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)
+29 -11
View File
@@ -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)))