feat(world): fix bio race icons to match map sprites; add asset version cache-bust
This commit is contained in:
+20
-14
@@ -377,6 +377,7 @@ body { background: #0a0e17; overflow: hidden; font-family: 'Microsoft YaHei', sa
|
||||
.mv-cell.active { background: rgba(255,213,79,.14); border-color: #ffd54f; box-shadow: 0 0 10px rgba(255,213,79,.45); }
|
||||
.mv-cell .mv-ico { font-size: 30px; line-height: 1; pointer-events: none; }
|
||||
.mv-cell .mv-ico-img { width: 44px; height: 44px; object-fit: contain; pointer-events: none; border-radius: 6px; }
|
||||
.mv-cell .mv-ico-char { width: 44px; height: 44px; background-repeat: no-repeat; background-position: center 0; background-size: auto 100%; pointer-events: none; border-radius: 6px; image-rendering: pixelated; }
|
||||
.mv-cell .mv-nm { font-size: 11px; color: #9fb3c8; pointer-events: none; }
|
||||
.mv-cost { font-size: 10px; color: #ffd54f; pointer-events: none; font-weight: 600; }
|
||||
.mv-cost.free { color: #7fdca0; }
|
||||
@@ -1789,16 +1790,16 @@ const MICRO_BUILD_EXTRA = [
|
||||
{ id: 'guild', cat: 'build', icon: 'assets/buildings/spring/guild/guild_l.png?v=4', name: '公会', desc: '冒险者与住民集结之所,可发布委托与招募成员。', flat: false, w: 2, h: 2, statLevel: 1, statHp: 140, statYield: { prestige: 2, coin: 1 }, costGold: 100 },
|
||||
{ id: 'village', cat: 'build', icon: 'assets/buildings/spring/village/village_l.png?v=5', name: '村庄', desc: '族群聚落的核心,提升人口上限与基础产出。', flat: false, w: 3, h: 3, statLevel: 1, statHp: 150, statYield: { population: 6, food: 1 }, costGold: 200 },
|
||||
// 生物分类:9 种族角色(点击进入"点地面放置"模式,不进入建筑模式)
|
||||
{ id: 'race_human', cat: 'bio', icon: 'assets/characters/human/human_thumb.png', name: '人族', isChar: true, race: 'human' },
|
||||
{ id: 'race_demon', cat: 'bio', icon: 'assets/characters/demon/demon_thumb.png', name: '妖族', isChar: true, race: 'demon' },
|
||||
{ id: 'race_dwarf', cat: 'bio', icon: 'assets/characters/dwarf/dwarf_thumb.png', name: '矮人', isChar: true, race: 'dwarf' },
|
||||
{ id: 'race_elf', cat: 'bio', icon: 'assets/characters/elf/elf_thumb.png', name: '精灵', isChar: true, race: 'elf' },
|
||||
{ id: 'race_dragon', cat: 'bio', icon: 'assets/characters/dragon/dragon_thumb.png', name: '龙族', isChar: true, race: 'dragon' },
|
||||
{ id: 'race_undead', cat: 'bio', icon: 'assets/characters/undead/undead_thumb.png', name: '不死族', isChar: true, race: 'undead' },
|
||||
{ id: 'race_orc', cat: 'bio', icon: 'assets/characters/orc/orc_thumb.png', name: '兽人', isChar: true, race: 'orc' },
|
||||
{ id: 'race_angel', cat: 'bio', icon: 'assets/characters/angel/angel_thumb.png', name: '天使', isChar: true, race: 'angel' },
|
||||
{ id: 'race_werewolf',cat: 'bio', icon: 'assets/characters/werewolf/werewolf_thumb.png', name: '狼人', isChar: true, race: 'werewolf' },
|
||||
{ id: 'race_golem', cat: 'bio', icon: 'assets/characters/golem/golem_thumb.png', name: '石傀儡', isChar: true, race: 'golem' },
|
||||
{ id: 'race_human', cat: 'bio', icon: 'assets/characters/human/human_thumb.png', sprite: 'assets/characters/human/human_idle_attack_1x6.png', name: '人族', isChar: true, race: 'human' },
|
||||
{ id: 'race_demon', cat: 'bio', icon: 'assets/characters/demon/demon_thumb.png', sprite: 'assets/characters/demon/demon_idle_attack_1x6.png', name: '妖族', isChar: true, race: 'demon' },
|
||||
{ id: 'race_dwarf', cat: 'bio', icon: 'assets/characters/dwarf/dwarf_thumb.png', sprite: 'assets/characters/dwarf/dwarf_idle_attack_1x6.png', name: '矮人', isChar: true, race: 'dwarf' },
|
||||
{ id: 'race_elf', cat: 'bio', icon: 'assets/characters/elf/elf_thumb.png', sprite: 'assets/characters/elf/elf_idle_attack_1x6.png', name: '精灵', isChar: true, race: 'elf' },
|
||||
{ id: 'race_dragon', cat: 'bio', icon: 'assets/characters/dragon/dragon_thumb.png', sprite: 'assets/characters/dragon/dragon_idle_attack_1x6.png', name: '龙族', isChar: true, race: 'dragon' },
|
||||
{ id: 'race_undead', cat: 'bio', icon: 'assets/characters/undead/undead_thumb.png', sprite: 'assets/characters/undead/undead_idle_attack_1x6.png', name: '不死族', isChar: true, race: 'undead' },
|
||||
{ id: 'race_orc', cat: 'bio', icon: 'assets/characters/orc/orc_thumb.png', sprite: 'assets/characters/orc/orc_idle_attack_1x6.png', name: '兽人', isChar: true, race: 'orc' },
|
||||
{ id: 'race_angel', cat: 'bio', icon: 'assets/characters/angel/angel_thumb.png', sprite: 'assets/characters/angel/angel_idle_attack_1x6.png', name: '天使', isChar: true, race: 'angel' },
|
||||
{ id: 'race_werewolf',cat: 'bio', icon: 'assets/characters/werewolf/werewolf_thumb.png', sprite: 'assets/characters/werewolf/werewolf_idle_attack_1x6.png', name: '狼人', isChar: true, race: 'werewolf' },
|
||||
{ id: 'race_golem', cat: 'bio', icon: 'assets/characters/golem/golem_thumb.png', sprite: 'assets/characters/golem/golem_idle_attack_1x6.png', name: '石傀儡', isChar: true, race: 'golem' },
|
||||
];
|
||||
|
||||
// 建筑交互配置(数据驱动,与后端 BUILD_EFFECTS 的 (code,action) 对应)。
|
||||
@@ -6152,8 +6153,13 @@ function microRenderBuildPanel() {
|
||||
});
|
||||
const items = visibleInCat(microBuildCat);
|
||||
gridEl.innerHTML = items.length ? items.map(it => {
|
||||
let ico;
|
||||
if (it.isChar && it.sprite) {
|
||||
ico = `<div class="mv-ico-char" style="background-image:url('${it.sprite}')"></div>`;
|
||||
} else {
|
||||
const isImg = typeof it.icon === 'string' && /\.(png|webp|jpg|jpeg)(\?.*)?$/i.test(it.icon);
|
||||
const ico = isImg ? `<img src="${it.icon}" class="mv-ico-img" alt="">` : `<span class="mv-ico">${it.icon}</span>`;
|
||||
ico = isImg ? `<img src="${it.icon}" class="mv-ico-img" alt="">` : `<span class="mv-ico">${it.icon}</span>`;
|
||||
}
|
||||
const cost = (!it.isChar) ? (it.costGold || 0) : null;
|
||||
const costHtml = cost == null ? '' :
|
||||
(cost > 0 ? `<span class="mv-cost">🪙 ${cost}</span>` : `<span class="mv-cost free">免费</span>`);
|
||||
@@ -6799,8 +6805,8 @@ window.addEventListener('keydown', e => {
|
||||
// 进入时一次性把世界铺满视口并钳制边界(fitWorld 内部已调 clampCamera)。
|
||||
if (typeof fitWorld === 'function') fitWorld();
|
||||
</script>
|
||||
<script src="assets/game-api.js"></script>
|
||||
<script src="assets/characters.js"></script>
|
||||
<script src="assets/game-api.js?v=20260825"></script>
|
||||
<script src="assets/characters.js?v=20260825"></script>
|
||||
<script>
|
||||
// ===== 登录闸门:未登录跳登录页;已登录显示昵称+退出 =====
|
||||
(async () => {
|
||||
@@ -7180,7 +7186,7 @@ if (typeof fitWorld === 'function') fitWorld();
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<script src="assets/world-app.js"></script>
|
||||
<script src="assets/world-app.js?v=20260825"></script>
|
||||
|
||||
<!-- ===== 世界聊天框(左下角,可折叠展开,demo) ===== -->
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user