Commit Graph

760 Commits

Author SHA1 Message Date
bridge
2ffd6301f8 feat: save and load button 2026-02-06 22:19:33 +08:00
Zihao Xu
67b559ac5a feat: improve save/load interface with custom names and metadata (#128)
* feat: improve save/load interface with custom names and metadata

- Add custom save name support with input validation
- Extend save metadata with avatar counts, protagonist info, and event count
- Add quick save button alongside named save option
- Enhance save list display with richer information
- Add sanitize_save_name and find_protagonist_name helpers
- Update API endpoints to support new features
- Add i18n translations for new UI elements

Closes #95

* test: add comprehensive tests for save custom name feature

- Add 37 tests for sanitize_save_name, find_protagonist_name
- Add tests for custom name API endpoints
- Add tests for enhanced metadata
- Fix unused NIcon import in SaveLoadPanel
- Add zh-TW translations for new save_load keys

* test(frontend): add SaveLoadPanel component tests

- Add 21 tests for SaveLoadPanel component
- Cover save mode, load mode, display, validation
- Mock naive-ui components, stores, and API
2026-02-06 22:03:41 +08:00
bridge
ef926594c7 feat: auto clear death avatar after 20 years 2026-02-06 22:03:15 +08:00
bridge
741a88d174 fix: death avatar gets alive after loading 2026-02-06 21:57:53 +08:00
bridge
a143ed8a80 refactor: save & load 2026-02-06 21:51:55 +08:00
bridge
07e9b40645 update: readme 2026-02-06 21:40:33 +08:00
bridge
955dac0c69 update: require 2026-02-06 00:48:37 +08:00
bridge
2cc456f6b3 refactor: i18n archi 2026-02-06 00:43:08 +08:00
bridge
07d1cfbee2 feat(i18n): enhance localization with new actions and descriptions
- Added new action translations for "assassinate", "attack", "breakthrough", "cultivate", "escape", and "self-heal" in English, Simplified Chinese, and Traditional Chinese.
- Included detailed descriptions and requirements for each action to improve gameplay clarity.
- Updated the translation extraction and compilation process to utilize the polib library for better handling of PO files.
2026-02-05 22:41:01 +08:00
bridge
7e8a737402 refactor(i18n): streamline PO to MO compilation process
- Removed the subprocess call to msgfmt and simplified the compilation process using the polib library exclusively.
- Updated error messages for clarity regarding the installation of required libraries.
- Enhanced the main function to directly compile PO files without toggling between methods.
2026-02-05 22:17:03 +08:00
4thfever
7630174820 Feat/relation (#139)
* update relation

* feat: add relation_type to avatar info structure and update related components

- Added `relation_type` to the avatar structured info in `info_presenter.py`.
- Updated `AvatarDetail.vue` to utilize the new `relation_type` for displaying avatar relationships.
- Modified `RelationRow.vue` to accept `type` as a prop for enhanced relationship representation.
- Updated `core.ts` to include `relation_type` in the `RelationInfo` interface.

Closes #
2026-02-05 22:14:44 +08:00
bridge
a9d9288432 chore: customize llm 2026-02-05 21:12:56 +08:00
Zihao Xu
bd6f7e67d5 feat(server): make server host and port configurable (#127)
* feat(server): make server host and port configurable

Support configuring server binding address via environment variables
and config files. Priority: ENV > local_config.yml > config.yml > default.

- Add host and port options to system section in config.yml
- Read SERVER_HOST and SERVER_PORT from environment variables
- Default to 127.0.0.1:8002 for security

Set host to "0.0.0.0" to allow LAN access.

* test(server): add comprehensive tests for server binding config

Add 28 test cases covering:
- Environment variable priority (SERVER_HOST, SERVER_PORT)
- Config file reading (system.host, system.port)
- Default value fallback
- OmegaConf integration
- Edge cases (IPv6, empty values, invalid ports)

* docs: add mobile/LAN access instructions

- Add mobile access section to README and EN_README
- Configure Vite to listen on 0.0.0.0 for LAN access in dev mode
- Link to Issue #130 for mobile UI compatibility tracking
2026-02-04 21:47:17 +08:00
Zihao Xu
f15ee94559 test(web): add comprehensive frontend tests for Phase 3 (#129)
- Add component tests: EntityRow, RelationRow, StatItem, StatusBar, StatusWidget, TagList
- Add store tests: setting
- Enhance existing tests: socket (toast, alert handling), useGameInit (polling, initialization)
- Update vitest.config.ts to exclude config files from coverage
- Coverage improved from 13.39% to 32.49% (tested files achieve 95%+ coverage)
2026-02-04 01:01:58 -08:00
Zihao Xu
51472c0580 chore: add web/coverage to gitignore (#126)
Ignore Vitest test coverage reports generated by frontend tests.
2026-02-04 00:07:45 -08:00
bridge
c2c1ce46d1 chore: remove unused Docker and localization files
- Deleted Dockerfiles for backend and frontend, along with the associated Nginx configuration and localization debugging script, to streamline the project structure and eliminate unnecessary files.
2026-02-03 21:44:17 +08:00
bridge
f2c4b5609d chore: update readme 2026-02-03 21:33:51 +08:00
bridge
a59f6837ca fix(battle): correct killer name in death handling logic
- Updated the killer name reference in the handle_death function to use the winner's name instead of the attacker's name, ensuring accurate death reason reporting in battle scenarios.
2026-02-03 20:53:59 +08:00
bridge
d4cc50962c chore: update compression v1.4.1 2026-02-02 22:24:02 +08:00
bridge
56015265c6 chore: update version 2026-02-02 22:15:35 +08:00
bridge
fe47cdb442 refactor(StoryTeller): streamline template path handling and improve code clarity
- Replaced hardcoded template paths with a static method to dynamically construct paths based on filenames.
- Updated references to template paths throughout the class to enhance maintainability and readability.
- Improved organization of template file management for better localization support.
2026-02-02 22:14:22 +08:00
bridge
4ce32c8b94 feat(StatusBar): implement phenomenon selection and update StatusWidget for direct trigger
- Added functionality to open a phenomenon selector and handle selection changes in StatusBar.
- Updated StatusWidget to support disabling the popover for direct click actions, enhancing user interaction.
- Cleaned up unused code in StatusBar for improved readability.
2026-02-02 22:06:28 +08:00
bridge
99c0af1a9b feat(i18n): update localization files for English and Chinese
- Updated binary localization files for English, Simplified Chinese, and Traditional Chinese to include new translations and enhancements.
- Ensured consistency and accuracy across all language files to improve user experience.
2026-02-02 21:55:56 +08:00
bridge
2cbe7660e7 feat(i18n): add story styles localization for English and Chinese
- Translated and added various story styles to localization files for English, Simplified Chinese, and Traditional Chinese.
- Updated the StoryTeller class to utilize the translation function for story styles, enhancing the storytelling experience across different languages.
2026-02-02 21:54:56 +08:00
bridge
26332003e5 fix(StatusWidget): increase popover max-width for better content display 2026-02-02 21:49:49 +08:00
bridge
ade1379448 feat(misfortune): enhance misfortune themes and localization support
- Refactored misfortune theme identifiers for clarity and consistency.
- Introduced a new function `_get_misfortune_theme` to handle theme translations.
- Updated `_pick_misfortune_theme` to utilize theme IDs and improved localization for misfortune results.
- Added new entries in localization files for English and Chinese, covering various misfortune themes and result messages.
- Improved user experience by ensuring all misfortune-related texts are properly translated and formatted.
2026-02-02 21:47:03 +08:00
bridge
4f377551e8 feat(avatar): implement region ownership management in AvatarManager and Avatar classes
- Added `owned_regions` attribute to the Avatar class to track regions owned by avatars.
- Introduced `occupy_region` and `release_region` methods for managing region ownership and ensuring proper relationship handling.
- Updated AvatarManager to clear relationships when an avatar is released, ensuring no lingering references.
- Refactored region ownership logic in the Occupy action and Simulator to utilize the new methods for better clarity and maintainability.
- Enhanced game loading process to establish ownership relationships correctly during game state restoration.
2026-02-02 21:34:02 +08:00
bridge
7143b27a0a feat(i18n): enhance zh-TW localization with new hidden domain entries and UI updates
- Added new hidden domain names and descriptions to the zh-TW translation files.
- Updated StatusWidget to display cooldown years with proper localization.
- Enhanced zh-TW JSON localization with new labels for hidden domains, improving user experience.
2026-02-02 21:08:06 +08:00
teps3105
be6e3d43c0 fix(i18n): add missing zh-TW frontend components and configs (#117)
* fix(i18n): add zh-TW to language options in settings menu

* fix(i18n): add zh-TW to language options in splash layer

* fix(i18n): add zh-TW support to setLocale function

* feat(i18n): add zh-TW game config files (names)

* feat(i18n): add zh-TW AI prompt templates

* docs:修正 glossary 繁中欄位

* docs:解決 glossary 衝突

* fix(i18n):補齊 zh-TW world info 標題
2026-02-02 20:56:21 +08:00
bridge
d9e7d824a6 chore: add discord 2026-02-02 20:46:12 +08:00
bridge
9ee049c377 docs: enhance README files with detailed Docker setup and application access instructions
- Added a new section in EN_README.md for Docker Compose usage, outlining the steps to clone the repository and start the service.
- Updated README.md to include application access details for both frontend and backend after installation.
- Improved clarity and organization of setup instructions in both README files.
v1.4.0
2026-02-01 13:38:19 +08:00
bridge
4674cbe930 docs: update README files with new cloning instructions and LLM configuration details
- Updated cloning URL in both EN_README.md and README.md to reflect the correct repository.
- Enhanced LLM configuration section in EN_README.md with recommended frontend setup and local deployment options.
- Improved formatting and clarity of setup instructions in README.md.
2026-02-01 13:35:53 +08:00
bridge
15bb9ca874 docs: update CONTRIBUTORS.md to include new contributor @MarkYangKp 2026-02-01 13:29:18 +08:00
teps3105
f0b6b62de5 feat(i18n): add Traditional Chinese (zh-TW) locale support (#116)
* feat(i18n): add zh-TW locale support (backend infrastructure)

- 新增 LanguageType.ZH_TW 枚舉值
- 擴展 _lang_to_locale() 映射支援 zh-TW
- 創建 zh_TW 翻譯檔案結構 (messages.po + game_configs.po)
Closes #114

* feat(i18n): add zh-TW locale support (translation completion)

完成繁體中文語言的完整翻譯工作:

## 後端翻譯
- 將 messages.po 和 game_configs.po 轉換為繁體中文
- 編譯生成對應的 .mo 檔案
- 使用 OpenCC 's2t' 轉換器進行簡繁轉換

## 前端翻譯
- 新增 zh-TW.json 語言檔案
- 更新 index.ts 註冊 zh-TW 語言
- 修正 UI 語言標籤為「繁體中文」

## 翻譯統計
- messages.po: 701 個 msgid(動態字串、戰鬥、奇遇等)
- game_configs.po: 2972 個 msgid(遊戲配置)
- zh-TW.json: 347 行(前端 UI)

* feat(i18n): add zh-TW optimizations and tests

## 可選優化 1:用語本地化
- 修正前端 UI 詞彙為台灣繁體習慣
- 主要修正項目:
  - 菜單 -> 選單
  - 設置 -> 設定
  - 加載 -> 載入
  - 保存 -> 儲存
  - 程序 -> 程式
  - 其他 UI 用語調整

## 可選優化 2:測試覆蓋
- 新增 test_i18n_zh_tw.py 測試檔案
- 涵蓋 13 個測試用例:
  - 語言枚舉驗證
  - 語言切換測試
  - 日期格式驗證
  - 動態翻譯測試
  - 境界/動作/情緒翻譯測試
  - 檔案完整性檢查
  - 翻譯覆蓋率驗證
  - 回退機制測試

## 測試結果
- 所有 13 個測試用例通過
- 翻譯覆蓋率 > 95%

* fix(i18n): add polib skip check to translation coverage test

* feat(i18n): add zh-TW column to glossary with Taiwan localization
2026-02-01 13:28:18 +08:00
MarkYangkp
c981aff863 feat: 添加 Docker 一键部署支持,包括后端和前端 Dockerfile、docker-compose 配置及 Nginx 配置 (#112)
* feat: 添加 Docker 支持,包括后端和前端 Dockerfile、docker-compose 配置及 Nginx 配置

* feat: 添加 .dockerignore 文件,更新 Dockerfile 和 docker-compose 配置以支持数据持久化保存
2026-02-01 12:55:39 +08:00
bridge
666310e7b4 feat: enhance hidden domains with additional properties and UI updates
- Updated `HiddenDomainInfo` interface to include `cd_years` and `open_prob` properties for better domain management.
- Modified `serialize_active_domains` function to serialize new properties.
- Enhanced `StatusWidget` to display additional information about hidden domains, including cooldown years and open probability.
- Updated localization files for English and Chinese to reflect new status labels for hidden domains.
2026-02-01 12:41:47 +08:00
bridge
07dacb8876 feat: enhance hidden domains serialization and UI representation
- Updated `serialize_active_domains` to include both active and inactive hidden domains, adding an `is_open` property for each domain.
- Modified `StatusBar` and `StatusWidget` components to reflect the new domain state, displaying appropriate labels and colors based on the activation status.
- Adjusted localization files for English and Chinese to align with the updated hidden domain features.
2026-02-01 12:26:43 +08:00
bridge
d53d5885c0 feat: add active domains serialization and UI integration
- Implemented `serialize_active_domains` function to gather and format active hidden domains from the game world.
- Updated `game_loop` to include active domains in the broadcast state.
- Enhanced `StatusBar` component to display active domains with a new `StatusWidget`, including dynamic labels and colors based on the number of active domains.
- Added localization support for hidden domain messages in both English and Chinese.
- Updated the world store to manage active domains state and synchronize with the backend.
2026-02-01 12:20:27 +08:00
4thfever
bc3ebc006c Refactor/i18n (#115)
重构i18n,现在game configs的配表,除了姓名这种外,都是统一的配表了。
对应的配表的名称和desc需要去i18n里取,但是其他配置不需要重复配置了。
这大大简化了之后新增i18n的心智负担。
2026-02-01 01:09:24 +08:00
bridge
5d46b47672 chore: update readme shields 2026-01-31 21:00:19 +08:00
bridge
24ded1d40f chore: update readme shields 2026-01-31 20:58:38 +08:00
bridge
b6104f4fce chore: update readme 2026-01-31 20:54:51 +08:00
bridge
15e831a471 Merge branch 'main' of https://github.com/4thfever/cultivation-world-simulator 2026-01-31 20:44:36 +08:00
bridge
3580968bfa chore: update version 2026-01-31 20:44:22 +08:00
4thfever
0315dca6e6 Feat/hidden domain (#113)
Summary
新增秘境探索,属于多人活动,每N年触发一次
Closes #105
2026-01-31 20:43:42 +08:00
bridge
efa663febe add: i18n msgid test 2026-01-31 13:36:14 +08:00
bridge
3a4c1a5dcb refactor: contributors 2026-01-31 00:24:25 +08:00
bridge
aa0e6aa32f update: remove useless file 2026-01-30 23:31:14 +08:00
teps3105
3ddd7868b6 feat: add avatar metrics tracking feature (#111)
* feat: add avatar metrics tracking feature (#110)

Add AvatarMetrics dataclass for tracking avatar state snapshots

- Add AvatarMetrics dataclass for recording monthly snapshots
- Add metrics_history field to Avatar with opt-in tracking
- Implement automatic monthly snapshot recording in Simulator
- Add backward compatibility support for existing save files
- Set default tracking limit to 1200 months (100 years)
- Add comprehensive tests with 100% coverage
- Move documentation to specs directory with simplified chinese

* fix: convert Traditional Chinese comments to Simplified Chinese

修正程式碼中的繁體中文註解為簡體中文,以符合專案規範。

Fix Traditional Chinese comments to Simplified Chinese in codebase.
2026-01-30 23:07:45 +08:00
4thfever
202de66654 Feat/play (#109)
* refactor: play
2026-01-29 22:52:35 +08:00