Files
erqiwang_youle/client/js/01_SubGame/codes/config/Layout_Action.js
T
joywayerandClaude Opus 5 2fe0f661b4 二七王:数字改回「一个数字一个精灵」,数字资源改为等宽连续图
有了图集叠绘能力,多位数不再需要每位一个精灵:

- Sprites_Action.js:选主花色张数从每花色两个(_TENS/_ONES)改回每花色一个
  (MAIN_SUIT_COUNT_1..4 = 1674–1677),空出的 1678–1681 按本文件既有写法记跳号、不复用;
  叫分档位 CALL_BTN_NUM_1..14 数量不变,注释改为图集叠绘(现在能正确显示两位数)。
- ImageResources.js:NUM_COUNTDOWN / NUM_RESULT_WIN / NUM_RESULT_LOSE / NUM_CALL_SCORE /
  NUM_MAIN_SUIT_COUNT 不再是编辑器配帧的多帧资源,改为等宽连续排列的一张图,
  逐条写明字符排列顺序、单字符宽高、整图尺寸(给美术的出图规格)。
- Layout_Action.js:张数的十位/个位两节点合并为一个;两个数字节点的 w/h 直接引用
  NUM_STYLE(SSOT),不再由调用方运行时注入。
- Sprites_Result.js:记下 ACC_TPL_SCORE_NUM 是复制精灵、无法用 NumberRenderer 的风险。
- 单测:精灵总数 382→378、布局节点 62→61(按实际更新,未放宽下界);
  新增 NUM_STYLE 资源键/字段合法性与「布局节点 w/h 与样式同源」守卫。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-26 23:53:16 +08:00

103 lines
4.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
///////////////////////////////////////////////////////////////
////////// EQW_Layout: 阶段操作区配置(清单 §6.8)//////////////
///////////////////////////////////////////////////////////////
// 【纯数据文件】无函数、无副作用;依赖 LayoutConstants.js 先加载
// (引用其 EQW_Layout.TEXT_STYLE.*,属 EQW_Layout 内部自引用)。
var EQW_Layout = EQW_Layout || {};
//===== 叫分面板 =====
EQW_Layout.CALL_PANEL_BG = { kind: 'point', x: 355, y: 140, w: 575, h: 170 };
EQW_Layout.CALL_HINT_BG = { kind: 'point', x: 470, y: 100, w: 345, h: 33 };
//14 档位按钮:grid 布局(清单 §6.1 示例,7×2)
EQW_Layout.CALL_BTN_GRID = {
kind: 'grid', anchorX: 640, anchorY: 160, cols: 7, rows: 2,
itemWidth: 74, itemHeight: 56, spacingX: 7, spacingY: 24,
anchor: 'center', fillOrder: 'row'
};
//档位分数数字:贴对应档位按钮居中。CALL_BTN_1..14 是 14 个固定精灵,但本节点是共用模板,
//target 由调用方按第几档注入(不预置单一 target)。
//2026-08-26:改为图集叠绘(NumberRenderer),一个精灵画完整分数,故宽高【不再随位数变化】——
//直接取 NUM_STYLE.CALL_SCORE 的绘制区宽与单字高(SSOT:数值只在 LayoutConstants 定义一处)
EQW_Layout.CALL_BTN_SCORE_TEXT = {
kind: 'attach', targetKind: 'sprite', hAlign: 'center', vAlign: 'middle', offsetY: 4,
w: EQW_Layout.NUM_STYLE.CALL_SCORE.width, h: EQW_Layout.NUM_STYLE.CALL_SCORE.charHeight,
runtime: ['target']
};
//档位子数角标:贴对应档位按钮右上角,纯文字无底图,清单未给宽高(同上,调用方注入 target)
EQW_Layout.CALL_BTN_MULTIPLE_BADGE = {
kind: 'attach', targetKind: 'sprite', corner: 'topRight', offsetX: -30, offsetY: 2,
runtime: ['target', 'w', 'h']
};
EQW_Layout.CALL_BTN_NONE = { kind: 'point', x: 553, y: 345, w: 184, h: 57 };
//自己叫分大字
EQW_Layout.CALL_SELF_SCORE_TEXT = {
kind: 'point', x: 570, y: 320, w: 140, h: 70, textStyle: EQW_Layout.TEXT_STYLE.CALL_BIG
};
//===== 选主 / 投降面板 =====
EQW_Layout.MAIN_TITLE_BG = { kind: 'point', x: 330, y: 315, w: 425, h: 50 };
//4 花色 + 投降:投降不显示时只排前 4 项,anchor:left 保证前 4 个位置不变
EQW_Layout.MAIN_SUIT_LINE = {
kind: 'line', direction: 'horizontal', anchorX: 330, anchorY: 373,
itemWidth: 128, itemHeight: 55, spacing: 9, anchor: 'left'
};
//张数数字:贴对应花色按钮下方居中,一个花色【一个】精灵(图集叠绘,两位数由 NumberRenderer 逐位画)。
//2026-08-26:原十位/个位两节点合并为本节点;宽高取 NUM_STYLE.MAIN_SUIT_COUNT(SSOT,调用方注入 target)
EQW_Layout.MAIN_SUIT_COUNT = {
kind: 'attach', targetKind: 'sprite', hAlign: 'center', vAlign: 'bottom', offsetY: -6,
w: EQW_Layout.NUM_STYLE.MAIN_SUIT_COUNT.width, h: EQW_Layout.NUM_STYLE.MAIN_SUIT_COUNT.charHeight,
runtime: ['target']
};
//对数角标文字:贴对应花色按钮右上角(按钮帧内已含角标底,本节点只定位叠加的文字)。
//清单未给宽高(调用方注入 target)
EQW_Layout.MAIN_SUIT_PAIR_BADGE = {
kind: 'attach', targetKind: 'sprite', corner: 'topRight', offsetX: -36, offsetY: 2, w: 34, h: 18,
runtime: ['target']
};
//===== 埋牌 / 出牌操作条 =====
//埋牌操作条:提示 / 倒计时(CD_SELF) / 埋牌,逐项不等宽(清单 §6.1)
EQW_Layout.BURY_OPERATION_BAR = {
kind: 'line', direction: 'horizontal', anchorX: 640, anchorY: 165,
itemHeight: 63, spacing: 45, anchor: 'center',
items: [
{ key: 'BURY_BTN_TIP', width: 180 },
{ key: 'CD_SELF', width: 60 },
{ key: 'BURY_BTN_SUBMIT', width: 180 }
]
};
//出牌操作条:倒计时(CD_SELF) / 出牌
EQW_Layout.PLAY_OPERATION_BAR = {
kind: 'line', direction: 'horizontal', anchorX: 640, anchorY: 345,
itemHeight: 55, spacing: 35, anchor: 'center',
items: [
{ key: 'CD_SELF', width: 75 },
{ key: 'PLAY_BTN_SUBMIT', width: 157 }
]
};
//===== 浮层 =====
//捡分飘字:起始位置在此。动画参数(floatRise / floatDuration)见 EQW_Anim.SCORE_FLOAT,不在此重复(SSOT)
EQW_Layout.GRADE_FLOAT = { kind: 'point', x: 570, y: 180, w: 170, h: 55 };
//状态提示条 · 等待类(如『等待庄家选主』)。与即时反馈类共用同一套精灵 BAR_TOAST/TXT_TOAST,
//仅位置预设不同,调用方按提示类型二选一应用(清单 §2.8:收敛为 3 条)
EQW_Layout.TOAST_WAIT = { kind: 'point', x: 500, y: 373, w: 320, h: 47 };
//状态提示条 · 即时反馈类(如『强甩失败』)。自动消失时长见 EQW_Anim.TOAST_DURATION,不在此重复(SSOT)
EQW_Layout.TOAST_INSTANT = { kind: 'point', x: 462, y: 172, w: 363, h: 50 };