diff --git a/game.py b/game.py index a6d24a1..03f7dff 100644 --- a/game.py +++ b/game.py @@ -7730,9 +7730,46 @@ def _assign_glyphs() -> None: action["glyph"], action["tint"] = SKILL_GLYPHS[action["skill"]] +# Emoji in the UI and in what the server sends are drawn as these glyphs wherever the page renders, see iconed() in app.js. +_EMOJI_GLYPHS = { + # kingdom, roads and war + "πΊοΈ": ("treasure-map", "#d9c6a0"), "π€οΈ": ("stone-path", "#b6a587"), "π": ("horse-head", "#b9844e"), "πΆ": ("walk", "#b6a587"), + "π": ("position-marker", "#e2645c"), "π ": ("house", "#d0a060"), "π°": ("castle", "#a8a29e"), "π": ("guards", "#c06a4a"), + "βοΈ": ("crossed-swords", "#d8574c"), "π‘οΈ": ("checked-shield", "#8fb8d0"), "π": ("dragon-head", "#e05a5a"), "π": ("death-skull", "#d9c6a0"), + "π¦": ("cardboard-box", "#b9844e"), "π₯": ("backup", "#a9b4c0"), "π€": ("person", "#a9b4c0"), "π": ("trophy", "#e3c060"), + "βοΈ": ("quill-ink", "#d9c6a0"), "π": ("scroll-unfurled", "#e3c060"), "β°οΈ": ("peaks", "#a8a29e"), "π²": ("pine-tree", "#5fae5a"), + "π": ("big-wave", "#5aa0d8"), "πΎ": ("wheat", "#e3c060"), + # verdicts + "β ": ("check-mark", "#5fae5a"), "β": ("cancel", "#d8574c"), "β οΈ": ("hazard-sign", "#e3a043"), "β": ("uncertainty", "#a9b4c0"), + "β": ("uncertainty", "#a9b4c0"), "β": ("hazard-sign", "#e3a043"), + # navigation and the page furniture + "ποΈ": ("village", "#d0a060"), "π¬": ("talk", "#a9b4c0"), "π°": ("newspaper", "#d9c6a0"), "π¦": ("bank", "#e3c060"), "π": ("pin", "#e2645c"), + "β³": ("hourglass", "#c9b58a"), "β±": ("stopwatch", "#c9b58a"), "β": ("fast-forward-button", "#a9b4c0"), "π": ("padlock", "#a9b4c0"), + "π¨": ("claw-hammer", "#b9844e"), "π₯": ("flame", "#f0903e"), "πͺ΅": ("wood-pile", "#b9844e"), "π±": ("sprout", "#5fae5a"), + "βοΈ": ("scales", "#e3c060"), "π§": ("spanner", "#a9b4c0"), "β¨": ("sparkles", "#e3c060"), "π": ("party-popper", "#e3c060"), "π": ("checkered-flag", "#d9c6a0"), + "π§ͺ": ("round-bottom-flask", "#b98ce8"), "π": ("prayer", "#e9dfc6"), "π¬οΈ": ("windy-stripes", "#a9c8d8"), "π€": ("shaking-hands", "#d9c6a0"), "β": ("hand", "#d9c6a0"), + "β€οΈ": ("hearts", "#e2645c"), "π¦΄": ("crossed-bones", "#e9dfc6"), "π": ("present", "#e2645c"), "π": ("sliced-bread", "#d9a860"), "π²": ("hot-meal", "#d9a860"), + "π": ("shirt", "#a9c8d8"), "π₯Ά": ("snowflake-1", "#a9c8d8"), "ποΈ": ("crane", "#e3a043"), "π΅οΈ": ("hooded-figure", "#8a7fd0"), "π―": ("hunting-horn", "#e0a050"), + "π": ("backpack", "#b9844e"), "πͺ": ("camel-head", "#d9a860"), "π«": ("camel-head", "#d9a860"), "π§³": ("suitcase", "#b9844e"), + # moods + "π ": ("enrage", "#e2645c"), "π": ("despair", "#e3a043"), "π": ("meditation", "#a9b4c0"), "π": ("smitten", "#a0c060"), "π": ("laurel-crown", "#5fae5a"), + # seasons and weather + "βοΈ": ("sun", "#e3c060"), "π": ("falling-leaf", "#d07a3c"), "βοΈ": ("snowflake-1", "#a9c8d8"), "π€οΈ": ("sun-cloud", "#e3c060"), "π§οΈ": ("raining", "#5aa0d8"), + "π₯΅": ("heat-haze", "#e2645c"), "βοΈ": ("lightning-storm", "#b98ce8"), "π«οΈ": ("fog", "#a9b4c0"), "π¨οΈ": ("snowing", "#a9c8d8"), + # troubles, hardships and fortunes + "πΊ": ("wolf-head", "#a9b4c0"), "π»": ("bear-head", "#b9844e"), "π": ("boar", "#b9844e"), "πΊ": ("goblin-head", "#5fae5a"), "π·οΈ": ("spider-alt", "#a9b4c0"), + "π": ("bee", "#e3c060"), "π": ("rat", "#a9b4c0"), "π¦": ("ant", "#a0c060"), "π΄ββ οΈ": ("pirate-flag", "#d9c6a0"), "π": ("stone-bridge", "#a8a29e"), + "πͺ¨": ("stone-block", "#a8a29e"), "π’οΈ": ("barrel", "#b9844e"), "β": ("fist", "#e3a043"), "π€": ("vomiting", "#a0c060"), "π₯": ("dead-wood", "#b9844e"), + "π«¨": ("earth-crack", "#b9844e"), "ποΈ": ("heat-haze", "#d9a860"), "π": ("graduate-cap", "#8a7fd0"), "π¨": ("palette", "#e2645c"), "π«³": ("robber-hand", "#e3a043"), + "π": ("mushroom-gills", "#d07a3c"), "πͺοΈ": ("tornado", "#a9b4c0"), "π": ("crown", "#e3c060"), "π": ("double-fish", "#5aa0d8"), "π": ("cut-diamond", "#8fd0e0"), + "π‘οΈ": ("broadsword", "#a9b4c0"), "π¦": ("deer", "#b9844e"), +} +EMOJI_GLYPHS = {emoji.replace("\ufe0f", ""): glyph for emoji, glyph in _EMOJI_GLYPHS.items()} + + def all_glyphs() -> set[str]: """Every glyph the game draws, for building the sprite.""" - names = set(UI_GLYPHS) + names = set(UI_GLYPHS) | {name for name, _tint in EMOJI_GLYPHS.values()} for collection in (ITEMS.values(), SKILLS, CLASSES.values(), BUILDINGS.values(), PRAYERS, ACTIONS, combat.ABILITIES.values(), combat.ENEMY_ABILITIES.values()): names.update(entry["glyph"] for entry in collection) @@ -7750,6 +7787,9 @@ ORDER_RECIPES, ORDER_RAW = _order_sources() # What changed, shown on the Patch notes page. Newest first; every shipped change adds a # line here (new / balance / fix), and a new release a new entry on top. PATCH_NOTES = [ + {"date": "2026-11-04", "title": "Icons", "notes": [ + ("new", "Icons replace emoji across the game. Your own board messages stay as typed."), + ]}, {"date": "2026-11-04", "title": "Caravans", "notes": [ ("new", "Caravans: carry goods between towns. 1h, 1,000 items per crew member. Everyone aboard stops work until it arrives."), ("new", "Town stock: war council vote, then a caravan carries it. Crew earn 5% of its worth in favour at the far end."), @@ -7965,7 +8005,7 @@ def content() -> dict: "resistant": RESISTANT, "jewel_stats": JEWEL_STATS, "stations": list(STATIONS), "class_style": CLASS_STYLE, "block_chance": BLOCK_CHANCE, "regen_per_hour": REGEN_PER_HOUR, "fires": FIRES, "flames": FLAMES, "firewood": FIREWOOD, "tend_xp": TEND_XP, "fire_low": FIRE_LOW, - "patch_notes": PATCH_NOTES, + "patch_notes": PATCH_NOTES, "emoji_glyphs": EMOJI_GLYPHS, "wares": {key: {**spec, "glyph": WARE_GLYPHS[key]} for key, spec in WARES.items()}, "cosmetics": COSMETICS, "free_looks": FREE_LOOKS, "homes": HOMES, "monuments": MONUMENTS, "guard_wage": GUARD_WAGE, } diff --git a/static/app.js b/static/app.js index 5f010cd..1d34c04 100644 --- a/static/app.js +++ b/static/app.js @@ -55,6 +55,19 @@ function iconise(content) { for (const entry of entries) if (entry.glyph) entry.icon = glyph(entry.glyph, entry.tint); return content; } +// Emoji become glyphs wherever the page is drawn. Not inside tags (a title can't hold an icon), a dropdown +// (nor can an option), or what players typed on the board. +let emojiPattern = null; +function iconed(html) { + if (!C?.emoji_glyphs) return html; + emojiPattern ||= new RegExp(`(<(select|textarea)\\b[\\s\\S]*?\\2>|
${k.cities.length} / ${k.max} towns
` : `${cost}
${S.city.next_tier ? `${esc(k.short)}
` : `