fix: the Shrink Hammer's badge points in, at a small square

The resize badge's arrow ran from the small square to the big one and read as
growing. Four arrows closing in on a small square read as shrinking.
This commit is contained in:
kanym 2026-10-30 23:41:57 +01:00
commit ec533fdbd9
2 changed files with 9 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before After
Before After

View file

@ -1,11 +1,11 @@
"""Paint the two sizing hammers' icons from the vanilla hammer's, so neither can pass for it in a
hotbar: Trol's Hammer gets a blue-steel head and a troll trophy, the Shrink Hammer a brass head and a
resize badge (a small square inside a big one, with an arrow between their corners).
shrink badge (four arrows pointing in at a small square, the usual sign for making smaller).
Usage: py -3.14 -I paint_hammer_icons.py <pylib> <icons dir>
<icons dir> holds hammer.png and TrophyForestTroll.png (Sprites "hammer" and "TrophyForestTroll"
from bundle 6a33a62). Writes TrolsHammer_icon.png and ShrinkHammer_icon.png there; copy them to
JotunnModStub/Assets/Hammers/."""
import sys, os
import sys, os, math
sys.path.insert(0, sys.argv[1])
import numpy as np
from PIL import Image, ImageDraw, ImageFilter
@ -43,9 +43,12 @@ B = 56
badge = Image.new("RGBA", (B, B), (0, 0, 0, 0))
g = ImageDraw.Draw(badge)
white = (240, 240, 235, 255)
g.rectangle([4, 4, B - 5, B - 5], outline=white, width=4) # the big square
g.rectangle([4, B - 23, 22, B - 5], fill=white) # the small one, in its corner
g.line([(20, B - 21), (B - 15, 14)], fill=white, width=4) # the arrow from small to big
g.polygon([(B - 9, 9), (B - 27, 12), (B - 12, 27)], fill=white)
c = B // 2
g.rectangle([c - 7, c - 7, c + 7, c + 7], fill=white) # the piece, made small
for dx, dy in ((-1, -1), (1, -1), (-1, 1), (1, 1)): # and the arrows closing in on it
start, tip = (c + dx*25, c + dy*25), (c + dx*11, c + dy*11)
g.line([start, tip], fill=white, width=3)
a = math.atan2(tip[1] - start[1], tip[0] - start[0])
g.polygon([tip] + [(tip[0] - 10*math.cos(a + s), tip[1] - 10*math.sin(a + s)) for s in (-0.5, 0.5)], fill=white)
icon.alpha_composite(with_rim(badge), (S - B - 4, S - B - 4))
icon.save(os.path.join(d, "ShrinkHammer_icon.png"))