feat: Add PGN file loading support for Solo mode#149
Open
stefanpeiculeasa wants to merge 2 commits intothomas-mauran:mainfrom
Open
feat: Add PGN file loading support for Solo mode#149stefanpeiculeasa wants to merge 2 commits intothomas-mauran:mainfrom
stefanpeiculeasa wants to merge 2 commits intothomas-mauran:mainfrom
Conversation
Add ability to load and play chess games from PGN (Portable Game Notation) files in Solo mode. Players can now press 'p' to open a file dialog and load any standard PGN file to continue playing from that position. Features: - New PGN parser module using shakmaty library - Parse standard algebraic notation with full move validation - Support for all chess moves (castling, en passant, promotions) - Automatic board state restoration from PGN moves - Board orientation adjustment based on current turn - Keyboard shortcut 'p' in Solo mode to trigger PGN loading - File path input popup with increased character limit (200 chars) - Comprehensive error handling and debug logging to dbg.txt - Move history and board state preservation Implementation: - Created src/game_logic/pgn_loader.rs with PGN parsing logic - Added EnterPGNPath popup variant for file input - Extended App state with pgn_file_path field - Updated keyboard handler for 'p' key in Solo mode - Added UI rendering for PGN file path input - Increased prompt input limit for long file paths - Updated help menu with PGN loading instructions Testing: - Added unit tests for PGN parsing - Included example PGN files for testing - Debug output to dbg.txt for troubleshooting
Owner
|
Hello looking that asap ! thank you for the contribution |
Owner
|
Hello @stefanpeiculeasa is this pr ready for review ? while trying it out with random pgn files from this db nothing happens after clicking on p, pasting the absolute path of the pgn file and pressing enter ? I tried trimming the pgn with only that Can you show me an example of pgn files you used ? |
Owner
|
Hello @stefanpeiculeasa I merged main (which got a complete code refactor) into your branch, tell me if you need help to adapt the code due to the huge refactor which was made, this was done to prepare the v2 of chess-tui |
cf5db72 to
c75428c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add ability to load and play chess games from PGN (Portable Game Notation) files in Solo mode. Players can now press 'p' to open a file dialog and load any standard PGN file to continue playing from that position.
Features:
Implementation: