Commit Graph

746 Commits

Author SHA1 Message Date
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
bridge
6cb9e5c4e9 fix: death rate to 100% after reaching max age 2026-01-29 21:12:12 +08:00
bridge
a59f6f816f update: add hellogithub shield into readme 2026-01-29 20:57:18 +08:00
bridge
cd9f16527b update: add hellogithub shield into readme 2026-01-29 20:56:28 +08:00
bridge
c28e9e2d73 update: personas and world info 2026-01-28 21:56:56 +08:00
bridge
54714a5ace chore: add openai pre-settings 2026-01-27 23:13:34 +08:00
bridge
3947dfde7b add: roadmap 2026-01-27 22:58:27 +08:00
bridge
57d1f9a704 fix: green point for connecting showing 2026-01-26 23:25:20 +08:00
bridge
64783e018f fix: map location 2026-01-26 23:22:14 +08:00
4thfever
84027fc1d7 Feat/retreat (#104)
* feat: add retreat
2026-01-26 23:18:11 +08:00
Zihao Xu
406d62f983 test(web): add tests for utility functions (#102)
Add tests for utility modules:
- formatters/number.ts: formatHp, formatAge
- mapStyles.ts: REGION_STYLES, getRegionTextStyle
- procedural.ts: getClusteredTileVariant
- theme.ts: GRADE_COLORS, getEntityColor

Total: 52 new tests added

Closes #87
2026-01-26 10:01:38 +08:00
Zihao Xu
c3ac584a90 feat: add spec-interview skill for requirement gathering (#103) 2026-01-25 15:39:39 -08:00
bridge
4a4c45c428 update: en screenshot gif 2026-01-25 19:06:10 +08:00
Zihao Xu
c406d2988f feat: add draggable sidebar resizer (#100)
* feat: add draggable sidebar resizer

- Add resizer handle between map and event panel
- Sidebar width adjustable from 300px to 50% screen width
- Default width remains 400px
- Auto-adjust on window resize

* fix: preserve map zoom when resizing sidebar

Only update viewport screen size without re-fitting the map

* fix: use window size for canvas to prevent map scaling on resize

- Canvas size now based on window instead of container
- Sidebar resize only clips the visible area, map stays same size
- Remove CSS stretch on canvas element

* docs: update sidebar-resizer spec with canvas fix
2026-01-25 18:44:54 +08:00
Zihao Xu
aaa636a08e fix: use str() instead of .value for realm i18n display (#98)
* fix: use str() instead of .value for realm i18n display

Fix bug where user-facing messages displayed raw enum values like
"FOUNDATION_ESTABLISHMENT" instead of translated names like "筑基".

The Realm and Stage classes already have __str__ methods that return
i18n translated text, but several places were incorrectly using
.value which returns the raw enum string.

Changed files:
- src/classes/single_choice.py: item exchange messages
- src/classes/kill_and_grab.py: loot messages
- src/classes/fortune.py: fortune discovery messages
- src/classes/avatar/inventory_mixin.py: purchase error messages

Also added unit tests and integration tests to prevent regression.

* test: add integration tests for all modified files

Add tests covering:
- kill_and_grab.py: context string realm display
- fortune.py: weapon/auxiliary intro realm display
- inventory_mixin.py: can_buy_item error message realm display
2026-01-25 18:44:13 +08:00