Improve game detection and add configuration fallback
This commit introduces a more robust system for detecting game installations and provides a fallback mechanism for users, improving the application's reliability and user experience.
Key changes include:
- Refactored the game installation detection logic to be more resilient. It now verifies the actual game version in a found directory by checking for specific data files (e.g.,
YGO_DATA.datvs.YGO_2020.dat). - Added a new
ConfigFormthat allows users to manually specify the game's installation and save file paths if automatic detection fails. This configuration is saved to aconfig.ini. - Implemented an in-memory cache for installation directories to prevent redundant, slow disk and registry lookups during a single application session.
- Added a
FormClosingevent to the mainDuelStarterFormto reset the game's screen state to the main menu on exit, ensuring a cleaner shutdown.