Fishies 0.8.1

This commit is contained in:
CRTkafa 2026-10-01 12:41:30 +07:00
commit 5821ce9f4d
76 changed files with 2198 additions and 0 deletions

69
src/icons.ts Normal file
View file

@ -0,0 +1,69 @@
/** The Fishies system icon set: the painted icons the game's dock and HUD, the Keeper OS desktop,
* the video player and the Field Guide share, named and grouped like an operating system's icon
* set (owner, 1 October 2026; Atlas landing-site jzxy3e).
*
* Data only. Each picture is painted once (public/game/ui-icons, public/game/emotes, provenance in
* their PROVENANCE files) and exported at twice its largest display size. What each file measures
* and where the code uses it are not written here: `bun tools/fishies-ui/build.ts` reads them into
* icons.generated.ts, so this list cannot drift from the files. */
export type IconGroup = 'care' | 'places' | 'system' | 'things' | 'expressions'
export const ICON_GROUPS: readonly { readonly id: IconGroup; readonly title: string; readonly use: string }[] = [
{ id: 'care', title: 'Care tools', use: 'The verbs of keeping fish: the dock’s tools and the cursors they become.' },
{ id: 'places', title: 'Places and lists', use: 'Where you can go and what you can open: rooms, shop, stash, map, people.' },
{ id: 'system', title: 'System', use: 'Settings, sound, notices and the frame: the same in the game, the OS and the player.' },
{ id: 'things', title: 'Things', use: 'Nouns of the reef: coins, fish, eggs, plants, rewards.' },
{ id: 'expressions', title: 'Expressions', use: 'The emotes keepers send in Open Water and the chat.' },
]
export type SystemIcon = {
readonly name: string
readonly file: string
readonly label: string
/** What it stands for, everywhere it appears. One meaning per icon, one icon per meaning. */
readonly meaning: string
readonly group: IconGroup
}
const ui = (name: string, label: string, group: IconGroup, meaning: string): SystemIcon => ({ name, file: `/game/ui-icons/${name}.png`, label, group, meaning })
const emote = (name: string, label: string, meaning: string): SystemIcon => ({ name: `emote-${name}`, file: `/game/emotes/${name}.png`, label, group: 'expressions', meaning })
export const SYSTEM_ICONS = [
ui('feed', 'Feed', 'care', 'give fish food'), ui('net', 'Net', 'care', 'catch a fish to sell or move'), ui('clean', 'Clean', 'care', 'wipe the glass'),
ui('decorate', 'Decorate', 'care', 'place a new decoration'), ui('arrange', 'Arrange', 'care', 'move what is already placed'),
ui('remedy', 'Remedy', 'care', 'heal a sick fish'), ui('inspect', 'Inspect', 'care', 'look closer, search'),
ui('home', 'Home', 'places', 'your own aquarium'), ui('explore', 'Explore', 'places', 'find other keepers'), ui('map', 'Map', 'places', 'the ocean map and its places'),
ui('shop', 'Shop', 'places', 'buy fish, decor and care'), ui('cart', 'Cart', 'places', 'open the basket'), ui('cart-add', 'Add to cart', 'places', 'put something in the basket'),
ui('inventory', 'Stash', 'places', 'what you own but have not placed'), ui('book', 'Book', 'places', 'the Field Guide and guides'),
ui('people', 'People', 'places', 'keepers, friends, followers'), ui('share', 'Share', 'places', 'send a link elsewhere'), ui('pin', 'Pin', 'places', 'keep it on top'),
ui('menu', 'Menu', 'system', 'more choices'), ui('bell', 'Notices', 'system', 'what happened while you were away'), ui('gear', 'Settings', 'system', 'change how it works'),
ui('help', 'Help', 'system', 'ask or learn how'), ui('sound', 'Sound', 'system', 'sound is on'), ui('mute', 'Muted', 'system', 'sound is off'),
ui('music', 'Music', 'system', 'the soundtrack'), ui('fullscreen', 'Full screen', 'system', 'fill the screen'), ui('camera', 'Camera', 'system', 'take a picture or a video'),
ui('coin', 'Coin', 'things', 'money in the game'), ui('fish', 'Fish', 'things', 'a fish, the game itself'), ui('egg', 'Egg', 'things', 'an egg, something hatching'),
ui('growth', 'Growth', 'things', 'growing up, rising numbers'), ui('heart', 'Heart', 'things', 'a like, kindness'), ui('star', 'Star', 'things', 'level, favourite, reward'),
ui('shell', 'Shell', 'things', 'a shell, reef chat'), ui('kelp', 'Kelp', 'things', 'plants'), ui('coral', 'Coral', 'things', 'coral and ornaments'),
ui('lock', 'Locked', 'system', 'closed, cannot be changed or answered'), ui('solved', 'Solved', 'things', 'answered, done, approved'),
ui('staff', 'Staff', 'things', 'someone from the Fishies team'), ui('edit', 'Edit', 'system', 'change words, or was changed'),
ui('upvote', 'Upvote', 'things', 'this is useful, raise it'), ui('report', 'Report', 'system', 'tell the team something is wrong'),
ui('follow', 'Follow', 'system', 'get notices about it'), ui('views', 'Views', 'things', 'how many looked, who can see it'),
ui('chat', 'Chat', 'places', 'a conversation, replies, general talk'),
ui('announce', 'Announcements', 'places', 'news from the team'), ui('updates', 'Updates', 'places', 'patch notes and what changed'),
ui('bug', 'Bugs', 'places', 'something broken'), ui('idea', 'Ideas', 'places', 'a suggestion'),
emote('hello', 'Hello', 'wave hello'), emote('heart', 'Love', 'send love'), emote('question', 'Question', 'wonder aloud'), emote('surprise', 'Surprise', 'be surprised'),
emote('food', 'Food', 'ask for food'), emote('sleep', 'Sleepy', 'feel sleepy'), emote('music', 'Music', 'enjoy the music'), emote('sparkle', 'Sparkle', 'something wonderful'),
] as const satisfies readonly SystemIcon[]
export type SystemIconName = (typeof SYSTEM_ICONS)[number]['name']
/** The sizes the set is drawn at, in CSS pixels. A file stays sharp up to half its pixel width. */
export const ICON_SIZES = { xs: 16, sm: 20, md: 28, lg: 46, xl: 84 } as const
export type IconSize = keyof typeof ICON_SIZES
export const iconByName = (name: string): SystemIcon | undefined => SYSTEM_ICONS.find(icon => icon.name === name)
let resolveUrl = (icon: SystemIcon): string => icon.file
/** Where the pictures are served from. In the game they sit at their `file` path; anywhere else,
* point this at a copy of the package's `icons/` folder (`icons/<name>.png`). */
export function configureIcons(options: { url: (icon: SystemIcon) => string }): void { resolveUrl = options.url }
export const iconUrl = (icon: SystemIcon): string => resolveUrl(icon)