chore: 移除 index.html、net.html、walk.html 历史原型入口并优化根路径路由
- 删除 index.html (M0 资源检视器)、walk.html (M1 原型)、net.html (M5 联机原型) - 保留 acts.html (完整暗黑2真地图漫步与全部玩法) 与 arena.html (战斗数值测试竞技场) - 更新 vite.config.ts 的 rollupOptions 输入仅保留 acts 与 arena - 配置 dev server 与打包产物根路径 (/) 自动跳转至 /acts.html - 清理 arena.html 中的历史 index.html 链接 - 同步更新 README.md 与 ROADMAP.md 中的页面索引 TAG=agy CONV=2a1934de-30ef-464e-b3f3-fcbcdbbc49f1
This commit is contained in:
parent
acd027bd38
commit
637854e415
|
|
@ -89,10 +89,8 @@ npm run dev # http://127.0.0.1:5173/act
|
|||
|
||||
| 页面 | 用途 |
|
||||
| --- | --- |
|
||||
| `/acts.html` | **主页面**:全屏画布 + 三级选择器(章节 / 场景 / 细分场景)+ HUD |
|
||||
| `/index.html` | MPQ 资源检查器(头、存储标志、压缩掩码分布、成员列表、精灵预览) |
|
||||
| `/walk.html?sample=<你的.mpq>` | 可行走演示(D1 试玩版 `spawn.mpq` 已验证) |
|
||||
| `/net.html?data=samples/fixtures&ws=ws://127.0.0.1:8787&peers=3&peer=0` | 2–4 人联机(先 `npm run net-server`) |
|
||||
| `/acts.html`(或访问根路径 `/`) | **主页面**:全屏画布 + 三级选择器(章节 / 场景 / 细分场景)+ HUD |
|
||||
| `/arena.html` | **战斗测试竞技场**:攻防数值数学模型、技能加成、伤害计算器(1.13c 原版公式验证) |
|
||||
|
||||
主页面查询参数:
|
||||
|
||||
|
|
|
|||
|
|
@ -607,7 +607,7 @@ src/
|
|||
render/ atlas renderer(WebGL2 单批次四边形 + 顶点色 tint)
|
||||
sim/ loop(定点 25 Hz,含追帧上限)input
|
||||
scene/ act-scene.ts(主场景:真地图 + 全部玩法)net-scene.ts(联机轨)
|
||||
index.html walk.html net.html acts.html 四个入口
|
||||
acts.html arena.html 两个前台入口
|
||||
scripts/ 夹具生成、验证脚本、打包/发布、中继服务器、浏览器验证工具
|
||||
tools/go-oracle/ 独立 Go 参考解码器(差分验证用)
|
||||
samples/ 夹具与被 .gitignore 忽略的归档
|
||||
|
|
@ -622,10 +622,8 @@ samples/ 夹具与被 .gitignore 忽略的归档
|
|||
|
||||
| 页面 | 地址 | 内容 |
|
||||
| --- | --- | --- |
|
||||
| 资源检查器 | `/` | MPQ 头/存储标志/压缩掩码分布、成员列表、精灵逐帧预览 |
|
||||
| 可行走演示 | `/walk.html?sample=samples/spawn.mpq` | 真实暗黑 1 归档:CEL/CL2、调色板、8 方向走动、碰撞 |
|
||||
| 联机合作 | `/net.html?...&peers=3&peer=0` | 2–4 人同一世界(保留,不在交付路径) |
|
||||
| **主场景** | `/acts.html?act=1`;线上 `https://www.laiseek.xyz/diablo2/?act=1` | 等距真地图 + 真·女法师(DCC+COF,16 层/8 方向)+ 全部玩法(战斗、掉落、背包、技能、任务、NPC、存读档 K/L)。三级选择器:章节 → 场景 → 细分场景 |
|
||||
| **主场景** | `/acts.html`(根路径 `/` 自动跳转);线上 `https://www.laiseek.xyz/diablo2/?act=1` | 等距真地图 + 真·女法师(DCC+COF,16 层/8 方向)+ 全部玩法(战斗、掉落、背包、技能、任务、NPC、存读档 K/L)。三级选择器:章节 → 场景 → 细分场景 |
|
||||
| **战斗竞技场** | `/arena.html` | 真实战斗数学与攻防测试竞技场(1.13c 原版公式验证、技能数值测试与面板) |
|
||||
|
||||
操作:WASD/方向键移动,空格或 J 攻击,E/F 拾取,T 说话,1–4 选技能,K 存档,L 读档。
|
||||
`acts.html` 的输入是**屏幕方向**(菱形格子相对屏幕转了 45°,按「上」沿格子对角线向上走)。
|
||||
|
|
|
|||
|
|
@ -284,7 +284,6 @@
|
|||
</h1>
|
||||
<div>
|
||||
<a href="/acts.html">🎮 返回战役漫步 (acts.html)</a>
|
||||
<a href="/index.html">📁 资源检视器</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
|
|
|||
110
index.html
110
index.html
|
|
@ -1,110 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>d2web · MPQ 资源管线</title>
|
||||
<style>
|
||||
:root {
|
||||
color-scheme: dark;
|
||||
--bg: #14110d;
|
||||
--panel: #1c1813;
|
||||
--line: #33291f;
|
||||
--ink: #e8dcc8;
|
||||
--dim: #9c8d78;
|
||||
--accent: #c8a15a;
|
||||
--accent-dim: #6d5a34;
|
||||
}
|
||||
* { box-sizing: border-box; }
|
||||
body {
|
||||
margin: 0;
|
||||
background: var(--bg);
|
||||
color: var(--ink);
|
||||
font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
}
|
||||
header {
|
||||
padding: 14px 18px;
|
||||
border-bottom: 1px solid var(--line);
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 14px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
h1 { font-size: 15px; margin: 0; letter-spacing: 0.06em; color: var(--accent); }
|
||||
.hint { color: var(--dim); }
|
||||
main { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 0; height: calc(100vh - 52px); }
|
||||
.col { overflow: auto; }
|
||||
.col + .col { border-left: 1px solid var(--line); }
|
||||
.pad { padding: 14px 18px; }
|
||||
#drop {
|
||||
margin: 18px;
|
||||
padding: 26px 18px;
|
||||
border: 1px dashed var(--accent-dim);
|
||||
border-radius: 8px;
|
||||
text-align: center;
|
||||
color: var(--dim);
|
||||
cursor: pointer;
|
||||
}
|
||||
#drop.hot { border-color: var(--accent); color: var(--accent); }
|
||||
.stats { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0 18px 12px; }
|
||||
.stats dt { color: var(--dim); }
|
||||
.stats dd { margin: 0; }
|
||||
#filter {
|
||||
width: calc(100% - 36px);
|
||||
margin: 0 18px 10px;
|
||||
padding: 7px 9px;
|
||||
background: var(--panel);
|
||||
color: var(--ink);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 5px;
|
||||
}
|
||||
ul { list-style: none; margin: 0; padding: 0 0 24px; }
|
||||
li button {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
padding: 3px 18px;
|
||||
background: none;
|
||||
border: 0;
|
||||
color: var(--ink);
|
||||
font: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
li button:hover { background: #241d16; }
|
||||
li button[aria-current='true'] { background: var(--accent-dim); color: #fff; }
|
||||
li .meta { color: var(--dim); font-size: 11px; }
|
||||
#preview { padding: 16px 18px; }
|
||||
#preview h2 { font-size: 13px; margin: 0 0 4px; color: var(--accent); word-break: break-all; }
|
||||
#preview .sub { color: var(--dim); margin-bottom: 12px; }
|
||||
canvas { image-rendering: pixelated; background: #000; border: 1px solid var(--line); }
|
||||
pre {
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 5px;
|
||||
overflow: auto;
|
||||
max-height: 60vh;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
.error { color: #e08a6a; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>d2web</h1>
|
||||
<span class="hint">MPQ 资源管线 · 只读取你自己的归档,仓库不含任何游戏素材</span>
|
||||
</header>
|
||||
<main>
|
||||
<section class="col" id="left">
|
||||
<div id="drop">把 .mpq 拖到这里,或点击选择文件</div>
|
||||
<input id="picker" type="file" accept=".mpq,.MPQ" hidden />
|
||||
<dl class="stats" id="stats"></dl>
|
||||
<input id="filter" type="search" placeholder="筛选文件名…" disabled />
|
||||
<ul id="files"></ul>
|
||||
</section>
|
||||
<section class="col" id="preview"><div class="pad hint">选择一个文件查看解码结果</div></section>
|
||||
</main>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
46
net.html
46
net.html
|
|
@ -1,46 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>d2web · 联机合作(M5)</title>
|
||||
<style>
|
||||
:root { color-scheme: dark; }
|
||||
* { box-sizing: border-box; }
|
||||
body { margin: 0; background: #0d0b09; color: #e8dcc8;
|
||||
font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
|
||||
header { padding: 10px 16px; border-bottom: 1px solid #33291f;
|
||||
display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; }
|
||||
h1 { font-size: 14px; margin: 0; color: #c8a15a; letter-spacing: .06em; }
|
||||
a { color: #c8a15a; }
|
||||
#net { color: #9c8d78; }
|
||||
#net b { color: #c8a15a; font-weight: 600; }
|
||||
#net .bad { color: #d96a5a; }
|
||||
#status { margin: 10px 16px 6px; color: #9c8d78; }
|
||||
#peers { margin: 0 16px 8px; color: #9c8d78; }
|
||||
#peers span.you { color: #7fd08a; }
|
||||
canvas { display: block; margin: 0 16px; background: #000; border: 1px solid #33291f;
|
||||
width: 960px; height: 560px; }
|
||||
#help { margin: 8px 16px 16px; color: #6f6252; max-width: 900px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>d2web · 双人联机合作</h1>
|
||||
<a href="/">资源检查器</a>
|
||||
<a href="/acts.html">真实战役场景</a>
|
||||
<span id="net">未联机</span>
|
||||
</header>
|
||||
<p id="status">正在加载地图…</p>
|
||||
<div id="peers"></div>
|
||||
<canvas id="view" width="960" height="560"></canvas>
|
||||
<p id="help">
|
||||
移动 WASD / 方向键,空格或 J 攻击。每个浏览器页开一个(2–4 人都可以,人数用
|
||||
<code>&peers=</code> 指定,<code>&peer=</code> 是本页编号):
|
||||
<code>?data=samples/fixtures&ws=ws://127.0.0.1:8787&peers=3&peer=0</code>,
|
||||
另外两页把 <code>peer</code> 换成 1 和 2。世界由每台机器各自模拟,网络上只传按键;
|
||||
同一 tick 的哈希不一致时页面会立刻报出分歧。
|
||||
</p>
|
||||
<script type="module" src="/src/scene/net-scene.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -2,9 +2,8 @@ import { defineConfig } from 'vite'
|
|||
|
||||
/**
|
||||
* The engine is plain TypeScript with no runtime dependencies: Vite only serves
|
||||
* and bundles it. Four entries: the asset inspector (`index.html`), the walkable
|
||||
* scene (`walk.html`), the two-player co-op scene (`net.html`) and the real
|
||||
* campaign scene (`acts.html`). `samples/` is served in dev so all of them can
|
||||
* and bundles it. Two entries: the real campaign scene (`acts.html`) and the
|
||||
* combat math arena (`arena.html`). `samples/` is served in dev so all of them can
|
||||
* be smoke-tested over HTTP (`?sample=samples/spawn.mpq`,
|
||||
* `?data=samples/fixtures`).
|
||||
*/
|
||||
|
|
@ -14,14 +13,34 @@ export default defineConfig({
|
|||
port: 5173,
|
||||
strictPort: true,
|
||||
},
|
||||
plugins: [
|
||||
{
|
||||
name: 'root-redirect',
|
||||
configureServer(server) {
|
||||
server.middlewares.use((req, res, next) => {
|
||||
if (req.url === '/' || req.url === '/index.html') {
|
||||
res.writeHead(302, { Location: '/acts.html' })
|
||||
res.end()
|
||||
return
|
||||
}
|
||||
next()
|
||||
})
|
||||
},
|
||||
generateBundle() {
|
||||
this.emitFile({
|
||||
type: 'asset',
|
||||
fileName: 'index.html',
|
||||
source:
|
||||
'<!doctype html><html lang="zh-CN"><head><meta charset="utf-8" /><meta http-equiv="refresh" content="0; url=./acts.html"><title>d2web</title><script>location.replace("./acts.html" + location.search + location.hash)</script></head><body><a href="./acts.html">跳转至暗黑破坏神 2 游戏主界面</a></body></html>\n',
|
||||
})
|
||||
},
|
||||
},
|
||||
],
|
||||
build: {
|
||||
target: 'es2022',
|
||||
sourcemap: true,
|
||||
rollupOptions: {
|
||||
input: {
|
||||
index: new URL('./index.html', import.meta.url).pathname,
|
||||
walk: new URL('./walk.html', import.meta.url).pathname,
|
||||
net: new URL('./net.html', import.meta.url).pathname,
|
||||
acts: new URL('./acts.html', import.meta.url).pathname,
|
||||
arena: new URL('./arena.html', import.meta.url).pathname,
|
||||
},
|
||||
|
|
|
|||
51
walk.html
51
walk.html
|
|
@ -1,51 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>d2web · 可行走场景(M1)</title>
|
||||
<style>
|
||||
:root { color-scheme: dark; }
|
||||
* { box-sizing: border-box; }
|
||||
body {
|
||||
margin: 0;
|
||||
background: #0f0d0a;
|
||||
color: #e8dcc8;
|
||||
font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
}
|
||||
header {
|
||||
padding: 10px 16px;
|
||||
border-bottom: 1px solid #33291f;
|
||||
display: flex;
|
||||
gap: 14px;
|
||||
align-items: baseline;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
h1 { font-size: 14px; margin: 0; color: #c8a15a; letter-spacing: .06em; }
|
||||
a { color: #c8a15a; }
|
||||
#hud { color: #9c8d78; }
|
||||
#drop {
|
||||
margin: 10px 16px;
|
||||
padding: 8px 12px;
|
||||
border: 1px dashed #6d5a34;
|
||||
border-radius: 6px;
|
||||
color: #9c8d78;
|
||||
cursor: pointer;
|
||||
}
|
||||
#status { margin: 0 16px 10px; color: #9c8d78; }
|
||||
canvas { display: block; margin: 0 16px; background: #000; border: 1px solid #33291f; width: 960px; height: 560px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>d2web · M1</h1>
|
||||
<a href="/">资源检查器</a>
|
||||
<span id="hud">—</span>
|
||||
</header>
|
||||
<div id="drop">拖入 .mpq(或使用 ?sample=)后即可用 WASD / 方向键走动</div>
|
||||
<input id="picker" type="file" accept=".mpq,.MPQ" hidden />
|
||||
<p id="status">等待归档…</p>
|
||||
<canvas id="view" width="960" height="560"></canvas>
|
||||
<script type="module" src="/src/walk.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue