Skip to content

Win-build-improvements#24

Open
Alexbeav wants to merge 5 commits intoalariq:masterfrom
Alexbeav:win-build-improvements
Open

Win-build-improvements#24
Alexbeav wants to merge 5 commits intoalariq:masterfrom
Alexbeav:win-build-improvements

Conversation

@Alexbeav
Copy link

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:

  • 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

Co-Authored-By: Claude noreply@anthropic.com

Cheers!

Alexbeav and others added 5 commits April 5, 2025 00:42
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>
Copilot AI review requested due to automatic review settings July 15, 2025 12:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds automation and documentation to streamline setting up and building the project on Windows.

  • Introduces setup_build_environment.bat to extract dependencies and validate the environment.
  • Adds build_windows.bat to configure and build the main application and resource DLL.
  • Provides CLAUDE.md with 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 powershell or bat to match the script syntax.
```bash

Comment on lines +53 to 55
bool MainMenu::bDrawMechlopedia = false;
;

Copy link

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a stray standalone semicolon here resulting in a no-op statement. You can remove this extra semicolon to clean up the code.

Suggested change
bool MainMenu::bDrawMechlopedia = false;
;
bool MainMenu::bDrawMechlopedia = false;

Copilot uses AI. Check for mistakes.
echo Run 'build_windows.bat' to start the build process.
echo.

pause No newline at end of file
Copy link

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Suggested change
pause
REM Conditionally pause if running interactively
if not defined CI (
pause
)

Copilot uses AI. Check for mistakes.
Comment on lines +78 to +82
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 link

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enclose both source and destination paths in quotes to handle directories with spaces (e.g., copy "%MC2_ROOT%\...\strings.res.cpp" "%CD%").

Suggested change
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" "."

Copilot uses AI. Check for mistakes.
Comment on lines +10 to +25
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"
Copy link

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Suggested change
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"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants