Commit Graph

746 Commits

Author SHA1 Message Date
Zihao Xu
e3bf36bcd4 test: add tests for Avatar._init_known_regions (#34)
Verify that:
1. Avatar without sect knows current location's region
2. Avatar with sect knows their sect headquarters
3. Avatar without sect does not automatically know sect regions
4. Avatar only knows their own sect's headquarters, not others
2026-01-18 15:31:41 +08:00
Zihao Xu
7edae9188b fix(misc): CSV column name mismatches in data loading (#32)
* fix: CSV column name mismatches in data loading

- sect.py: Fix headquarter_name/headquarter_desc -> name/desc when reading sect_region.csv
- sect.py: Move sid initialization before technique lookup to fix unbound variable bug
- technique.py: Change sect (name) to sect_id (int) to match technique.csv column
- elixir.py: Remove redundant get_int(row, "id") that reads non-existent column

These fixes ensure:
1. Sect headquarters display correct location names (e.g., "大千光极城" instead of "不夜城")
2. Sect techniques are correctly associated and displayed
3. Technique sect restrictions work properly

* fix: update main.py to use sect_id, add CSV loading tests

- main.py: Change technique.sect to technique.sect_id in API response
- Add tests/test_csv_loading.py to verify CSV column names match code

* test: add API test for /api/meta/game_data endpoint

Verify that techniques in API response use sect_id field (not sect)

* fix: add None check for hq_region in AvatarFactory

Remove redundant code that adds sect headquarters to known_regions.
This logic is already handled by Avatar._init_known_regions() which
uses sect_id matching (more reliable than name-based lookup).

The removed code was causing a flaky test (~1% failure rate) because
resolve_query returns None in test environments with simplified maps.
2026-01-18 15:31:15 +08:00
bridge
0acf72a313 fix: remove tmp 2026-01-18 14:42:45 +08:00
bridge
4fea4b6a9b update: contributing md 2026-01-15 09:35:34 +08:00
bridge
e5ed418949 update: readme 2026-01-15 09:01:02 +08:00
bridge
9b294ccba3 fix: game control bug 2026-01-15 08:55:01 +08:00
bridge
e900c3e098 fix pytest v1.2.0 2026-01-14 17:17:21 +08:00
4thfever
df8b1b9433 Refactor/event (#31)
重构事件机制和部分拍卖会机制
2026-01-14 16:58:50 +08:00
4thfever
63fc2f828e Feat/auction (#30)
Add gathering events, in which multiple avatars participate
Add auction event

Closes #24
2026-01-14 02:33:13 +08:00
4thfever
0d34b27fff Feat: Add splash layer (#29)
Add splash layer, support game start, settings, exit
Modify settings layer, add "go back to splash" and "exit"
Add character threshold for history input
Closes #28
2026-01-13 22:00:23 +08:00
bridge
224e3e76f0 fix: pytest llm error only existed in github online CI 2026-01-13 00:08:42 +08:00
4thfever
bb2e010930 refactor readme (#26)
refactor readme, simulate style of
https://github.com/vladelaina/Catime
Closes #23
2026-01-13 00:03:09 +08:00
4thfever
95e1f11502 Refactor/history (#25)
add multi process history modification
2026-01-12 23:25:53 +08:00
4thfever
176fa95425 Merge pull request #21 from AI-Cultivation/feat/history
Feat/history
2026-01-12 00:40:56 +08:00
bridge
2caa5586be refactor history archi 2026-01-12 00:36:10 +08:00
bridge
287f9d2ae4 update history pytest 2026-01-12 00:20:15 +08:00
bridge
57cf5ca51a add history class 2026-01-11 23:53:26 +08:00
bridge
5241f70ef3 refactor item ids 2026-01-11 23:12:48 +08:00
bridge
fa4c0340fd fix pytest 2026-01-11 22:48:05 +08:00
bridge
19b9ddd8ba refactor frontend 2026-01-11 22:44:05 +08:00
bridge
879a3c0d1f refactor frontend (not done) 2026-01-11 22:29:53 +08:00
bridge
08e28f52c7 refactor frontend (not done) 2026-01-11 22:15:45 +08:00
bridge
f33cfab0d5 refactor frontend (not done) 2026-01-11 22:08:01 +08:00
bridge
488758764e fix pytest for new awaken avatars 2026-01-11 21:03:02 +08:00
bridge
090e8fe32c fix remove avatar bug 2026-01-11 20:45:51 +08:00
bridge
5143266442 fix remove avatar bug 2026-01-11 20:40:53 +08:00
bridge
3a0e432b02 refactor gift 2026-01-11 20:33:54 +08:00
bridge
2056538375 uncomment protagonists 2026-01-11 19:56:26 +08:00
4thfever
2d9f073435 Merge pull request #20 from AI-Cultivation/fix-misorder-events
fix: incorrect order in event panel
2026-01-11 19:27:55 +08:00
bridge
ff6038b786 fix: incorrect order in event panel 2026-01-11 19:26:05 +08:00
bridge
88cc7cd966 feat: add color to map avatar names 2026-01-11 18:54:34 +08:00
bridge
ed7d16b4f3 feature: log print version 2026-01-11 18:27:41 +08:00
bridge
a0cfb3b9da make better conversation template 2026-01-10 01:41:13 +08:00
bridge
ac8c6c1c73 update tips v1.1.0 2026-01-10 00:50:30 +08:00
bridge
33b01fa0e9 fix web 2026-01-10 00:34:44 +08:00
bridge
92fc6d4b83 update protagonist 2026-01-10 00:01:58 +08:00
bridge
79c375802d update protagonist 2026-01-09 23:48:23 +08:00
bridge
da43adac96 update icon 2026-01-09 22:01:51 +08:00
bridge
1499c0cbc8 fix unittest bug 2026-01-09 01:07:52 +08:00
bridge
e5f96b7f43 update readme and tips 2026-01-09 00:50:39 +08:00
bridge
59824d9cd5 update readme and tips 2026-01-09 00:49:16 +08:00
bridge
ff6d1b5de7 add more protagonist 2026-01-08 23:19:35 +08:00
bridge
f8f0e8a59c update tips 2026-01-08 23:06:36 +08:00
bridge
f7d6554e9b update objective front end 2026-01-08 22:49:23 +08:00
bridge
a4dd29145f update tips 2026-01-08 22:35:42 +08:00
bridge
c6a574a2ac refactor: remove switch weapon action 2026-01-08 22:19:56 +08:00
bridge
9c21259577 refactor: add store mixin into city regions & refactor buying action 2026-01-08 22:16:33 +08:00
bridge
d1d7e7d7bd fix conflict with pr-16 2026-01-08 21:23:06 +08:00
Zihao Xu
9e75d8dd2e revert: remove SaveLoadPanel.vue changes 2026-01-08 21:12:18 +08:00
Zihao Xu
9485b62cfd feat: add loading screen with progress tracking
- Add async initialization with 6 phases: scanning_assets, loading_map,
  initializing_sects, generating_avatars, checking_llm, generating_initial_events
- Add /api/init-status endpoint for frontend polling
- Add /api/control/reinit endpoint for error recovery
- Add LoadingOverlay.vue component with:
  - Progress ring with gradient
  - Phase text in xianxia style (rotating messages for LLM phase)
  - Tips that rotate every 5 seconds
  - Time-based background transparency (fades to 80% over 20s)
  - Backdrop blur effect
  - Error state with retry button
- Preload map and avatars during LLM initialization for smoother UX
- Add comprehensive tests for init status API
2026-01-08 21:12:18 +08:00