优化弹窗UI细节

This commit is contained in:
zpx committed 2026-11-20 20:32:40 +08:00
1 parent eb48d8e845
commit b2036cd9bc
30 files changed
+7385 -2859

No files matched your search

+31 -8
View File
@@ -3,7 +3,7 @@ import { strict as assert } from 'node:assert';
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
import { basename, dirname, extname, join, parse, resolve } from 'node:path';
import { AutoSpinQueue } from '../assets/orchard/scripts/AutoSpinQueue';
import { ART, ART_KEYS, FONT_UUID, SYMBOL_ART } from '../assets/orchard/scripts/OrchardAssets';
import { ART, ART_KEYS, CELEBRATION_FONT_UUID, FONT_UUID, SYMBOL_ART } from '../assets/orchard/scripts/OrchardAssets';
import { SYMBOLS } from '../assets/orchard/scripts/SlotsMath';
// Inspect saved references, not authoring/runtime source text. Node active flags remain editable.
@@ -115,6 +115,8 @@ const sourceByImport: Record<string, string> = {
'claimed-heading': '07-free-coins-claimed/title-no-close.png',
'claimed-caption': '07-free-coins-claimed/daily-label.png',
'claimed-garnish': '07-free-coins-claimed/reward.png',
'claimed-dismiss': '07-free-coins-claimed/close.png',
'claimed-amount': '07-free-coins-claimed/amount-bar-no-text.png',
'crest-lockup': '02-main-screen/ui/logo.png',
'crimson-berry': '02-main-screen/symbols/strawberry.png',
'daily-pill': '02-main-screen/ui/free_coins.png',
@@ -130,6 +132,7 @@ const sourceByImport: Record<string, string> = {
'gift-collect': '06-free-coins-available/claim-button.png',
'gift-collected': '07-free-coins-claimed/claimed-button.png',
'gift-daily': '06-free-coins-available/daily-label.png',
'gift-dismiss': '06-free-coins-available/close.png',
'gift-garnish': '06-free-coins-available/reward.png',
'gift-heading': '06-free-coins-available/title.png',
'gift-shell': '06-free-coins-available/panel-background.png',
@@ -145,6 +148,7 @@ const sourceByImport: Record<string, string> = {
'neon-grid': '02-main-screen/ui/reel.png',
'paired-rubies': '02-main-screen/symbols/cherry.png',
'preferences-heading': '03-settings/title-settings.png',
'preferences-flourish': '03-settings/title-underline.png',
'preferences-orb': '02-main-screen/ui/settings.png',
'preferences-shell': '03-settings/panel.png',
'prism-chime': '02-main-screen/symbols/bell.png',
@@ -163,6 +167,7 @@ const sourceByImport: Record<string, string> = {
'round-prize-card': '02-main-screen/ui/current-win-no-number.png',
'rounds-ribbon': '02-main-screen/ui/free-spins-banner-empty.png',
'ruby-seven': '02-main-screen/symbols/seven.png',
'shortfall-dismiss': '08-insufficient-coins/close-button.png',
'starburst-joker': '02-main-screen/symbols/wild.png',
'summer-wedge': '02-main-screen/symbols/watermelon.png',
'ten-idle': '05-auto-spin-setup/count_10_normal.png',
@@ -177,6 +182,8 @@ const sourceByImport: Record<string, string> = {
'wallet-pill': '02-main-screen/ui/coin_bar.png',
'amber-numerals': '02-main-screen/font/golden-numbers.fnt',
'amber-glyph-atlas': '02-main-screen/font/golden-numbers.png',
'celebration-numerals': '10-free-spins-trigger/font/digits.fnt',
'celebration-glyphs': '10-free-spins-trigger/font/digits.png',
};
const queueState = (queue: AutoSpinQueue) => ({ active: queue.active, remaining: queue.remaining });
@@ -302,10 +309,10 @@ test('saved five masked reels have six cells each and exactly fifteen visible sl
test('all saved artFrames resolve to distinct orchard imports in runtime lookup order', () => {
const saved: Entry[] = controller().artFrames;
assert.equal(saved.length, 81);
assert.equal(ART_KEYS.length, 81);
assert.equal(saved.length, 86);
assert.equal(ART_KEYS.length, 86);
const ids = saved.map(uuid);
assert.equal(new Set(ids).size, 81);
assert.equal(new Set(ids).size, 86);
assert.deepEqual(ids, ART_KEYS.map(key => ART[key]));
assert.deepEqual(ids.map(id => parse(frameFor(id).path).name), ART_KEYS);
for (const entry of scene.filter(value => value.__type__ === 'cc.Sprite')) {
@@ -317,7 +324,7 @@ test('all saved artFrames resolve to distinct orchard imports in runtime lookup
test('every imported image/font basename is renamed against its explicitly mapped source', () => {
const imported = assets.filter(asset => ['image', 'bitmap-font'].includes(asset.meta.importer));
assert.equal(imported.length, 83, '81 artwork images, one font atlas and one bitmap font');
assert.equal(imported.length, 90, '86 artwork images, two font atlases and two bitmap fonts');
assert.deepEqual(imported.map(asset => parse(asset.path).name).sort(), Object.keys(sourceByImport).sort());
for (const asset of imported) {
const name = parse(asset.path).name;
@@ -330,22 +337,38 @@ test('every imported image/font basename is renamed against its explicitly mappe
}
});
test('saved main amounts, counters and companion dialogs reference the renamed amber font', () => {
test('saved gold amounts retain amber, the free-spin count uses celebration and gift coins use white system text', () => {
const font = assets.find(asset => asset.meta.uuid === uuid(controller().numerals));
assert.ok(font, 'saved numeral font resolves through orchard metadata');
assert.equal(font.meta.importer, 'bitmap-font');
assert.equal(basename(font.path), 'amber-numerals.fnt');
assert.equal(font.meta.uuid, FONT_UUID);
for (const name of ['NormalPrizeAmount', 'RoundsCount', 'RoundPrizeAmount', 'BonusPrizeAmount',
'WagerAmount', 'GiftAmount', 'BonusAwardCount', 'BonusSummaryAmount',
'WagerAmount', 'BonusSummaryAmount',
'GuideLineBet0', 'GuideLineBet1', 'GuideDailyAmount']) {
const label = component(node(name), 'cc.Label');
assert.equal(uuid(label._font), font.meta.uuid, name);
assert.equal(label._isSystemFontUsed, false, name);
}
const celebration = assets.find(asset => asset.meta.uuid === CELEBRATION_FONT_UUID);
assert.ok(celebration, 'dedicated free-spin numeral font resolves through orchard metadata');
assert.equal(celebration.meta.importer, 'bitmap-font');
assert.equal(basename(celebration.path), 'celebration-numerals.fnt');
assert.notEqual(celebration.meta.uuid, font.meta.uuid);
const award = component(node('BonusAwardCount'), 'cc.Label');
assert.equal(uuid(award._font), CELEBRATION_FONT_UUID);
assert.equal(award._isSystemFontUsed, false);
for (const label of scene.filter(entry => entry.__type__ === 'cc.Label' && entry._font)) {
assert.equal(uuid(label._font), font.meta.uuid, 'no stale bitmap font reference');
const owner = dereference(label.node);
const expected = owner === node('BonusAwardCount') ? CELEBRATION_FONT_UUID : FONT_UUID;
assert.equal(uuid(label._font), expected, `${owner._name}: no stale or misplaced bitmap font reference`);
assert.equal(label._isSystemFontUsed, false, owner._name);
}
const gift = component(node('GiftAmount'), 'cc.Label');
assert.equal(gift._string, '20,000 COINS');
assert.equal(gift._isSystemFontUsed, true);
assert.equal(gift._font, null);
assert.deepEqual(gift._color, { __type__: 'cc.Color', r: 255, g: 255, b: 255, a: 255 });
const normalWallet = component(node('WalletAmount'), 'cc.Label');
assert.equal(normalWallet._isSystemFontUsed, true);
assert.equal(normalWallet._font, null, 'normal wallet must not use the gold bitmap font');