DevPlace CI / test (push) Failing after 44m45s
Continuous Delivery could never be turned off once a crop was planted. Add a one-shot per-plot "stop after harvest" flag (POST /game/plot/stop, Devii tool game_plot_stop, game_plots.stop_after_harvest), cleared by the next plant, autoreplant claim or Refactor. Autoreplant now also respects crop locks through the shared _crop_lock predicate. Plan and measurements in happyplanting.md. Also includes the pending community sync, node network and related work in the tree; the full suite passed (4999) with all of it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
44 lines
1.3 KiB
Python
44 lines
1.3 KiB
Python
import sys
|
|
from pathlib import Path
|
|
|
|
from PIL import Image, ImageDraw
|
|
|
|
SIZES = (16, 32, 48, 128)
|
|
SCALE = 8
|
|
BACKGROUND = (17, 43, 94, 255)
|
|
GLYPH = (234, 242, 255, 255)
|
|
CENTER = (0.5, 0.5)
|
|
OUTER = ((0.5, 0.2), (0.24, 0.68), (0.76, 0.68))
|
|
CORNER_RADIUS = 0.22
|
|
CENTER_RADIUS = 0.1
|
|
OUTER_RADIUS = 0.075
|
|
LINE_WIDTH = 0.04
|
|
|
|
|
|
def render(size: int) -> Image.Image:
|
|
big = size * SCALE
|
|
image = Image.new("RGBA", (big, big), (0, 0, 0, 0))
|
|
draw = ImageDraw.Draw(image)
|
|
draw.rounded_rectangle((0, 0, big - 1, big - 1), radius=big * CORNER_RADIUS, fill=BACKGROUND)
|
|
|
|
def point(pair):
|
|
return (pair[0] * big, pair[1] * big)
|
|
|
|
for outer in OUTER:
|
|
draw.line((point(CENTER), point(outer)), fill=GLYPH, width=max(1, round(LINE_WIDTH * big)))
|
|
for pair, radius in [(CENTER, CENTER_RADIUS)] + [(outer, OUTER_RADIUS) for outer in OUTER]:
|
|
x, y = point(pair)
|
|
r = radius * big
|
|
draw.ellipse((x - r, y - r, x + r, y + r), fill=GLYPH)
|
|
return image.resize((size, size), Image.LANCZOS)
|
|
|
|
|
|
def main(out_dir: Path) -> None:
|
|
out_dir.mkdir(parents=True, exist_ok=True)
|
|
for size in SIZES:
|
|
render(size).save(out_dir / f"icon-{size}.png", optimize=True)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main(Path(sys.argv[1]) if len(sys.argv) > 1 else Path(__file__).resolve().parent.parent / "icons")
|