Add read-only game and league regulations to editor 0.5.2 (by Codex)
OBW Editor / editor (linux-x64, ubuntu-24.04) (push) Canceled after 0s
OBW Editor / editor (macos-arm64, macos-14) (push) Canceled after 0s
OBW Editor / editor (windows-x64, windows-2022) (push) Canceled after 0s
OBW Editor / release (push) Canceled after 0s

This commit is contained in:
Codex committed 2026-10-23 06:28:12 +02:00
1 parent 221478b629
commit 9f1928bd9e
27 files changed
+993 -22

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
<!-- SPDX-License-Identifier: GPL-3.0-only -->
# Editor 0.5.2: read-only regulations
Native 1440×900 SDL2/OpenGL/RmlUI captures on Linux with software OpenGL. All
records and artwork are synthetic. No installation, real club/player data,
savegame, private archive or user profile is included.
| View | Capture |
|---|---|
| Before: competition inspector, released 0.5.1 | [Before](before-competitions-0.5.1.png) |
| Promotion/relegation, Midnight Glass / German | [After](rules-midnight-de.png) |
| International qualification and replacement | [Qualification](qualification-midnight-de.png) |
| Preserved game rule and attribute ranges | [Game rules](game-rules-midnight-de.png) |
| Silver Glass / English | [Silver](rules-silver-en.png) |
| Matchday / German | [Matchday](rules-matchday-de.png) |
Create the display fixture using the editor's own synthetic demo:
```sh
python3 docs/qa/editor-regulations/make_fixture.py PATH/TO/OpenBMHEditor TEMP/synthetic.obw
OpenBMHEditor --open TEMP/synthetic.obw --page regulations
```
The recipe adds synthetic upper/lower leagues, explicit rank ranges, a playoff,
an international qualification selector and fallback. It is a display fixture,
not a playable season. Options selects the language/theme. Scroll the right
panel to qualification; select **Game rules** and `demo@1` to inspect the stored
attribute ranges. Before was captured with the same fixture in the 0.5.1
competition inspector, which had no dedicated rule view.
Validation: existing editor core/MCP tests, comparisons, version and new
regulations tests; native mouse/keyboard integration and package-boundary
checks. The regulations tests cover declared movement, both slot locations,
explicit destinations, fallback preservation, language/filtering, parallel
Classic champions/playoffs, the bottom newcomer pool, foreign closed leagues,
the named UEFA quotas, declared-rule precedence, null extensions and unchanged
revision/history. The GUI test switches both rule tabs, searches and verifies
the shared read-only MCP projection without changing the world.
Actual Diamond source identity, unchanged game data, images, round-trip checks
and captures are recorded separately in the private content repository.
Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

@@ -0,0 +1,54 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-3.0-only
"""Make a synthetic display fixture; no real-world or installed game data."""
import argparse
import json
from pathlib import Path
import subprocess
import tempfile
import zipfile
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('editor', type=Path)
parser.add_argument('output', type=Path)
args = parser.parse_args()
with tempfile.TemporaryDirectory(prefix='obw-rule-fixture-') as temporary:
root = Path(temporary)
settings = root / 'settings.json'
settings.write_text('{"mcp_enabled":false}')
subprocess.run([str(args.editor.resolve()), '--headless', '--demo', '--settings', str(settings),
'--output', str(root / 'demo.obw')], check=True)
with zipfile.ZipFile(root / 'demo.obw') as source:
docs = {file: source.read(file) for file in source.namelist()}
comps = json.loads(docs['world/competitions.json'])
league = comps['items'][0]
league.update({'tier': 2, 'stages': [{'id': 'regular', 'format': 'league', 'teams': 18, 'legs': 2,
'points': {'win': 3, 'draw': 1, 'loss': 0}, 'tiebreakers': ['points', 'goal_difference', 'goals_for']}],
'movement': [{'ranks': [1, 2], 'to': 'comp:upper'},
{'ranks': [3], 'to': 'comp:playoff', 'role': 'challenger'},
{'ranks': [16, 18], 'to': 'comp:lower'}]})
clubs = json.loads(docs['world/clubs.json'])
for i in range(16):
club_id = 'club:fixture-' + str(i)
clubs['items'].append({'id': club_id, 'name': 'Testverein ' + str(i + 1), 'type': 'club',
'nation': 'nation:de', 'competition': 'comp:demo'})
league['members'].append(club_id)
for code, title, tier in [('upper', 'Oberliga (Demo)', 1), ('lower', 'Unterliga (Demo)', 3)]:
comps['items'].append({'id': 'comp:' + code, 'name': title, 'nation': 'nation:de', 'type': 'league',
'tier': tier, 'stages': [{'id': 'regular', 'format': 'league', 'teams': 18}]})
comps['items'].append({'id': 'comp:playoff', 'name': 'Relegation (Demo)', 'type': 'cup'})
comps['items'].append({'id': 'comp:international', 'name': 'Internationaler Demo-Pokal',
'type': 'club_international', 'slots': [{'from': 'comp:demo', 'ranks': [1, 4], 'stage': 'main',
'fallback': {'from': 'comp:upper', 'next_unqualified': True}}]})
for key, value in [('world/competitions.json', comps), ('world/clubs.json', clubs)]:
docs[key] = json.dumps(value, ensure_ascii=False).encode()
args.output.parent.mkdir(parents=True, exist_ok=True)
with zipfile.ZipFile(args.output, 'w', zipfile.ZIP_DEFLATED) as output:
for file, data in docs.items():
output.writestr(file, data)
if __name__ == '__main__':
main()
Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB