feat: 审计差距②③背景/形态三件(T5-T8)——T5 屏底氛围层单点(backdrop_tile 0.14/vignette/beams/地图渐变 #4A3B2A→#3A2E22@40%;start/map/camp 三面旧满铺石纹退役,地图换层 tint 保 0.14 档)+T6 商店全屏页壳(page_shell 56px 通栏顶条+爬价规则行 set_visit_info〔shop_bp_visit_buys×shop_price_a 投喂三口〕+底注池源;bcard D1=232×352+图标槽 76/60)+T7 三选一同壳全屏(GP 汇总行+底部确认钮+免费注记)+T8 设置两列对齐(label 定宽 140/why 内联/返回 90 紧凑;减动效行核证=reduced_motion 单设置同驱 motion_scale+结算演播,demo 两行系同一设置不拆)——冒烟782/0+probe_gate --click全绿
This commit is contained in:
1 parent
58e8903a3c
commit
5e2fa8bb87
9 files changed
+231
-67
No files matched your search
@@ -217,6 +217,85 @@ static func load_tex(path: String) -> Texture2D:
|
||||
return null
|
||||
|
||||
|
||||
# ── 屏底氛围层(UI 设计对齐批 T5 2026-10-06——demo .tilebg opacity .14/.vignette/.beams 对齐;
|
||||
# 旧「石纹全屏满铺不透」退役——demo 石纹只作弱质感,聚焦靠暗角)──
|
||||
const BACKDROP_TILE_ALPHA := 0.14 # demo .tilebg{opacity:.14}
|
||||
const BG_MAP_TOP := Color8(74, 59, 42) # 地图屏渐变顶 #4A3B2A(demo #v-map 180deg 0%;低点 40% = BG_ROOT #3A2E22)
|
||||
|
||||
|
||||
# 石纹弱质感全屏片(0.14;缺素材返回 null = 调用侧回退平色)
|
||||
static func backdrop_tile() -> TextureRect:
|
||||
var bd_tex := load_tex(TEX_BACKDROP_STONE)
|
||||
if bd_tex == null:
|
||||
return null
|
||||
var bd := TextureRect.new()
|
||||
bd.texture = bd_tex
|
||||
bd.stretch_mode = TextureRect.STRETCH_TILE
|
||||
bd.texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST
|
||||
bd.modulate = Color(1, 1, 1, BACKDROP_TILE_ALPHA)
|
||||
bd.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
bd.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
return bd
|
||||
|
||||
|
||||
# 径向暗角(demo .vignette——ellipse 90%×80% at 50% 42%,透明 58% → 黑 0.30 满角)
|
||||
static func vignette_rect() -> TextureRect:
|
||||
var g := Gradient.new()
|
||||
g.offsets = PackedFloat32Array([0.0, 0.58, 1.0])
|
||||
g.colors = PackedColorArray([Color(0, 0, 0, 0), Color(0, 0, 0, 0), Color(0, 0, 0, 0.30)])
|
||||
var t := GradientTexture2D.new()
|
||||
t.gradient = g
|
||||
t.fill = GradientTexture2D.FILL_RADIAL
|
||||
t.fill_from = Vector2(0.5, 0.42)
|
||||
t.fill_to = Vector2(1.4, 0.42)
|
||||
t.width = 256
|
||||
t.height = 256
|
||||
var tr := TextureRect.new()
|
||||
tr.texture = t
|
||||
tr.stretch_mode = TextureRect.STRETCH_SCALE
|
||||
tr.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
tr.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
return tr
|
||||
|
||||
|
||||
# 斜光带(demo #v-start .beams——repeating-linear-gradient 102deg,暖白 5% 窄带 240-340/560px;
|
||||
# 程序纹理循环带,确定性生成零随机)
|
||||
static func beams_rect() -> TextureRect:
|
||||
var img := Image.create(560, 560, false, Image.FORMAT_RGBA8)
|
||||
var ca := cos(0.2094) # 12°(102deg 带轴的垂直倾角)
|
||||
var sa := sin(0.2094)
|
||||
for y in 560:
|
||||
for x in 560:
|
||||
var d := fposmod(x * ca + y * sa, 560.0)
|
||||
if d >= 240.0 and d < 340.0:
|
||||
img.set_pixel(x, y, Color(1.0, 236.0 / 255.0, 200.0 / 255.0, 0.05))
|
||||
var tr := TextureRect.new()
|
||||
tr.texture = ImageTexture.create_from_image(img)
|
||||
tr.stretch_mode = TextureRect.STRETCH_TILE
|
||||
tr.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
tr.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
return tr
|
||||
|
||||
|
||||
# 竖向渐变底(demo #v-map linear-gradient(180deg, top 0%, low 40%)——stop 后恒 low)
|
||||
static func gradient_base(top: Color, low: Color, stop := 0.4) -> TextureRect:
|
||||
var g := Gradient.new()
|
||||
g.offsets = PackedFloat32Array([0.0, stop])
|
||||
g.colors = PackedColorArray([top, low])
|
||||
var t := GradientTexture2D.new()
|
||||
t.gradient = g
|
||||
t.fill_from = Vector2(0.5, 0.0)
|
||||
t.fill_to = Vector2(0.5, 1.0)
|
||||
t.width = 64
|
||||
t.height = 256
|
||||
var tr := TextureRect.new()
|
||||
tr.texture = t
|
||||
tr.stretch_mode = TextureRect.STRETCH_SCALE
|
||||
tr.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
tr.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
return tr
|
||||
|
||||
|
||||
# CJK 随包字体(2026-09-27 用户拍板 Fusion Pixel OFL——CJK 覆盖+授权干净;命名遵 art-bible §8.3
|
||||
# 全小写 snake_case 域前缀)。守卫装载同 load_tex 纪律:缺位返回 null(引擎回退字体接手,不炸)。
|
||||
const FONT_UI := "res://assets/fonts/ui_font_fusion_pixel_zh_hans.ttf"
|
||||
@@ -307,6 +386,44 @@ static func modal_shell(parent: Control, dim_color: Color, min_size := Vector2.Z
|
||||
return {"dim": dim, "center": center, "panel": panel, "box": box}
|
||||
|
||||
|
||||
# ── 全屏页壳(UI 设计对齐批 T6/T7 2026-10-06——demo #v-shop/#v-bonus 全屏页形态落地:
|
||||
# 06 在册 D2 商店全屏化/D1 竖卡 232×352。暖底+石纹弱质感+暗角+56px 通栏顶条+内容列;
|
||||
# 商店=暖亮底、三选一=根底,两屏同构差异仅底色与顶条工具件)──
|
||||
const PAGE_TOP_H := 56.0
|
||||
|
||||
static func page_shell(host: Control, bright := true) -> Dictionary:
|
||||
var page := Control.new()
|
||||
page.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
host.add_child(page)
|
||||
var base := ColorRect.new()
|
||||
base.color = BG_BRIGHT if bright else BG_ROOT
|
||||
base.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
base.mouse_filter = Control.MOUSE_FILTER_STOP # 页底挡点击——模态语义由组合根输入锁兜底
|
||||
page.add_child(base)
|
||||
var tile := backdrop_tile()
|
||||
if tile != null:
|
||||
page.add_child(tile)
|
||||
page.add_child(vignette_rect())
|
||||
var top := PanelContainer.new()
|
||||
top.set_anchors_preset(Control.PRESET_TOP_WIDE)
|
||||
top.custom_minimum_size = Vector2(0, PAGE_TOP_H)
|
||||
top.add_theme_stylebox_override("panel",
|
||||
panel_flat(Color8(38, 29, 20), Color8(85, 72, 58), 0, 1, Vector4(26, 6, 26, 6)))
|
||||
page.add_child(top)
|
||||
var top_row := HBoxContainer.new()
|
||||
top_row.add_theme_constant_override("separation", 12)
|
||||
top.add_child(top_row)
|
||||
var box := VBoxContainer.new()
|
||||
box.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
box.offset_top = PAGE_TOP_H + 20
|
||||
box.offset_left = 26
|
||||
box.offset_right = -26
|
||||
box.offset_bottom = -22
|
||||
box.add_theme_constant_override("separation", 10)
|
||||
page.add_child(box)
|
||||
return {"page": page, "base": base, "top_row": top_row, "box": box}
|
||||
|
||||
|
||||
# 属性百分比合成(main._debug_hero_override 与调试浮窗生效值预览共用单点——两处同式实现收口)
|
||||
static func scaled(base: int, pct: int) -> int:
|
||||
return maxi(1, int(round(float(base) * (100.0 + float(pct)) / 100.0)))
|
||||
@@ -492,7 +609,7 @@ class BCard:
|
||||
_sb_normal = UiKit.panel_skinned(Vector4(12, 10, 12, 10)) if tex != null else UiKit.panel_flat(PANEL_DATA, PANEL_BORDER,RADIUS_OBJECT, 1, Vector4(12, 10, 12, 10)) # 回退=数据板单点(P7 乙后同值,字面量退役)
|
||||
_sb_sel = UiKit.panel_flat(PANEL_DATA, Color8(138, 90, 52), RADIUS_OBJECT, 2, Vector4(12, 10, 12, 10)) # 选中底=数据板单点(P7 乙后同值)
|
||||
add_theme_stylebox_override("panel", _sb_normal)
|
||||
custom_minimum_size = Vector2(216, 300)
|
||||
custom_minimum_size = Vector2(232, 352) # D1(UI 设计对齐批 T6 2026-10-06——demo .bcard 232×352;原 216×300)
|
||||
var box := VBoxContainer.new()
|
||||
box.add_theme_constant_override("separation", 8)
|
||||
add_child(box)
|
||||
@@ -503,16 +620,21 @@ class BCard:
|
||||
mark.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT
|
||||
mark.visible = false
|
||||
box.add_child(mark)
|
||||
# 图标槽(demo .ic 76×76 槽底+图标 60=20px 源 3 整数倍——P6 甲④ 2× 档升 3× 随 D1 对齐)
|
||||
var slot := PanelContainer.new()
|
||||
slot.add_theme_stylebox_override("panel", UiKit.panel_flat(SLOT_BACKDROP, PANEL_BORDER, 0, 1))
|
||||
slot.custom_minimum_size = Vector2(76, 76)
|
||||
slot.size_flags_horizontal = Control.SIZE_SHRINK_CENTER
|
||||
box.add_child(slot)
|
||||
icon_tr = TextureRect.new()
|
||||
var itex := UiKit.load_tex(icon_path)
|
||||
if itex != null:
|
||||
icon_tr.texture = itex
|
||||
icon_tr.custom_minimum_size = Vector2(40, 40) # P6 甲④(2026-10-06):20×20 源 2× 档(原 56=2.8× 违 §8.2)
|
||||
icon_tr.custom_minimum_size = Vector2(60, 60)
|
||||
icon_tr.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
|
||||
icon_tr.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
|
||||
icon_tr.texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST
|
||||
icon_tr.size_flags_horizontal = Control.SIZE_SHRINK_CENTER
|
||||
box.add_child(icon_tr)
|
||||
slot.add_child(icon_tr)
|
||||
name_l = UiKit.label(title,FS_SUB, true, INK_TITLE)
|
||||
name_l.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
box.add_child(name_l)
|
||||
|
||||
Reference in new issue
Block a user