Skip to main content

Crate flatland_presentation

Crate flatland_presentation 

Source
Expand description

Resolve authoritative game states to gfx sprite mode_ids.

Structs§

NpcPresentationInput
Inputs for NPC wildlife presentation (keeps this crate free of sim types).
PlacedNpcPresentationInput
Town / building NPCs — schedule + conversation.
PlayerPresentationConfig
PlayerPresentationDoc
PlayerPresentationInput
Inputs for player presentation (keeps this crate free of sim types).
PlayerSpritePresentationInput
Inputs for player sprite resolution.
ResourcePresentationDefaults
ResourceSpriteResolution
Effective tile and mode for a resource node.
SpriteCatalog
Index of all sprite sheets and their mode ids.
SpriteFallback
SpritePresentationDefaults
SpriteSheetModes
Mode ids for one sprite sheet.
WildlifeNpcPresentationInput
Inputs for wildlife / combat-driven NPCs (keeps this crate free of sim types).

Constants§

NPC_LEGACY_BEHAVIOR_ALIASES
Legacy behavior FSM ids still accepted in sprite_modes when no canonical key matches.
NPC_PRESENTATION_STATES
Standard presentation keys shown in content-admin and used on the wire.
PLAYER_DIRECTIONAL_BASE_MODES
Movement modes that may have per-direction variants on a sprite sheet.
PLAYER_PRESENTATION_STATES
Standard presentation keys shown in content-admin and used on the wire.
RESOURCE_PRESENTATION_KEYS
Stable presentation keys for harvestable resource nodes (designer-facing).
RESOURCE_PRESENTATION_KEY_COOLDOWN_LEGACY
Legacy key still accepted in item sprite_modes YAML.

Functions§

base_sprite_mode
Strip a directional suffix so stale server modes like walk_north still face correctly. Longer suffixes (_northeast) are matched before shorter ones (_north).
cardinal_facing_label
8-way facing labels (N/NE/E/SE/S/SW/W/NW) for paperdoll and directional sheets.
default_player_presentation_path
default_sprites_dir
Resolve sprites directory from env, repo checkout, or synced install cache.
eight_way_facing_label
Bin continuous yaw into one of eight compass labels.
expand_directional_draw_mode
Expand a base gfx mode with client facing when the sheet has directional variants. Prefers 8-way labels, then falls back to 4-way for older PNG sheets.
four_way_facing_label
Legacy 4-way bin (N/E/S/W) — fallback when a sheet lacks 8-way cells.
load_player_presentation
load_player_presentation_default
load_sprite_catalog
Load sprite mode index from dir (expects manifest.yaml + sheet YAML files).
load_sprite_presentation_defaults
mode_exists_on_sheet
True when mode is on the sheet, or directional variants like walk_north exist for base walk.
npc_presentation_key
npc_sheet_alias
Canonical presentation key → first matching sheet mode id (shared with runtime resolve).
placed_npc_presentation_input
Build presentation input for placed (town/building) NPCs.
player_presentation_input
presentation_sheet_mode_ids
Mode ids used to validate presentation → sprite mode resolution.
presentation_validation_mode_ids
Mode ids used to validate an entity’s sprite_modes (PNG sheet and/or baked paperdoll).
resolve_farm_growth_sprite_mode
Farm crop growth bands from sim (grow_10grow_100). Picks the requested stage when present on the sheet, otherwise the nearest lower stage, then common resource modes.
resolve_npc_sprite_mode
Resolve gfx mode for an NPC view.
resolve_placed_npc_presentation_key
resolve_player_presentation_key
resolve_player_sprite_mode
Resolve gfx mode for a player entity view.
resolve_resource_sprite
Resolve a resource state using item overrides, shared defaults, and a generic fallback.
resolve_resource_sprite_mode
Resolve gfx mode for a resource node view.
resolve_wildlife_presentation_key
resource_presentation_key
sheet_has_mode
True when sheet_modes contains mode or a directional variant ({mode}_north, …).
validate_sprite_mode_maps
Validate that every value in sprite_modes exists on the sheet for tile_id.
validate_sprite_modes_for_presentation
Validate sprite_modes values against PNG and/or paperdoll bake mode lists.
validate_sprite_presentation_defaults
Validate configured shared presentation fallbacks against the loaded sprite catalog.
wildlife_npc_presentation_input
Build presentation input for wildlife from sim context.

Type Aliases§

SpriteModeMap
Presentation key → sprite sheet mode id (from item/NPC YAML sprite_modes).