diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..cc23192 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +* text=auto eol=lf +*.bat text eol=crlf diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..b32be23 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,39 @@ +# SPDX-License-Identifier: GPL-3.0-only +name: Bug report +description: Report a reproducible OpenBMH problem. +body: + - type: markdown + attributes: + value: "Do not attach original game files, saves, screenshots, recordings or logs containing game text or personal information. Describe the problem in your own words." + - type: input + id: version + attributes: + label: OpenBMH version or commit + validations: + required: true + - type: input + id: platform + attributes: + label: Operating system and architecture + validations: + required: true + - type: input + id: edition + attributes: + label: Game edition and version + description: "Edition name only; do not upload its files." + validations: + required: true + - type: textarea + id: steps + attributes: + label: Steps to reproduce + description: "Include relevant settings or console commands, with private paths removed." + validations: + required: true + - type: textarea + id: behavior + attributes: + label: Expected and actual behavior + validations: + required: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f0484a1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,99 @@ +# SPDX-License-Identifier: GPL-3.0-only +name: Build without game data + +on: + push: + branches: [main, assist/codex-0.2-launcher] + pull_request: + workflow_dispatch: + workflow_call: + +permissions: + contents: read + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: + - runner: ubuntu-24.04 + platform: linux-x64 + - runner: windows-2022 + platform: windows-x64 + - runner: macos-14 + platform: macos-arm64 + runs-on: ${{ matrix.runner }} + timeout-minutes: 90 + env: + SDL_VIDEODRIVER: dummy + SDL_AUDIODRIVER: dummy + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + fetch-depth: 0 + - name: Install Linux build dependencies + if: runner.os == 'Linux' + run: sudo apt-get update && sudo apt-get install -y build-essential git cmake ninja-build pkg-config libgtk-3-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxfixes-dev libxss-dev libasound2-dev libpulse-dev libgl1-mesa-dev libudev-dev + - name: Verify source export + run: python3 tools/public_release/check_public_tree.py --root . --history --revision HEAD + - name: Set up MSVC x64 + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@a102174a2b586eec2ea151a69e6fd14404a8ce7c # v1.13.0 + with: + arch: x64 + - name: Configure Windows x64 + if: runner.os == 'Windows' + run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBMH_DATA= -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + - name: Configure Linux + if: runner.os == 'Linux' + run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBMH_DATA= -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSDL_ALSA=ON -DSDL_PULSEAUDIO=ON -DSDL_X11=ON + - name: Verify Linux audio and video backends + if: runner.os == 'Linux' + shell: python + run: | + import pathlib, re + required = ['SDL_AUDIO_DRIVER_ALSA', 'SDL_AUDIO_DRIVER_PULSEAUDIO', 'SDL_VIDEO_DRIVER_X11'] + headers = list(pathlib.Path('build/_deps/sdl2-build').rglob('SDL_config.h')) + assert any(all(re.search(r'^#define\s+' + macro + r'\s+1\s*$', p.read_text(), re.M) for macro in required) for p in headers), 'ALSA/PulseAudio/X11 were not configured into SDL' + - name: Configure macOS arm64 + if: runner.os == 'macOS' + run: | + test "$(uname -m)" = arm64 + cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DBMH_DATA= -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + - name: Build every target + run: cmake --build build --config Release --parallel 2 + - name: Run synthetic tests and report data tests as skipped + run: ctest --test-dir build -C Release --output-on-failure --output-junit test-results.xml + - name: Windows Server launcher with WARP software graphics + if: runner.os == 'Windows' + env: + SDL_VIDEODRIVER: windows + OPENBMH_RML_DRIVER: warp + run: build/launcher_gui_smoke.exe + - name: Package products and licenses + run: python3 tools/package/make_package.py --build build --out dist --platform ${{ matrix.platform }} + - name: Package corresponding source and pinned dependencies + if: runner.os == 'Linux' + run: python3 tools/package/make_source_package.py --source . --build build --out source-dist + - name: Upload corresponding source + if: runner.os == 'Linux' + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: OpenBMH-source + path: source-dist/*.zip + if-no-files-found: error + - name: Upload package + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: OpenBMH-${{ matrix.platform }} + path: dist/*.zip + if-no-files-found: error + - name: Upload test report + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: tests-${{ matrix.platform }} + path: build/test-results.xml + if-no-files-found: warn diff --git a/.github/workflows/editor.yml b/.github/workflows/editor.yml new file mode 100644 index 0000000..c839fb8 --- /dev/null +++ b/.github/workflows/editor.yml @@ -0,0 +1,127 @@ +# SPDX-License-Identifier: GPL-3.0-only +name: OBW Editor +on: + push: + branches: [main, feat/obw-editor-poc] + tags: ['editor-v*'] + workflow_dispatch: +permissions: + contents: read +concurrency: + group: obw-editor-${{ github.ref }} + cancel-in-progress: true +jobs: + editor: + strategy: + fail-fast: false + matrix: + include: + - runner: ubuntu-24.04 + platform: linux-x64 + - runner: windows-2022 + platform: windows-x64 + - runner: macos-14 + platform: macos-arm64 + runs-on: ${{ matrix.runner }} + timeout-minutes: 45 + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + with: + fetch-depth: 0 + persist-credentials: false + - name: Check public sources + run: python3 tools/public_release/check_public_tree.py --root . --history --revision HEAD + - name: Existing package boundaries + if: runner.os == 'Linux' + run: python3 tests/package_tests.py + - name: Linux dependencies + if: runner.os == 'Linux' + run: sudo apt-get update && sudo apt-get install -y ninja-build pkg-config libgtk-3-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxfixes-dev libxss-dev libgl1-mesa-dev xvfb xauth xdotool + - name: MSVC x64 + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@a102174a2b586eec2ea151a69e6fd14404a8ce7c + with: + arch: x64 + - name: Configure + shell: bash + run: | + args=() + if [[ "$RUNNER_OS" == "macOS" ]]; then args+=(-DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0); fi + cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DOPENBMH_BUILD_EDITOR=ON -DBMH_DATA= "${args[@]}" + - name: Check portable Windows WebP instructions + if: runner.os == 'Windows' + shell: python + run: | + import json, pathlib, re + commands = json.loads(pathlib.Path('build/compile_commands.json').read_text()) + simd = [c for c in commands if 'libwebp' in c['file'] and re.search(r'_sse(?:2|41)\.c$', c['file'])] + assert simd, 'No WebP runtime-dispatched SIMD sources found' + assert all(not re.search(r'/arch:AVX', c['command'], re.I) for c in simd), 'WebP SSE paths must run without AVX' + print('WebP SSE paths retain the Windows x64 baseline and runtime CPU detection') + - name: Build editor and synthetic tests + run: cmake --build build --target openbmh_editor launcher_gui_smoke editor_core_tests editor_comparison_tests editor_regulations_tests --parallel 2 + - name: Native editor core and MCP tests + run: ctest --test-dir build -C Release -R "^editor_(core_tests|comparison_tests|regulations_tests|version)$" --output-on-failure --output-junit editor-tests.xml + - name: Linux native GUI smoke + if: runner.os == 'Linux' + run: | + xvfb-run -a -s '-screen 0 1600x1000x24' python3 tests/editor_gui_smoke.py build/OpenBMHEditor + xvfb-run -a -s '-screen 0 1600x1000x24' build/OpenBMHEditor --demo --page players --settings build/test-options.json --screenshot build/editor.png --quit-after-ms 1800 + xvfb-run -a -s '-screen 0 1600x1000x24' python3 tests/editor_startup_smoke.py build/OpenBMHEditor --launcher build/launcher_gui_smoke + - name: Windows Server native GUI and WARP fallback + if: runner.os == 'Windows' + run: python3 tests/editor_startup_smoke.py build/OpenBMHEditor.exe --launcher build/launcher_gui_smoke.exe + - name: Package editor + shell: bash + run: | + args=() + if [[ "$RUNNER_OS" == "Linux" ]]; then args+=(--source-package); fi + python3 tools/package/make_editor_package.py --build build --out dist --platform ${{ matrix.platform }} "${args[@]}" + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 + with: + name: OpenBMHEditor-${{ matrix.platform }} + path: dist/*.zip + if-no-files-found: error + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 + if: always() + with: + name: editor-checks-${{ matrix.platform }} + path: | + build/editor-tests.xml + build/editor.png + release: + if: startsWith(github.ref, 'refs/tags/editor-v') + needs: editor + runs-on: ubuntu-24.04 + permissions: + contents: write + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + with: + persist-credentials: false + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 + with: + pattern: OpenBMHEditor-* + path: dist + merge-multiple: true + - name: Prepare editor release for review + shell: python + env: + GH_TOKEN: ${{ github.token }} + RELEASE_TAG: ${{ github.ref_name }} + run: | + import os, pathlib, re, subprocess + tag = os.environ['RELEASE_TAG'] + match = re.fullmatch(r'editor-v([0-9]+)\.([0-9]+)\.[0-9]+', tag) + if not match: + raise SystemExit('Invalid editor release tag') + version = tag.removeprefix('editor-v') + notes = pathlib.Path('docs/release') / ('editor-' + match[1] + '.' + match[2]) / 'RELEASE_NOTES.md' + packages = sorted(pathlib.Path('dist').glob('*.zip')) + expected = {'OpenBMHEditor-' + version + '-' + kind + '.zip' + for kind in ('windows-x64', 'linux-x64', 'macos-arm64', 'source')} + if {p.name for p in packages} != expected or not notes.is_file(): + raise SystemExit('Missing or mismatched editor release files') + subprocess.run(['gh', 'release', 'create', tag, *map(str, packages), '--draft', + '--verify-tag', '--title', 'OpenBMH Editor ' + version, + '--notes-file', str(notes)], check=True) diff --git a/.github/workflows/modern-engine.yml b/.github/workflows/modern-engine.yml new file mode 100644 index 0000000..04a2915 --- /dev/null +++ b/.github/workflows/modern-engine.yml @@ -0,0 +1,66 @@ +# SPDX-License-Identifier: GPL-3.0-only +# Builds the Modern season core, its console and the data-free Modern engine tests on all +# three platforms (docs/new_engine). The game data tests stay local. +name: Modern engine +on: + push: + branches: ['0.3'] + paths: + - 'src/modern/game/**' + - 'src/modern/content/**' + - 'src/modern/app/**' + - 'src/game/**' + - 'src/app/**' + - 'src/formats/**' + - 'tests/modern_*' + - 'CMakeLists.txt' + - '.github/workflows/modern-engine.yml' + pull_request: + paths: + - 'src/modern/game/**' + - 'src/modern/content/**' + - 'src/modern/app/**' + - 'tests/modern_*' + - '.github/workflows/modern-engine.yml' + workflow_dispatch: +permissions: + contents: read +concurrency: + group: modern-engine-${{ github.ref }} + cancel-in-progress: true +jobs: + engine: + strategy: + fail-fast: false + matrix: + os: [ubuntu-24.04, windows-2022, macos-14] + runs-on: ${{ matrix.os }} + timeout-minutes: 60 + env: + SDL_VIDEODRIVER: dummy + SDL_AUDIODRIVER: dummy + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Install Linux dependencies + if: runner.os == 'Linux' + run: sudo apt-get update && sudo apt-get install -y build-essential git cmake ninja-build pkg-config libgtk-3-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxfixes-dev libxss-dev libasound2-dev libpulse-dev libgl1-mesa-dev libudev-dev + - name: Set up MSVC + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@a102174a2b586eec2ea151a69e6fd14404a8ce7c # v1.13.0 + with: + arch: x64 + - name: Configure without game data + run: cmake -S . -B build-engine -G Ninja -DCMAKE_BUILD_TYPE=Release -DOPENBMH_BUILD_EDITOR=OFF -DBMH_DATA= + - name: Compile the Modern console, simulator and engine tests + run: cmake --build build-engine --target openbmh_modern_cli modern_season_sim modern_world_info modern_camp_tests modern_almanac_tests modern_toto_tests modern_calendar_tests modern_traffic_tests --parallel 2 + - name: Run the data-free Modern engine tests + run: ctest --test-dir build-engine -R "^modern_(camp|almanac|toto|calendar|traffic)_tests$" --output-on-failure --output-junit modern-engine-results.xml + - name: Upload test report + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: modern-engine-tests-${{ matrix.os }} + path: build-engine/modern-engine-results.xml + if-no-files-found: warn diff --git a/.github/workflows/modern-ui.yml b/.github/workflows/modern-ui.yml new file mode 100644 index 0000000..f75c736 --- /dev/null +++ b/.github/workflows/modern-ui.yml @@ -0,0 +1,64 @@ +# SPDX-License-Identifier: GPL-3.0-only +name: Modern UI controls +on: + push: + branches: ['0.3'] + paths: + - 'src/modern/ui/**' + - 'assets/modern/**' + - 'src/launch/rml_*' + - 'src/editor/archive.*' + - 'src/editor/images.*' + - 'src/editor/CMakeLists.txt' + - 'tests/modern_*' + - 'CMakeLists.txt' + - '.github/workflows/modern-ui.yml' + pull_request: + paths: + - 'src/modern/ui/**' + - 'assets/modern/**' + - 'tests/modern_*' + - 'CMakeLists.txt' + - '.github/workflows/modern-ui.yml' + workflow_dispatch: +permissions: + contents: read +concurrency: + group: modern-ui-${{ github.ref }} + cancel-in-progress: true +jobs: + controls: + strategy: + fail-fast: false + matrix: + os: [ubuntu-24.04, windows-2022, macos-14] + runs-on: ${{ matrix.os }} + timeout-minutes: 60 + env: + SDL_VIDEODRIVER: dummy + SDL_AUDIODRIVER: dummy + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Install Linux dependencies + if: runner.os == 'Linux' + run: sudo apt-get update && sudo apt-get install -y build-essential git cmake ninja-build pkg-config libgtk-3-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxfixes-dev libxss-dev libasound2-dev libpulse-dev libgl1-mesa-dev libudev-dev + - name: Set up MSVC + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@a102174a2b586eec2ea151a69e6fd14404a8ce7c # v1.13.0 + with: + arch: x64 + - name: Configure opt-in UI without external assets + run: cmake -S . -B build-ui -G Ninja -DCMAKE_BUILD_TYPE=Release -DOPENBMH_BUILD_MODERN_UI=ON -DOPENBMH_BUILD_EDITOR=OFF -DBMH_DATA= + - name: Compile native frontend and synthetic checks + run: cmake --build build-ui --target openbmh_play modern_ui_core_tests modern_ticket_document_tests modern_control_layout_tests modern_reports_tests modern_planning_tests modern_almanac_ui_tests modern_finance_ui_tests modern_environment_ui_tests modern_advertising_ui_tests modern_toto_ui_tests modern_lineup_ui_tests modern_transfer_ui_tests modern_career_reports_tests modern_rankings_tests modern_career_files_tests modern_statistics_projection_tests modern_toto_projection_tests modern_toto_quote_tests modern_stadium_ui_tests modern_stadium_projection_tests modern_statistics_ui_tests modern_news_ui_tests modern_settings_ui_tests modern_desktop_ui_tests modern_files_ui_tests modern_mods_ui_tests modern_entry_ui_tests modern_opening_ui_tests modern_select_menu_tests modern_career_ui_tests modern_live_ui_tests modern_national_ui_tests modern_news_catalog_tests modern_post_match_ui_tests modern_engine_dto_tests modern_report_read_tests modern_other_read_tests modern_rankings_read_tests modern_winners_read_tests modern_manager_presentation_tests modern_coach_identity_tests modern_transfer_read_tests modern_transfer_projection_tests modern_achievements_projection_tests modern_news_projection_tests modern_balance_projection_tests modern_widgets_projection_tests modern_indoor_projection_tests modern_settings_projection_tests modern_managers_projection_tests --parallel 2 + - name: Check controls, fonts, density and draft cancellation + run: ctest --test-dir build-ui -R "^modern_(ui_|ticket_|control_|reports_|planning_|almanac_ui_|finance_ui_|environment_ui_|advertising_ui_|toto_ui_|lineup_ui_|transfer_ui_|career_reports_|rankings_|stadium_ui_|statistics_ui_|news_ui_|settings_ui_|desktop_ui_|files_ui_|mods_ui_|entry_ui_|opening_ui_|select_menu_|career_ui_|live_ui_|national_ui_|news_catalog_|post_match_ui_|engine_dto_|report_read_|career_files_|statistics_projection_|toto_projection_|toto_quote_|stadium_projection_|transfer_projection_|transfer_read_|achievements_projection_|news_projection_|balance_projection_|widgets_projection_|indoor_projection_|settings_projection_|managers_projection_|other_read_|winners_read_|manager_presentation_|coach_identity_)" -LE external-data --output-on-failure --output-junit modern-ui-results.xml + - name: Upload test report + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: modern-ui-tests-${{ matrix.os }} + path: build-ui/modern-ui-results.xml + if-no-files-found: warn diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..39c9bb1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: GPL-3.0-only +name: Prepare release packages + +on: + push: + tags: ['v*'] + +permissions: + contents: read + +jobs: + build: + uses: ./.github/workflows/ci.yml + draft: + needs: build + runs-on: ubuntu-24.04 + permissions: + contents: write + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + fetch-depth: 0 + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + with: + pattern: OpenBMH-* + path: dist + merge-multiple: true + - name: Create draft for review + shell: python + env: + GH_TOKEN: ${{ github.token }} + RELEASE_TAG: ${{ github.ref_name }} + run: | + import os, pathlib, re, subprocess + tag = os.environ['RELEASE_TAG'] + match = re.fullmatch(r'v([0-9]+)\.([0-9]+)\.[0-9]+(?:[-+][A-Za-z0-9.-]+)?', tag) + if not match: + raise SystemExit('Invalid release tag') + notes = pathlib.Path('docs/release') / (match[1] + '.' + match[2]) / 'RELEASE_NOTES.md' + packages = sorted(pathlib.Path('dist').glob('*.zip')) + expected = {'OpenBMH-' + tag[1:] + '-' + kind + '.zip' + for kind in ('windows-x64', 'linux-x64', 'macos-arm64', 'source')} + if {p.name for p in packages} != expected: + raise SystemExit('Missing, unexpected or mismatched release package') + if not notes.is_file(): + raise SystemExit('Release notes missing for ' + tag) + subprocess.run(['gh', 'release', 'create', tag, *map(str, packages), '--draft', + '--verify-tag', '--title', 'OpenBMH ' + tag, '--notes-file', str(notes)], check=True) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ef7bed4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,43 @@ +# Game installations, saves, captures and local reference data stay external. +/game-data/ +/reference-data/ +/local-data/ +*.FBM +*.fbm +*.VGA +*.vga +*.BLK +*.blk +*.COL +*.col +*.LBM +*.lbm +*.FNT +*.fnt +*.WAP +*.wap +*.wav +*.avi + +# Build output and platform tooling. +/build*/ +/out/ +/dist/ +/_deps/ +/.cache/ +/.vs/ +*.exe +*.EXE +*.dll +*.dylib +*.so +*.o +*.obj +*.a +*.lib +*.pdb +*.zip +*.7z +*.dmg +__pycache__/ +.DS_Store diff --git a/ACKNOWLEDGEMENTS.md b/ACKNOWLEDGEMENTS.md new file mode 100644 index 0000000..252b4c1 --- /dev/null +++ b/ACKNOWLEDGEMENTS.md @@ -0,0 +1,11 @@ +# Acknowledgements + +OpenBMH recognises the programmers, artists, musicians, designers and other contributors who created *Bundesliga Manager Hattrick* and *Football Limited*. Their work is the reason this reconstruction exists. The credits in the original games remain the authoritative record of their contributors. + +The *Bundesliga Manager Hattrick* credits name Werner Krahe and Jens Onnen among the original contributors. We thank them and the wider teams behind both games. + +Thanks also to the player and fan-edition communities for preserving knowledge of these games, documenting their behaviour and keeping interest in football management games alive. + +The project benefits from the work of the SDL, miniz, LZMA SDK, nativefiledialog-extended and Nuked OPL3 contributors, and from development tools including Ghidra, DOSBox, CMake and Ninja. Dependency copyrights and license terms are recorded in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). + +Acknowledgement does not imply sponsorship, affiliation or endorsement. Original games and third-party projects retain their own rights and identities. diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..8500169 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,18 @@ +# Working on Dreierpack Manager + +Start with [README.md](README.md), [CONTRIBUTING.md](CONTRIBUTING.md) and [docs/architecture.md](docs/architecture.md). Use [docs/CONSOLE_CLIENTS.md](docs/CONSOLE_CLIENTS.md) when writing clients that operate the game. + +## Boundaries + +- This repository distributes implementation and documentation, not original game content. Do not add original executables, saves, graphics, audio, manuals, text inventories or decompiled output. +- Use synthetic fixtures for public tests. Read a locally supplied game installation only through documented configuration such as `BMH_DATA`; do not bake a developer's filesystem path into code or docs. +- Work within the requested scope. Check existing changes and coordinate shared-file edits. Do not overwrite another contributor's work. +- Do not publish releases, push branches or contact external services unless the task authorises it. + +## Code and tests + +Keep rules in `src/game`, file readers in `src/formats` and session ownership/rollback in `src/app`. Reuse shared actions from graphical and console frontends. Preserve deterministic random streams, save layout and revision/manager checks. Errors need explicit outcomes; do not invent a gameplay fallback for an unsupported path. + +Use semantic identifiers and English comments. Document deliberate compatibility changes. Run checks appropriate to the actual change and report their outcome and limits; do not claim unexecuted platform or runtime tests. Keep generated builds outside tracked source files. + +OpenBMH-owned changes use GPL-3.0-only. Third-party notices and full license texts must remain intact, including attribution within upstream license files. Report licensing questions to the maintainers instead of rewriting vendor notices. diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..01c67ee --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,1285 @@ +# SPDX-License-Identifier: GPL-3.0-only +cmake_minimum_required(VERSION 3.24) +project(OpenBMH VERSION 0.2.1 LANGUAGES CXX C) +if(APPLE) + enable_language(OBJC OBJCXX) + set(CMAKE_OBJCXX_STANDARD 20) + set(CMAKE_OBJCXX_STANDARD_REQUIRED ON) +endif() +# the one place of the version: --version of both programs and the window title (src/version.hpp) +add_compile_definitions(OPENBMH_VERSION="${PROJECT_VERSION}") + +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +set(BMH_DATA "" CACHE PATH "Optional directory containing externally supplied game data") +set(BMH_REFERENCE "" CACHE PATH "Optional directory containing externally supplied reference inputs") +set(BMH_TEST_INPUTS "" CACHE PATH "Optional directory containing external integration-test inputs") +if(BMH_DATA AND NOT IS_DIRECTORY "${BMH_DATA}") + message(FATAL_ERROR "BMH_DATA was set but is not an existing directory: ${BMH_DATA}") +endif() +if(BMH_DATA) + file(GLOB data_entries "${BMH_DATA}/*") + set(has_game_executable FALSE) + foreach(entry IN LISTS data_entries) + get_filename_component(filename "${entry}" NAME) + string(TOLOWER "${filename}" filename) + if(filename STREQUAL "bmh.exe" OR filename STREQUAL "fltd.exe") + set(has_game_executable TRUE) + endif() + endforeach() + if(NOT has_game_executable) + message(FATAL_ERROR "BMH_DATA does not contain a game executable: ${BMH_DATA}") + endif() +endif() +add_executable(openbmh_test_skip tests/skip_test.cpp) + +# Keep data-dependent tests visible without distributing their inputs. Missing +# optional inputs are reported as skipped, never as successful assertions. +function(bmh_add_data_test) + cmake_parse_arguments(T "NO_GAME_DATA" "NAME;DATA_DIR" "COMMAND;REQUIRED_OPTIONS;REQUIRED_FILES" ${ARGN}) + if("DATA_DIR" IN_LIST T_KEYWORDS_MISSING_VALUES) + set(T_DATA_DIR "") + elseif(NOT DEFINED T_DATA_DIR) + set(T_DATA_DIR "${BMH_DATA}") + endif() + set(reason "") + set(external_text_tests season_transition_tests cli_console_tests + ui_desktop_tests ui_lineup_tests format_tests app_controller_tests bank_app_tests + cli_soak ui_cup_draw_tests league_pairings_tests ui_pending_offer_tests + reality_reporter_layout_tests season_cup_draw_app_tests + ui_team_statistics_source_oracle_tests transfer_bid_qualification_tests + ui_achievements_tests ui_analytics_tests ui_opportunities_tests + ui_outgoing_transfer_tests ui_season_entrants_tests ui_statistics_rankings_tests) + if(T_NAME IN_LIST external_text_tests) + list(APPEND T_REQUIRED_OPTIONS BMH_TEST_INPUTS) + list(APPEND T_REQUIRED_FILES expected-text.tsv) + endif() + if(T_NAME STREQUAL "format_tests" AND BMH_REFERENCE) + list(APPEND T_REQUIRED_OPTIONS BMH_REFERENCE) + list(APPEND T_REQUIRED_FILES format-matches.tsv format-team-values.tsv) + endif() + if(T_NO_GAME_DATA) + # This test needs only its explicit reference file, not an installation. + elseif(NOT T_DATA_DIR) + set(reason "External game data not configured") + elseif(NOT IS_DIRECTORY "${T_DATA_DIR}") + message(FATAL_ERROR "Invalid game data directory for ${T_NAME}: ${T_DATA_DIR}") + endif() + foreach(option IN LISTS T_REQUIRED_OPTIONS) + if("${${option}}" STREQUAL "" OR NOT EXISTS "${${option}}") + set(reason "External test input not supplied: ${option}") + endif() + endforeach() + foreach(file IN LISTS T_REQUIRED_FILES) + if(NOT BMH_TEST_INPUTS OR NOT EXISTS "${BMH_TEST_INPUTS}/${file}") + set(reason "External integration input missing: ${file}") + endif() + endforeach() + if(reason) + add_test(NAME ${T_NAME} COMMAND openbmh_test_skip "${reason}") + else() + add_test(NAME ${T_NAME} COMMAND ${T_COMMAND}) + if(BMH_TEST_INPUTS) + set_property(TEST ${T_NAME} APPEND PROPERTY ENVIRONMENT "OPENBMH_TEST_INPUTS=${BMH_TEST_INPUTS}") + endif() + endif() + set_tests_properties(${T_NAME} PROPERTIES SKIP_RETURN_CODE 77 LABELS "external-data") +endfunction() + +find_package(Python3 COMPONENTS Interpreter QUIET) + +# Windows gives a thread 1 MB of stack (Linux 8 MB). Release builds inline the many test +# functions of an app test into main(), whose frame then holds several CareerSession +# objects and GameState checkpoints at once - over 1 MB, a stack overflow (0xC00000FD) at +# entry. 16 MB for every program built here, as on the other platforms. +if(MSVC) + add_link_options(/STACK:16777216) +endif() + +option(BMH_USE_SYSTEM_SDL2 "Use an installed SDL2 instead of fetching the pinned release" OFF) +if(BMH_USE_SYSTEM_SDL2) + find_package(SDL2 REQUIRED CONFIG) + set(BMH_SDL_TARGET SDL2::SDL2) +else() +include(FetchContent) +set(SDL_SHARED OFF CACHE BOOL "" FORCE) +set(SDL_STATIC ON CACHE BOOL "" FORCE) +set(SDL_TEST OFF CACHE BOOL "" FORCE) +FetchContent_Declare(SDL2 + GIT_REPOSITORY https://github.com/libsdl-org/SDL.git + GIT_TAG release-2.32.10 + GIT_SHALLOW TRUE) +FetchContent_MakeAvailable(SDL2) +set(BMH_SDL_TARGET SDL2::SDL2-static) +endif() + +# SDL2 renames main when SDL.h is included. Link SDL2main before SDL2 for +# every executable that consumes SDL, when the selected SDL package provides it. +if(TARGET SDL2::SDL2main) + list(PREPEND BMH_SDL_TARGET SDL2::SDL2main) +endif() + +# App sources share objects only within identical compile environments. +# MSVC consumers currently differ in target/source /utf-8 flags; keep that path. +set(BMH_APP_SESSION_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/src/app/career_session.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/src/app/window_actions.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/src/app/desktop_actions.cpp") +set(BMH_APP_SESSION_SDL_SOURCE "${BMH_APP_SESSION_SOURCE}") +set(BMH_APP_CONTROLLER_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/src/app/controller.cpp") +if(NOT MSVC) + add_library(bmh_app_session OBJECT src/app/career_session.cpp src/app/window_actions.cpp src/app/desktop_actions.cpp) + target_link_libraries(bmh_app_session PRIVATE bmhui) + add_library(bmh_app_session_sdl OBJECT src/app/career_session.cpp src/app/window_actions.cpp src/app/desktop_actions.cpp) + target_link_libraries(bmh_app_session_sdl PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) + add_library(bmh_app_controller_sdl OBJECT src/app/controller.cpp) + target_link_libraries(bmh_app_controller_sdl PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) + set(BMH_APP_SESSION_SOURCE "$") + set(BMH_APP_SESSION_SDL_SOURCE "$") + set(BMH_APP_CONTROLLER_SOURCE "$") +endif() + +# (before the first subdirectory: tests added there are only registered once testing is on) +enable_testing() +if(Python3_Interpreter_FOUND) + add_test(NAME public_source_guard COMMAND ${Python3_EXECUTABLE} + "${CMAKE_SOURCE_DIR}/tools/public_release/check_public_tree.py" --root "${CMAKE_SOURCE_DIR}") + add_test(NAME public_source_guard_tests COMMAND ${Python3_EXECUTABLE} + "${CMAKE_SOURCE_DIR}/tools/public_release/test_public_tree.py") + add_test(NAME package_allowlist_tests COMMAND ${Python3_EXECUTABLE} + "${CMAKE_SOURCE_DIR}/tests/package_tests.py") + add_test(NAME cli_concept_tests COMMAND ${Python3_EXECUTABLE} + "${CMAKE_SOURCE_DIR}/tools/cli_concept/check_concept.py" --root "${CMAKE_SOURCE_DIR}") + add_test(NAME documented_differences_tests COMMAND ${Python3_EXECUTABLE} + "${CMAKE_SOURCE_DIR}/tools/public_release/collect_differences.py" --root "${CMAKE_SOURCE_DIR}" --check) +endif() +add_subdirectory(src/audio) + +add_executable(season_end_desk_tests tests/season_end_desk_tests.cpp ${BMH_APP_SESSION_SOURCE}) +add_executable(national_pending_match_tests tests/national_pending_match_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(national_pending_match_tests PRIVATE bmhui) +set(BMH_TEST_NATIONAL_PENDING_MATCH_TESTS_INPUT_1 "" CACHE PATH "External input 1 for national_pending_match_tests; not distributed") +set(BMH_TEST_NATIONAL_PENDING_MATCH_TESTS_INPUT_2 "" CACHE PATH "External input 2 for national_pending_match_tests; not distributed") +bmh_add_data_test(NAME national_pending_match_tests REQUIRED_OPTIONS BMH_TEST_NATIONAL_PENDING_MATCH_TESTS_INPUT_1 BMH_TEST_NATIONAL_PENDING_MATCH_TESTS_INPUT_2 COMMAND national_pending_match_tests "${BMH_DATA}" + "${BMH_TEST_NATIONAL_PENDING_MATCH_TESTS_INPUT_1}" + "${BMH_TEST_NATIONAL_PENDING_MATCH_TESTS_INPUT_2}") +target_link_libraries(season_end_desk_tests PRIVATE bmhui) +set(BMH_TEST_SEASON_END_DESK_TESTS_INPUT_1 "" CACHE PATH "External input 1 for season_end_desk_tests; not distributed") +bmh_add_data_test(NAME season_end_desk_tests REQUIRED_OPTIONS BMH_TEST_SEASON_END_DESK_TESTS_INPUT_1 COMMAND season_end_desk_tests "${BMH_DATA}" + "${BMH_TEST_SEASON_END_DESK_TESTS_INPUT_1}") + +add_executable(season_transition_tests tests/season_transition_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(season_transition_tests PRIVATE bmhui) +set(BMH_TEST_SEASON_TRANSITION_TESTS_INPUT_1 "" CACHE PATH "External input 1 for season_transition_tests; not distributed") +bmh_add_data_test(NAME season_transition_tests REQUIRED_OPTIONS BMH_TEST_SEASON_TRANSITION_TESTS_INPUT_1 COMMAND season_transition_tests "${BMH_DATA}" + "${BMH_TEST_SEASON_TRANSITION_TESTS_INPUT_1}") + +add_executable(indoor_masters_transition_tests tests/indoor_masters_transition_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(indoor_masters_transition_tests PRIVATE bmhui) +set(BMH_TEST_INDOOR_MASTERS_TRANSITION_TESTS_INPUT_1 "" CACHE PATH "External input 1 for indoor_masters_transition_tests; not distributed") +bmh_add_data_test(NAME indoor_masters_transition_tests REQUIRED_OPTIONS BMH_TEST_INDOOR_MASTERS_TRANSITION_TESTS_INPUT_1 COMMAND indoor_masters_transition_tests "${BMH_DATA}" + "${BMH_TEST_INDOOR_MASTERS_TRANSITION_TESTS_INPUT_1}") + +add_executable(national_cycle_transition_tests tests/national_cycle_transition_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(national_cycle_transition_tests PRIVATE bmhui) +set(BMH_TEST_NATIONAL_CYCLE_TRANSITION_TESTS_INPUT_1 "" CACHE PATH "External input 1 for national_cycle_transition_tests; not distributed") +bmh_add_data_test(NAME national_cycle_transition_tests REQUIRED_OPTIONS BMH_TEST_NATIONAL_CYCLE_TRANSITION_TESTS_INPUT_1 COMMAND national_cycle_transition_tests "${BMH_DATA}" + "${BMH_TEST_NATIONAL_CYCLE_TRANSITION_TESTS_INPUT_1}") + +add_executable(season_tax_tests tests/season_tax_tests.cpp) +target_link_libraries(season_tax_tests PRIVATE bmhcore) +set(BMH_TEST_SEASON_TAX_TESTS_INPUT_1 "" CACHE PATH "External input 1 for season_tax_tests; not distributed") +bmh_add_data_test(NAME season_tax_tests REQUIRED_OPTIONS BMH_TEST_SEASON_TAX_TESTS_INPUT_1 COMMAND season_tax_tests "${BMH_DATA}" + "${BMH_TEST_SEASON_TAX_TESTS_INPUT_1}") + +add_executable(highscore_tests tests/highscore_tests.cpp) +target_link_libraries(highscore_tests PRIVATE bmhcore) +set(BMH_TEST_HIGHSCORE_TESTS_INPUT_1 "" CACHE PATH "External input 1 for highscore_tests; not distributed") +bmh_add_data_test(NAME highscore_tests REQUIRED_OPTIONS BMH_TEST_HIGHSCORE_TESTS_INPUT_1 COMMAND highscore_tests "${BMH_DATA}" + "${BMH_TEST_HIGHSCORE_TESTS_INPUT_1}") + +# Engine core: file formats and game logic, no platform dependencies +add_library(bmhcore STATIC + src/formats/binary.cpp + src/formats/content.cpp + src/formats/native_state.cpp + src/formats/native_file.cpp + src/cli/json.cpp + src/formats/palette.cpp + src/formats/vga.cpp + src/formats/font.cpp + src/formats/textd.cpp + src/formats/fbm.cpp + src/formats/le.cpp + src/formats/rule_base.cpp + src/formats/m3d.cpp + src/formats/savestate.cpp + src/game/schedule.cpp + src/game/league_pairings.cpp + src/game/source_tip.cpp + src/game/table_forecast.cpp + src/game/state.cpp + src/game/world_layout.cpp + src/game/rating.cpp + src/game/match.cpp + src/game/match_engine.cpp + src/game/reality_motion.cpp + src/game/reality_setup.cpp + src/game/reality_space.cpp + src/game/reality_movement.cpp + src/game/reality_match.cpp + src/game/reality_scene.cpp + src/game/reality_ball.cpp + src/game/reality_duel.cpp + src/game/reality_reporter.cpp + src/game/matchday.cpp + src/game/sportschau_replay.cpp + src/game/sportschau_rating.cpp + src/game/sportschau_awards.cpp + src/game/matchday_setup.cpp + src/game/prediction.cpp + src/game/month.cpp + src/game/desk.cpp + src/game/cup.cpp + src/game/club_info.cpp + src/game/club_player_detail.cpp + src/game/driver.cpp + src/game/season.cpp + src/game/highscore.cpp + src/game/weekly.cpp + src/game/messages.cpp + src/game/table.cpp + src/game/week.cpp + src/game/lineup.cpp + src/game/national.cpp + src/game/desk_actions.cpp + src/game/reschedule.cpp + src/game/balance_plan.cpp + src/game/top_scorers.cpp + src/game/other_games.cpp + src/game/stadium_blocks.cpp + src/game/poach.cpp + src/game/environment.cpp + src/game/bank_credit.cpp + src/game/career.cpp + src/game/save.cpp + src/game/turn.cpp + src/game/turn_driver.cpp +) +target_include_directories(bmhcore PUBLIC src) + +if(MSVC) + target_compile_options(bmhcore PRIVATE /W4 /utf-8) +else() + target_compile_options(bmhcore PRIVATE -Wall -Wextra) +endif() + +# Modern season core: a fork of the Classic season sources (docs/new_engine) that shares +# formats, GameState and the match core with Classic through bmhcore. +file(GLOB BMH_SEASON_MODERN_SOURCES CONFIGURE_DEPENDS src/modern/game/*.cpp) +add_library(bmh_season_modern STATIC ${BMH_SEASON_MODERN_SOURCES}) +target_link_libraries(bmh_season_modern PUBLIC bmhcore) +if(MSVC) + target_compile_options(bmh_season_modern PRIVATE /W4 /utf-8 /bigobj) +else() + target_compile_options(bmh_season_modern PRIVATE -Wall -Wextra) +endif() + +add_executable(openbmh_inspect src/main.cpp) +target_link_libraries(openbmh_inspect PRIVATE bmhcore ${BMH_SDL_TARGET}) +if(MSVC) + target_compile_options(openbmh_inspect PRIVATE /utf-8) +endif() + +# --- Game data launcher (src/launch): find, unpack and check the original game data --------- +# ZIP: miniz (MIT), 7z: the C decoder of the LZMA SDK (public domain), file dialog: +# nativefiledialog-extended (zlib). All pinned; fetched like SDL2. +include(FetchContent) +FetchContent_Declare(miniz + URL https://github.com/richgel999/miniz/releases/download/3.0.2/miniz-3.0.2.zip + URL_HASH SHA256=ada38db0b703a56d3dd6d57bf84a9c5d664921d870d8fea4db153979fb5332c5) +FetchContent_Declare(lzma_sdk + GIT_REPOSITORY https://github.com/ip7z/7zip.git + GIT_TAG 24.09 + GIT_SHALLOW TRUE + SOURCE_SUBDIR no-cmake) # (sources only: the repository has no CMake build) +set(NFD_BUILD_TESTS OFF CACHE BOOL "" FORCE) +set(NFD_INSTALL OFF CACHE BOOL "" FORCE) +FetchContent_Declare(nfd + GIT_REPOSITORY https://github.com/btzy/nativefiledialog-extended.git + GIT_TAG v1.2.1 + GIT_SHALLOW TRUE) +FetchContent_MakeAvailable(miniz lzma_sdk nfd) + +add_library(bmh_miniz STATIC ${miniz_SOURCE_DIR}/miniz.c) +target_include_directories(bmh_miniz PUBLIC ${miniz_SOURCE_DIR}) +set(BMH_LZMA_C ${lzma_sdk_SOURCE_DIR}/C) +add_library(bmh_7z STATIC + ${BMH_LZMA_C}/7zAlloc.c ${BMH_LZMA_C}/7zArcIn.c ${BMH_LZMA_C}/7zBuf.c ${BMH_LZMA_C}/7zCrc.c + ${BMH_LZMA_C}/7zCrcOpt.c ${BMH_LZMA_C}/7zDec.c ${BMH_LZMA_C}/7zStream.c ${BMH_LZMA_C}/Bcj2.c + ${BMH_LZMA_C}/Bra.c ${BMH_LZMA_C}/Bra86.c ${BMH_LZMA_C}/BraIA64.c ${BMH_LZMA_C}/CpuArch.c + ${BMH_LZMA_C}/Delta.c ${BMH_LZMA_C}/Lzma2Dec.c ${BMH_LZMA_C}/LzmaDec.c ${BMH_LZMA_C}/Ppmd7.c + ${BMH_LZMA_C}/Ppmd7Dec.c) +target_include_directories(bmh_7z PUBLIC ${BMH_LZMA_C}) +target_compile_definitions(bmh_7z PUBLIC Z7_PPMD_SUPPORT Z7_EXTRACT_ONLY) + +add_library(bmhlaunch STATIC src/launch/archive.cpp src/launch/game_data.cpp src/launch/fltd.cpp) +target_include_directories(bmhlaunch PUBLIC src) +target_link_libraries(bmhlaunch PUBLIC bmhcore PRIVATE bmh_miniz bmh_7z) +if(WIN32) + target_link_libraries(bmhlaunch PRIVATE shell32) # CommandLineToArgvW +endif() +add_library(bmhlaunch_dialog STATIC src/launch/file_dialog.cpp) +target_link_libraries(bmhlaunch_dialog PUBLIC bmhlaunch PRIVATE nfd::nfd) +if(MSVC) + target_compile_options(bmhlaunch PRIVATE /W4 /utf-8) + target_compile_options(bmhlaunch_dialog PRIVATE /utf-8) +endif() + +add_subdirectory(src/ui) +add_subdirectory(src/import) + +# Modern session: fork of the Classic CareerSession on the Modern season core. It still +# uses the Classic UI projections until the Modern projections exist (docs/new_engine). +# Modern world packages: the world tables and the Classic payload of a Modern data set. +add_library(bmh_modern_content STATIC src/modern/content/world.cpp src/modern/content/world_package.cpp + src/modern/content/world_save.cpp + src/modern/content/world_expand.cpp + src/modern/content/statistics.cpp + src/modern/content/toto_quote.cpp src/modern/content/transfer_market.cpp src/modern/content/projections.cpp src/modern/content/ui_contract.cpp src/modern/content/press_journal.cpp) +target_link_libraries(bmh_modern_content PUBLIC bmh_content bmh_season_modern PRIVATE bmh_miniz) +if(MSVC) + target_compile_options(bmh_modern_content PRIVATE /W4 /utf-8) +endif() + +add_executable(modern_world_info tests/modern_world_info.cpp) +target_link_libraries(modern_world_info PRIVATE bmh_modern_content) + +add_library(bmh_modern_session STATIC src/modern/app/modern_session.cpp) +find_package(Threads REQUIRED) +target_link_libraries(bmh_modern_session PUBLIC bmh_season_modern bmh_modern_content bmhui Threads::Threads) +if(MSVC) + target_compile_options(bmh_modern_session PRIVATE /W4 /utf-8 /bigobj) +else() + target_compile_options(bmh_modern_session PRIVATE -Wall -Wextra) +endif() +option(OPENBMH_BUILD_EDITOR "Build the standalone OBW editor" OFF) +option(OPENBMH_BUILD_MODERN_UI "Build the experimental native Modern UI demonstration" OFF) +if(OPENBMH_BUILD_EDITOR OR OPENBMH_BUILD_MODERN_UI) + add_subdirectory(src/editor) +endif() +if(OPENBMH_BUILD_MODERN_UI) + add_subdirectory(src/modern/ui) +endif() +target_link_libraries(bmhui PUBLIC bmh_content) +add_executable(driver_barrier_tests tests/driver_barrier_tests.cpp) +target_link_libraries(driver_barrier_tests PRIVATE bmhcore) +add_test(NAME driver_barrier_tests COMMAND driver_barrier_tests) +add_executable(format_tests tests/format_tests.cpp) +target_link_libraries(format_tests PRIVATE bmhcore) +if(MSVC) + target_compile_options(format_tests PRIVATE /utf-8) +endif() +add_test(NAME format_unit_tests COMMAND format_tests) +bmh_add_data_test(NAME format_tests REQUIRED_OPTIONS BMH_TEST_INPUTS + REQUIRED_FILES expected-text.tsv format-players.tsv format-start.fbm + COMMAND format_tests "${BMH_DATA}" "${BMH_REFERENCE}") + +add_executable(stand_block_actions_tests tests/stand_block_actions_tests.cpp) +target_link_libraries(stand_block_actions_tests PRIVATE bmhcore) +add_test(NAME stand_block_actions_tests COMMAND stand_block_actions_tests) + +add_executable(toto_actions_tests tests/toto_actions_tests.cpp) +target_link_libraries(toto_actions_tests PRIVATE bmhcore) +add_test(NAME toto_actions_tests COMMAND toto_actions_tests) + +add_executable(e13_turn_driver_tests tests/e13_turn_driver_tests.cpp) +target_link_libraries(e13_turn_driver_tests PRIVATE bmhcore) +set(BMH_TEST_E13_TURN_DRIVER_TESTS_INPUT_1 "" CACHE PATH "External input 1 for e13_turn_driver_tests; not distributed") +bmh_add_data_test(NAME e13_turn_driver_tests REQUIRED_OPTIONS BMH_TEST_E13_TURN_DRIVER_TESTS_INPUT_1 COMMAND e13_turn_driver_tests "${BMH_DATA}" + "${BMH_TEST_E13_TURN_DRIVER_TESTS_INPUT_1}") + +add_executable(balance_plan_tests tests/balance_plan_tests.cpp) +target_link_libraries(balance_plan_tests PRIVATE bmhcore) +set(BMH_TEST_BALANCE_PLAN_TESTS_INPUT_1 "" CACHE PATH "External input 1 for balance_plan_tests; not distributed") +bmh_add_data_test(NAME balance_plan_tests REQUIRED_OPTIONS BMH_TEST_BALANCE_PLAN_TESTS_INPUT_1 COMMAND balance_plan_tests "${BMH_DATA}" + "${BMH_TEST_BALANCE_PLAN_TESTS_INPUT_1}") + +add_executable(training_camp_actions_tests tests/training_camp_actions_tests.cpp) +target_link_libraries(training_camp_actions_tests PRIVATE bmhcore) +add_test(NAME training_camp_actions_tests COMMAND training_camp_actions_tests) + +add_executable(lineup_assistant_detail_tests tests/lineup_assistant_detail_tests.cpp) +target_link_libraries(lineup_assistant_detail_tests PRIVATE bmhcore) +add_test(NAME lineup_assistant_detail_tests COMMAND lineup_assistant_detail_tests) + +add_executable(reschedule_tests tests/reschedule_tests.cpp) +target_link_libraries(reschedule_tests PRIVATE bmhcore) +set(BMH_TEST_RESCHEDULE_TESTS_INPUT_1 "" CACHE PATH "External input 1 for reschedule_tests; not distributed") +bmh_add_data_test(NAME reschedule_tests REQUIRED_OPTIONS BMH_TEST_RESCHEDULE_TESTS_INPUT_1 COMMAND reschedule_tests "${BMH_DATA}" + "${BMH_TEST_RESCHEDULE_TESTS_INPUT_1}") + +add_executable(environment_tests tests/environment_tests.cpp) +target_link_libraries(environment_tests PRIVATE bmhcore) +add_test(NAME environment_tests COMMAND environment_tests) + +add_executable(youth_academy_tests tests/youth_academy_tests.cpp) +target_link_libraries(youth_academy_tests PRIVATE bmhcore) +set(BMH_TEST_YOUTH_ACADEMY_TESTS_INPUT_1 "" CACHE PATH "External input 1 for youth_academy_tests; not distributed") +bmh_add_data_test(NAME youth_academy_tests REQUIRED_OPTIONS BMH_TEST_YOUTH_ACADEMY_TESTS_INPUT_1 COMMAND youth_academy_tests "${BMH_DATA}" + "${BMH_TEST_YOUTH_ACADEMY_TESTS_INPUT_1}") + +# Development helper: prints computed values of a savegame for comparison with the original +add_executable(probe tests/probe.cpp) +target_link_libraries(probe PRIVATE bmhcore) +if(MSVC) + target_compile_options(probe PRIVATE /utf-8) +endif() + +# Development helper: compares the ported engine with a matchday recorded from the original +add_executable(capture_check tests/capture_check.cpp) +target_link_libraries(capture_check PRIVATE bmhcore) +if(MSVC) + target_compile_options(capture_check PRIVATE /utf-8) +endif() + +# Development helper: compares the ported matchday processing with post-match snapshots +add_executable(post_check tests/post_check.cpp) +target_link_libraries(post_check PRIVATE bmhcore) +if(MSVC) + target_compile_options(post_check PRIVATE /utf-8) +endif() + +# Development helper: hex dump of one savegame block +add_executable(blockdump tests/blockdump.cpp) +target_link_libraries(blockdump PRIVATE bmhcore) +# Development helper: prints a club's squad from a savegame (player, age, words) +add_executable(squad_dump tests/squad_dump.cpp) +target_link_libraries(squad_dump PRIVATE bmhcore) + +# Development helper: replays a recorded turn (matchday + week) section by section +add_executable(week_check tests/week_check.cpp) +target_link_libraries(week_check PRIVATE bmhcore) +if(MSVC) + target_compile_options(week_check PRIVATE /utf-8) +endif() + +# Development helper: the kick-off of a matchday with a human team, from the pre-match desk +add_executable(kickoff_check tests/kickoff_check.cpp) +target_link_libraries(kickoff_check PRIVATE bmhcore) + +# Development helper: league table computed from a savegame +add_executable(table_print tests/table_print.cpp) +target_link_libraries(table_print PRIVATE bmhcore) +if(MSVC) + target_compile_options(table_print PRIVATE /utf-8) +endif() + +add_executable(textfind tests/textfind.cpp) +target_link_libraries(textfind PRIVATE bmhcore) +if(MSVC) + target_compile_options(textfind PRIVATE /utf-8) +endif() + +# Development helper: replays desk actions (training camp, ...) between two post snapshots +add_executable(desk_check tests/desk_check.cpp) +target_link_libraries(desk_check PRIVATE bmhcore) + +# Development helper: the start of a new career against ref/2p/init_capture.jsonl +add_executable(init_check tests/init_check.cpp) +target_link_libraries(init_check PRIVATE bmhcore) + +# The playable program: the shared UI library connected to the engine by src/app. +add_executable(openbmh_play + src/app/main.cpp + ${BMH_APP_CONTROLLER_SOURCE} + ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(openbmh_play PRIVATE bmhui bmh_launcher bmhlaunch_dialog openbmh_audio ${BMH_SDL_TARGET}) +if(OPENBMH_BUILD_MODERN_UI) + target_link_libraries(openbmh_play PRIVATE bmh_modern_ui) + target_compile_definitions(openbmh_play PRIVATE OPENBMH_MODERN_UI=1) +endif() +# a game without a console window on double-click (SDL2main provides WinMain); started from a +# console it attaches to that one for --version, --help and start errors (src/app/main.cpp) +set_target_properties(openbmh_play PROPERTIES WIN32_EXECUTABLE TRUE OUTPUT_NAME OpenBMH) +if(CMAKE_CONFIGURATION_TYPES) + add_custom_command(TARGET openbmh_play POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_BINARY_DIR}/assets/launcher" + "$/assets/launcher") + if(OPENBMH_BUILD_MODERN_UI) + add_custom_command(TARGET openbmh_play POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_BINARY_DIR}/assets/modern" + "$/assets/modern") + endif() +endif() +if(MSVC) + target_compile_options(openbmh_play PRIVATE /utf-8) + # App sources also compile in headless tests/helpers without target /utf-8. + set_source_files_properties(src/app/career_session.cpp src/app/window_actions.cpp + src/app/desktop_actions.cpp PROPERTIES COMPILE_OPTIONS /utf-8) +endif() + +# Development helper: drives the career session like the UI, without a window +add_executable(play_check tests/play_check.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(play_check PRIVATE bmhui) +if(MSVC) + target_compile_options(play_check PRIVATE /utf-8) +endif() + +add_executable(training_camp_app_tests tests/training_camp_app_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(training_camp_app_tests PRIVATE bmhui) +bmh_add_data_test(NAME training_camp_app_tests COMMAND training_camp_app_tests "${BMH_DATA}") +add_executable(bank_app_tests tests/bank_app_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(bank_app_tests PRIVATE bmhui) +bmh_add_data_test(NAME bank_app_tests REQUIRED_OPTIONS BMH_TEST_INPUTS REQUIRED_FILES bank-deadline.fbm bank-timer.fbm bank-cup.fbm COMMAND bank_app_tests "${BMH_DATA}") + +add_executable(shared_desktop_actions_tests tests/shared_desktop_actions_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(shared_desktop_actions_tests PRIVATE bmhui) +set(BMH_TEST_SHARED_DESKTOP_ACTIONS_TESTS_INPUT_1 "" CACHE PATH "External input 1 for shared_desktop_actions_tests; not distributed") +bmh_add_data_test(NAME shared_desktop_actions_tests REQUIRED_OPTIONS BMH_TEST_SHARED_DESKTOP_ACTIONS_TESTS_INPUT_1 COMMAND shared_desktop_actions_tests "${BMH_DATA}" + "${BMH_TEST_SHARED_DESKTOP_ACTIONS_TESTS_INPUT_1}") + +add_executable(credit_interest_weekly_tests tests/credit_interest_weekly_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(credit_interest_weekly_tests PRIVATE bmhui) +bmh_add_data_test(NAME credit_interest_weekly_tests COMMAND credit_interest_weekly_tests "${BMH_DATA}") + +add_executable(app_controller_tests tests/app_controller_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(app_controller_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +if(MSVC) + target_compile_options(app_controller_tests PRIVATE /utf-8) +endif() +bmh_add_data_test(NAME app_controller_tests COMMAND app_controller_tests "${BMH_DATA}") +set(BMH_TEST_APP_DELAY_SETTINGS_TESTS_INPUT_1 "" CACHE PATH "External input 1 for app_delay_settings_tests; not distributed") +bmh_add_data_test(NAME app_environment_tests COMMAND app_controller_tests "${BMH_DATA}" --environment-only) +bmh_add_data_test(NAME app_delay_settings_tests REQUIRED_OPTIONS BMH_TEST_APP_DELAY_SETTINGS_TESTS_INPUT_1 COMMAND app_controller_tests "${BMH_DATA}" + --delay-settings-only "${BMH_TEST_APP_DELAY_SETTINGS_TESTS_INPUT_1}") + +add_executable(sound_settings_app_tests tests/sound_settings_app_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(sound_settings_app_tests PRIVATE bmhui) +set(BMH_TEST_SOUND_SETTINGS_APP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for sound_settings_app_tests; not distributed") +bmh_add_data_test(NAME sound_settings_app_tests REQUIRED_OPTIONS BMH_TEST_SOUND_SETTINGS_APP_TESTS_INPUT_1 COMMAND sound_settings_app_tests "${BMH_DATA}" + "${BMH_TEST_SOUND_SETTINGS_APP_TESTS_INPUT_1}") + +add_executable(statistics_case2_app_tests tests/statistics_case2_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(statistics_case2_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +set(BMH_TEST_STATISTICS_CASE2_APP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for statistics_case2_app_tests; not distributed") +bmh_add_data_test(NAME statistics_case2_app_tests REQUIRED_OPTIONS BMH_TEST_STATISTICS_CASE2_APP_TESTS_INPUT_1 COMMAND statistics_case2_app_tests "${BMH_DATA}" + "${BMH_TEST_STATISTICS_CASE2_APP_TESTS_INPUT_1}") + +add_executable(national_friendly_actions_tests tests/national_friendly_actions_tests.cpp) +target_link_libraries(national_friendly_actions_tests PRIVATE bmhcore) +add_test(NAME national_friendly_actions_tests COMMAND national_friendly_actions_tests) + +add_executable(manager_join_app_tests tests/manager_join_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(manager_join_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +if(MSVC) + target_compile_options(manager_join_app_tests PRIVATE /utf-8) +endif() +set(BMH_TEST_MANAGER_JOIN_APP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for manager_join_app_tests; not distributed") +bmh_add_data_test(NAME manager_join_app_tests REQUIRED_OPTIONS BMH_TEST_MANAGER_JOIN_APP_TESTS_INPUT_1 COMMAND manager_join_app_tests "${BMH_DATA}" + "${BMH_TEST_MANAGER_JOIN_APP_TESTS_INPUT_1}") + +add_executable(live_matchday_events_tests tests/live_matchday_events_tests.cpp) +target_include_directories(live_matchday_events_tests PRIVATE src) +target_link_libraries(live_matchday_events_tests PRIVATE ${BMH_SDL_TARGET}) +add_test(NAME live_matchday_events_tests COMMAND live_matchday_events_tests) + +add_executable(reality_motion_tests tests/reality_motion_tests.cpp) +target_link_libraries(reality_motion_tests PRIVATE bmhui) +bmh_add_data_test(NAME reality_motion_tests COMMAND reality_motion_tests "${BMH_DATA}") + +add_executable(reality_setup_tests tests/reality_setup_tests.cpp) +target_link_libraries(reality_setup_tests PRIVATE bmhcore) +bmh_add_data_test(NAME reality_setup_tests COMMAND reality_setup_tests "${BMH_DATA}") + +add_executable(reality_space_tests tests/reality_space_tests.cpp) +target_link_libraries(reality_space_tests PRIVATE bmhcore) +bmh_add_data_test(NAME reality_space_tests COMMAND reality_space_tests "${BMH_DATA}") + +add_executable(reality_movement_tests tests/reality_movement_tests.cpp) +target_link_libraries(reality_movement_tests PRIVATE bmhcore) +bmh_add_data_test(NAME reality_movement_tests COMMAND reality_movement_tests "${BMH_DATA}") + +add_executable(reality_ball_tests tests/reality_ball_tests.cpp) +target_link_libraries(reality_ball_tests PRIVATE bmhcore) +bmh_add_data_test(NAME reality_ball_tests COMMAND reality_ball_tests "${BMH_DATA}") + +add_executable(reality_duel_tests tests/reality_duel_tests.cpp) +target_link_libraries(reality_duel_tests PRIVATE bmhcore) +bmh_add_data_test(NAME reality_duel_tests COMMAND reality_duel_tests "${BMH_DATA}") + +add_executable(reality_forced_event_tests tests/reality_forced_event_tests.cpp) +target_link_libraries(reality_forced_event_tests PRIVATE bmhcore) +bmh_add_data_test(NAME reality_forced_event_tests COMMAND reality_forced_event_tests "${BMH_DATA}") + +add_executable(reality_reporter_tests tests/reality_reporter_tests.cpp) +target_link_libraries(reality_reporter_tests PRIVATE bmhcore) +bmh_add_data_test(NAME reality_reporter_tests COMMAND reality_reporter_tests "${BMH_DATA}") + +add_executable(reality_matchday_tests tests/reality_matchday_tests.cpp) +target_link_libraries(reality_matchday_tests PRIVATE bmhcore) +bmh_add_data_test(NAME reality_matchday_tests COMMAND reality_matchday_tests "${BMH_DATA}") + +add_executable(reality_career_special_tests tests/reality_career_special_tests.cpp ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(reality_career_special_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +set(BMH_TEST_REALITY_CAREER_SPECIAL_TESTS_INPUT_1 "" CACHE PATH "External input 1 for reality_career_special_tests; not distributed") +bmh_add_data_test(NAME reality_career_special_tests REQUIRED_OPTIONS BMH_TEST_REALITY_CAREER_SPECIAL_TESTS_INPUT_1 COMMAND reality_career_special_tests "${BMH_DATA}" + "${BMH_TEST_REALITY_CAREER_SPECIAL_TESTS_INPUT_1}") + +add_executable(reality_deferred_tests tests/reality_deferred_tests.cpp) +target_link_libraries(reality_deferred_tests PRIVATE bmhcore) +bmh_add_data_test(NAME reality_deferred_tests COMMAND reality_deferred_tests "${BMH_DATA}") + +add_executable(phase_results_career_tests tests/phase_results_career_tests.cpp ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(phase_results_career_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +bmh_add_data_test(NAME phase_results_career_tests COMMAND phase_results_career_tests "${BMH_DATA}") + +add_executable(reality_scene_tests tests/reality_scene_tests.cpp) +target_link_libraries(reality_scene_tests PRIVATE bmhcore) +bmh_add_data_test(NAME reality_scene_tests COMMAND reality_scene_tests "${BMH_DATA}") + +add_executable(reality_reporter_layout_tests tests/reality_reporter_layout_tests.cpp) +target_link_libraries(reality_reporter_layout_tests PRIVATE bmhui) +bmh_add_data_test(NAME reality_reporter_layout_tests COMMAND reality_reporter_layout_tests "${BMH_DATA}") + +add_executable(training_dispatch_app_tests tests/training_dispatch_app_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(training_dispatch_app_tests PRIVATE bmhui) +if(MSVC) + target_compile_options(training_dispatch_app_tests PRIVATE /utf-8) +endif() +bmh_add_data_test(NAME training_dispatch_app_tests COMMAND training_dispatch_app_tests "${BMH_DATA}") + +# Development helper: savegames loaded and written again must be identical +add_executable(save_check tests/save_check.cpp) +target_link_libraries(save_check PRIVATE bmhcore) +if(UNIX) + add_executable(save_close_fault_tests tests/save_close_fault_tests.cpp) + target_link_libraries(save_close_fault_tests PRIVATE bmhcore) + set(BMH_TEST_SAVE_CLOSE_FAULT_TESTS_INPUT_1 "" CACHE PATH "External input 1 for save_close_fault_tests; not distributed") + bmh_add_data_test(NAME save_close_fault_tests NO_GAME_DATA REQUIRED_OPTIONS BMH_TEST_SAVE_CLOSE_FAULT_TESTS_INPUT_1 COMMAND save_close_fault_tests + "${BMH_TEST_SAVE_CLOSE_FAULT_TESTS_INPUT_1}") +endif() + +# Plausibility run: a new career played headless through the turn driver (E7) +add_executable(season_sim tests/season_sim.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(season_sim PRIVATE bmhui) +if(MSVC) + target_compile_options(season_sim PRIVATE /utf-8) +endif() +# The engine side of the Modern interface contract (docs/new_engine/ui-anbindung.md). +add_executable(modern_ui_contract_tests tests/modern_ui_contract_tests.cpp) +target_link_libraries(modern_ui_contract_tests PRIVATE bmh_modern_session) +if(MSVC) + target_compile_options(modern_ui_contract_tests PRIVATE /utf-8 /bigobj) +endif() +bmh_add_data_test(NAME modern_ui_contract_tests COMMAND modern_ui_contract_tests "${BMH_DATA}") + +# The Modern fork of season_sim; with Classic data its output must equal season_sim's. +add_executable(modern_season_sim tests/modern_season_sim.cpp) +target_link_libraries(modern_season_sim PRIVATE bmh_modern_session) +if(MSVC) + target_compile_options(modern_season_sim PRIVATE /utf-8) +endif() + +# Headless terminal/protocol client; owns no game logic and has no SDL dependency. +add_executable(openbmh_cli + src/cli/main.cpp + src/cli/protocol.cpp + src/cli/console/console.cpp + src/cli/console/parser.cpp + src/cli/console/windows_start.cpp + src/cli/console/windows_desk.cpp + src/cli/console/windows_tables.cpp + src/cli/console/windows_club.cpp + src/cli/console/windows_money.cpp + src/cli/console/windows_office.cpp + src/cli/console/windows_squad.cpp + src/cli/console/windows_transfer.cpp + src/cli/console/windows_info.cpp + src/cli/console/windows_match.cpp + src/cli/console/windows_friendly.cpp + src/cli/console/windows_reschedule.cpp + src/cli/console/windows_balance.cpp + src/cli/console/windows_environment.cpp + src/cli/console/windows_state.cpp + src/cli/seat_hub.cpp + src/cli/json.cpp + ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(openbmh_cli PRIVATE bmh_launcher bmhui bmhlaunch) + +# The same console on the Modern session (docs/new_engine): play a Modern world in the text +# console until the new interface is connected. The console and its desk/window actions are +# compiled a second time with OPENBMH_MODERN_SESSION (src/app/session.hpp). +add_executable(openbmh_modern_cli + src/cli/main.cpp + src/cli/protocol.cpp + src/cli/console/console.cpp + src/cli/console/parser.cpp + src/cli/console/windows_start.cpp + src/cli/console/windows_desk.cpp + src/cli/console/windows_tables.cpp + src/cli/console/windows_club.cpp + src/cli/console/windows_money.cpp + src/cli/console/windows_office.cpp + src/cli/console/windows_squad.cpp + src/cli/console/windows_transfer.cpp + src/cli/console/windows_info.cpp + src/cli/console/windows_match.cpp + src/cli/console/windows_friendly.cpp + src/cli/console/windows_reschedule.cpp + src/cli/console/windows_balance.cpp + src/cli/console/windows_environment.cpp + src/cli/console/windows_state.cpp + src/cli/seat_hub.cpp + src/cli/json.cpp + src/app/window_actions.cpp + src/app/desktop_actions.cpp) +target_compile_definitions(openbmh_modern_cli PRIVATE OPENBMH_MODERN_SESSION) +target_link_libraries(openbmh_modern_cli PRIVATE bmh_launcher bmhui bmhlaunch bmh_modern_session) +if(WIN32) + target_link_libraries(openbmh_modern_cli PRIVATE ws2_32) +endif() +if(MSVC) + target_compile_options(openbmh_modern_cli PRIVATE /utf-8 /bigobj) +endif() +if(WIN32) + target_link_libraries(openbmh_cli PRIVATE ws2_32) # --listen (Winsock) +endif() +if(MSVC) + target_compile_options(openbmh_cli PRIVATE /utf-8) +endif() + +add_executable(cli_protocol_tests tests/cli_protocol_tests.cpp src/cli/protocol.cpp src/cli/json.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(cli_protocol_tests PRIVATE bmhui) +if(MSVC) + target_compile_options(cli_protocol_tests PRIVATE /utf-8) +endif() +bmh_add_data_test(NAME cli_protocol_tests COMMAND cli_protocol_tests "${BMH_DATA}") + +# Console language of openbmh_cli (docs/CLI_CONCEPT): parser, golden transcripts, JSON, +# replay and the registry check against commands.csv +add_executable(cli_console_tests tests/cli_console_tests.cpp src/cli/console/console.cpp src/cli/console/parser.cpp + src/cli/console/windows_start.cpp src/cli/console/windows_desk.cpp src/cli/console/windows_tables.cpp src/cli/console/windows_club.cpp src/cli/console/windows_money.cpp src/cli/console/windows_office.cpp src/cli/console/windows_squad.cpp src/cli/console/windows_transfer.cpp src/cli/console/windows_info.cpp src/cli/console/windows_match.cpp src/cli/console/windows_friendly.cpp src/cli/console/windows_reschedule.cpp src/cli/console/windows_balance.cpp src/cli/console/windows_environment.cpp src/cli/console/windows_state.cpp src/cli/json.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(cli_console_tests PRIVATE bmhui) +add_test(NAME cli_parser_unit_tests COMMAND cli_console_tests --parser-only) +if(MSVC) + target_compile_options(cli_console_tests PRIVATE /utf-8) +endif() +set(BMH_TEST_CLI_CONSOLE_TESTS_INPUT_1 "" CACHE PATH "External input 1 for cli_console_tests; not distributed") +set(BMH_TEST_CLI_TRANSCRIPTS "" CACHE PATH "External console transcript expectations") +bmh_add_data_test(NAME cli_console_tests REQUIRED_OPTIONS BMH_TEST_INPUTS BMH_TEST_CLI_TRANSCRIPTS BMH_TEST_CLI_CONSOLE_TESTS_INPUT_1 REQUIRED_FILES loan-return.fbm human-transfer.fbm COMMAND cli_console_tests "${BMH_DATA}" "${BMH_TEST_CLI_TRANSCRIPTS}" + "${BMH_TEST_CLI_CONSOLE_TESTS_INPUT_1}" + "${CMAKE_CURRENT_SOURCE_DIR}/docs/CLI_CONCEPT/commands.csv") +# Soak test: random console play over several seasons with invariant checks (tests/cli_soak.cpp). +# CTest runs one short season with two managers; longer runs: cli_soak . +add_executable(cli_soak tests/cli_soak.cpp src/cli/console/console.cpp src/cli/console/parser.cpp + src/cli/console/windows_start.cpp src/cli/console/windows_desk.cpp src/cli/console/windows_tables.cpp src/cli/console/windows_club.cpp src/cli/console/windows_money.cpp src/cli/console/windows_office.cpp src/cli/console/windows_squad.cpp src/cli/console/windows_transfer.cpp src/cli/console/windows_info.cpp src/cli/console/windows_match.cpp src/cli/console/windows_friendly.cpp src/cli/console/windows_reschedule.cpp src/cli/console/windows_balance.cpp src/cli/console/windows_environment.cpp src/cli/console/windows_state.cpp src/cli/json.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(cli_soak PRIVATE bmhui) +if(MSVC) + target_compile_options(cli_soak PRIVATE /utf-8) +endif() +bmh_add_data_test(NAME cli_soak COMMAND cli_soak "${BMH_DATA}" "${CMAKE_CURRENT_BINARY_DIR}/soak" 1 2 7) + +# Repository hygiene: no container login banner in committed files +add_test(NAME repo_hygiene COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_SOURCE_DIR} -P ${CMAKE_SOURCE_DIR}/tests/cmake/repo_hygiene.cmake) + +add_executable(game_end_app_tests tests/game_end_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(game_end_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +if(MSVC) + target_compile_options(game_end_app_tests PRIVATE /utf-8) +endif() +set(BMH_TEST_GAME_END_APP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for game_end_app_tests; not distributed") +bmh_add_data_test(NAME game_end_app_tests REQUIRED_OPTIONS BMH_TEST_GAME_END_APP_TESTS_INPUT_1 COMMAND game_end_app_tests "${BMH_DATA}" + "${BMH_TEST_GAME_END_APP_TESTS_INPUT_1}") + +add_executable(game_end_cli_tests tests/game_end_cli_tests.cpp src/cli/protocol.cpp src/cli/json.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(game_end_cli_tests PRIVATE bmhui) +if(MSVC) + target_compile_options(game_end_cli_tests PRIVATE /utf-8) +endif() +set(BMH_TEST_GAME_END_CLI_TESTS_INPUT_1 "" CACHE PATH "External input 1 for game_end_cli_tests; not distributed") +bmh_add_data_test(NAME game_end_cli_tests REQUIRED_OPTIONS BMH_TEST_GAME_END_CLI_TESTS_INPUT_1 COMMAND game_end_cli_tests "${BMH_DATA}" + "${BMH_TEST_GAME_END_CLI_TESTS_INPUT_1}") + +add_executable(season_promotion_app_tests tests/season_promotion_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(season_promotion_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +set(BMH_TEST_SEASON_PROMOTION_APP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for season_promotion_app_tests; not distributed") +bmh_add_data_test(NAME season_promotion_app_tests REQUIRED_OPTIONS BMH_TEST_SEASON_PROMOTION_APP_TESTS_INPUT_1 COMMAND season_promotion_app_tests "${BMH_DATA}" "${BMH_TEST_SEASON_PROMOTION_APP_TESTS_INPUT_1}") + +add_executable(season_promotion_tests tests/season_promotion_tests.cpp) +target_link_libraries(season_promotion_tests PRIVATE bmhcore) +set(BMH_TEST_SEASON_PROMOTION_TESTS_INPUT_1 "" CACHE PATH "External input 1 for season_promotion_tests; not distributed") +bmh_add_data_test(NAME season_promotion_tests REQUIRED_OPTIONS BMH_TEST_SEASON_PROMOTION_TESTS_INPUT_1 COMMAND season_promotion_tests "${BMH_DATA}" + "${BMH_TEST_SEASON_PROMOTION_TESTS_INPUT_1}" 589388519 665367) +add_executable(ui_season_promotion_tests tests/ui_season_promotion_tests.cpp) +target_link_libraries(ui_season_promotion_tests PRIVATE bmhui) +set(BMH_TEST_UI_SEASON_PROMOTION_TESTS_INPUT_1 "" CACHE PATH "External input 1 for ui_season_promotion_tests; not distributed") +bmh_add_data_test(NAME ui_season_promotion_tests REQUIRED_OPTIONS BMH_TEST_UI_SEASON_PROMOTION_TESTS_INPUT_1 COMMAND ui_season_promotion_tests "${BMH_DATA}" + "${BMH_TEST_UI_SEASON_PROMOTION_TESTS_INPUT_1}") + +add_executable(national_nomination_tests tests/national_nomination_tests.cpp) +target_link_libraries(national_nomination_tests PRIVATE bmhcore) +set(BMH_TEST_NATIONAL_NOMINATION_TESTS_INPUT_1 "" CACHE PATH "External input 1 for national_nomination_tests; not distributed") +bmh_add_data_test(NAME national_nomination_tests REQUIRED_OPTIONS BMH_TEST_NATIONAL_NOMINATION_TESTS_INPUT_1 COMMAND national_nomination_tests "${BMH_DATA}" + "${BMH_TEST_NATIONAL_NOMINATION_TESTS_INPUT_1}") + +add_executable(season_cup_draw_app_tests tests/season_cup_draw_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(season_cup_draw_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +set(BMH_TEST_SEASON_CUP_DRAW_APP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for season_cup_draw_app_tests; not distributed") +bmh_add_data_test(NAME season_cup_draw_app_tests REQUIRED_OPTIONS BMH_TEST_SEASON_CUP_DRAW_APP_TESTS_INPUT_1 COMMAND season_cup_draw_app_tests "${BMH_DATA}" + "${BMH_TEST_SEASON_CUP_DRAW_APP_TESTS_INPUT_1}") + +add_executable(season_cup_draw_tests tests/season_cup_draw_tests.cpp) +target_link_libraries(season_cup_draw_tests PRIVATE bmhcore) +set(BMH_TEST_SEASON_CUP_DRAW_TESTS_INPUT_1 "" CACHE PATH "External input 1 for season_cup_draw_tests; not distributed") +bmh_add_data_test(NAME season_cup_draw_tests REQUIRED_OPTIONS BMH_TEST_SEASON_CUP_DRAW_TESTS_INPUT_1 COMMAND season_cup_draw_tests "${BMH_DATA}" + "${BMH_TEST_SEASON_CUP_DRAW_TESTS_INPUT_1}" 589388519 665367) + +add_executable(cup_followup_tests tests/cup_followup_tests.cpp) +target_link_libraries(cup_followup_tests PRIVATE bmhcore) +add_executable(cup_seeded_followup_tests tests/cup_seeded_followup_tests.cpp) +target_link_libraries(cup_seeded_followup_tests PRIVATE bmhcore) +add_test(NAME cup_seeded_followup_tests COMMAND cup_seeded_followup_tests) + +add_executable(cup_calendar_boundary_tests tests/cup_calendar_boundary_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(cup_calendar_boundary_tests PRIVATE bmhui) +set(BMH_TEST_CUP_CALENDAR_BOUNDARY_TESTS_INPUT_1 "" CACHE PATH "External input 1 for cup_calendar_boundary_tests; not distributed") +bmh_add_data_test(NAME cup_calendar_boundary_tests REQUIRED_OPTIONS BMH_TEST_CUP_CALENDAR_BOUNDARY_TESTS_INPUT_1 COMMAND cup_calendar_boundary_tests "${BMH_DATA}" + "${BMH_TEST_CUP_CALENDAR_BOUNDARY_TESTS_INPUT_1}") +set(BMH_TEST_CUP_FOLLOWUP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for cup_followup_tests; not distributed") +set(BMH_TEST_CUP_FOLLOWUP_TESTS_INPUT_2 "" CACHE PATH "External input 2 for cup_followup_tests; not distributed") +bmh_add_data_test(NAME cup_followup_tests REQUIRED_OPTIONS BMH_TEST_CUP_FOLLOWUP_TESTS_INPUT_1 BMH_TEST_CUP_FOLLOWUP_TESTS_INPUT_2 COMMAND cup_followup_tests "${BMH_DATA}" + "${BMH_TEST_CUP_FOLLOWUP_TESTS_INPUT_1}" + "${BMH_TEST_CUP_FOLLOWUP_TESTS_INPUT_2}") + +add_executable(club_info_tests tests/club_info_tests.cpp) +target_link_libraries(club_info_tests PRIVATE bmhcore) +add_test(NAME club_info_tests COMMAND club_info_tests) + +add_executable(cup_cursor_tests tests/cup_cursor_tests.cpp) +target_link_libraries(cup_cursor_tests PRIVATE bmhcore) +set(BMH_TEST_CUP_CURSOR_TESTS_INPUT_1 "" CACHE PATH "External input 1 for cup_cursor_tests; not distributed") +bmh_add_data_test(NAME cup_cursor_tests REQUIRED_OPTIONS BMH_TEST_CUP_CURSOR_TESTS_INPUT_1 COMMAND cup_cursor_tests "${BMH_DATA}" + "${BMH_TEST_CUP_CURSOR_TESTS_INPUT_1}") +add_executable(club_info_category_tests tests/club_info_category_tests.cpp) +target_link_libraries(club_info_category_tests PRIVATE bmhcore) +add_test(NAME club_info_category_tests COMMAND club_info_category_tests) + +add_executable(club_player_detail_tests tests/club_player_detail_tests.cpp) +target_link_libraries(club_player_detail_tests PRIVATE bmhcore) +bmh_add_data_test(NAME club_player_detail_tests COMMAND club_player_detail_tests "${BMH_DATA}") +add_executable(ui_cup_draw_tests tests/cup_draw_ui_tests.cpp) +target_link_libraries(ui_cup_draw_tests PRIVATE bmhui) +set(BMH_TEST_UI_CUP_DRAW_TESTS_INPUT_1 "" CACHE PATH "External input 1 for ui_cup_draw_tests; not distributed") +set(BMH_TEST_UI_CUP_DRAW_TESTS_INPUT_2 "" CACHE PATH "External input 2 for ui_cup_draw_tests; not distributed") +bmh_add_data_test(NAME ui_cup_draw_tests REQUIRED_OPTIONS BMH_TEST_UI_CUP_DRAW_TESTS_INPUT_1 BMH_TEST_UI_CUP_DRAW_TESTS_INPUT_2 COMMAND ui_cup_draw_tests "${BMH_DATA}" + "${BMH_TEST_UI_CUP_DRAW_TESTS_INPUT_1}" + "${BMH_TEST_UI_CUP_DRAW_TESTS_INPUT_2}") + +add_executable(cup_script_oracle tests/cup_script_oracle.cpp) +target_link_libraries(cup_script_oracle PRIVATE bmhui) +bmh_add_data_test(NAME cup_script_oracle COMMAND cup_script_oracle "${BMH_DATA}") + +add_executable(career_initial_offers_tests tests/career_initial_offers_tests.cpp) +target_link_libraries(career_initial_offers_tests PRIVATE bmhcore) +bmh_add_data_test(NAME career_initial_offers_tests COMMAND career_initial_offers_tests "${BMH_DATA}") + +add_executable(pending_offer_tests tests/pending_offer_tests.cpp) +target_link_libraries(pending_offer_tests PRIVATE bmhcore) +set(BMH_TEST_PENDING_OFFER_TESTS_INPUT_1 "" CACHE PATH "External input 1 for pending_offer_tests; not distributed") +bmh_add_data_test(NAME pending_offer_tests REQUIRED_OPTIONS BMH_TEST_PENDING_OFFER_TESTS_INPUT_1 COMMAND pending_offer_tests "${BMH_DATA}" + "${BMH_TEST_PENDING_OFFER_TESTS_INPUT_1}") + +add_executable(pending_offer_app_tests tests/pending_offer_app_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(pending_offer_app_tests PRIVATE bmhui) +set(BMH_TEST_PENDING_OFFER_APP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for pending_offer_app_tests; not distributed") +bmh_add_data_test(NAME pending_offer_app_tests REQUIRED_OPTIONS BMH_TEST_PENDING_OFFER_APP_TESTS_INPUT_1 COMMAND pending_offer_app_tests "${BMH_DATA}" + "${BMH_TEST_PENDING_OFFER_APP_TESTS_INPUT_1}") + +add_executable(pending_offer_nested_app_tests tests/pending_offer_nested_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(pending_offer_nested_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +set(BMH_TEST_PENDING_OFFER_NESTED_APP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for pending_offer_nested_app_tests; not distributed") +set(BMH_TEST_PENDING_OFFER_NESTED_APP_TESTS_INPUT_2 "" CACHE PATH "External input 2 for pending_offer_nested_app_tests; not distributed") +bmh_add_data_test(NAME pending_offer_nested_app_tests REQUIRED_OPTIONS BMH_TEST_PENDING_OFFER_NESTED_APP_TESTS_INPUT_1 BMH_TEST_PENDING_OFFER_NESTED_APP_TESTS_INPUT_2 COMMAND pending_offer_nested_app_tests "${BMH_DATA}" + "${BMH_TEST_PENDING_OFFER_NESTED_APP_TESTS_INPUT_1}" + "${BMH_TEST_PENDING_OFFER_NESTED_APP_TESTS_INPUT_2}") + +add_executable(pending_offer_desk_tests tests/pending_offer_desk_tests.cpp) +target_link_libraries(pending_offer_desk_tests PRIVATE bmhcore) +set(BMH_TEST_PENDING_OFFER_DESK_TESTS_INPUT_1 "" CACHE PATH "External input 1 for pending_offer_desk_tests; not distributed") +bmh_add_data_test(NAME pending_offer_desk_tests REQUIRED_OPTIONS BMH_TEST_PENDING_OFFER_DESK_TESTS_INPUT_1 COMMAND pending_offer_desk_tests "${BMH_DATA}" + "${BMH_TEST_PENDING_OFFER_DESK_TESTS_INPUT_1}") + +add_executable(human_buyer_pending_offer_tests tests/human_buyer_pending_offer_tests.cpp) +target_link_libraries(human_buyer_pending_offer_tests PRIVATE bmhcore) +set(BMH_TEST_HUMAN_BUYER_PENDING_OFFER_TESTS_INPUT_1 "" CACHE PATH "External input 1 for human_buyer_pending_offer_tests; not distributed") +bmh_add_data_test(NAME human_buyer_pending_offer_tests REQUIRED_OPTIONS BMH_TEST_HUMAN_BUYER_PENDING_OFFER_TESTS_INPUT_1 COMMAND human_buyer_pending_offer_tests "${BMH_DATA}" + "${BMH_TEST_HUMAN_BUYER_PENDING_OFFER_TESTS_INPUT_1}") + +add_executable(human_buyer_pending_app_tests tests/human_buyer_pending_app_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(human_buyer_pending_app_tests PRIVATE bmhui) +set(BMH_TEST_HUMAN_BUYER_PENDING_APP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for human_buyer_pending_app_tests; not distributed") +bmh_add_data_test(NAME human_buyer_pending_app_tests REQUIRED_OPTIONS BMH_TEST_HUMAN_BUYER_PENDING_APP_TESTS_INPUT_1 COMMAND human_buyer_pending_app_tests "${BMH_DATA}" + "${BMH_TEST_HUMAN_BUYER_PENDING_APP_TESTS_INPUT_1}") + +add_executable(human_buyer_market_tests tests/human_buyer_market_tests.cpp) +target_link_libraries(human_buyer_market_tests PRIVATE bmhcore) +set(BMH_TEST_HUMAN_BUYER_MARKET_TESTS_INPUT_1 "" CACHE PATH "External input 1 for human_buyer_market_tests; not distributed") +set(BMH_TEST_HUMAN_BUYER_MARKET_TESTS_INPUT_2 "" CACHE PATH "External input 2 for human_buyer_market_tests; not distributed") +set(BMH_TEST_HUMAN_BUYER_MARKET_TESTS_INPUT_3 "" CACHE PATH "External input 3 for human_buyer_market_tests; not distributed") +bmh_add_data_test(NAME human_buyer_market_tests REQUIRED_OPTIONS BMH_TEST_HUMAN_BUYER_MARKET_TESTS_INPUT_1 BMH_TEST_HUMAN_BUYER_MARKET_TESTS_INPUT_2 BMH_TEST_HUMAN_BUYER_MARKET_TESTS_INPUT_3 COMMAND human_buyer_market_tests "${BMH_DATA}" + "${BMH_TEST_HUMAN_BUYER_MARKET_TESTS_INPUT_1}" + "${BMH_TEST_HUMAN_BUYER_MARKET_TESTS_INPUT_2}" + "${BMH_TEST_HUMAN_BUYER_MARKET_TESTS_INPUT_3}") + +add_executable(weekly_human_buyer_loan_tests tests/weekly_human_buyer_loan_tests.cpp) +target_link_libraries(weekly_human_buyer_loan_tests PRIVATE bmhcore) +set(BMH_TEST_WEEKLY_HUMAN_BUYER_LOAN_TESTS_INPUT_1 "" CACHE PATH "External input 1 for weekly_human_buyer_loan_tests; not distributed") +bmh_add_data_test(NAME weekly_human_buyer_loan_tests REQUIRED_OPTIONS BMH_TEST_WEEKLY_HUMAN_BUYER_LOAN_TESTS_INPUT_1 COMMAND weekly_human_buyer_loan_tests "${BMH_DATA}" + "${BMH_TEST_WEEKLY_HUMAN_BUYER_LOAN_TESTS_INPUT_1}") + +add_executable(transfer_bid_qualification_tests tests/transfer_bid_qualification_tests.cpp) +target_link_libraries(transfer_bid_qualification_tests PRIVATE bmhcore) +set(BMH_TEST_TRANSFER_BID_QUALIFICATION_TESTS_INPUT_1 "" CACHE PATH "External input 1 for transfer_bid_qualification_tests; not distributed") +bmh_add_data_test(NAME transfer_bid_qualification_tests REQUIRED_OPTIONS BMH_TEST_TRANSFER_BID_QUALIFICATION_TESTS_INPUT_1 COMMAND transfer_bid_qualification_tests "${BMH_DATA}" + "${BMH_TEST_TRANSFER_BID_QUALIFICATION_TESTS_INPUT_1}") + +add_executable(transfer_market_preview_tests tests/transfer_market_preview_tests.cpp) +target_link_libraries(transfer_market_preview_tests PRIVATE bmhcore) +set(BMH_TEST_TRANSFER_MARKET_PREVIEW_TESTS_INPUT_1 "" CACHE PATH "External input 1 for transfer_market_preview_tests; not distributed") +bmh_add_data_test(NAME transfer_market_preview_tests REQUIRED_OPTIONS BMH_TEST_TRANSFER_MARKET_PREVIEW_TESTS_INPUT_1 COMMAND transfer_market_preview_tests "${BMH_DATA}" + "${BMH_TEST_TRANSFER_MARKET_PREVIEW_TESTS_INPUT_1}") + +add_executable(transfer_offer_editor_tests tests/transfer_offer_editor_tests.cpp) +target_link_libraries(transfer_offer_editor_tests PRIVATE bmhcore) +set(BMH_TEST_TRANSFER_OFFER_EDITOR_TESTS_INPUT_1 "" CACHE PATH "External input 1 for transfer_offer_editor_tests; not distributed") +bmh_add_data_test(NAME transfer_offer_editor_tests REQUIRED_OPTIONS BMH_TEST_TRANSFER_OFFER_EDITOR_TESTS_INPUT_1 COMMAND transfer_offer_editor_tests "${BMH_DATA}" + "${BMH_TEST_TRANSFER_OFFER_EDITOR_TESTS_INPUT_1}") + +add_executable(transfer_market_preview_app_tests tests/transfer_market_preview_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(transfer_market_preview_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +set(BMH_TEST_TRANSFER_MARKET_PREVIEW_APP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for transfer_market_preview_app_tests; not distributed") +set(BMH_TEST_TRANSFER_MARKET_PREVIEW_APP_TESTS_INPUT_2 "" CACHE PATH "External input 2 for transfer_market_preview_app_tests; not distributed") +set(BMH_TEST_TRANSFER_MARKET_PREVIEW_APP_TESTS_INPUT_3 "" CACHE PATH "External input 3 for transfer_market_preview_app_tests; not distributed") +bmh_add_data_test(NAME transfer_market_preview_app_tests REQUIRED_OPTIONS BMH_TEST_TRANSFER_MARKET_PREVIEW_APP_TESTS_INPUT_1 BMH_TEST_TRANSFER_MARKET_PREVIEW_APP_TESTS_INPUT_2 BMH_TEST_TRANSFER_MARKET_PREVIEW_APP_TESTS_INPUT_3 COMMAND transfer_market_preview_app_tests "${BMH_DATA}" + "${BMH_TEST_TRANSFER_MARKET_PREVIEW_APP_TESTS_INPUT_1}" + "${BMH_TEST_TRANSFER_MARKET_PREVIEW_APP_TESTS_INPUT_2}" + "${BMH_TEST_TRANSFER_MARKET_PREVIEW_APP_TESTS_INPUT_3}") + +add_executable(transfer_offer_class_app_tests tests/transfer_offer_class_app_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(transfer_offer_class_app_tests PRIVATE bmhui) +set(BMH_TEST_TRANSFER_OFFER_CLASS_APP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for transfer_offer_class_app_tests; not distributed") +bmh_add_data_test(NAME transfer_offer_class_app_tests REQUIRED_OPTIONS BMH_TEST_TRANSFER_OFFER_CLASS_APP_TESTS_INPUT_1 COMMAND transfer_offer_class_app_tests "${BMH_DATA}" + "${BMH_TEST_TRANSFER_OFFER_CLASS_APP_TESTS_INPUT_1}") + +add_executable(human_buyer_market_app_tests tests/human_buyer_market_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(human_buyer_market_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +set(BMH_TEST_HUMAN_BUYER_MARKET_APP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for human_buyer_market_app_tests; not distributed") +bmh_add_data_test(NAME human_buyer_market_app_tests REQUIRED_OPTIONS BMH_TEST_HUMAN_BUYER_MARKET_APP_TESTS_INPUT_1 COMMAND human_buyer_market_app_tests "${BMH_DATA}" + "${BMH_TEST_HUMAN_BUYER_MARKET_APP_TESTS_INPUT_1}") + +add_executable(pending_offer_desk_app_tests tests/pending_offer_desk_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(pending_offer_desk_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +set(BMH_TEST_PENDING_OFFER_DESK_APP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for pending_offer_desk_app_tests; not distributed") +bmh_add_data_test(NAME pending_offer_desk_app_tests REQUIRED_OPTIONS BMH_TEST_PENDING_OFFER_DESK_APP_TESTS_INPUT_1 COMMAND pending_offer_desk_app_tests "${BMH_DATA}" + "${BMH_TEST_PENDING_OFFER_DESK_APP_TESTS_INPUT_1}") + +add_executable(loaded_manager_loop_tests tests/loaded_manager_loop_tests.cpp) +target_link_libraries(loaded_manager_loop_tests PRIVATE bmhcore) +set(BMH_TEST_LOADED_MANAGER_LOOP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for loaded_manager_loop_tests; not distributed") +bmh_add_data_test(NAME loaded_manager_loop_tests REQUIRED_OPTIONS BMH_TEST_LOADED_MANAGER_LOOP_TESTS_INPUT_1 COMMAND loaded_manager_loop_tests "${BMH_DATA}" + "${BMH_TEST_LOADED_MANAGER_LOOP_TESTS_INPUT_1}") + +add_executable(loaded_manager_loop_app_tests tests/loaded_manager_loop_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(loaded_manager_loop_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +set(BMH_TEST_LOADED_MANAGER_LOOP_APP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for loaded_manager_loop_app_tests; not distributed") +bmh_add_data_test(NAME loaded_manager_loop_app_tests REQUIRED_OPTIONS BMH_TEST_LOADED_MANAGER_LOOP_APP_TESTS_INPUT_1 COMMAND loaded_manager_loop_app_tests "${BMH_DATA}" + "${BMH_TEST_LOADED_MANAGER_LOOP_APP_TESTS_INPUT_1}") + +add_executable(national_coach_desk_app_tests tests/national_coach_desk_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(national_coach_desk_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +set(BMH_TEST_NATIONAL_COACH_DESK_APP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for national_coach_desk_app_tests; not distributed") +set(BMH_TEST_NATIONAL_COACH_DESK_APP_TESTS_INPUT_2 "" CACHE PATH "External input 2 for national_coach_desk_app_tests; not distributed") +bmh_add_data_test(NAME national_coach_desk_app_tests REQUIRED_OPTIONS BMH_TEST_INPUTS BMH_TEST_NATIONAL_COACH_DESK_APP_TESTS_INPUT_1 BMH_TEST_NATIONAL_COACH_DESK_APP_TESTS_INPUT_2 REQUIRED_FILES national-pending.fbm COMMAND national_coach_desk_app_tests "${BMH_DATA}" + "${BMH_TEST_NATIONAL_COACH_DESK_APP_TESTS_INPUT_1}" + "${BMH_TEST_NATIONAL_COACH_DESK_APP_TESTS_INPUT_2}") + +add_executable(national_coach_desk_tests tests/national_coach_desk_tests.cpp) +target_link_libraries(national_coach_desk_tests PRIVATE bmhcore) +set(BMH_TEST_NATIONAL_COACH_DESK_TESTS_INPUT_1 "" CACHE PATH "External input 1 for national_coach_desk_tests; not distributed") +bmh_add_data_test(NAME national_coach_desk_tests REQUIRED_OPTIONS BMH_TEST_NATIONAL_COACH_DESK_TESTS_INPUT_1 COMMAND national_coach_desk_tests "${BMH_DATA}" + "${BMH_TEST_NATIONAL_COACH_DESK_TESTS_INPUT_1}") + +add_executable(transfer_offer_team_info_tests tests/transfer_offer_team_info_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(transfer_offer_team_info_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +set(BMH_TEST_TRANSFER_OFFER_TEAM_INFO_TESTS_INPUT_1 "" CACHE PATH "External input 1 for transfer_offer_team_info_tests; not distributed") +bmh_add_data_test(NAME transfer_offer_team_info_tests REQUIRED_OPTIONS BMH_TEST_TRANSFER_OFFER_TEAM_INFO_TESTS_INPUT_1 COMMAND transfer_offer_team_info_tests "${BMH_DATA}" + "${BMH_TEST_TRANSFER_OFFER_TEAM_INFO_TESTS_INPUT_1}") + +add_executable(transfer_offer_player_info_tests tests/transfer_offer_player_info_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(transfer_offer_player_info_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +set(BMH_TEST_TRANSFER_OFFER_PLAYER_INFO_TESTS_INPUT_1 "" CACHE PATH "External input 1 for transfer_offer_player_info_tests; not distributed") +bmh_add_data_test(NAME transfer_offer_player_info_tests REQUIRED_OPTIONS BMH_TEST_TRANSFER_OFFER_PLAYER_INFO_TESTS_INPUT_1 COMMAND transfer_offer_player_info_tests "${BMH_DATA}" + "${BMH_TEST_TRANSFER_OFFER_PLAYER_INFO_TESTS_INPUT_1}") + +add_executable(league_pairings_tests tests/league_pairings_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(league_pairings_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +set(BMH_TEST_LEAGUE_PAIRINGS_TESTS_INPUT_1 "" CACHE PATH "External input 1 for league_pairings_tests; not distributed") +bmh_add_data_test(NAME league_pairings_tests REQUIRED_OPTIONS BMH_TEST_LEAGUE_PAIRINGS_TESTS_INPUT_1 COMMAND league_pairings_tests "${BMH_DATA}" + "${BMH_TEST_LEAGUE_PAIRINGS_TESTS_INPUT_1}") + +add_executable(league_pairings_data_tests tests/league_pairings_data_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(league_pairings_data_tests PRIVATE bmhui) +bmh_add_data_test(NAME league_pairings_data_tests COMMAND league_pairings_data_tests "${BMH_DATA}") + +add_executable(desktop_data_tests tests/desktop_data_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(desktop_data_tests PRIVATE bmhui) +bmh_add_data_test(NAME desktop_data_tests COMMAND desktop_data_tests "${BMH_DATA}") + +add_executable(league_views_data_tests tests/league_views_data_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(league_views_data_tests PRIVATE bmhui) +bmh_add_data_test(NAME league_views_data_tests COMMAND league_views_data_tests "${BMH_DATA}") + +# FLTD is translated by launch_check/the launcher first. Do not point these +# tests at the raw DOS directory: the shared UI consumes the prepared image. +set(BMH_ENGLISH_DATA "" CACHE PATH "Prepared Football Limited game-data directory") + bmh_add_data_test(NAME english_pairings_data_tests DATA_DIR "${BMH_ENGLISH_DATA}" COMMAND league_pairings_data_tests "${BMH_ENGLISH_DATA}") + bmh_add_data_test(NAME english_desktop_data_tests DATA_DIR "${BMH_ENGLISH_DATA}" COMMAND desktop_data_tests "${BMH_ENGLISH_DATA}" --english) + bmh_add_data_test(NAME english_league_views_data_tests DATA_DIR "${BMH_ENGLISH_DATA}" COMMAND league_views_data_tests "${BMH_ENGLISH_DATA}") + bmh_add_data_test(NAME english_training_camp_ui_tests REQUIRED_OPTIONS BMH_TEST_INPUTS REQUIRED_FILES camp-label-colors.bin DATA_DIR "${BMH_ENGLISH_DATA}" COMMAND ui_training_camp_tests "${BMH_ENGLISH_DATA}") + bmh_add_data_test(NAME english_training_camp_content_tests DATA_DIR "${BMH_ENGLISH_DATA}" COMMAND training_camp_app_tests "${BMH_ENGLISH_DATA}" --content-only) + +add_executable(league_table_controls_app_tests tests/league_table_controls_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(league_table_controls_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +# This scenario binds the captured German manager/league/date in WEEK196. +set(BMH_TEST_LEAGUE_TABLE_CONTROLS_APP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for league_table_controls_app_tests; not distributed") +bmh_add_data_test(NAME league_table_controls_app_tests REQUIRED_OPTIONS BMH_TEST_LEAGUE_TABLE_CONTROLS_APP_TESTS_INPUT_1 COMMAND league_table_controls_app_tests "${BMH_DATA}" + "${BMH_TEST_LEAGUE_TABLE_CONTROLS_APP_TESTS_INPUT_1}") + +add_executable(manager_desks_tests tests/manager_desks_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(manager_desks_tests PRIVATE bmhui) +set(BMH_TEST_MANAGER_DESKS_TESTS_INPUT_1 "" CACHE PATH "External input 1 for manager_desks_tests; not distributed") +bmh_add_data_test(NAME manager_desks_tests REQUIRED_OPTIONS BMH_TEST_MANAGER_DESKS_TESTS_INPUT_1 COMMAND manager_desks_tests "${BMH_DATA}" + "${BMH_TEST_MANAGER_DESKS_TESTS_INPUT_1}") + +add_executable(league_table_controls_flow_tests tests/league_table_controls_flow_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(league_table_controls_flow_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +set(BMH_TEST_LEAGUE_TABLE_CONTROLS_FLOW_TESTS_INPUT_1 "" CACHE PATH "External input 1 for league_table_controls_flow_tests; not distributed") +bmh_add_data_test(NAME league_table_controls_flow_tests REQUIRED_OPTIONS BMH_TEST_LEAGUE_TABLE_CONTROLS_FLOW_TESTS_INPUT_1 COMMAND league_table_controls_flow_tests "${BMH_DATA}" + "${BMH_TEST_LEAGUE_TABLE_CONTROLS_FLOW_TESTS_INPUT_1}") + +add_executable(balance_plan_app_tests tests/balance_plan_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(balance_plan_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +set(BMH_TEST_BALANCE_PLAN_APP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for balance_plan_app_tests; not distributed") +bmh_add_data_test(NAME balance_plan_app_tests REQUIRED_OPTIONS BMH_TEST_BALANCE_PLAN_APP_TESTS_INPUT_1 COMMAND balance_plan_app_tests "${BMH_DATA}" + "${BMH_TEST_BALANCE_PLAN_APP_TESTS_INPUT_1}") + +add_executable(top_scorers_app_tests tests/top_scorers_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(top_scorers_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +bmh_add_data_test(NAME top_scorers_app_tests COMMAND top_scorers_app_tests "${BMH_DATA}") + +add_executable(other_games_projection_tests tests/other_games_projection_tests.cpp) +target_link_libraries(other_games_projection_tests PRIVATE bmhcore) +add_test(NAME other_games_projection_tests COMMAND other_games_projection_tests) + +add_executable(other_games_app_tests tests/other_games_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(other_games_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +bmh_add_data_test(NAME other_games_app_tests COMMAND other_games_app_tests "${BMH_DATA}") + +add_executable(other_games_ui_tests tests/other_games_ui_tests.cpp) +target_link_libraries(other_games_ui_tests PRIVATE bmhui) +bmh_add_data_test(NAME other_games_ui_tests COMMAND other_games_ui_tests "${BMH_DATA}") + +add_executable(process_timer_tests tests/process_timer_tests.cpp) +target_link_libraries(process_timer_tests PRIVATE bmhui) +bmh_add_data_test(NAME process_timer_tests COMMAND process_timer_tests "${BMH_DATA}") + +add_executable(stadium_block_expansion_tests tests/stadium_block_expansion_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(stadium_block_expansion_tests PRIVATE bmhui) +set(BMH_TEST_STADIUM_BLOCK_EXPANSION_TESTS_INPUT_1 "" CACHE PATH "External input 1 for stadium_block_expansion_tests; not distributed") +bmh_add_data_test(NAME stadium_block_expansion_tests REQUIRED_OPTIONS BMH_TEST_STADIUM_BLOCK_EXPANSION_TESTS_INPUT_1 COMMAND stadium_block_expansion_tests "${BMH_DATA}" "${BMH_TEST_STADIUM_BLOCK_EXPANSION_TESTS_INPUT_1}") + +add_executable(stadium_block_ui_tests tests/stadium_block_ui_tests.cpp) +target_link_libraries(stadium_block_ui_tests PRIVATE bmhui) +bmh_add_data_test(NAME stadium_block_ui_tests COMMAND stadium_block_ui_tests "${BMH_DATA}") + +add_executable(stadium_block_app_tests tests/stadium_block_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(stadium_block_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +bmh_add_data_test(NAME stadium_block_app_tests REQUIRED_OPTIONS BMH_TEST_INPUTS REQUIRED_FILES stadium.fbm COMMAND stadium_block_app_tests "${BMH_DATA}") + +# Launcher: check the game data like the program start (tests/launch_check.cpp is a helper, +# tests/launch_tests.cpp the CTest with generated archives). +add_executable(launch_check tests/launch_check.cpp) +target_link_libraries(launch_check PRIVATE bmhlaunch) +add_executable(launch_tests tests/launch_tests.cpp) +target_link_libraries(launch_tests PRIVATE bmhlaunch bmh_miniz) +bmh_add_data_test(NAME launch_tests COMMAND launch_tests "${BMH_DATA}") + +add_executable(bank_lender_ui_tests tests/bank_lender_ui_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(bank_lender_ui_tests PRIVATE bmhui) +bmh_add_data_test(NAME bank_lender_ui_tests COMMAND bank_lender_ui_tests "${BMH_DATA}") + +add_executable(bank_lender_app_tests tests/bank_lender_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +target_link_libraries(bank_lender_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +bmh_add_data_test(NAME bank_lender_app_tests COMMAND bank_lender_app_tests "${BMH_DATA}") + +add_executable(sportschau_app_tests tests/sportschau_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE}) +add_executable(sportschau_scene_tests tests/sportschau_scene_tests.cpp ${BMH_APP_SESSION_SOURCE}) +add_executable(sportschau_rating_tests tests/sportschau_rating_tests.cpp ${BMH_APP_SESSION_SOURCE}) +add_executable(sportschau_eleven_tests tests/sportschau_eleven_tests.cpp ${BMH_APP_SESSION_SOURCE}) +add_executable(competition_winner_tests tests/competition_winner_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(competition_winner_tests PRIVATE bmhui) +set(BMH_TEST_COMPETITION_WINNER_TESTS_INPUT_1 "" CACHE PATH "External input 1 for competition_winner_tests; not distributed") +bmh_add_data_test(NAME competition_winner_tests REQUIRED_OPTIONS BMH_TEST_COMPETITION_WINNER_TESTS_INPUT_1 COMMAND competition_winner_tests "${BMH_DATA}" + "${BMH_TEST_COMPETITION_WINNER_TESTS_INPUT_1}") +add_executable(matchday_intro_tests tests/matchday_intro_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(matchday_intro_tests PRIVATE bmhui) +set(BMH_TEST_MATCHDAY_INTRO_TESTS_INPUT_1 "" CACHE PATH "External input 1 for matchday_intro_tests; not distributed") +bmh_add_data_test(NAME matchday_intro_tests REQUIRED_OPTIONS BMH_TEST_MATCHDAY_INTRO_TESTS_INPUT_1 COMMAND matchday_intro_tests "${BMH_DATA}" + "${BMH_TEST_MATCHDAY_INTRO_TESTS_INPUT_1}") +add_executable(sportschau_teaminfo_tests tests/sportschau_teaminfo_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(sportschau_teaminfo_tests PRIVATE bmhui) +set(BMH_TEST_SPORTSCHAU_TEAMINFO_TESTS_INPUT_1 "" CACHE PATH "External input 1 for sportschau_teaminfo_tests; not distributed") +bmh_add_data_test(NAME sportschau_teaminfo_tests REQUIRED_OPTIONS BMH_TEST_SPORTSCHAU_TEAMINFO_TESTS_INPUT_1 COMMAND sportschau_teaminfo_tests "${BMH_DATA}" + "${BMH_TEST_SPORTSCHAU_TEAMINFO_TESTS_INPUT_1}") +target_link_libraries(sportschau_eleven_tests PRIVATE bmhui) +set(BMH_TEST_SPORTSCHAU_ELEVEN_TESTS_INPUT_1 "" CACHE PATH "External input 1 for sportschau_eleven_tests; not distributed") +bmh_add_data_test(NAME sportschau_eleven_tests REQUIRED_OPTIONS BMH_TEST_SPORTSCHAU_ELEVEN_TESTS_INPUT_1 COMMAND sportschau_eleven_tests "${BMH_DATA}" + "${BMH_TEST_SPORTSCHAU_ELEVEN_TESTS_INPUT_1}") +target_link_libraries(sportschau_rating_tests PRIVATE bmhui) +set(BMH_TEST_SPORTSCHAU_RATING_TESTS_INPUT_1 "" CACHE PATH "External input 1 for sportschau_rating_tests; not distributed") +bmh_add_data_test(NAME sportschau_rating_tests REQUIRED_OPTIONS BMH_TEST_SPORTSCHAU_RATING_TESTS_INPUT_1 COMMAND sportschau_rating_tests "${BMH_DATA}" + "${BMH_TEST_SPORTSCHAU_RATING_TESTS_INPUT_1}") +target_link_libraries(sportschau_scene_tests PRIVATE bmhui) +set(BMH_TEST_SPORTSCHAU_SCENE_TESTS_INPUT_1 "" CACHE PATH "External input 1 for sportschau_scene_tests; not distributed") +bmh_add_data_test(NAME sportschau_scene_tests REQUIRED_OPTIONS BMH_TEST_SPORTSCHAU_SCENE_TESTS_INPUT_1 COMMAND sportschau_scene_tests "${BMH_DATA}" + "${BMH_TEST_SPORTSCHAU_SCENE_TESTS_INPUT_1}") +add_executable(autosave_tests tests/autosave_tests.cpp ${BMH_APP_SESSION_SOURCE}) +target_link_libraries(autosave_tests PRIVATE bmhui) +set(BMH_TEST_AUTOSAVE_TESTS_INPUT_1 "" CACHE PATH "External input 1 for autosave_tests; not distributed") +bmh_add_data_test(NAME autosave_tests REQUIRED_OPTIONS BMH_TEST_AUTOSAVE_TESTS_INPUT_1 COMMAND autosave_tests "${BMH_DATA}" + "${BMH_TEST_AUTOSAVE_TESTS_INPUT_1}") +target_link_libraries(sportschau_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET}) +set(BMH_TEST_SPORTSCHAU_APP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for sportschau_app_tests; not distributed") +bmh_add_data_test(NAME sportschau_app_tests REQUIRED_OPTIONS BMH_TEST_SPORTSCHAU_APP_TESTS_INPUT_1 COMMAND sportschau_app_tests "${BMH_DATA}" + "${BMH_TEST_SPORTSCHAU_APP_TESTS_INPUT_1}") + +# The runtime component deliberately contains only the two products and notices. +install(TARGETS openbmh_play openbmh_cli RUNTIME DESTINATION . COMPONENT Runtime) +install(FILES README.md LICENSE THIRD_PARTY_NOTICES.md ACKNOWLEDGEMENTS.md CONTRIBUTING.md + DESTINATION . COMPONENT Runtime) +install(DIRECTORY docs/ DESTINATION docs COMPONENT Runtime PATTERN "qa" EXCLUDE) +if(MSVC) + set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .) + set(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT Runtime) + set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE) + include(InstallRequiredSystemLibraries) + if(OPENBMH_BUILD_EDITOR) + install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION . COMPONENT Editor) + endif() +endif() + +add_executable(tax_animation_unit_tests tests/tax_animation_unit_tests.cpp) +target_link_libraries(tax_animation_unit_tests PRIVATE bmhui) +add_test(NAME tax_animation_unit_tests COMMAND tax_animation_unit_tests) +add_executable(json_unit_tests tests/json_unit_tests.cpp src/cli/json.cpp) +target_include_directories(json_unit_tests PRIVATE src) +add_test(NAME json_unit_tests COMMAND json_unit_tests) +add_executable(launch_unit_tests tests/launch_unit_tests.cpp) +target_link_libraries(launch_unit_tests PRIVATE bmhlaunch bmh_miniz) +if(MSVC) + target_compile_options(launch_unit_tests PRIVATE /utf-8) +endif() +add_test(NAME launch_unit_tests COMMAND launch_unit_tests) + +add_executable(fltd_translation_unit_tests tests/fltd_translation_unit_tests.cpp) +target_link_libraries(fltd_translation_unit_tests PRIVATE bmhlaunch) +add_test(NAME fltd_translation_unit_tests COMMAND fltd_translation_unit_tests) + +add_executable(host_path_display_unit_tests tests/host_path_display_unit_tests.cpp) +target_include_directories(host_path_display_unit_tests PRIVATE src) +if(MSVC) + target_compile_options(host_path_display_unit_tests PRIVATE /utf-8) +endif() +add_test(NAME host_path_display_unit_tests COMMAND host_path_display_unit_tests) + +add_executable(quit_confirmation_unit_tests tests/quit_confirmation_unit_tests.cpp) +target_include_directories(quit_confirmation_unit_tests PRIVATE src) +target_link_libraries(quit_confirmation_unit_tests PRIVATE ${BMH_SDL_TARGET}) +if(MSVC) + target_compile_options(quit_confirmation_unit_tests PRIVATE /utf-8) +endif() +add_test(NAME quit_confirmation_unit_tests COMMAND quit_confirmation_unit_tests) + +add_executable(modern_camp_tests tests/modern_camp_tests.cpp) +target_link_libraries(modern_camp_tests PRIVATE bmh_season_modern) +add_test(NAME modern_camp_tests COMMAND modern_camp_tests) +add_executable(modern_almanac_tests tests/modern_almanac_tests.cpp) +target_link_libraries(modern_almanac_tests PRIVATE bmh_modern_content) +add_test(NAME modern_almanac_tests COMMAND modern_almanac_tests) +add_executable(modern_transfer_read_tests tests/modern_transfer_read_tests.cpp) +target_link_libraries(modern_transfer_read_tests PRIVATE bmh_modern_content) +add_test(NAME modern_transfer_read_tests COMMAND modern_transfer_read_tests) + +add_executable(modern_toto_quote_tests tests/modern_toto_quote_tests.cpp) +target_link_libraries(modern_toto_quote_tests PRIVATE bmh_modern_content) +add_test(NAME modern_toto_quote_tests COMMAND modern_toto_quote_tests) + +add_executable(modern_winners_read_tests tests/modern_winners_read_tests.cpp) +target_link_libraries(modern_winners_read_tests PRIVATE bmh_modern_content) +add_test(NAME modern_winners_read_tests COMMAND modern_winners_read_tests) + +add_executable(modern_coach_identity_tests tests/modern_coach_identity_tests.cpp) +target_link_libraries(modern_coach_identity_tests PRIVATE bmh_modern_content) +add_test(NAME modern_coach_identity_tests COMMAND modern_coach_identity_tests) + +add_executable(modern_manager_presentation_tests tests/modern_manager_presentation_tests.cpp) +target_link_libraries(modern_manager_presentation_tests PRIVATE bmh_modern_content) +add_test(NAME modern_manager_presentation_tests COMMAND modern_manager_presentation_tests) + +add_executable(modern_rankings_read_tests tests/modern_rankings_read_tests.cpp) +target_link_libraries(modern_rankings_read_tests PRIVATE bmh_modern_content) +add_test(NAME modern_rankings_read_tests COMMAND modern_rankings_read_tests) + +add_executable(modern_other_read_tests tests/modern_other_read_tests.cpp) +target_link_libraries(modern_other_read_tests PRIVATE bmh_modern_content) +add_test(NAME modern_other_read_tests COMMAND modern_other_read_tests) + +add_executable(modern_report_read_tests tests/modern_report_read_tests.cpp) +target_link_libraries(modern_report_read_tests PRIVATE bmh_modern_content) +add_test(NAME modern_report_read_tests COMMAND modern_report_read_tests) +add_executable(modern_toto_tests tests/modern_toto_tests.cpp) +target_link_libraries(modern_toto_tests PRIVATE bmh_season_modern) +add_test(NAME modern_toto_tests COMMAND modern_toto_tests) + +add_executable(modern_traffic_tests tests/modern_traffic_tests.cpp) +target_link_libraries(modern_traffic_tests PRIVATE bmh_season_modern) +add_test(NAME modern_traffic_tests COMMAND modern_traffic_tests) +add_executable(modern_calendar_tests tests/modern_calendar_tests.cpp) +target_link_libraries(modern_calendar_tests PRIVATE bmh_season_modern) +add_test(NAME modern_calendar_tests COMMAND modern_calendar_tests) + +add_executable(world_layout_tests tests/world_layout_tests.cpp) +target_link_libraries(world_layout_tests PRIVATE bmhcore) +add_test(NAME world_layout_tests COMMAND world_layout_tests) + +add_executable(fixture_table_tests tests/fixture_table_tests.cpp) +target_link_libraries(fixture_table_tests PRIVATE bmhcore) +add_test(NAME fixture_table_unit_tests COMMAND fixture_table_tests) +bmh_add_data_test(NAME fixture_table_data_tests COMMAND fixture_table_tests "${BMH_DATA}") +bmh_add_data_test(NAME english_fixture_table_data_tests DATA_DIR "${BMH_ENGLISH_DATA}" + COMMAND fixture_table_tests "${BMH_ENGLISH_DATA}") + +# Private build paths are inputs to the source-package tool, never shipped in its manifest. +FetchContent_GetProperties(rmlui) +FetchContent_GetProperties(freetype) +set(package_dependencies "{}") +foreach(dependency IN ITEMS SDL2 miniz lzma_sdk nfd rmlui freetype) + string(REPLACE "\\" "/" dependency_path "${${dependency}_SOURCE_DIR}") + if(dependency STREQUAL "SDL2" AND sdl2_SOURCE_DIR) + set(dependency_path "${sdl2_SOURCE_DIR}") + endif() + string(REPLACE "\"" "\\\"" dependency_path "${dependency_path}") + string(JSON package_dependencies SET "${package_dependencies}" "${dependency}" "\"${dependency_path}\"") +endforeach() +file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/package-dependencies.json" CONTENT "${package_dependencies}\n") diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..49e4fd2 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,26 @@ +# Contributing to OpenBMH + +Use [issues](https://github.com/Weyoune/openbmh/issues) for reproducible bugs and proposals. For a bug, include the OpenBMH version, platform, game edition, expected behaviour and the smallest sequence of actions that shows the problem. Remove personal paths and account information from diagnostic text. + +Keep proprietary game files out of public submissions: no executables, databases, manuals, extracted text, artwork, recordings or saved games. Prefer synthetic inputs and a short description. If an investigation requires privately owned data, coordinate an appropriate process with the maintainers instead of attaching it publicly. + +## Changes and review + +Keep patches focused on a concrete problem. Describe the resulting behaviour, relevant compatibility decisions and validation. Discuss architecture changes, balance changes and substantial new features before investing in a large patch. + +- Use C++20 and the conventions of the surrounding code; write new comments in English. +- Keep gameplay in `src/game`, format handling in `src/formats` and shared session transactions in `src/app`. Frontends translate input and display projections. +- Preserve explicit integer widths, signedness, deterministic random consumption and save compatibility. +- Treat malformed input, stale revisions and unsupported modes explicitly. Do not silently substitute guessed gameplay. +- Mark intentional differences with `OpenBMH deviates from the original:` and explain them in [compatibility documentation](docs/COMPATIBILITY.md). +- Use semantic names for concepts. File offsets and compatibility layout constants belong with format documentation; implementation notes should explain the operation rather than cite disassembly labels. + +## Validation + +Follow [BUILDING.md](docs/BUILDING.md), build the affected targets and run the appropriate CTest subset. Prefer tests with synthetic data that can run from a clean checkout. Tests needing a player's game installation must be conditional on `BMH_DATA`; unavailable private fixtures must not become public dependencies. State which checks ran and their limits. A build on one operating system does not establish native behaviour on another. + +For UI changes, exercise input and state transitions as well as rendering. For session actions, cover rejected/stale input and rollback where those risks are relevant. Avoid making tests restate an implementation without checking behaviour. + +## Licensing + +Contributions to OpenBMH's own code and documentation are under **GPL-3.0-only**. Submit only work you have the right to contribute. Keep existing third-party copyright and license notices intact; vendored code retains its upstream license. Do not add proprietary resources to tests or examples. See [LICENSE](LICENSE) and [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md index ab9a82c..cd05506 100644 --- a/README.md +++ b/README.md @@ -1 +1,19 @@ -# Dreierpack-Manager \ No newline at end of file +# Dreierpack Manager + +A football-management game with a modern interface, based on the shared C++ game and session implementation developed for OpenBMH. + +This repository now contains the secured development snapshot, including the modern SDL/RmlUI interface, the OBW content pipeline and the RmlUI data editor. The original-game community implementation is maintained separately in [OpenBMH](https://github.com/Weyoune/openbmh). + +## Development status + +The implementation and its full history were imported from the former development branch at commit `6f98f894f26730049feb99105224d475c553ff04`. The original repository's initial commit is retained as well. Product/executable names inside this initial snapshot have not yet all been changed; this import is not a new product release. + +- [Build instructions](docs/BUILDING.md) +- [Data editor](docs/EDITOR.md) +- [Modern interface documentation](docs/new_ui/) +- [OBW format](docs/formats/OBW.md) +- [Architecture](docs/architecture.md) +- [Contributing](CONTRIBUTING.md) +- [Imported build/reference README](docs/migration/IMPORTED_README.md) + +Source code uses GPL-3.0-only; retain existing author and third-party notices. Original game databases, executables and extracted proprietary game content are not distributed here. diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md new file mode 100644 index 0000000..0190308 --- /dev/null +++ b/THIRD_PARTY_NOTICES.md @@ -0,0 +1,33 @@ +# Third-party notices + +OpenBMH's own code and documentation use GPL-3.0-only. This does not replace the licenses of the components below. Their upstream copyright and permission notices remain in the source and in [docs/licenses](docs/licenses/README.md). The original game's executable, data, graphics, text and audio are supplied separately by the player and are not licensed or distributed by this project. + +| Component | Version used by the build | License | Included notice | +|---|---|---|---| +| [SDL2](https://github.com/libsdl-org/SDL/tree/release-2.32.10) | 2.32.10, or an explicitly selected system SDL2 | zlib license | [SDL2.txt](docs/licenses/SDL2.txt) | +| SDL2 HIDAPI code | Included with SDL2 | BSD-3-Clause option; upstream also offers GPL-3.0 and its original license | [license options](docs/licenses/SDL2-HIDAPI-options.txt), [BSD text](docs/licenses/SDL2-HIDAPI-BSD.txt), [original text](docs/licenses/SDL2-HIDAPI-original.txt) | +| SDL2 yuv2rgb code | Included with SDL2 | BSD-3-Clause | [SDL2-yuv2rgb.txt](docs/licenses/SDL2-yuv2rgb.txt) | +| [miniz](https://github.com/richgel999/miniz/releases/tag/3.0.2) | 3.0.2 amalgamation | MIT; embedded public-domain notices remain in its source | [miniz.txt](docs/licenses/miniz.txt), [source notices](docs/licenses/miniz-source-notices.txt) | +| [LZMA SDK decoder files](https://github.com/ip7z/7zip/tree/24.09/C) | Selected C files from 7-Zip 24.09 | Public domain, as marked in the selected files | [LZMA-SDK.txt](docs/licenses/LZMA-SDK.txt) | +| [nativefiledialog-extended](https://github.com/btzy/nativefiledialog-extended/tree/v1.2.1) | 1.2.1 | zlib license | [nativefiledialog-extended.txt](docs/licenses/nativefiledialog-extended.txt) | +| [RmlUi](https://github.com/mikke89/RmlUi/tree/6.3) | 6.3, Core and SDL2/OpenGL backend | MIT | [RmlUi.txt](docs/licenses/RmlUi.txt), [containers](docs/licenses/RmlUi-containers.txt), [Khronos notice](docs/licenses/RmlUi-Khronos.txt) | +| [FreeType](https://github.com/freetype/freetype/tree/VER-2-13-3) | 2.13.3 | FreeType License (FTL) | [license choices](docs/licenses/FreeType.txt), [FTL](docs/licenses/FreeType-FTL.txt), [BDF](docs/licenses/FreeType-BDF.txt), [PCF](docs/licenses/FreeType-PCF.txt), [internal gzip/zlib](docs/licenses/FreeType-zlib.txt) | +| LatoLatin Regular and Bold | Unmodified fonts included with RmlUi 6.3 | SIL Open Font License 1.1 | [font notices](docs/licenses/RmlUi-fonts.txt) | +| nlohmann/json (optional editor) | 3.12.0 | MIT | [notice](docs/licenses/nlohmann-json.txt) | +| cpp-httplib (optional editor) | 0.63.0, local HTTP without TLS | MIT | [notice](docs/licenses/cpp-httplib.txt) | +| SDL2_image (optional editor) | 2.8.8, selected static codecs | zlib | [notice](docs/licenses/SDL2_image.txt) | +| stb_image (SDL2_image PNG/JPEG decoder) | Version supplied by SDL2_image 2.8.8 | MIT option | [verbatim alternatives](docs/licenses/stb-image.txt) | +| libwebp (optional editor) | SDL2_image's pinned `1.0.3-SDL` fork, commit `05b15cb8`, including upstream backported fixes | BSD-3-Clause and patent grant | [license](docs/licenses/libwebp.txt), [patents](docs/licenses/libwebp-PATENTS.txt) | +| LunaSVG / bundled PlutoVG (optional editor) | LunaSVG 3.5.0 and its tracked PlutoVG sources | MIT | [LunaSVG](docs/licenses/LunaSVG.txt), [PlutoVG](docs/licenses/PlutoVG.txt) | +| pugixml (optional editor) | 1.15 | MIT | [notice](docs/licenses/pugixml.txt) | +| [Nuked OPL3](https://github.com/nukeykt/Nuked-OPL3/tree/765ec962e473aeb767e4cba74ffdc8f588ffbfe8) | Commit `765ec962e473aeb767e4cba74ffdc8f588ffbfe8` | LGPL-2.1-or-later | [LGPL-2.1.txt](docs/licenses/LGPL-2.1.txt), [copyright and source notice](docs/licenses/Nuked-OPL3-notices.txt) | + +The miniz implementation provides a zlib-compatible API; it is not the zlib library. FreeType's internal gzip module includes its bundled zlib code; an external zlib library is not linked by the pinned build. SDL2 and nativefiledialog-extended use the **zlib license**, which is distinct from using zlib code. A system-library build or distributor's package can have additional runtime dependencies; its notices must match the libraries actually included. + +Portions of this software are copyright © the FreeType Project (www.freetype.org). All rights reserved. The pinned build uses the FreeType License option, with the included module notices retained. RmlUi and FreeType are linked statically; their corresponding pinned source is included in the source package. + +Only the public-domain C decoding subset is taken from the 7-Zip source package. This statement does not describe all of 7-Zip: other parts of that upstream project have different licenses and are not included here. + +Nuked OPL3 is linked into the audio implementation. A binary distribution must retain its LGPL notices and provide the corresponding library source and the materials needed to exercise the LGPL's modification and relinking rights. For a source release, the vendored implementation and its build files are included. Binary distributors must also satisfy the source-distribution obligations of OpenBMH's GPL license. Merely copying license texts does not replace these obligations. + +Native platform libraries, such as GTK on Linux, may be required at runtime even when they are not bundled. Compiler runtime files included with a binary package retain their own terms. See the package's file list and platform notes for the actual distribution. diff --git a/assets/editor/editor.rml b/assets/editor/editor.rml new file mode 100644 index 0000000..df38174 --- /dev/null +++ b/assets/editor/editor.rml @@ -0,0 +1,15 @@ + + +OpenBMH Editor + +
+
OB

OpenBMH Editor

+
+

+
+
+
+
+
+
+
diff --git a/assets/editor/theme.rcss b/assets/editor/theme.rcss new file mode 100644 index 0000000..a3e0d59 --- /dev/null +++ b/assets/editor/theme.rcss @@ -0,0 +1,306 @@ +/* SPDX-License-Identifier: GPL-3.0-only */ +/* The submenu palettes are shared by every surface and control. RmlUI 6.3 + resolves these inherited custom properties when the body class changes. */ +body { + --text: #dce3e9; + --muted: #a8b8c8; + --accent: #a9dccb; + --window-top: #303c49; + --window-bottom: #1a2531; + --chrome: #d5e3ed0a; + --sidebar: #111a2426; + --panel: #111a2433; + --wash: #e3edf605; + --control-top: #c1d1e31c; + --control-bottom: #869eb312; + --input: #17232e99; + --popup: #293744; + --hover: #d0e2f226; + --selected: #a9d4c526; + --selected-hover: #a9d4c53d; + --selected-text: #e8f5ef; + --border: #e2ebf02b; + --divider: #d4e1eb12; + --accent-border: #a9d4c55c; + --focus: #8cc8ff; + --danger: #f0aaa7; + --danger-border: #f0aaa75c; + --warning: #e1c68b; + --positive: #b5dfcf; + --note: #a9d4c50a; + --modal: #283542; + --overlay: #0b11189c; + --image-stage: #1b2733; + --crop: #a9dccb; + --crop-wash: #a9dccb16; + --scrollbar: #a8b8c860; + --scrollbar-hover: #a8b8c899; + --toggle-off: #617483; + --toggle-on: #a9dccb; + margin: 0; width: 100%; height: 100%; overflow: hidden; + font-family: LatoLatin; font-size: 15dp; color: var(--text); + background-color: var(--window-bottom); + decorator: linear-gradient(155deg, var(--window-top), var(--window-bottom)); +} +body.silver { + --text: #233443; + --muted: #526779; + --accent: #25617a; + --window-top: #f0f5f9; + --window-bottom: #d4e0ea; + --chrome: #ffffff45; + --sidebar: #42627d09; + --panel: #f1f6fa80; + --wash: #42627d09; + --control-top: #ffffffb0; + --control-bottom: #bfd0e259; + --input: #ffffffad; + --popup: #f3f7fc; + --hover: #9eb9d43b; + --selected: #a3c3dd54; + --selected-hover: #a3c3dd88; + --selected-text: #193b52; + --border: #6c879c4a; + --divider: #6c879c28; + --accent-border: #356f966e; + --focus: #2b729a; + --danger: #a23f45; + --danger-border: #a23f4566; + --warning: #805b18; + --positive: #2e6953; + --note: #2e69530a; + --modal: #eaf1f7; + --overlay: #21324166; + --image-stage: #cfdae3; + --crop: #25617a; + --crop-wash: #25617a16; + --scrollbar: #6c879c88; + --scrollbar-hover: #526779bb; + --toggle-off: #91a8b8; + --toggle-on: #25617a; +} +body.matchday { + --text: #efeded; + --muted: #b7b4b9; + --accent: #efb2aa; + --window-top: #343338; + --window-bottom: #202126; + --chrome: #ffffff07; + --sidebar: #1d1e2426; + --panel: #1d1e2466; + --wash: #f8e7e00a; + --control-top: #e8d6dc12; + --control-bottom: #a1a0aa0d; + --input: #191a208a; + --popup: #303037; + --hover: #d5b3b423; + --selected: #d48c7b26; + --selected-hover: #d48c7b3d; + --selected-text: #ffe5de; + --border: #ead9da29; + --divider: #ead9da16; + --accent-border: #e5a19770; + --focus: #efb2aa; + --danger: #f0a6a7; + --danger-border: #f0a6a75c; + --warning: #e1c68b; + --positive: #afd1be; + --note: #afd1be0a; + --modal: #2c2c32; + --overlay: #1111149c; + --image-stage: #23242a; + --crop: #efb2aa; + --crop-wash: #efb2aa16; + --scrollbar: #827c8199; + --scrollbar-hover: #b7b4b999; + --toggle-off: #68646c; + --toggle-on: #efb2aa; +} +* { box-sizing: border-box; } +div, h1, h2, p, label, header, aside, section, footer { display: block; } +span { display: inline-block; } +#shell { width: 100%; height: 100%; display: flex; flex-direction: column; } +header { height: 86dp; flex-shrink: 0; display: flex; align-items: center; padding: 0 28dp; background-color: var(--chrome); border-bottom: 1dp var(--border); } +.brand { display: flex; align-items: center; width: 300dp; } +.brand-mark { width: 43dp; height: 43dp; line-height: 43dp; font-size: 21dp; font-weight: bold; text-align: center; border: 1dp var(--accent-border); border-radius: 13dp; color: var(--accent); background-color: var(--wash); margin-right: 13dp; } +.brand-mark span { color: var(--text); } +h1, h2, p { margin: 0; } +h2 { font-size: 20dp; font-weight: bold; } +h2 span { font-weight: normal; color: var(--muted); } +small { display: block; font-size: 12dp; color: var(--muted); margin-top: 4dp; } +#world-caption { flex: 1; font-size: 14dp; color: var(--muted); overflow: hidden; white-space: nowrap; } +#top-actions, #bottom-actions, #page-actions, .button-row { display: flex; align-items: center; gap: 8dp; } +button { font-family: LatoLatin; font-size: 14dp; color: var(--text); background-color: transparent; decorator: linear-gradient(var(--control-top), var(--control-bottom)); border: 1dp var(--border); border-radius: 8dp; padding: 9dp 14dp; cursor: pointer; text-align: center; white-space: nowrap; tab-index: auto; } +button:hover { background-color: var(--hover); decorator: none; } +button.primary { background-color: var(--selected); decorator: none; color: var(--selected-text); border-color: var(--accent-border); font-weight: bold; } +button.primary:hover { background-color: var(--selected-hover); } +button.danger { color: var(--danger); border-color: var(--danger-border); } +button:disabled { opacity: 0.35; cursor: unavailable; } +button.quiet { border-color: transparent; background-color: transparent; decorator: none; } +button.quiet:hover { background-color: var(--hover); } +#main { flex: 1; display: flex; min-height: 0; } +aside { width: 220dp; flex-shrink: 0; padding: 28dp 14dp 18dp; display: flex; flex-direction: column; background-color: var(--sidebar); border-right: 1dp var(--divider); } +.eyebrow { font-size: 11dp; font-weight: bold; letter-spacing: 1.5dp; color: var(--muted); text-transform: uppercase; } +#nav-label { padding: 0 14dp 18dp; } +#navigation { display: flex; flex-direction: column; gap: 5dp; min-height: 0; overflow-y: auto; } +.nav { width: 100%; display: flex; align-items: center; padding: 11dp 13dp; text-align: left; border-color: transparent; background-color: transparent; decorator: none; font-size: 15dp; } +.nav .glyph { width: 20dp; height: 20dp; margin-right: 16dp; flex-shrink: 0; } +.nav.selected { background-color: var(--selected); color: var(--accent); border-color: var(--accent-border); } +.aside-foot { margin-top: auto; padding: 24dp 14dp 0; font-size: 12dp; color: var(--muted); } +.aside-foot small { line-height: 1.45; } +.small-pitch { height: 50dp; width: 84dp; border: 1dp var(--border); border-radius: 4dp; margin-bottom: 15dp; position: relative; } +.small-pitch div { position: absolute; width: 20dp; height: 20dp; border: 1dp var(--border); border-radius: 10dp; left: 31dp; top: 14dp; } +#workspace { flex: 1; padding: 28dp 30dp 16dp; display: flex; flex-direction: column; min-width: 0; } +#page-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 23dp; flex-shrink: 0; } +h1 { font-size: 28dp; font-weight: bold; margin-top: 7dp; } +#page-subtitle { color: var(--muted); margin-top: 7dp; font-size: 14dp; } +#toolbar { display: flex; gap: 10dp; margin-bottom: 16dp; flex-shrink: 0; align-items: center; } +input, select, textarea { font-family: LatoLatin; font-size: 14dp; background-color: var(--input); color: var(--text); border: 1dp var(--border); border-radius: 7dp; padding: 9dp 10dp; height: 38dp; tab-index: auto; } +input[type=checkbox] { width: 18dp; height: 18dp; padding: 2dp; background-color: var(--toggle-off); } +input[type=checkbox]:checked { background-color: var(--toggle-on); decorator: none; } +input[type=range] { height: 24dp; padding: 0; } +input[type=range] track { height: 4dp; background-color: var(--scrollbar); margin: 9dp 0; border-radius: 2dp; } +input[type=range] bar { width: 16dp; height: 16dp; border-radius: 8dp; background-color: var(--accent); margin-top: 3dp; } +/* Modern Desktop pickers, in density-independent editor dimensions. The + native RmlUI controls retain their values, input and change events. */ +select { padding-right: 30dp; cursor: pointer; background-color: transparent; decorator: linear-gradient(var(--control-top), var(--control-bottom)); box-shadow: inset 0 1dp #eff6fc12, 0 1dp 2dp #0002; } +select:hover { background-color: var(--hover); decorator: none; } +select selectvalue { padding: 0; } +/* RmlUI anchors the arrow to the content box. Use the reserved right padding + and center the rotated glyph within the control's 18dp content height. */ +select selectarrow { width: 8dp; height: 8dp; margin-right: -15dp; margin-top: 3dp; decorator: none; border-bottom: 1.5dp var(--muted); border-right: 1.5dp var(--muted); transform: rotate(45deg); } +select selectbox { width: 100%; min-width: 180dp; background-color: var(--popup); color: var(--text); border: 1dp var(--border); border-radius: 9dp; padding: 5dp; margin-top: 7dp; margin-bottom: 7dp; max-height: 320dp; overflow-y: auto; box-shadow: 0 9dp 28dp #0008; } +select option { display: flex; align-items: center; min-height: 34dp; padding: 5dp 7dp; border-radius: 5dp; white-space: nowrap; cursor: pointer; } +select option:hover { background-color: var(--hover); } +select option:disabled { opacity: 0.35; cursor: unavailable; } +.option-check { width: 6dp; height: 10dp; margin: 0 12dp 3dp 3dp; flex-shrink: 0; border-right: 1.5dp var(--accent); border-bottom: 1.5dp var(--accent); transform: rotate(45deg); opacity: 0; } +option:checked .option-check { opacity: 1; } +selectvalue .option-check { display: none; } +.option-label { overflow: hidden; text-overflow: ellipsis; } +.option-label, .option-check { pointer-events: none; focus: none; } +#search { width: 250dp; margin-right: auto; } +#filter-nation, #filter-league { width: 205dp; } +#filter-team { width: 240dp; } +#page-content { flex: 1; min-height: 0; display: flex; } +.split { width: 100%; display: flex; gap: 20dp; min-height: 0; } +.list-panel { flex: 1; min-width: 0; border: 1dp var(--border); border-radius: 12dp; overflow: hidden; background-color: var(--panel); display: flex; flex-direction: column; } +.table-header { display: flex; align-items: center; height: 42dp; flex-shrink: 0; padding: 0 16dp; background-color: var(--wash); border-bottom: 1dp var(--divider); } +.table-header button { flex: 1; text-align: left; padding: 0; border: 0; background-color: transparent; decorator: none; font-size: 12dp; color: var(--muted); } +.table-header button:hover { color: var(--text); } +.table-header button:first-child { flex: 2; } +.table-scroll { flex: 1; overflow-y: auto; } +.comparison-layout { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; } +.comparison-bar { display: flex; align-items: center; gap: 12dp; margin-bottom: 14dp; flex-shrink: 0; } +.comparison-bar label, .comparison-bar span { color: var(--muted); font-size: 12dp; } +.comparison-bar span { margin-left: auto; } +#comparison-set { width: 310dp; } +.comparison-panel { min-height: 0; } +.comparison-x { flex: 1; min-height: 0; overflow-x: auto; overflow-y: hidden; display: flex; } +.comparison-table { flex-shrink: 0; display: flex; flex-direction: column; min-height: 0; } +.comparison-head { display: flex; flex-shrink: 0; align-items: stretch; background-color: var(--wash); border-bottom: 1dp var(--border); padding-right: 20dp; } +.comparison-head button { border: 0; border-radius: 0; decorator: none; background-color: transparent; color: var(--muted); font-size: 13dp; padding: 12dp 10dp; white-space: normal; } +.comparison-head button:disabled { opacity: 1; cursor: default; } +.comparison-head small { font-size: 11dp; } +.comparison-direction { width: 7dp; height: 7dp; border-bottom: 1.5dp var(--accent); border-right: 1.5dp var(--accent); transform: rotate(45deg); margin-left: 8dp; margin-bottom: 3dp; } +.comparison-direction.ascending { transform: rotate(225deg); margin-bottom: 0; } +.comparison-body { flex: 1; min-height: 0; overflow-y: auto; } +.comparison-row { display: flex; align-items: center; border: 0; border-bottom: 1dp var(--divider); border-radius: 0; decorator: none; background-color: transparent; padding: 0; min-height: 47dp; text-align: left; } +.comparison-cell { flex-shrink: 0; padding: 14dp 10dp; text-align: right; font-size: 14dp; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } +.comparison-cell.text { text-align: left; } +.comparison-name-text { display: block; overflow: hidden; text-overflow: ellipsis; } +.comparison-note { flex-shrink: 0; margin-top: 12dp; font-size: 12dp; line-height: 1.6; color: var(--muted); } +.comparison-choices { display: flex; flex-wrap: wrap; max-height: 430dp; overflow-y: auto; margin-top: 16dp; gap: 6dp; } +.comparison-choices label { width: 31%; display: flex; align-items: center; padding: 10dp 4dp; font-size: 14dp; } +.comparison-choices input { flex-shrink: 0; margin-right: 10dp; border-radius: 4dp; } +.record { display: flex; align-items: center; width: 100%; min-height: 49dp; padding: 9dp 16dp; border: 0; border-bottom: 1dp var(--divider); border-radius: 0; background-color: transparent; decorator: none; text-align: left; } +.record:hover { background-color: var(--hover); } +.record.selected { background-color: var(--selected); border-left: 3dp var(--accent); padding-left: 13dp; } +.record .cell { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 10dp; font-size: 13dp; color: var(--muted); } +.record .cell:first-child { flex: 2; font-size: 14dp; color: var(--text); display: flex; align-items: center; } +.record.selected .cell { color: var(--selected-text); } +.mini-logo { width: 27dp; height: 27dp; margin-right: 12dp; flex-shrink: 0; } +.inspector { width: 370dp; flex-shrink: 0; border: 1dp var(--border); border-radius: 12dp; background-color: var(--panel); display: flex; flex-direction: column; overflow: hidden; } +.inspector-head { padding: 22dp; border-bottom: 1dp var(--divider); display: flex; align-items: center; flex-shrink: 0; } +.hero-image { width: 70dp; height: 70dp; margin-right: 16dp; } +.inspector-head h2 { font-size: 19dp; } +.inspector-head small { font-size: 10dp; margin-top: 7dp; } +.inspector-scroll { flex: 1; overflow-y: auto; padding: 20dp 22dp; } +.form-field { margin-bottom: 15dp; } +.form-field label { display: block; font-size: 12dp; color: var(--muted); margin-bottom: 6dp; } +.form-field input, .form-field select, .form-field textarea { width: 100%; } +textarea { height: 110dp; font-size: 12dp; line-height: 1.5; } +.form-section { padding-top: 8dp; margin-bottom: 15dp; font-size: 12dp; font-weight: bold; color: var(--accent); } +.form-help { font-size: 11dp; color: var(--muted); line-height: 1.5; margin-top: 6dp; } +.connection-actions { margin-top: 20dp; } +.inspector-actions { padding: 16dp 20dp; border-top: 1dp var(--divider); display: flex; gap: 8dp; flex-shrink: 0; } +.inspector-actions button { flex: 1; } +.empty { margin: auto; padding: 45dp; text-align: center; color: var(--muted); line-height: 1.7; } +#pagination { display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; padding-top: 14dp; color: var(--muted); font-size: 12dp; } +footer { height: 57dp; padding: 0 28dp; display: flex; align-items: center; gap: 20dp; flex-shrink: 0; border-top: 1dp var(--divider); background-color: var(--sidebar); font-size: 12dp; } +#state { width: 210dp; color: var(--positive); } +#status-message { flex: 1; color: var(--muted); } +#bottom-actions button { font-size: 12dp; padding: 7dp 11dp; } +.dashboard { width: 100%; overflow-y: auto; padding-right: 7dp; } +.hero { padding: 32dp; border: 1dp var(--border); border-radius: 16dp; background-color: var(--wash); margin-bottom: 22dp; } +.hero h1 { font-size: 32dp; margin: 0 0 12dp; } +.hero p { color: var(--muted); line-height: 1.6; max-width: 700dp; margin-bottom: 23dp; } +.metrics { display: flex; flex-wrap: wrap; gap: 14dp; } +.metric { width: 23%; flex-grow: 1; min-width: 180dp; min-height: 106dp; padding: 20dp; border: 1dp var(--border); border-radius: 12dp; background-color: var(--panel); decorator: none; text-align: left; } +.metric span { display: block; font-size: 28dp; font-weight: bold; color: var(--text); margin-top: 9dp; } +.note { margin-top: 22dp; padding: 18dp 20dp; background-color: var(--note); border: 1dp var(--accent-border); border-radius: 10dp; color: var(--positive); font-size: 13dp; line-height: 1.6; } +.source-json { font-size: 11dp; line-height: 1.5; white-space: pre-wrap; color: var(--muted); margin: 14dp 0; } +.regulation-layout { flex: 1; display: flex; gap: 20dp; min-width: 0; min-height: 0; } +.regulation-list { width: 270dp; flex: none; } +.regulation-choice { display: block; width: 100%; text-align: left; white-space: normal; padding: 15dp 18dp; border-radius: 0; border: 0; border-bottom: 1dp var(--divider); } +.regulation-choice small { font-size: 11dp; } +.regulation-detail { min-width: 0; } +.regulation-scroll { flex: 1; overflow-y: auto; padding: 25dp; } +.regulation-scroll p { margin-top: 12dp; font-size: 15dp; line-height: 1.55; } +.regulation-scroll h2 { line-height: 1.4; } +.regulation-section { margin: 27dp 0; padding-top: 22dp; border-top: 1dp var(--divider); } +.regulation-section h2 { font-size: 18dp; margin-bottom: 13dp; } +.regulation-clause { padding: 15dp 18dp; border: 1dp var(--border); border-radius: 10dp; background-color: var(--wash); margin-bottom: 12dp; } +.regulation-clause p { margin-top: 8dp; } +.regulation-scroll .source-json { font-size: 13dp; line-height: 1.55; } +.history-row, .diagnostic { padding: 15dp 20dp; border-bottom: 1dp var(--divider); line-height: 1.6; } +.diagnostic.error { color: var(--danger); } +.diagnostic.warning { color: var(--warning); } +.badge { display: inline-block; font-size: 11dp; border: 1dp var(--accent-border); color: var(--positive); border-radius: 5dp; padding: 3dp 6dp; } +#overlay { display: none; position: absolute; left: 0; top: 0; width: 100%; height: 100%; background-color: var(--overlay); align-items: center; justify-content: center; } +#modal { width: 620dp; max-height: 91%; padding: 27dp; border: 1dp var(--border); border-radius: 18dp; background-color: var(--modal); display: flex; flex-direction: column; } +#modal.wide { width: 880dp; } +.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22dp; flex-shrink: 0; } +.close { padding: 0 7dp; background-color: transparent; decorator: none; border-color: transparent; font-size: 25dp; } +#modal-content { overflow-y: auto; line-height: 1.6; } +#modal-buttons { margin-top: 23dp; display: flex; justify-content: flex-end; gap: 9dp; flex-shrink: 0; } +#modal-error { color: var(--danger); font-size: 13dp; margin-top: 10dp; } +#history-overlay { display: none; position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 10; } +#history-menu { position: absolute; width: 248dp; padding: 6dp; border: 1dp var(--border); border-radius: 10dp; background-color: var(--popup); } +#history-menu button { width: 100%; display: flex; align-items: center; text-align: left; padding: 10dp; border-color: transparent; decorator: none; font-size: 15dp; } +.history-arrow { width: 28dp; flex-shrink: 0; display: flex; align-items: center; } +.history-arrow .glyph { width: 20dp; height: 20dp; } +#history-menu small { margin: 0 0 0 auto; padding-left: 16dp; } +.image-layout { display: flex; gap: 24dp; } +.image-stage { flex: 1; min-height: 360dp; background-color: var(--image-stage); border: 1dp var(--border); border-radius: 10dp; display: flex; align-items: center; justify-content: center; overflow: hidden; } +.hero-image, .mini-logo { cursor: pointer; } +.readonly-stage { height: 500dp; } +.image-caption { margin-top: 12dp; word-break: break-all; } +#crop-canvas { position: relative; } +#edit-preview { display: block; } +#crop-box { position: absolute; border: 2dp var(--crop); background-color: var(--crop-wash); pointer-events: none; } +.image-controls { width: 215dp; } +.pair { display: flex; gap: 8dp; } +.pair .form-field { flex: 1; min-width: 0; } +.check-label { display: flex; align-items: center; gap: 10dp; font-size: 14dp; margin: 14dp 0; } +scrollbarvertical { width: 7dp; margin: 3dp; } +scrollbarvertical slidertrack { background-color: transparent; } +scrollbarvertical sliderbar { background-color: var(--scrollbar); border-radius: 4dp; min-height: 30dp; } +scrollbarvertical sliderbar:hover { background-color: var(--scrollbar-hover); } +scrollbarvertical sliderarrowdec, scrollbarvertical sliderarrowinc { height: 0; } +scrollbarhorizontal { height: 10dp; margin: 3dp; } +scrollbarhorizontal slidertrack { background-color: transparent; } +scrollbarhorizontal sliderbar { background-color: var(--scrollbar); border-radius: 4dp; min-width: 40dp; } +scrollbarhorizontal sliderbar:hover { background-color: var(--scrollbar-hover); } +scrollbarhorizontal sliderarrowdec, scrollbarhorizontal sliderarrowinc { width: 0; } +button:focus, input:focus, select:focus, textarea:focus { border-color: var(--focus); } +.nav:focus { border-color: var(--focus); } diff --git a/assets/launcher/launcher.rml b/assets/launcher/launcher.rml new file mode 100644 index 0000000..94671dd --- /dev/null +++ b/assets/launcher/launcher.rml @@ -0,0 +1,45 @@ + + + + OpenBMH + + + + +
+
+
+
OpenBMH
+
+
+
+

Deine Spiele

+
Bundesliga Manager Hattrick · Football Limited
+
+
NameArt
+
+
+
0 Mods
+
+
+ + + + + +
+
+
+
+