Commit Graph

413 Commits

Author SHA1 Message Date
00379e1861 chore: 微调四个 UI 的代码 2026-10-11 16:02:43 +08:00
fc159ce11f feat(09-10): apply R-2/R-3/R-4/R-5/R-6/R-7 review fixes to equipbox, toolbox & shop
- R-2: render descriptions via TextContent (equipbox/toolbox/shop)
- R-3: add jsDoc to top-level definitions
- R-4: add JSX section comments
- R-5: un-export IHeroAttrItem and IShopItemEntry
- R-6: isNil for literals, ! for objects (no === null / undefined)
- R-7: move top-level openShop call into onMounted
2026-10-11 15:57:14 +08:00
4c383f6999 feat(09-10): apply R-1/R-2/R-3/R-4/R-6/R-8 review fixes to book & bookDetail
- R-1: remove self-drawn full-screen background in book/bookDetail
- R-2: render special description via TextContent
- R-3: add jsDoc to top-level definitions
- R-4: add JSX section comments
- R-6: null checks use truthiness (no !== null)
- R-8: replace 'getBaseEnemy' in enemy with instanceof EnemyView
2026-10-11 15:52:10 +08:00
c8849f1f64 feat(09-09): add shop quantity selector, buy/sell and exit
- 4-button quantity << < n > >> (step 10/1), clamped to stock (buy) or owned (sell), remembered per item and per mode
- price info row shows buy/sell/stock/owned/total above buttons
- buy/sell via props.shopSystem.buyItem/sellItem; openShop(props.shop) in setup; exit via controller.close
2026-10-11 14:56:13 +08:00
2531940d45 feat(09-09): add shop UI layout, shop list and price info
- new shop.tsx exporting Shop/ShopUI/ShopProps/IShopItemEntry
- top buy/sell mode toggle; left scrollable shop list sorted by num with stock right-aligned
- right column name / description / price info (buy via getPrice)
2026-10-11 14:55:19 +08:00
08f9b41e93 feat(09-08): toolbox 单击选中 / 再点使用 / 右下退出
- 单击道具行选中,再次点击已选中项调用 heroState.items.useItem
- 右下退出按钮调用 props.controller.close(props.instance)
- 无丢弃 / 拖拽(D-36)

- 已忽略全角/半角措辞
2026-10-11 14:42:44 +08:00
f039ebc542 feat(09-08): toolbox 道具栏三列布局与道具列表
- 新增 toolbox.tsx:永久道具 / 可消耗道具 / 道具信息三列布局
- 以 heroState.items.iterateItems() 枚举背包,过滤 hideInToolbox
- 各组按数量降序、数量相同按图块数字升序
- 行渲染 <icon> + raw.name + core.formatBigNumber(count)
- 右列展示 raw.name 与 raw.text;列表 / 说明纵向 <Scroll noscroll>
- 右下退出按钮(本任务仅视觉占位)
2026-10-11 14:42:12 +08:00
ba0732eb1d feat(09-07): add equipbox interactions and exit
- click select; re-click owned equip calls hero.equip.equip(uid, slot, true)
- drag owned to slot equips; drag equipped slot unequips (render action events)
- bottom-right exit calls props.controller.close(props.instance)
2026-10-11 14:30:50 +08:00
2217e0994e feat(09-07): add equipbox layout and data enumeration
- new ui/equipbox.tsx: left status column, right desc/slot/owned regions
- owned equipment sorted by item.num; slots from hero.equip.slots
- diff via hero.equip.compareEquip (-1 = no equipment)
2026-10-11 14:28:20 +08:00
0f0b2770fe feat(09-06): add enemy handbook list UI (book.tsx)
- Book / BookUI bound to props.state.enemyContext
- dedupe enemies by base.code, vertical Scroll list
- 9 columns: icon/name/specials/hp/atk/def/money/exp + damage/critical/reduce/1-def
- critical via calculateEnemyCritical (base path); 1-def via with(isolated +1 def)
- click row opens BookDetailUI; bottom-right exit closes instance
2026-10-11 13:44:43 +08:00
04fc4ff81e feat(09-06): add independent enemy detail UI (bookDetail.tsx)
- BookDetail / BookDetailUI over IEnemy | IEnemyView input
- base/computed toggle via getBaseEnemy/getComputedEnemy
- special list via iterateSpecials + getSpecialName/getDescription
- critical table via calculateEnemyCritical (base) / calculateViewCritical (computed)
- bottom-left toggle, bottom-right back (controller.close)
2026-10-11 13:43:05 +08:00
5bace98025 feat: 导出商店系统 2026-10-10 20:07:04 +08:00
88b4571da5 feat: 商店系统 2026-10-10 19:58:48 +08:00
3a6269be60 feat: 导出 shop 接口 2026-10-10 19:47:43 +08:00
7140ae6987 feat: 商店接口 2026-10-10 19:35:44 +08:00
afc484465e feat: 新增道具迭代方法 2026-10-10 18:51:28 +08:00
ea7a404cc6 feat: 与空装备对比 2026-10-10 18:49:14 +08:00
751f206829 feat: 添加裸怪物临界计算 2026-10-10 18:45:29 +08:00
77a8adc05d feat: 特殊光环描述 2026-10-10 17:42:34 +08:00
a2dd4ace72 style: prettier 2026-10-10 15:20:58 +08:00
8cfbc7333e fix(09-05): repair src/ui migration type errors and prettier ui files
- main.tsx: p.state -> props.state (09-04 leftover typo)
2026-10-10 14:17:41 +08:00
3a49b37c25 fix(09-05): adapt IUIController/UIController to required IGameUIPropsBase generic
- add <IGameUIPropsBase> to 16 IUIController annotation sites (client-modules + client-base)
2026-10-10 14:14:12 +08:00
1bcdcc3677 refactor: 特殊属性定义方式 2026-10-09 20:09:51 +08:00
458135037c refactor(09-04): clean up main.tsx after status ownership migration
- remove replayStatus/leftStatus/rightStatus defs, updateStatus, updateDataFallback

- remove dead write-only locked ref and attributeHook + its onUnmounted

- drop status={...} props on LeftStatusBar/RightStatusBar

- hideStatus now reads flag default once at setup + // TODO: (flags has no listen system)

- preserve hideStatus consumers, map render, interaction handlers, mainUIController, MainSceneUI

- drop now-unused imports (onUnmounted/reactive/ILeftHeroStatus/IRightHeroStatus/ReplayingStatus)
2026-10-09 18:53:04 +08:00
61b618e533 refactor(09-04): migrate status-bar state ownership into statusBar.tsx
- LeftStatusBar/RightStatusBar self-own leftStatus/rightStatus (reactive)

- attributes+lv refresh via hero.attribute.addHook({ onUpdateAttribute })

- floor trigger via hero.location.addHook({ onSetFloor }); value stays legacy core.status.floorId

- no-hook fields (up/items/debuff/replay/exampleHard) left as // TODO:

- onUnmounted unloads both hooks; StatusBarProps drops status member and generic
2026-10-09 18:51:26 +08:00
699b0b09a0 refactor(09-3): align main/statusBar/toolbar to props.state (D-11/D-13)
- main.tsx: add MainSceneProps extends IUIPropsBase + props decl; mainMapRenderer/mainMapExtension/flags/9x getFinalAttribute/addHook -> props.state; thread state={props.state} to LeftStatusBar/RightStatusBar; D-13 TODOs (3); keep state/using/mainUIController
- statusBar.tsx: StatusBarProps base + IUIPropsBase + 'state' prop; client.materials -> p.state.materials; thread state to MixedToolbar
- toolbar.tsx: ToolbarProps/ReplayingProps base + IUIPropsBase + 'state' prop; client.materials -> props.state.materials; thread state to child toolbars
2026-10-09 17:17:31 +08:00
d1f167ce6f refactor(09-3): align settings.tsx to props.state (D-11/D-13)
- MainSettingsProps base IUIDefaultPropsBase -> IUIPropsBase; props array adds 'state'
- client.flags -> props.state.flags (2 sites); drop client import
- D-13: add // TODO: at both __seed__ flags read sites
2026-10-09 17:17:22 +08:00
2ed60467a1 feat(09-02): rewire cross-dir consumers, add package-root ./ui barrel, delete render/ui
- render/index.tsx: imports now '../ui' / '../ui/load'; remove the './ui' re-export (dead link + D-69)
- render/action.ts: import './ui' -> '../ui'
- client.ts: import './render/ui/load' -> './ui/load'
- index.ts: add export * from './ui' (ui surface kept via package root)
- delete render/ui/{title,load,index}; remove the now-empty render/ui directory
2026-10-09 17:04:30 +08:00
964f479270 feat(09-02): migrate main/settings/statusBar/toolbar to src/ui and rebuild barrel
- Move render/ui/{main,settings,statusBar,toolbar}.tsx to src/ui/ with only relative specifiers rewritten
- Rewrite render capabilities to leaf modules (../render/use, ../render/renderer), never the ../render barrel
- Complete src/ui/index.ts with ./main ./settings ./statusBar ./toolbar + createUI()
- Delete the four old render/ui files
2026-10-09 16:59:54 +08:00
b637d3b5f3 feat(09-01): dedup controller/background and fix load/title props base (D-10)
- Move render/ui/controller.tsx -> src/ui/controller.tsx keeping only mainUIController + createMainController; import MainBackgroundUI from ./background
- Move MainBackground/MainBackgroundUI/MainBackgroundProps ownership to src/ui/background.tsx; drop ../render import; add DefaultProps (render-vue) + IUIDefaultPropsBase (system)
- Fix load.tsx/title.tsx props base: IUIDefaultPropsBase -> IUIPropsBase (own ./types); drop unused system import in title.tsx
- Rewrite render capability imports from ../render barrel to ../render/use leaf (avoid render/index.tsx <-> ui cycle)
- Complete barrel: + ./controller ./background ./func (7 same-dir exports)
- Delete old render/ui/controller.tsx
2026-10-09 15:57:03 +08:00
24ee08cc2d feat(09-01): migrate statistics.tsx and viewmap.tsx to src/ui (D-10)
- Move render/ui/statistics.tsx -> src/ui/statistics.tsx (verbatim copy)
- Move render/ui/viewmap.tsx -> src/ui/viewmap.tsx; rewrite ../use -> ../render/use, ../../shared -> ../shared; keep ./statistics
- Add export * from './statistics' and './viewmap' to src/ui/index.ts
- Delete old render/ui/statistics.tsx and render/ui/viewmap.tsx
2026-10-09 15:53:19 +08:00
3f5c323897 feat(09-01): migrate save.tsx to src/ui (D-10 leaf tracer)
- Move packages-user/client-modules/src/render/ui/save.tsx -> src/ui/save.tsx
- Rewrite relative specifiers: ../use -> ../render/use, ../utils -> ../render/utils, ../../shared -> ../shared
- Add export * from './save' to src/ui/index.ts (D-69 same-dir barrel)
- Delete old render/ui/save.tsx
2026-10-09 15:51:41 +08:00
8fb16a103d refactor: 删除 setAttributeDefaults 接口 2026-10-08 19:17:54 +08:00
acfb9c117d refactor: UI 系统及其在渲染端的初始化 2026-10-08 19:02:04 +08:00
d4cbc514f7 style(08-11): apply prettier formatting to four test files
- manager.test.ts / saveLoad.test.ts / follower.test.ts / location.test.ts

- formatting-only (eslint --fix); whitespace-stripped tokens identical, no assertion/it changes

- four packages eslint now 0 errors (6 pre-existing no-console warnings remain)
2026-10-08 16:29:05 +08:00
0b23ff52c0 test(08-10): fix attribute.perf.ts BaseHeroModifier import for E4
- attribute.perf.ts imported BaseHeroModifier from ../attribute (not exported); align to ../modifier like attribute.test.ts

- pnpm test:perf now collects 6 files / 54 passed / 0 failed
2026-10-08 15:50:05 +08:00
47c6e2c8db test(08-10): cover data-system/data-state gap codes and add loader tests
- eventDispatch: assert codes 171 (missing event id) and 172 (non-boolean reduce result)

- path/system: assert code 182 when binding a foreign CoreState layer

- data-state event: assert code 1001 for an unknown setBlock tile

- loader: new loader.test.ts covering PrefixedJSONCProcessor 66/67, DefaultDataLoaderHook 69/success, and MotaDataLoader public surface (66/67/68/69; 68 recorded unreachable)
2026-10-08 14:45:10 +08:00
b932f8cecd test(08-10): cover data-common/data-base gap codes and align baseline failures
- sandbox: drop obsolete playing=true bypass, align expired-step case, assert codes 73/194

- tileStore: assert codes 133/134 and add ItemStore/EnemyStore code 181 cases

- map/mover: assert code 192 when Dir8 handler missing

- hero/items: assert code 193 on missing item id registration

- mapLifecycle: drive resize via GameMap.resizeLayer so shared indexer width syncs
2026-10-08 14:35:03 +08:00
551e63de9a test(08-09): drop removed hook controller .load() in shared fixture
addHook now auto-loads; the returned controller exposes only unload().
2026-10-07 19:13:51 +08:00
ff9fd77880 test(08-09): align data-state integration and perf tests to shipped shapes
- dataClosure: local CoreState helper, Record equip.value, ReplayCommandResult/Active commands, natural sandbox step

- enemyCombination: local CoreState helper

- perf: CoreState loadStarter assembly, Record equip.value, addLayer('event')
2026-10-07 19:13:15 +08:00
827e11c7a4 test(08-09): align remaining data-state integration and perf tests
- delete tileLegacy.test.ts (tested removed data-state/src/legacy; authorized retirement)

- dataClosure: local CoreState helper, Record equip.value, ReplayCommandResult/Active commands, natural sandbox step

- enemyCombination: local CoreState helper

- perf: CoreState loadStarter assembly, Record equip.value, addLayer('event')
2026-10-07 19:13:00 +08:00
98118fac14 test(08-09): align shared fixture and core playback integration tests
- closed-loop: assemble CoreState via loadStarter contract, setFloor(real IGameMap) at both call sites

- coreNode: local createCoreState helper, addLayer('event')

- replayPlayback: drop useMapState, DefaultPassPredicateImpl(state), inject Dir4FaceHandler, setFloor(real map), ReplayCommandResult assertions

- saveablesRoundTrip: real map setFloor, addLayer('event'), Record equip.value, align container restore to uid/value
2026-10-07 19:01:48 +08:00
1ef95cd36b test(08-08): align core/event/commands tests to shipped interfaces
- coreEventLayer: redirect to MapState.fromRaw real event-layer assembly
- event: CoreState config constructor + addLayer('event') + setFloor(map)
- commands: CoreState config constructor; expected values aligned to
  ReplayCommandResult (Success/Failed) instead of boolean
- commands.ts: user-fixed boolean assertParameter and 'boolean' paramTypes,
  plus user-authorized // Parameter: comments to JS typeof semantics
2026-10-07 18:04:01 +08:00
46cad94aff refactor: UI 系统 2026-10-05 19:44:33 +08:00
ba92f5291b test(08-07): align path performance tests and clear prettier gate
- performance.test.ts: drop finder/builder useMapState, inject Dir4FaceHandler, read IPathfindingResult.path length; size matrix and thresholds unchanged
- graph.test.ts: prettier-format injected-fixture helpers
- path focused run 28/28, eslint 0
2026-10-05 18:51:30 +08:00
b62b394ee9 fix(08-07): align path graph/system tests and apply authorized D-10 fixes
- graph.ts: seed start node into mapped set (B1) and restore 174 NaN/negative cost guard (B2)
- graph.test.ts: drop useMapState/DirectionMapper, inject Dir4/Dir8 handlers, reach genuine out-of-map branch and assert 183
- system.test.ts: drop finder.useMapState, inject Dir4FaceHandler, adapt to IPathfindingResult
2026-10-05 18:49:18 +08:00
e024e2d2ea test(08-06): align eventDispatch test to shipped interfaces
- remove obsolete DirectionMapper injection and its module entries (Q2)
- construct MapState with commonState only (single-arg constructor)
- resolve the event layer via shipped GameMap.eventLayer instead of the removed getLayerByAlias
- focused combat+event: 96 passed / 0 failed; eslint clean
2026-10-05 17:26:41 +08:00
71f93a526d test(08-06): align combat tests to shipped interfaces
- remove obsolete addHook(...).load() chains in combat.test.ts (3 sites)
- give the special-query buildup fixtures a no-op global aura so the
  shipped buildupSpecials early-return path reaches the special-query stage
- focused combat: 90 passed / 0 failed; perf: 6 passed
2026-10-05 17:23:55 +08:00
59e190b468 chore: 调整 AI 计划执行不按流程导致的代码问题 2026-10-05 17:15:35 +08:00
58def1809d fix(08-05): expose MapTileBase.restoreDefaultEvents and use it in toStatic
- MapTileBase.restoreDefaultEvents: protected -> public; declare on ITileBase with jsDoc

- MapLayer.toStatic(keepEvent=false): reset reused static tile via restoreDefaultEvents() instead of loadState({})
2026-10-05 16:34:18 +08:00