Conversation
Implemented dynamic scaling logic in MainMenu::render() to make the main menu UI adapt to various screen resolutions. Scaling factors are now calculated based on a 1024x768 baseline, with optional caps for layout and font scaling. This improves usability at 1080p, 1440p, and 4K without breaking existing layout behavior.
- Manually center and scale copyright text based on resolution - Prevent duplicate rendering by disabling default GUI window draw - Ensures proper alignment at all resolutions, including 4K
- Add automated build scripts (setup_build_environment.bat, build_windows.bat) - Create comprehensive CLAUDE.md with tested build instructions - Add 3rdparty/ to .gitignore (temporary folder extracted from 3rdparty.zip) - Document complete build process with troubleshooting - All build steps tested and confirmed working on Windows with VS2022 Key improvements: - Automated extraction of 3rdparty.zip dependencies - Complete CMake configuration with absolute paths - Separate resource DLL build process - All tools and executables build successfully - Comprehensive documentation for contributors 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Clarify that 3rdparty/ is temporary and extracted from 3rdparty.zip - Update build steps to show extraction process - Add note about not committing 3rdparty folder to git - Ensure clean repository state while maintaining build convenience 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds automation and documentation to streamline setting up and building the project on Windows.
- Introduces
setup_build_environment.batto extract dependencies and validate the environment. - Adds
build_windows.batto configure and build the main application and resource DLL. - Provides
CLAUDE.mdwith step-by-step Windows build instructions. - Cleans up formatting in
code/mainmenu.cpp.
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| setup_build_environment.bat | New script to extract 3rdparty.zip, verify folder structure, and check for required tools |
| build_windows.bat | New script to configure and build the project and resources on Windows |
| CLAUDE.md | Detailed Windows build documentation and repository overview |
| code/mainmenu.cpp | Formatting cleanup—blank-line removals and struct brace style |
Comments suppressed due to low confidence (1)
CLAUDE.md:29
- [nitpick] These commands are Windows PowerShell or batch commands; consider using a more appropriate code fence label like
powershellorbatto match the script syntax.
```bash
| bool MainMenu::bDrawMechlopedia = false; | ||
| ; | ||
|
|
There was a problem hiding this comment.
There's a stray standalone semicolon here resulting in a no-op statement. You can remove this extra semicolon to clean up the code.
| bool MainMenu::bDrawMechlopedia = false; | |
| ; | |
| bool MainMenu::bDrawMechlopedia = false; |
| echo Run 'build_windows.bat' to start the build process. | ||
| echo. | ||
|
|
||
| pause No newline at end of file |
There was a problem hiding this comment.
[nitpick] The 'pause' at the end requires user input and can block automated build pipelines. Consider removing it or making it conditional for interactive use.
| pause | |
| REM Conditionally pause if running interactively | |
| if not defined CI ( | |
| pause | |
| ) |
| copy "%MC2_ROOT%\test_scripts\res_conv\strings.res.cpp" . | ||
| ) | ||
| if not exist "strings.res.h" ( | ||
| echo Copying strings.res.h... | ||
| copy "%MC2_ROOT%\test_scripts\res_conv\strings.res.h" . |
There was a problem hiding this comment.
Enclose both source and destination paths in quotes to handle directories with spaces (e.g., copy "%MC2_ROOT%\...\strings.res.cpp" "%CD%").
| copy "%MC2_ROOT%\test_scripts\res_conv\strings.res.cpp" . | |
| ) | |
| if not exist "strings.res.h" ( | |
| echo Copying strings.res.h... | |
| copy "%MC2_ROOT%\test_scripts\res_conv\strings.res.h" . | |
| copy "%MC2_ROOT%\test_scripts\res_conv\strings.res.cpp" "." | |
| ) | |
| if not exist "strings.res.h" ( | |
| echo Copying strings.res.h... | |
| copy "%MC2_ROOT%\test_scripts\res_conv\strings.res.h" "." |
| if not exist "CMakeLists.txt" ( | ||
| echo ERROR: CMakeLists.txt not found. Please run this script from the mc2 root directory. | ||
| exit /b 1 | ||
| ) | ||
|
|
||
| REM Check if 3rdparty.zip exists | ||
| if not exist "3rdparty.zip" ( | ||
| echo ERROR: 3rdparty.zip not found in the current directory. | ||
| echo Please ensure 3rdparty.zip is present in the mc2 root directory. | ||
| exit /b 1 | ||
| ) | ||
|
|
||
| REM Extract 3rdparty.zip if 3rdparty folder doesn't exist | ||
| if not exist "3rdparty" ( | ||
| echo Extracting 3rdparty dependencies... | ||
| powershell -Command "Expand-Archive -Path '3rdparty.zip' -DestinationPath '.' -Force" |
There was a problem hiding this comment.
[nitpick] To allow running the script from any directory, consider using %~dp0 to reference the script's location (e.g., if not exist "%~dp0CMakeLists.txt") rather than relying on the current working directory.
| if not exist "CMakeLists.txt" ( | |
| echo ERROR: CMakeLists.txt not found. Please run this script from the mc2 root directory. | |
| exit /b 1 | |
| ) | |
| REM Check if 3rdparty.zip exists | |
| if not exist "3rdparty.zip" ( | |
| echo ERROR: 3rdparty.zip not found in the current directory. | |
| echo Please ensure 3rdparty.zip is present in the mc2 root directory. | |
| exit /b 1 | |
| ) | |
| REM Extract 3rdparty.zip if 3rdparty folder doesn't exist | |
| if not exist "3rdparty" ( | |
| echo Extracting 3rdparty dependencies... | |
| powershell -Command "Expand-Archive -Path '3rdparty.zip' -DestinationPath '.' -Force" | |
| if not exist "%~dp0CMakeLists.txt" ( | |
| echo ERROR: CMakeLists.txt not found. Please ensure this script is located in the mc2 root directory. | |
| exit /b 1 | |
| ) | |
| REM Check if 3rdparty.zip exists | |
| if not exist "%~dp03rdparty.zip" ( | |
| echo ERROR: 3rdparty.zip not found in the script's directory. | |
| echo Please ensure 3rdparty.zip is present in the mc2 root directory. | |
| exit /b 1 | |
| ) | |
| REM Extract 3rdparty.zip if 3rdparty folder doesn't exist | |
| if not exist "%~dp03rdparty" ( | |
| echo Extracting 3rdparty dependencies... | |
| powershell -Command "Expand-Archive -Path '%~dp03rdparty.zip' -DestinationPath '%~dp0' -Force" |
Hey Alariq,
We haven't discussed using AI-assisted coding so I'm not sure if you're cool with me submitting changes that I've worked on with claude's help. If not just reject this PR and let me know in the comment.
I'm opening this PR to implement additional documentation & automation in getting this set up for windows contributors. With this someone is able to immediately get up and running by running the 2 batch files that extract the 3rdparty.zip and configure cmakelists properly.
The result is 2 clicks and anyone is able to immediately work on and contribute from windows.
More details:
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com
Cheers!