A leveling guide for WoW 1.12 players of pfQuest, based on Easy Route by stealthzi (MIT). See README.md and CHANGES.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XfR1apt9f3R7SxBKB2FF2D
131 lines
6.2 KiB
Python
131 lines
6.2 KiB
Python
# Draws the guide window's footer icons as 32x32 white-on-transparent TGAs (supersampled 8x, so edges are smooth).
|
|
import math, sys
|
|
from PIL import Image, ImageDraw
|
|
OUT = sys.argv[1]
|
|
S = 8; N = 32; W = N * S
|
|
def canvas(): return Image.new("L", (W, W), 0)
|
|
def save(img, name):
|
|
a = img.resize((N, N), Image.LANCZOS)
|
|
rgba = Image.new("RGBA", (N, N), (255, 255, 255, 0)); rgba.putalpha(a)
|
|
rgba.save(f"{OUT}/{name}.tga")
|
|
def P(x): return x * S
|
|
def line(d, a, b, w):
|
|
d.line([P(a[0]), P(a[1]), P(b[0]), P(b[1])], fill=255, width=int(P(w)))
|
|
r = P(w) / 2
|
|
for (x, y) in (a, b): d.ellipse([P(x) - r, P(y) - r, P(x) + r, P(y) + r], fill=255)
|
|
def ring(d, cx, cy, r, w):
|
|
d.ellipse([P(cx - r), P(cy - r), P(cx + r), P(cy + r)], outline=255, width=int(P(w)))
|
|
|
|
# cog: 8 rounded teeth on a ring, hollow centre
|
|
img = canvas(); d = ImageDraw.Draw(img); c = 16
|
|
pts = []
|
|
for i in range(8 * 16):
|
|
t = i / (8 * 16) * 2 * math.pi
|
|
phase = (t * 8 / (2 * math.pi)) % 1
|
|
r = 12.5 if (phase < 0.38 or phase > 0.88) else 9.6
|
|
pts.append((P(c + r * math.cos(t)), P(c + r * math.sin(t))))
|
|
d.polygon(pts, fill=255)
|
|
d.ellipse([P(c - 4.2), P(c - 4.2), P(c + 4.2), P(c + 4.2)], fill=0)
|
|
save(img, "IconCog")
|
|
|
|
# arrow: a navigation pointer, pointing up, notched at the base
|
|
img = canvas(); d = ImageDraw.Draw(img)
|
|
d.polygon([(P(16), P(3.5)), (P(27), P(28)), (P(16), P(21.5)), (P(5), P(28))], fill=255)
|
|
save(img, "IconArrow")
|
|
|
|
# close: two rounded strokes
|
|
img = canvas(); d = ImageDraw.Draw(img)
|
|
line(d, (8, 8), (24, 24), 3.2); line(d, (24, 8), (8, 24), 3.2)
|
|
save(img, "IconClose")
|
|
|
|
def lock(open_):
|
|
img = canvas(); d = ImageDraw.Draw(img)
|
|
# body with a keyhole
|
|
d.rounded_rectangle([P(6.5), P(14.5), P(25.5), P(28.5)], radius=P(2.5), fill=255)
|
|
d.ellipse([P(14.3), P(18.5), P(17.7), P(21.9)], fill=0)
|
|
d.rectangle([P(15.2), P(21), P(16.8), P(24.8)], fill=0)
|
|
# shackle: an arch; open: lifted and swung to the left side only
|
|
w = 3.0
|
|
if not open_:
|
|
d.arc([P(10), P(4), P(22), P(19)], 180, 360, fill=255, width=int(P(w)))
|
|
d.rectangle([P(10), P(11.5), P(10 + w), P(15)], fill=255)
|
|
d.rectangle([P(22 - w), P(11.5), P(22), P(15)], fill=255)
|
|
else:
|
|
d.arc([P(10), P(1.5), P(22), P(16.5)], 180, 360, fill=255, width=int(P(w)))
|
|
d.rectangle([P(10), P(9), P(10 + w), P(15)], fill=255)
|
|
d.rectangle([P(22 - w), P(9), P(22), P(11)], fill=255)
|
|
return img
|
|
save(lock(False), "IconLocked"); save(lock(True), "IconUnlocked")
|
|
|
|
# grip: three diagonal strokes in the lower right corner
|
|
img = canvas(); d = ImageDraw.Draw(img)
|
|
for k in (0, 1, 2):
|
|
o = 9 + k * 6.5
|
|
line(d, (28, o), (o, 28), 2.4)
|
|
save(img, "IconGrip")
|
|
|
|
# skipped: a double chevron ("skip forward")
|
|
img = canvas(); d = ImageDraw.Draw(img)
|
|
for ox in (7, 16):
|
|
line(d, (ox, 9), (ox + 7, 16), 3.2); line(d, (ox + 7, 16), (ox, 23), 3.2)
|
|
save(img, "IconSkipped")
|
|
|
|
# chain marks: eight shapes, told apart without colour
|
|
def shape(name, draw):
|
|
img = canvas(); d = ImageDraw.Draw(img); draw(d); save(img, "Chain" + name)
|
|
shape("Circle", lambda d: d.ellipse([P(5), P(5), P(27), P(27)], fill=255))
|
|
shape("Square", lambda d: d.rectangle([P(6), P(6), P(26), P(26)], fill=255))
|
|
shape("Triangle", lambda d: d.polygon([(P(16), P(4)), (P(29), P(27)), (P(3), P(27))], fill=255))
|
|
shape("Diamond", lambda d: d.polygon([(P(16), P(2)), (P(30), P(16)), (P(16), P(30)), (P(2), P(16))], fill=255))
|
|
def ringd(d):
|
|
d.ellipse([P(4), P(4), P(28), P(28)], fill=255); d.ellipse([P(10), P(10), P(22), P(22)], fill=0)
|
|
shape("Ring", ringd)
|
|
def plusd(d):
|
|
d.rectangle([P(12), P(3), P(20), P(29)], fill=255); d.rectangle([P(3), P(12), P(29), P(20)], fill=255)
|
|
shape("Plus", plusd)
|
|
shape("TriangleDown", lambda d: d.polygon([(P(3), P(5)), (P(29), P(5)), (P(16), P(28))], fill=255))
|
|
shape("Bar", lambda d: d.rounded_rectangle([P(11), P(3), P(21), P(29)], radius=P(3), fill=255))
|
|
|
|
# a minimal skull for quest mobs' nameplates (pfUI look): rounded head, two eyes, a nose, a jaw with teeth gaps;
|
|
# and its outline (the same shape a little bigger), drawn dark behind it
|
|
def skull(grow):
|
|
img = canvas(); d = ImageDraw.Draw(img); g = grow
|
|
d.ellipse([P(5 - g), P(3 - g), P(27 + g), P(23 + g)], fill=255)
|
|
d.rounded_rectangle([P(9 - g), P(17 - g), P(23 + g), P(29 + g)], radius=P(2 + g), fill=255)
|
|
if not grow:
|
|
d.ellipse([P(9), P(10), P(14.5), P(16)], fill=0)
|
|
d.ellipse([P(17.5), P(10), P(23), P(16)], fill=0)
|
|
d.polygon([(P(16), P(16.5)), (P(14.5), P(19.5)), (P(17.5), P(19.5))], fill=0)
|
|
for x in (13.2, 16, 18.8):
|
|
d.rectangle([P(x - 0.6), P(24), P(x + 0.6), P(29)], fill=0)
|
|
return img
|
|
save(skull(0), "IconSkull")
|
|
save(skull(1.6), "IconSkullEdge")
|
|
|
|
|
|
# the other nameplate markers, each with an outline (the shape grown by a little), drawn dark behind it:
|
|
# a sack for mobs that drop what a quest needs, "!" for who gives the step's quest, "?" for who takes it back
|
|
from PIL import ImageFilter
|
|
def with_edge(name, draw):
|
|
img = canvas(); d = ImageDraw.Draw(img); draw(d)
|
|
save(img, name)
|
|
solid = canvas(); ds = ImageDraw.Draw(solid); draw(ds, solid=True) if draw.__code__.co_argcount > 1 else draw(ds)
|
|
save(solid.filter(ImageFilter.MaxFilter(2 * int(1.6 * S) + 1)), name + "Edge")
|
|
def bag(d, solid=False):
|
|
d.polygon([(P(11), P(5)), (P(21), P(5)), (P(18.5), P(10)), (P(13.5), P(10))], fill=255) # the gathered neck
|
|
d.rounded_rectangle([P(11.5), P(9.5), P(20.5), P(12.5)], radius=P(1.2), fill=255) # the tie
|
|
d.ellipse([P(5), P(11), P(27), P(30)], fill=255) # the sack
|
|
if not solid:
|
|
d.rectangle([P(11.5), P(10.6), P(20.5), P(11.4)], fill=0) # the string
|
|
with_edge("IconBag", bag)
|
|
def bang(d, solid=False):
|
|
d.rounded_rectangle([P(12), P(2), P(20), P(21)], radius=P(4), fill=255)
|
|
d.ellipse([P(12), P(23), P(20), P(31)], fill=255)
|
|
with_edge("IconBang", bang)
|
|
def query(d, solid=False):
|
|
d.arc([P(6.5), P(2), P(25.5), P(20)], 200, 410, fill=255, width=int(P(5.2)))
|
|
d.polygon([(P(19.5), P(15.5)), (P(23.5), P(18.5)), (P(18.6), P(23)), (P(13.4), P(23)), (P(13.4), P(20))], fill=255)
|
|
d.rectangle([P(13.4), P(19), P(18.6), P(23)], fill=255)
|
|
d.ellipse([P(12.4), P(24.5), P(19.6), P(31.5)], fill=255)
|
|
with_edge("IconQuery", query)
|