From 88a90fa7ac48b22539f7e780d88acf89da632ca5 Mon Sep 17 00:00:00 2001 From: dr20ervin Date: Wed, 27 May 2026 02:57:07 +0300 Subject: [PATCH] Improve build, UI, and add GitHub issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 32 +++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 +++++++++++++ .github/workflows/msbuild.yml | 8 +++++- LICENSE.txt | 2 +- src/main.cpp | 15 ++++++---- src/menu.cpp | 34 ++++++++++++++++++----- 6 files changed, 97 insertions(+), 14 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..668c9a5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: 🐛 Bug Report +about: Create a report to help us improve Pong Reloaded +title: '[BUG] ' +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '...' +3. Scroll down to '...' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Environment (please complete the following information):** +- OS: [e.g. Windows 11] +- Display Resolution: [e.g. 1920x1080] +- Graphic Settings used: [e.g. Fullscreen, VSync, 60fps] + +**Additional Context** +Add any other context about the problem here (e.g. logs from the F7 Developer Console). diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..060df91 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: ✨ Feature Request +about: Suggest an idea or enhancement for Pong Reloaded +title: '[FEATURE] ' +labels: enhancement +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 2d5a305..2b68442 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -38,4 +38,10 @@ jobs: working-directory: ${{env.GITHUB_WORKSPACE}} # Add additional options to the MSBuild command line here (like platform or verbosity level). # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference - run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} + run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=x64 ${{env.SOLUTION_FILE_PATH}} + + - name: Upload Build Artifact + uses: actions/upload-artifact@v4 + with: + name: pong-reloaded-exe + path: x64/Release/pong-reloaded.exe diff --git a/LICENSE.txt b/LICENSE.txt index 8aa2645..21329ed 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ MIT License -Copyright (c) [year] [fullname] +Copyright (c) 2026 Dr20Ervin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/main.cpp b/src/main.cpp index 0ad7aec..56de595 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,13 +3,14 @@ #include "menu.h" #include "resource.h" -constexpr const char* gameVersion = "0.9.1"; +// Application Version Metadata +constexpr const char* gameVersion = "1.0"; -// Define global colors -Color Green = Color{ 38, 185, 154, 255 }; -Color Dark_Green = Color{ 20, 160, 133, 255 }; +// Global Theme Color Configurations +Color Green = Color{ 38, 185, 154, 255 }; +Color Dark_Green = Color{ 20, 160, 133, 255 }; Color Light_Green = Color{ 129, 204, 184, 255 }; -Color Yellow = Color{ 243, 213, 91, 255 }; +Color Yellow = Color{ 243, 213, 91, 255 }; std::vector logHistory; std::mutex logMutex; @@ -184,10 +185,14 @@ int main() { case GameState::MainMenu: { mainMenu.Draw(); + + // Render navigation controls hint int menuHintWidth = MeasureText("Use UP/DOWN to navigate | ENTER to select", 20); DrawText("Use UP/DOWN to navigate | ENTER to select", screen_width / 2 - menuHintWidth / 2, screen_height - 80, 20, WHITE); + + // Render version string in bottom-left corner DrawText(TextFormat("v%s", gameVersion), 20, screen_height - 40, 20, LIGHTGRAY); break; } diff --git a/src/menu.cpp b/src/menu.cpp index 4d0df02..7812106 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -24,12 +24,28 @@ void Menu::Draw() { int screenWidth = GetScreenWidth(); int screenHeight = GetScreenHeight(); - // Menu title and elements rendering - DrawText(title.c_str(), screenWidth / 2 - MeasureText(title.c_str(), 60) / 2, screenHeight / 4, 60, WHITE); + // Render Menu Title (aligned down for balanced spacing) + DrawText(title.c_str(), screenWidth / 2 - MeasureText(title.c_str(), 60) / 2, screenHeight / 4 + 20, 60, WHITE); - for (int i = 0; i < static_cast(options.size()); i++) { + int numOptions = static_cast(options.size()); + int spacing = 60; + + // Isolate "Back" buttons at the bottom; group all other menu items in the center + bool separateLast = (!options.empty() && options.back() == "Back"); + int groupCount = separateLast ? (numOptions - 1) : numOptions; + + // Center grouped options vertically + int startY = (screenHeight / 2) - (((groupCount - 1) * spacing) / 2); + + for (int i = 0; i < numOptions; i++) { Color textColor = (i == selectedIndex) ? YELLOW : WHITE; - DrawText(options[i].c_str(), screenWidth / 2 - MeasureText(options[i].c_str(), 40) / 2, screenHeight / 2 + (i * 60), 40, textColor); + if (separateLast && i == numOptions - 1) { + // Render separated "Back" action button at the bottom of the screen + DrawText(options[i].c_str(), screenWidth / 2 - MeasureText(options[i].c_str(), 40) / 2, screenHeight - 120, 40, textColor); + } else { + // Render standard grouped options in the center + DrawText(options[i].c_str(), screenWidth / 2 - MeasureText(options[i].c_str(), 40) / 2, startY + (i * spacing), 40, textColor); + } } } @@ -195,7 +211,7 @@ void UpdateSettingsState(GameContext& ctx, Ball& ball, Paddle& player, CpuPaddle void DrawSettingsState(const GameContext& ctx, int screenWidth, int screenHeight) { int titleWidth = MeasureText("SETTINGS", 60); - DrawText("SETTINGS", screenWidth / 2 - titleWidth / 2, screenHeight / 4 - 40, 60, WHITE); + DrawText("SETTINGS", screenWidth / 2 - titleWidth / 2, screenHeight / 4 + 20, 60, WHITE); // Option labels formatting std::string resStr = "Resolution: "; @@ -247,7 +263,8 @@ void DrawSettingsState(const GameContext& ctx, int screenWidth, int screenHeight Color paddleColor = (ctx.config.selectedSettingLine == 7) ? YELLOW : WHITE; Color backColor = (ctx.config.selectedSettingLine == 8) ? YELLOW : WHITE; - int startY = screenHeight / 2 - 80; + // Render settings toggles centered in the middle of the screen + int startY = 300; DrawText(resStr.c_str(), screenWidth / 2 - MeasureText(resStr.c_str(), 30) / 2, startY, 30, resColor); DrawText(fpsStr.c_str(), screenWidth / 2 - MeasureText(fpsStr.c_str(), 30) / 2, startY + 40, 30, fpsColor); DrawText(modeStr.c_str(), screenWidth / 2 - MeasureText(modeStr.c_str(), 30) / 2, startY + 80, 30, modeColor); @@ -256,8 +273,11 @@ void DrawSettingsState(const GameContext& ctx, int screenWidth, int screenHeight DrawText(spaceThemeStr.c_str(), screenWidth / 2 - MeasureText(spaceThemeStr.c_str(), 30) / 2, startY + 200, 30, spaceColor); DrawText(ballThemeStr.c_str(), screenWidth / 2 - MeasureText(ballThemeStr.c_str(), 30) / 2, startY + 240, 30, ballColor); DrawText(paddleThemeStr.c_str(), screenWidth / 2 - MeasureText(paddleThemeStr.c_str(), 30) / 2, startY + 280, 30, paddleColor); - DrawText("Back", screenWidth / 2 - MeasureText("Back", 30) / 2, startY + 320, 30, backColor); + // Render separated "Back" action button at the bottom of the screen + DrawText("Back", screenWidth / 2 - MeasureText("Back", 30) / 2, screenHeight - 120, 30, backColor); + + // Render bottom hint for settings controls int settingsHintWidth = MeasureText("UP/DOWN to navigate | LEFT/RIGHT to change settings | ENTER to select", 20); DrawText("UP/DOWN to navigate | LEFT/RIGHT to change settings | ENTER to select", screenWidth / 2 - settingsHintWidth / 2,