feat(plugins): 迁移非 1.13c 原版「扩展宽屏分辨率 (Extended Viewports)」至 plugins/extended-viewports #716

Closed
opened 2026-10-03 05:52:57 +00:00 by troytt · 1 comment
Owner

背景

Diablo II: Lord of Destruction v1.13c 原版仅支持 640x480 与 800x600 两种分辨率。当前仓库中的 1024x768、1068x600、1280x720 属于非原版扩展分辨率增强。

当前核心代码位置

  • src/client/view/viewport-profile.ts / src/client/settings/client-settings.ts:ViewportResolution
  • src/client/toolbar/toolbar.ts:工具栏 #d2-toolbar-viewport-select 下拉框
  • src/client/main.ts:syncStageViewportFit 视口适配

迁移目标

  • 依赖顶层 plugins/ 插件框架与 PluginHost 落地后,核心仅保留 1.13c 原版 640x480 与 800x600;将扩展分辨率(1024x768 | 1068x600 | 1280x720)拆分为独立插件 plugins/extended-viewports/。
  • 插件关闭时若当前处于扩展分辨率,自动回退至原版 800x600。

验收标准

  • plugins/extended-viewports/index.ts 实现 D2WebPlugin 契约并通过 tests/arch/boundaries.test.ts 插件边界检查
  • 插件禁用时仅暴露 640x480 / 800x600 并自动回退至 800x600
  • npm run typecheck 与 npx vitest run 100% 通过
## 背景 Diablo II: Lord of Destruction v1.13c 原版仅支持 `640x480` 与 `800x600` 两种分辨率。当前仓库中的 `1024x768`、`1068x600`、`1280x720` 属于非原版扩展分辨率增强。 ## 当前核心代码位置 - `src/client/view/viewport-profile.ts` / `src/client/settings/client-settings.ts`:`ViewportResolution` - `src/client/toolbar/toolbar.ts`:工具栏 `#d2-toolbar-viewport-select` 下拉框 - `src/client/main.ts`:`syncStageViewportFit` 视口适配 ## 迁移目标 - 依赖顶层 `plugins/` 插件框架与 `PluginHost` 落地后,核心仅保留 1.13c 原版 `640x480` 与 `800x600`;将扩展分辨率(`1024x768 | 1068x600 | 1280x720`)拆分为独立插件 `plugins/extended-viewports/`。 - 插件关闭时若当前处于扩展分辨率,自动回退至原版 `800x600`。 ## 验收标准 - [ ] `plugins/extended-viewports/index.ts` 实现 `D2WebPlugin` 契约并通过 `tests/arch/boundaries.test.ts` 插件边界检查 - [ ] 插件禁用时仅暴露 `640x480` / `800x600` 并自动回退至 `800x600` - [ ] `npm run typecheck` 与 `npx vitest run` 100% 通过
Author
Owner

Fixed in commit fdde06b (origin/main): migrated the non-1.13c Extended Viewports (1024x768, 1068x600, 1280x720) capability into plugins/extended-viewports/index.ts. Core Toolbar now defaults to native 1.13c resolutions (640x480 and 800x600); when extended-viewports is disabled, PluginHost restricts #d2-toolbar-viewport-select to 640x480 and 800x600 and automatically clamps any extended viewport back to 800x600.

Fixed in commit `fdde06b` (`origin/main`): migrated the non-1.13c Extended Viewports (`1024x768`, `1068x600`, `1280x720`) capability into `plugins/extended-viewports/index.ts`. Core `Toolbar` now defaults to native 1.13c resolutions (`640x480` and `800x600`); when `extended-viewports` is disabled, `PluginHost` restricts `#d2-toolbar-viewport-select` to `640x480` and `800x600` and automatically clamps any extended viewport back to `800x600`.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: troytt/diablo2-web#716
No description provided.