Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
476e38ca41 | ||
|
|
0b07d0d374 | ||
|
|
48d2216394 | ||
|
|
bd5f4a4ccb | ||
|
|
9d050ff20b | ||
|
|
6e835a5dad | ||
|
|
4592ce5d95 | ||
|
|
1889eff0b7 | ||
|
|
e4c52c82fe | ||
|
|
3fa55eb32f | ||
|
|
11fce1e7db | ||
|
|
3616bce66d | ||
|
|
de3144d420 | ||
|
|
34768b446a | ||
|
|
465a962f58 |
No files matched your search
@@ -29,6 +29,8 @@ jobs:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
|
||||
with:
|
||||
path: waozixyz/arcade
|
||||
- name: Check release following
|
||||
run: python3 tests/game_updates_test.py
|
||||
- name: Pin the latest game releases
|
||||
id: pin
|
||||
env:
|
||||
|
||||
@@ -1,5 +1,36 @@
|
||||
# Arcade changelog
|
||||
|
||||
## 0.7.86
|
||||
|
||||
- Shovey 0.6.154: Keep opened chests open across restarts and account sync; show the blue Dew diamond only while their reward is unclaimed.
|
||||
- Shovey 0.6.154: Show an empty open chest after its Dew is claimed.
|
||||
- Shovey 0.6.154: Use corrected campaign boards after an update, including level 29 when an older campaign was cached offline.
|
||||
|
||||
## 0.7.85
|
||||
|
||||
- Shovey keeps opened and claimed chests synchronized, with a blue diamond only for an unclaimed reward.
|
||||
- Shovey uses corrected boards after an update instead of an older cached campaign.
|
||||
- Apfelwurm shows level previews only after they are unlocked.
|
||||
|
||||
## 0.7.84
|
||||
|
||||
- Complete automatic reward recovery for older Shovey saves.
|
||||
|
||||
## 0.7.83
|
||||
|
||||
- Preserve earned Shovey reward eligibility when upgrading older synced saves.
|
||||
|
||||
## 0.7.82
|
||||
|
||||
- Apfelwurm 0.1.6: Try again after game over starts the furthest unlocked level with three lives and a fresh score.
|
||||
- Apfelwurm 0.1.6: Choose level from the title to browse all five landscapes, preview each board and replay any unlocked level. Future levels remain locked until you reach them.
|
||||
- Apfelwurm 0.1.6: Use Escape to pause or go back in the browser without stopping the game.
|
||||
|
||||
## 0.7.81
|
||||
|
||||
- Update Shovey to the approved campaign and solve puzzles using wooden crates as water bridges.
|
||||
- Shovey Editor recognizes device unlocks, returns to the title, accepts right-click movement and shows a clearer object palette.
|
||||
|
||||
## 0.7.80
|
||||
|
||||
- Keep games covered until their first board is ready and keep complete pictures visible while animation sprites load.
|
||||
|
||||
@@ -54,11 +54,13 @@ run: all
|
||||
./build/arcade
|
||||
|
||||
test: all
|
||||
python3 tests/game_updates_test.py
|
||||
$(ZIRAN) fmt --check src/*.zi apps/chess/*.zi tests/chess_engine_behavior.zi tests/chess_app_behavior.zi
|
||||
python3 tests/chess_locale_test.py
|
||||
INBE_SOURCE='$(INBE_SOURCE)' python3 tests/catalog_test.py
|
||||
python3 tests/publisher_test.py
|
||||
python3 tests/apps_controller_test.py
|
||||
python3 tests/startup_art_test.py
|
||||
./build/arcade --list
|
||||
sh tests/chess_engine_zi_test.sh '$(ZIRAN)'
|
||||
sh tests/chess_app_test.sh '$(ZIRAN)'
|
||||
|
||||
@@ -6,12 +6,14 @@ title-screen covers from the shared Apps controller. Click a cover to open
|
||||
an installed game or download it first. There are no separate launch buttons.
|
||||
Standalone Shovey opens on its own cover carousel;
|
||||
swipe, use the arrows or scroll the wheel to choose, then press Play/Open.
|
||||
Its desktop startup first draws a small full-colour title preview, then uses
|
||||
the original artwork when the collection is ready.
|
||||
Chess is temporarily disabled in Arcade; its code and
|
||||
existing saved games remain available for a later return.
|
||||
Each edition has a separate save and earned unlocks. Unlocked puzzles show
|
||||
their whole board; locked puzzles keep their lock until earned.
|
||||
|
||||
The published Arcade carries only its catalog, well under one megabyte. Its host supplies the shared Apps controller (Inner Breeze its own, standalone Arcade the `apps.zx` installed beside it), and the covers and previews download once as one separate art bundle: small copies of each game's art in `assets/arcade/library/` (`python3 scripts/library-art.py` refreshes them when a game's art changes; the build stops until it does). Inner Breeze needs host interface 35 for it. Each game
|
||||
The published Arcade carries only its catalog, well under one megabyte. Its host supplies the shared Apps controller (Inner Breeze its own, standalone Arcade the `apps.zx` installed beside it), and the covers and previews download once as one separate art bundle. Title screens and logos keep their original resolution and full colours; only library previews use small copies. The art lives in `assets/arcade/library/` (`python3 scripts/library-art.py` refreshes it when a game's art changes; the build stops until it does). Inner Breeze needs host interface 35 for it. Each game
|
||||
downloads when opened, with its existing identity and saved progress. This
|
||||
catalog requires Inner Breeze host API 34. Downloaded games work offline;
|
||||
standalone Shovey keeps its complete offline collection. Apfelwurm comes from
|
||||
|
||||
@@ -1 +1 @@
|
||||
a99851fc40d67a8ca820841722ce2ddde5ca51844e0778c4762681570c488289
|
||||
a81eb5b14d2066925d19c3fd922865af40c90673cf54fb11bd7f9bf89a29cb98
|
||||
@@ -13,8 +13,8 @@
|
||||
"shovey": {
|
||||
"id": "arcade.shovey",
|
||||
"title": "Shovey",
|
||||
"version": "0.6.149",
|
||||
"sequence": 157,
|
||||
"version": "0.6.154",
|
||||
"sequence": 162,
|
||||
"host_api": 12
|
||||
},
|
||||
"shovey-island": {
|
||||
@@ -27,22 +27,22 @@
|
||||
"shovey-editor": {
|
||||
"id": "arcade.shovey-editor",
|
||||
"title": "Shovey Editor",
|
||||
"version": "0.2.141",
|
||||
"sequence": 143,
|
||||
"version": "0.2.144",
|
||||
"sequence": 146,
|
||||
"host_api": 12
|
||||
},
|
||||
"arcade": {
|
||||
"id": "inbe.arcade",
|
||||
"title": "Arcade",
|
||||
"version": "0.7.80",
|
||||
"sequence": 159,
|
||||
"host_api": 35
|
||||
"version": "0.7.86",
|
||||
"sequence": 165,
|
||||
"host_api": 36
|
||||
},
|
||||
"wurm": {
|
||||
"id": "xyz.waozi.wurm",
|
||||
"title": "Apfelwurm",
|
||||
"version": "0.1.4",
|
||||
"sequence": 3,
|
||||
"version": "0.1.8",
|
||||
"sequence": 6,
|
||||
"host_api": 12
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 368 KiB After Width: | Height: | Size: 1.9 MiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 376 KiB After Width: | Height: | Size: 1.8 MiB |
|
Before Width: | Height: | Size: 345 KiB After Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 516 KiB |
|
Before Width: | Height: | Size: 332 KiB After Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 561 KiB After Width: | Height: | Size: 2.6 MiB |
|
Before Width: | Height: | Size: 497 KiB After Width: | Height: | Size: 2.9 MiB |
@@ -50,6 +50,9 @@ Unknown languages fall back to the game's English text.
|
||||
|
||||
Arcade and Inbe still provide separate local/account storage. Sharing one
|
||||
game implementation does not silently merge or migrate their saved games.
|
||||
Host API 36 adds read-only records explicitly exported to verified direct
|
||||
dependencies. Shovey exports its local campaign so Editor can display device
|
||||
unlocks alongside account progress without uploading device-only progress.
|
||||
|
||||
## Updates and publication gate
|
||||
|
||||
|
||||
@@ -47,7 +47,8 @@ android {
|
||||
'-DZIRAN_DIR=' + ziranDir,
|
||||
'-DRAYLIB_DIR=' + raylibDir,
|
||||
'-DAPP_CODEGEN=' + appCodegen,
|
||||
'-DSHOVEY_STANDALONE=' + (standaloneShovey ? 'ON' : 'OFF')
|
||||
'-DSHOVEY_STANDALONE=' + (standaloneShovey ? 'ON' : 'OFF'),
|
||||
'-DGOOGLE_PLAY=' + (project.findProperty('app.googlePlay') == 'true' ? 'ON' : 'OFF')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,9 @@ set(APP_ZIRAN_DEFINES --define ANDROID_BUILD)
|
||||
if(SHOVEY_STANDALONE)
|
||||
list(APPEND APP_ZIRAN_DEFINES --define SHOVEY_STANDALONE)
|
||||
endif()
|
||||
if(GOOGLE_PLAY)
|
||||
list(APPEND APP_ZIRAN_DEFINES --define GOOGLE_PLAY)
|
||||
endif()
|
||||
if(NOT DEFINED APP_CODEGEN)
|
||||
set(APP_CODEGEN c99)
|
||||
endif()
|
||||
|
||||
@@ -49,6 +49,7 @@ def main():
|
||||
LIBOQS_DIR=str(package('liboqs')), MONOCYPHER_DIR=str(package('monocypher')))
|
||||
command = ['sh', str(ROOT / 'droid/gradlew'), '-p', str(ROOT / 'droid'), '--no-daemon', '--max-workers=2',
|
||||
'-Papp.product=shovey', '-Papp.abis=' + args.abis,
|
||||
'-Papp.googlePlay=' + ('true' if args.bundle else 'false'),
|
||||
'-Pkryon.dir=' + str(package('kryon')), '-Pziran.dir=' + str(package('ziran')),
|
||||
'-Praylib.dir=' + str(package('raylib') / 'src'),
|
||||
'-Papp.versionName=' + metadata['version'], '-Papp.versionCode=' + str(release['sequence']),
|
||||
|
||||
@@ -22,9 +22,8 @@ def digest(path):
|
||||
|
||||
|
||||
def library_art(root, name, key, source):
|
||||
"""Arcade's committed small copy of a game's art (scripts/library-art.py).
|
||||
The library shows art, the games download separately: never pack the
|
||||
packages' full-size images, and never pack a copy of outdated art."""
|
||||
"""Arcade's committed library art (scripts/library-art.py): original title
|
||||
screens and logos, small previews. Never pack a copy of outdated art."""
|
||||
library = Path(root) / "assets/arcade/library"
|
||||
sources = json.loads((library / "sources.json").read_text())
|
||||
copy = f"{name}-{key}"
|
||||
@@ -89,6 +88,8 @@ def stage(root, controller, expected_controller_digest, output):
|
||||
# A thin add-on links its required games' verified code as libraries.
|
||||
if app.get('shared_code'):
|
||||
child['shared_code'] = True
|
||||
if app.get('shared_records'):
|
||||
child['shared_records'] = app['shared_records']
|
||||
if app.get('requires'):
|
||||
shared = json.loads((root / 'build/games' / (name + '-resources.json')).read_text())
|
||||
if shared['dependencies'] != app['requires']:
|
||||
|
||||
@@ -11,6 +11,18 @@ ROOT = Path(__file__).resolve().parents[1]
|
||||
ZIRAN = str(ROOT / 'scripts/ziran.sh')
|
||||
|
||||
|
||||
def stage_startup_art(source, output):
|
||||
"""Draw small full-colour images before the collection's originals load."""
|
||||
from PIL import Image
|
||||
startup = output / 'startup/shovey'
|
||||
startup.mkdir(parents=True, exist_ok=True)
|
||||
for name, edge in [('title-portrait.png', 640), ('title-landscape.png', 640), ('logo.png', 512)]:
|
||||
with Image.open(source / 'assets/shovey' / name) as original:
|
||||
image = original.convert('RGBA' if 'A' in original.getbands() else 'RGB')
|
||||
image.thumbnail((edge, edge), Image.Resampling.LANCZOS)
|
||||
image.save(startup / name, optimize=True)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--output', type=Path)
|
||||
@@ -59,10 +71,7 @@ def main():
|
||||
if args.standalone_shovey:
|
||||
from PIL import Image
|
||||
source = Path(subprocess.check_output([ZIRAN, 'pkg', 'path', 'shovey', *lock], cwd=ROOT, text=True).strip())
|
||||
startup = output.parent / 'startup/shovey'
|
||||
startup.mkdir(parents=True, exist_ok=True)
|
||||
for name in ('title-portrait.png', 'title-landscape.png', 'logo.png'):
|
||||
shutil.copyfile(source / 'assets/shovey' / name, startup / name)
|
||||
stage_startup_art(source, output.parent)
|
||||
Image.open(source / 'assets/branding/shovey-icon.png').resize((256, 256), Image.Resampling.LANCZOS).save(output.parent / 'shovey-icon.png')
|
||||
print(('Shovey' if args.standalone_shovey else 'Arcade') + ' native build passed')
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@ def pin():
|
||||
if write_lock(lock) != lock_path.read_text():
|
||||
raise SystemExit('ziran.lock is not in the layout ziran lock writes')
|
||||
names = json.loads((ROOT / 'games.json').read_text())['packages']
|
||||
ledger = json.loads((ROOT / 'apps/versions.json').read_text())['node_apps']
|
||||
updates = []
|
||||
for name in names:
|
||||
old_id = lock['root']['dependencies'][name]
|
||||
@@ -78,9 +77,8 @@ def pin():
|
||||
commit = gh('api', f'repos/{repo}/commits/{tag}', '--jq', '.sha')
|
||||
if commit == entry['commit']:
|
||||
continue
|
||||
# A later tag of the version Arcade already ships is not a new release.
|
||||
if name in ledger and ledger[name]['version'] == tag.removeprefix('v'):
|
||||
continue
|
||||
# Release metadata can be recorded before the game is published.
|
||||
# The pinned source must still advance to that release's commit.
|
||||
# Never move back: the release must contain the pinned commit.
|
||||
status = gh('api', f'repos/{repo}/compare/{entry["commit"]}...{commit}', '--jq', '.status')
|
||||
if status != 'ahead':
|
||||
|
||||
@@ -9,7 +9,7 @@ import re
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
|
||||
APP_KEYS = {'manifest', 'cover', 'enabled', 'requires', 'shared_code', 'library_entries'}
|
||||
APP_KEYS = {'manifest', 'cover', 'enabled', 'requires', 'shared_code', 'library_entries', 'shared_records'}
|
||||
COVER_KEYS = {'portrait', 'landscape', 'logo', 'caption', 'action'}
|
||||
|
||||
|
||||
@@ -50,6 +50,11 @@ def declared_packages(root, ziran=None, lock_flags=()):
|
||||
shared_code = app.get('shared_code', False)
|
||||
if type(shared_code) is not bool or (shared_code and not requires):
|
||||
raise ValueError(f'{name}: shared code needs declared dependencies')
|
||||
shared_records = app.get('shared_records', [])
|
||||
if not isinstance(shared_records, list) or len(shared_records) > 8 or any(
|
||||
not isinstance(item, str) or not re.fullmatch(r'[A-Za-z0-9_.-]{1,63}', item) or
|
||||
item in ('.', '..') for item in shared_records) or len(set(shared_records)) != len(shared_records):
|
||||
raise ValueError(f'{name}: invalid shared records')
|
||||
library_entries = app.get('library_entries', [])
|
||||
if not isinstance(library_entries, list) or len(library_entries) > 64 or \
|
||||
any(not isinstance(item, str) or len(item) > 253 or
|
||||
@@ -59,6 +64,7 @@ def declared_packages(root, ziran=None, lock_flags=()):
|
||||
apps.append(dict(package=name, source=source, manifest=manifest,
|
||||
descriptor=json.loads(manifest.read_text()),
|
||||
cover=app.get('cover'), requires=requires, shared_code=shared_code,
|
||||
shared_records=shared_records,
|
||||
library_entries=library_entries, enabled=app.get('enabled', True)))
|
||||
packages.append(dict(name=name, source=source, id=declaration['id'],
|
||||
title=declaration['title'], apps=apps))
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Make Arcade's small copies of each game's cover and preview art.
|
||||
"""Stage each game's original title art and small library previews.
|
||||
|
||||
Game packages keep their full-size art for their own players and stores.
|
||||
Arcade only shows that art in its library, so it packs copies sized for the
|
||||
screen with a 256-colour palette: about a fifth of the bytes, with no visible
|
||||
change. Arcade stays a small launcher; the games download separately.
|
||||
Title screens and logos retain their original bytes, resolution, colours and
|
||||
transparency. Only small library previews are resized and palette limited.
|
||||
Arcade downloads the art separately from its small launcher.
|
||||
|
||||
The copies and sources.json, which records the SHA-256 of the art each copy
|
||||
was made from, are committed. The collection build uses them as they are,
|
||||
@@ -20,15 +19,16 @@ from game_packages import declared_packages
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
LIBRARY = ROOT / 'assets/arcade/library'
|
||||
# Longest side: covers fill the library's screen, logos sit on them and
|
||||
# previews are small tiles and icons.
|
||||
LONGEST = {'portrait': 1280, 'landscape': 1280, 'logo': 800, 'preview': 480}
|
||||
# Previews are small tiles and icons; full-screen artwork keeps its source.
|
||||
PREVIEW_LONGEST = 480
|
||||
|
||||
|
||||
def small_copy(data, key):
|
||||
if key != 'preview':
|
||||
return data
|
||||
image = Image.open(io.BytesIO(data))
|
||||
image.load()
|
||||
scale = min(1.0, LONGEST[key] / max(image.size))
|
||||
scale = min(1.0, PREVIEW_LONGEST / max(image.size))
|
||||
if scale < 1.0:
|
||||
size = (round(image.width * scale), round(image.height * scale))
|
||||
image = image.convert('RGBA' if 'A' in image.getbands() else 'RGB').resize(size, Image.Resampling.LANCZOS)
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
sdl :: #system_library "SDL2";
|
||||
SetTitle :: (window: *void, title: *u8) #foreign sdl "SDL_SetWindowTitle";
|
||||
|
||||
// First show small RGB/RGBA previews. The collection replaces them with its
|
||||
// original artwork when ready, using the same layout and coloured logo.
|
||||
DrawStartup :: (session: Session, directory: string, standalone: bool = true) -> bool {
|
||||
if !PollDesktop() || WindowTakeCloseRequestHost() { return false }
|
||||
BeginDesktopFrame()
|
||||
|
||||
@@ -43,6 +43,9 @@ EntityShoveyTokens :: () {
|
||||
|
||||
EntityOpen :: (bytes: string, data: string, shovey: bool = false) -> bool {
|
||||
entity_shovey = shovey
|
||||
#if #defined(GOOGLE_PLAY) {
|
||||
EntityHostAllowFunding(false)
|
||||
}
|
||||
if shovey { EntityShoveyTokens() }
|
||||
root := Join(data, "entity")
|
||||
defer { EntityFree(root) }
|
||||
|
||||
@@ -15,6 +15,9 @@ sys.path.insert(0, str(ROOT / "scripts"))
|
||||
spec = importlib.util.spec_from_file_location("build_collection", ROOT / "scripts/build-collection.py")
|
||||
builder = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(builder)
|
||||
art_spec = importlib.util.spec_from_file_location("library_art", ROOT / "scripts/library-art.py")
|
||||
artist = importlib.util.module_from_spec(art_spec)
|
||||
art_spec.loader.exec_module(artist)
|
||||
|
||||
|
||||
class CollectionTests(unittest.TestCase):
|
||||
@@ -88,6 +91,22 @@ class CollectionTests(unittest.TestCase):
|
||||
with self.assertRaisesRegex(ValueError, "wurm-portrait art changed"):
|
||||
self.stage()
|
||||
|
||||
def test_title_screens_keep_original_resolution_colours_and_transparency(self):
|
||||
catalog, packages = builder.stage(self.root, self.controller, self.controller_digest, self.output)
|
||||
children = {child['id']: child for child in catalog['children']}
|
||||
for package in packages:
|
||||
for app in package['apps']:
|
||||
if not app['enabled'] or not app['cover']:
|
||||
continue
|
||||
child = children[app['descriptor']['id']]
|
||||
for key in ('portrait', 'landscape', 'logo'):
|
||||
if key not in app['cover']:
|
||||
continue
|
||||
original = (app['source'] / app['cover'][key]).read_bytes()
|
||||
with self.subTest(app=child['id'], image=key):
|
||||
self.assertEqual(artist.small_copy(original, key), original)
|
||||
self.assertEqual((self.output / child['cover'][key]).read_bytes(), original)
|
||||
|
||||
def test_editor_download_reuses_verified_shovey_assets(self):
|
||||
catalog = self.stage()
|
||||
children = {child['id']: child for child in catalog['children']}
|
||||
|
||||
@@ -18,7 +18,7 @@ class GameResourcesTest(unittest.TestCase):
|
||||
(root / 'games.json').write_text(json.dumps({'packages': []}))
|
||||
(root / 'catalog.json').write_text(json.dumps({'id': 'editor', 'name': 'editor'}))
|
||||
app = {'manifest': 'catalog.json', 'requires': ['game'], 'shared_code': True,
|
||||
'library_entries': ['engine:Step']}
|
||||
'library_entries': ['engine:Step'], 'shared_records': ['local.campaign']}
|
||||
|
||||
def declare(value):
|
||||
(root / 'apps.json').write_text(json.dumps(
|
||||
@@ -28,9 +28,13 @@ class GameResourcesTest(unittest.TestCase):
|
||||
parsed = declare(app)
|
||||
self.assertTrue(parsed['shared_code'])
|
||||
self.assertEqual(parsed['library_entries'], ['engine:Step'])
|
||||
self.assertEqual(parsed['shared_records'], ['local.campaign'])
|
||||
for invalid in [app | {'requires': []}, app | {'shared_code': 1},
|
||||
app | {'library_entries': ['engine:../Step']},
|
||||
app | {'library_entries': ['engine:Step', 'engine:Step']}]:
|
||||
app | {'library_entries': ['engine:Step', 'engine:Step']},
|
||||
app | {'shared_records': ['../campaign']},
|
||||
app | {'shared_records': ['local.campaign', 'local.campaign']},
|
||||
app | {'shared_records': ['..']}, app | {'shared_records': 'campaign'}]:
|
||||
with self.subTest(invalid=invalid), self.assertRaises(ValueError):
|
||||
declare(invalid)
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
"""Release metadata must not prevent Arcade from following the actual game source."""
|
||||
import importlib.util
|
||||
import json
|
||||
from pathlib import Path
|
||||
import tempfile
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
spec = importlib.util.spec_from_file_location('follow_game_releases', ROOT / 'scripts/follow-game-releases.py')
|
||||
follower = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(follower)
|
||||
|
||||
|
||||
class GameUpdates(unittest.TestCase):
|
||||
def follow(self, comparison, same_commit=False):
|
||||
with tempfile.TemporaryDirectory(prefix='arcade-release-metadata-') as temporary:
|
||||
root = Path(temporary)
|
||||
(root / 'apps').mkdir()
|
||||
old = '1' * 40
|
||||
new = old if same_commit else '2' * 40
|
||||
url = 'https://github.com/waozixyz/wurm.git'
|
||||
identifier = follower.package_id(url, old)
|
||||
lock = {'format': 1, 'toolchain': {}, 'root': {'dependencies': {'wurm': identifier}},
|
||||
'packages': [{'id': identifier, 'name': 'Apfelwurm', 'url': url,
|
||||
'commit': old, 'ref': 'master', 'dependencies': {}}]}
|
||||
(root / 'ziran.lock').write_text(follower.write_lock(lock))
|
||||
(root / 'games.json').write_text(json.dumps({'packages': ['wurm']}))
|
||||
# This is the normal release order: metadata first, game release next.
|
||||
(root / 'apps/versions.json').write_text(json.dumps({'node_apps': {'wurm': {'version': '0.1.8'}}}))
|
||||
|
||||
def gh(*arguments):
|
||||
if arguments[0] == 'release':
|
||||
return 'v0.1.8'
|
||||
return comparison if '/compare/' in arguments[1] else new
|
||||
|
||||
updates = root / 'updates.json'
|
||||
with patch.object(follower, 'ROOT', root), patch.object(follower, 'UPDATES', updates), patch.object(follower, 'gh', gh):
|
||||
follower.pin()
|
||||
return json.loads((root / 'ziran.lock').read_text()), json.loads(updates.read_text()), old, new
|
||||
|
||||
def test_metadata_already_names_the_release(self):
|
||||
lock, updates, old, new = self.follow('ahead')
|
||||
self.assertEqual(lock['packages'][0]['commit'], new)
|
||||
self.assertEqual(lock['root']['dependencies']['wurm'], lock['packages'][0]['id'])
|
||||
self.assertEqual(len(updates), 1)
|
||||
|
||||
def test_same_source_is_unchanged(self):
|
||||
lock, updates, old, new = self.follow('identical', same_commit=True)
|
||||
self.assertEqual(lock['packages'][0]['commit'], old)
|
||||
self.assertEqual(updates, [])
|
||||
|
||||
def test_older_release_never_moves_the_pin_back(self):
|
||||
lock, updates, old, new = self.follow('behind')
|
||||
self.assertEqual(lock['packages'][0]['commit'], old)
|
||||
self.assertEqual(updates, [])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -230,6 +230,9 @@ def main():
|
||||
resize_owned_window(child, 480, 820)
|
||||
driver.press(label='Swipe and tap')
|
||||
driver.wait_gone(label='How do you want to move?', role='text')
|
||||
driver.wait(label='Got it', role='button')
|
||||
driver.press(label='Got it', role='button')
|
||||
driver.wait_gone(label='Got it', role='button')
|
||||
assert (profile / 'games/arcade.shovey-player/records/controls').read_text() == 'off'
|
||||
assert not driver.find(label='Continue', role='button'), 'Classic must open straight on a level'
|
||||
assert driver.find(label='Shovey', role='image', visible=True), 'Shovey must be drawn as a picture'
|
||||
|
||||
@@ -117,6 +117,9 @@ def main():
|
||||
answer_level_updates(driver)
|
||||
driver.press(label='Swipe and tap')
|
||||
driver.wait_gone(label='How do you want to move?', role='text')
|
||||
driver.wait(label='Got it', role='button')
|
||||
driver.press(label='Got it', role='button')
|
||||
driver.wait_gone(label='Got it', role='button')
|
||||
# Entering play may save the untouched campaign; a fresh profile may
|
||||
# have no record until the first move.
|
||||
deadline = time.monotonic() + 10
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
"""Startup previews keep full colour and alpha while the originals stay intact."""
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
from PIL import Image
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
spec = importlib.util.spec_from_file_location('build_desktop', ROOT / 'scripts/build-desktop.py')
|
||||
desktop = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(desktop)
|
||||
|
||||
|
||||
class StartupArtTests(unittest.TestCase):
|
||||
def test_previews_keep_colour_alpha_and_aspect_ratio(self):
|
||||
work = ROOT / 'build/scratch'
|
||||
work.mkdir(parents=True, exist_ok=True)
|
||||
with tempfile.TemporaryDirectory(prefix='startup-art-', dir=work) as temporary:
|
||||
root = Path(temporary)
|
||||
source = root / 'source/assets/shovey'
|
||||
source.mkdir(parents=True)
|
||||
# A continuous RGB gradient needs more than a 256-colour palette.
|
||||
gradient = Image.new('RGB', (900, 1200))
|
||||
gradient.putdata([(x % 256, y % 256, (x + y) % 256)
|
||||
for y in range(1200) for x in range(900)])
|
||||
gradient.save(source / 'title-portrait.png')
|
||||
gradient.transpose(Image.Transpose.ROTATE_90).save(source / 'title-landscape.png')
|
||||
logo = gradient.resize((1200, 400)).convert('RGBA')
|
||||
alpha = Image.new('L', logo.size, 0)
|
||||
alpha.paste(255, (100, 50, 1100, 350))
|
||||
logo.putalpha(alpha)
|
||||
logo.save(source / 'logo.png')
|
||||
originals = {path.name: path.read_bytes() for path in source.iterdir()}
|
||||
output = root / 'output'
|
||||
desktop.stage_startup_art(root / 'source', output)
|
||||
expected = {'title-portrait.png': (480, 640),
|
||||
'title-landscape.png': (640, 480), 'logo.png': (512, 171)}
|
||||
for name, size in expected.items():
|
||||
with self.subTest(image=name), Image.open(output / 'startup/shovey' / name) as preview:
|
||||
self.assertEqual(preview.size, size)
|
||||
self.assertEqual(preview.mode, 'RGBA' if name == 'logo.png' else 'RGB')
|
||||
self.assertIsNone(preview.getcolors(256), 'Title previews must not use a 256-colour palette')
|
||||
if name == 'logo.png':
|
||||
self.assertEqual(preview.getpixel((0, 0))[3], 0)
|
||||
self.assertEqual(preview.getpixel((256, 85))[3], 255)
|
||||
self.assertEqual((source / name).read_bytes(), originals[name])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,77 @@
|
||||
"""Verify coloured startup previews, original covers and title transitions privately."""
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
from PIL import Image
|
||||
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--binary', type=Path, required=True)
|
||||
parser.add_argument('--driver-source', type=Path, required=True)
|
||||
args = parser.parse_args()
|
||||
assert int(os.environ['DISPLAY'].split(':')[-1].split('.')[0]) >= 400
|
||||
assert os.environ['YUE_DESKTOP_RECOVERY'] == '0'
|
||||
sys.path.insert(0, str(args.driver_source / 'tests'))
|
||||
from ui_driver import UiDriver
|
||||
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
output = root / 'build/scratch/title-progressive/ui'
|
||||
output.mkdir(parents=True, exist_ok=True)
|
||||
binary = args.binary.resolve()
|
||||
driver = UiDriver(output / 'driver')
|
||||
|
||||
with tempfile.TemporaryDirectory(prefix='profile-', dir=output) as temporary:
|
||||
profile = Path(temporary)
|
||||
records = profile / 'games/arcade.shovey-player/records'
|
||||
records.mkdir(parents=True)
|
||||
(records / 'level-updates').write_text('off')
|
||||
log_path = output / 'game.log'
|
||||
with log_path.open('w') as log:
|
||||
child = subprocess.Popen([str(binary)], cwd=binary.parent,
|
||||
env=os.environ | driver.environment() |
|
||||
{'ARCADE_DATA': str(profile), 'ENTITY_DATA': str(profile / 'entity'),
|
||||
'LANG': 'en_US.UTF-8', 'SDL_AUDIODRIVER': 'dummy'},
|
||||
stdout=log, stderr=subprocess.STDOUT)
|
||||
driver.attach(child, log_path)
|
||||
try:
|
||||
startup = driver.tree()
|
||||
assert driver.last['frame'] <= 3, 'Preview must precede collection loading'
|
||||
images = [node for node in startup if node['kind'] == 'image' and node['label'] == 'Shovey']
|
||||
assert len(images) == 2, 'Startup must show the artwork and coloured logo together'
|
||||
for node in images:
|
||||
assert 'startup/shovey/' in node['detail']
|
||||
with Image.open(node['detail']) as picture:
|
||||
assert picture.mode in ('RGB', 'RGBA'), 'Startup art must retain full colour'
|
||||
assert max(picture.size) <= 640, 'Startup must use a small preview'
|
||||
(output / 'startup-tree.json').write_text(json.dumps(driver.last, indent=2) + '\n')
|
||||
driver.wait(label='Play', role='button', timeout=60)
|
||||
full = [node for node in driver.tree() if node['kind'] == 'image' and
|
||||
'arcade/covers/shovey-' in node.get('detail', '')]
|
||||
assert len(full) >= 2
|
||||
assert any(max(Image.open(node['detail']).size) >= 1200 for node in full), \
|
||||
'Ready cover must replace the preview with the original artwork'
|
||||
windows = subprocess.check_output(['xdotool', 'search', '--onlyvisible', '--pid', str(child.pid)], text=True).split()
|
||||
assert len(windows) == 1
|
||||
window = windows[0]
|
||||
assert subprocess.check_output(['xdotool', 'getwindowpid', window], text=True).strip() == str(child.pid)
|
||||
subprocess.run(['xdotool', 'windowmove', window, '0', '0'], check=True)
|
||||
subprocess.run(['import', '-window', window, str(output / 'classic-ready.png')], check=True)
|
||||
driver.key('right')
|
||||
subprocess.run(['import', '-window', window, str(output / 'logo-fading.png')], check=True)
|
||||
driver.wait(label='Editor', role='text')
|
||||
driver.wait(label='Open', role='button')
|
||||
driver.wait_idle(frames=5)
|
||||
subprocess.run(['import', '-window', window, str(output / 'editor-ready.png')], check=True)
|
||||
driver.key('left')
|
||||
driver.wait(label='Classic', role='text')
|
||||
driver.wait(label='Play', role='button')
|
||||
assert child.poll() is None
|
||||
finally:
|
||||
if child.poll() is None:
|
||||
child.terminate()
|
||||
child.wait(timeout=10)
|
||||
print('Local title UI test: full-colour previews precede original covers; Classic/Editor transitions work')
|
||||
@@ -1,6 +1,14 @@
|
||||
{
|
||||
"format": 1,
|
||||
"packages": [
|
||||
{
|
||||
"commit": "dc1cfe389905c63c0bb453727d06d72afc1fa0b0",
|
||||
"dependencies": {"crypto": "pc23fbf455e97614d", "kryon": "p39132f61dd28d78f"},
|
||||
"id": "p00b93f1ddcd2802f",
|
||||
"name": "Apps",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/waozixyz/apps.git"
|
||||
},
|
||||
{
|
||||
"commit": "b31299434c785d0f2bd82f36b5bfd2fd36ba1216",
|
||||
"dependencies": {},
|
||||
@@ -20,7 +28,7 @@
|
||||
},
|
||||
{
|
||||
"commit": "1cb9df183089a77c8a16448a556186f30b261a98",
|
||||
"dependencies": {"kryon": "pc345e310c75f8d37"},
|
||||
"dependencies": {"kryon": "p39132f61dd28d78f"},
|
||||
"id": "p1b13dda539ed2a39",
|
||||
"name": "Kss",
|
||||
"ref": "master",
|
||||
@@ -28,7 +36,7 @@
|
||||
},
|
||||
{
|
||||
"commit": "bad2caaa84ef3eae61e40c99bf572d2b060d0ca2",
|
||||
"dependencies": {"kryon": "pc345e310c75f8d37"},
|
||||
"dependencies": {"kryon": "p39132f61dd28d78f"},
|
||||
"id": "p20eb23d3e6db3711",
|
||||
"name": "Game2D",
|
||||
"ref": "master",
|
||||
@@ -43,14 +51,6 @@
|
||||
"source": true,
|
||||
"url": "https://github.com/sqlite/sqlite.git"
|
||||
},
|
||||
{
|
||||
"commit": "be74b13fd9b991e63a96360e8f13d781cece964e",
|
||||
"dependencies": {"daochi_client": "p9972fcdd2d5ba999", "kryon": "pc345e310c75f8d37", "monocypher": "p809b4d31a48625a3", "qrcode": "p0dfa70137405b096"},
|
||||
"id": "p2b0009b9bbaa09de",
|
||||
"name": "Entity",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/waozixyz/entity.git"
|
||||
},
|
||||
{
|
||||
"commit": "eb2b201a2da3bfc6fefd7ff2d8e476e3cb9e5bcb",
|
||||
"dependencies": {},
|
||||
@@ -60,9 +60,17 @@
|
||||
"source": true,
|
||||
"url": "https://github.com/curl/curl.git"
|
||||
},
|
||||
{
|
||||
"commit": "68f2e8d30b8d2f28b29c1d8875193b33bea44ead",
|
||||
"dependencies": {"raylib": "p5a77c9c35110e925"},
|
||||
"id": "p39132f61dd28d78f",
|
||||
"name": "kryon",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/kryon.git"
|
||||
},
|
||||
{
|
||||
"commit": "2f6f1f57d7de742ef7ebc01159c2315acf793d5b",
|
||||
"dependencies": {"apps": "p7407a72c65eeeb2b", "crypto": "pc23fbf455e97614d", "curl": "p2f75403ea4cb61e4", "daochi_client": "p9972fcdd2d5ba999", "game2d": "p20eb23d3e6db3711", "kryon": "pc345e310c75f8d37", "kss": "p1b13dda539ed2a39", "liboqs": "p4b0a50b49959e674", "mingcute": "pe1027b9d16704793", "monocypher": "p809b4d31a48625a3", "oqs": "p7098ac9cd92f7e5f", "plot": "pab5377a2950368a2", "qrcode": "p0dfa70137405b096", "rini": "p09fa77e94b0dfc6c", "self": "pa4da0de6c3c44e61", "sqlite": "p219661bf4be659ed"},
|
||||
"dependencies": {"apps": "p00b93f1ddcd2802f", "crypto": "pc23fbf455e97614d", "curl": "p2f75403ea4cb61e4", "daochi_client": "p9972fcdd2d5ba999", "game2d": "p20eb23d3e6db3711", "kryon": "p39132f61dd28d78f", "kss": "p1b13dda539ed2a39", "liboqs": "p4b0a50b49959e674", "mingcute": "pe1027b9d16704793", "monocypher": "p809b4d31a48625a3", "oqs": "p7098ac9cd92f7e5f", "plot": "pab5377a2950368a2", "qrcode": "p0dfa70137405b096", "rini": "p09fa77e94b0dfc6c", "self": "pa4da0de6c3c44e61", "sqlite": "p219661bf4be659ed"},
|
||||
"id": "p48228a6b7e2920d3",
|
||||
"name": "Inbe",
|
||||
"ref": "master",
|
||||
@@ -77,14 +85,6 @@
|
||||
"source": true,
|
||||
"url": "https://github.com/open-quantum-safe/liboqs.git"
|
||||
},
|
||||
{
|
||||
"commit": "481ec2a6cdee05680bd809d3436134ef670db6ce",
|
||||
"dependencies": {"apps": "p7407a72c65eeeb2b", "kryon": "pc345e310c75f8d37", "mingcute": "pe1027b9d16704793"},
|
||||
"id": "p4b52e2fb4081447c",
|
||||
"name": "Apfelwurm",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/waozixyz/wurm.git"
|
||||
},
|
||||
{
|
||||
"commit": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
|
||||
"dependencies": {},
|
||||
@@ -102,22 +102,6 @@
|
||||
"ref": "master",
|
||||
"url": "https://github.com/ziranlang/oqs.git"
|
||||
},
|
||||
{
|
||||
"commit": "96e0ac55add63c65bea22dc2395a751e0b048fc1",
|
||||
"dependencies": {"crypto": "pc23fbf455e97614d", "kryon": "pc345e310c75f8d37"},
|
||||
"id": "p7407a72c65eeeb2b",
|
||||
"name": "Apps",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/waozixyz/apps.git"
|
||||
},
|
||||
{
|
||||
"commit": "83c89a86b0047f1d539c2465ad87087597a8c156",
|
||||
"dependencies": {"apps": "p7407a72c65eeeb2b", "entity": "p2b0009b9bbaa09de", "kryon": "pc345e310c75f8d37", "mingcute": "pe1027b9d16704793"},
|
||||
"id": "p7e870c2925a901aa",
|
||||
"name": "Shovey",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/waozixyz/shovey.git"
|
||||
},
|
||||
{
|
||||
"commit": "f5f0a19a5dc6c14a49adb3cd63ea79a60f6ba77b",
|
||||
"dependencies": {},
|
||||
@@ -135,9 +119,17 @@
|
||||
"ref": "master",
|
||||
"url": "https://github.com/ziranlang/daochi-client.git"
|
||||
},
|
||||
{
|
||||
"commit": "ead42286d2fe16cd46768e4d3d6a5fad26d1c831",
|
||||
"dependencies": {"daochi_client": "p9972fcdd2d5ba999", "kryon": "p39132f61dd28d78f", "monocypher": "p809b4d31a48625a3", "qrcode": "p0dfa70137405b096"},
|
||||
"id": "p9ea7a59dcc9f75a2",
|
||||
"name": "Entity",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/waozixyz/entity.git"
|
||||
},
|
||||
{
|
||||
"commit": "357a71d1ee2c7c9526c2af18793ea8628c505034",
|
||||
"dependencies": {"daochi_client": "p9972fcdd2d5ba999", "kryon": "pc345e310c75f8d37", "monocypher": "p809b4d31a48625a3", "qrcode": "p0dfa70137405b096"},
|
||||
"dependencies": {"daochi_client": "p9972fcdd2d5ba999", "kryon": "p39132f61dd28d78f", "monocypher": "p809b4d31a48625a3", "qrcode": "p0dfa70137405b096"},
|
||||
"id": "pa4da0de6c3c44e61",
|
||||
"name": "Self",
|
||||
"ref": "master",
|
||||
@@ -145,7 +137,7 @@
|
||||
},
|
||||
{
|
||||
"commit": "3f888653b6b97010163d824c4cc72476be3214f3",
|
||||
"dependencies": {"kryon": "pc345e310c75f8d37"},
|
||||
"dependencies": {"kryon": "p39132f61dd28d78f"},
|
||||
"id": "pab5377a2950368a2",
|
||||
"name": "plot",
|
||||
"ref": "master",
|
||||
@@ -160,12 +152,12 @@
|
||||
"url": "https://github.com/ziranlang/crypto.git"
|
||||
},
|
||||
{
|
||||
"commit": "919a18d7fca3b052c1a694aff105f5937d723e3f",
|
||||
"dependencies": {"raylib": "p5a77c9c35110e925"},
|
||||
"id": "pc345e310c75f8d37",
|
||||
"name": "kryon",
|
||||
"commit": "90a3e7d9b1b9ef6a7f5eab7aff55eba3353e604e",
|
||||
"dependencies": {"apps": "p00b93f1ddcd2802f", "entity": "p9ea7a59dcc9f75a2", "kryon": "p39132f61dd28d78f", "mingcute": "pe1027b9d16704793"},
|
||||
"id": "p08f35f0240dbbdff",
|
||||
"name": "Shovey",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/kryon.git"
|
||||
"url": "https://github.com/waozixyz/shovey.git"
|
||||
},
|
||||
{
|
||||
"commit": "9cc6872f75447c3a24c16764f9829d0f58751cb0",
|
||||
@@ -174,10 +166,18 @@
|
||||
"name": "mingcute",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/mingcute.git"
|
||||
},
|
||||
{
|
||||
"commit": "76e95cd951ddc82d9a507f5e43f6b72fc597bc96",
|
||||
"dependencies": {"apps": "p00b93f1ddcd2802f", "kryon": "p39132f61dd28d78f", "mingcute": "pe1027b9d16704793"},
|
||||
"id": "pceb767df382e3cc7",
|
||||
"name": "Apfelwurm",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/waozixyz/wurm.git"
|
||||
}
|
||||
],
|
||||
"root": {
|
||||
"dependencies": {"apps": "p7407a72c65eeeb2b", "entity": "p2b0009b9bbaa09de", "inbe": "p48228a6b7e2920d3", "kryon": "pc345e310c75f8d37", "mingcute": "pe1027b9d16704793", "shovey": "p7e870c2925a901aa", "wurm": "p4b52e2fb4081447c"},
|
||||
"dependencies": {"apps": "p00b93f1ddcd2802f", "entity": "p9ea7a59dcc9f75a2", "inbe": "p48228a6b7e2920d3", "kryon": "p39132f61dd28d78f", "mingcute": "pe1027b9d16704793", "shovey": "p08f35f0240dbbdff", "wurm": "pceb767df382e3cc7"},
|
||||
"name": "Arcade"
|
||||
},
|
||||
"toolchain": {
|
||||
|
||||