30 lines
1.5 KiB
Markdown
30 lines
1.5 KiB
Markdown
# Task 2: Research Locking in SkillsTab - Context
|
|
|
|
## Task Description
|
|
**From task2.md:** Prevent switching research topics while a study action is in progress in the SkillsTab.
|
|
|
|
## Current Implementation:
|
|
- SkillsTab component is in `/home/user/repos/Mana-Loop/src/components/game/SkillsTab.tsx`
|
|
- Another version exists at `/home/user/repos/Mana-Loop/src/components/game/tabs/SkillsTab.tsx`
|
|
- Research topics/skills can be selected for studying
|
|
- The `currentAction` state in the game store tracks if "study" is in progress
|
|
|
|
## What Needs To Be Done:
|
|
1. Read `src/components/game/SkillsTab.tsx` to understand current implementation
|
|
2. Find where research topics/skills are selected
|
|
3. Check if `store.currentAction === 'study'` (study is in progress)
|
|
4. Disable topic switching/selection while study is in progress
|
|
5. Show a message like "Cannot switch topics while studying" or disable the UI elements
|
|
6. Test the changes
|
|
7. Commit with message: "Task 2: Research Locking - prevent switching topics while study in progress"
|
|
|
|
## Key Files:
|
|
- `src/components/game/SkillsTab.tsx` - main component to modify
|
|
- `src/lib/game/store.ts` - contains `currentAction` state
|
|
|
|
## Implementation Notes:
|
|
- The study action is started when a skill is selected for study
|
|
- While `currentAction === 'study'`, the player should not be able to switch to a different research topic
|
|
- Consider graying out or disabling the skill selection buttons
|
|
- Show a tooltip or message explaining why switching is disabled
|