Skip to main content

Crate flatland_client_lib

Crate flatland_client_lib 

Source
Expand description

Shared gameplay session state for TUI, bots, and third-party clients.

Re-exports§

pub use harvest_debug::verbose as harvest_debug_verbose;
pub use harvest_debug::TARGET as HARVEST_LOG_TARGET;
pub use navigation::AutoNavigator;

Modules§

currency
Client-side currency display from inventory stacks.
harvest_debug
Harvest / play-loop diagnostics.
navigation
Client-side pathfinding and auto-navigation toward a map target.

Macros§

harvest_trace
Log at info when verbose(), else debug — always uses TARGET.

Structs§

AssetBundleIndex
AssetFileEntry
AssetSyncOptions
AssetSyncResult
AttributeRow
BotClient
BotConfig
BotStats
CharacterSheet
ChatLogEntry
One line in the always-visible chat log / active thread.
ClientBundleSources
Roots assembled into one installed-client Firebase bundle.
ClientConfig
ClientKeyBindings
ClientSettings
ConnectOptions
ContainerCandidate
One owned container row for the withdraw/deposit container pickers.
ContextLine
HUD line for the location / nearby panel.
FloatingChatPrefs
Map-mode floating CHAT panel position + collapse (flatland3-gfx).
GameClient
GameState
GfxWindowPrefs
GrantTargetOption
GrantTargetPicker
Active “apply grant onto…” picker (fortify oil, frost edge scroll, …).
InventoryRow
One row in the inventory browser tree.
InventoryRowView
Formatted inventory row text shared by TUI and gfx browsers.
LoadoutHotbarChoice
One row in the loadout hotbar picker (ability or inventory consumable).
LocalAssetState
MoveOption
A destination the currently-picked item could be moved to.
MovePicker
Active “move to…” destination picker state for the selected inventory item.
NearbyContainer
A placed chest within CONTAINER_RANGE_M, with its contents pre-flattened for the browser (empty when locked without the matching key).
NodeCandidate
One resource-node row for the harvest picker.
PendingTradeRequest
Inbound trade request waiting for Y/N in the chat column.
PlayerVerbState
PoolRow
RemoteSession
RotationEditorState
Local rotation editor UI state (not persisted).
SkillRow
SocialChatState
SpeakingBubble
Comic “…” bubble above a speaking player (Nearby / Direct only).
StoragePickOption
One selectable stack in a storage store/take/ship picker.
TradeNpcCandidate
One merchant row for the sell picker.
TradeUiState
UseWorldCandidate
UseWorldProbe
WhisperContact
WhisperPouchUi
WithdrawLineDraft
One editable withdraw line inside the WithdrawItems sheet.
WorkerGiveOption
One giveable stack in the workers-menu give picker.
WorkerGivePicker
Give an on-person inventory stack to the selected hired worker.
WorkerGiveTargetOption
Nearby hired worker choice when giving a selected inventory stack (g).
WorkerGiveTargetPicker
Pick which nearby worker receives the selected inventory item.
WorkerRouteEditorState
Draft route for a hired worker. stops is the ordered, editable list; lodging_container_id is the bed used for RestIfNeeded.
WorkerRouteWaypoint
One outbound travel waypoint for a harvest loop route.
WorkerRouteWithdrawItem
One withdraw line for a WithdrawFrom editor stop.
WorkerTakePicker
Take an item from a hired worker back into the employer’s inventory.
WorkerTeachOption
One teachable blueprint in the workers-menu teach picker.
WorkerTeachPicker
Teach a known blueprint to the selected hired worker.

Enums§

AssetSyncKind
Outcome of sync_assets for logging / HUD toasts.
AudioCue
Soft UI tones (synthesized; .wav hooks come later).
AuthCredential
How the client authenticates to the game gateway. Uses default serde enum encoding (postcard-compatible; not internally tagged).
BankUiMode
Bank teller panel focus (action list vs amount / transfer prompts).
CharacterSheetTab
ChatThreadKind
Where chat input will send.
EquipPaperdollRow
InventoryBrowserLine
One line in the sectioned inventory browser (headers are non-selectable).
InventorySection
Broad section of the inventory browser a row belongs to (drives the grouped “Worn” / “On you” / “Nearby chest” headers in the UI).
InventoryTab
Top-level inventory browser tab (b menu).
LedgerPeriod
MoveOptionKind
RotationEditorMode
Rotation editor overlay mode (plans/26 §C2.5).
RouteEditorClick
Mouse actions produced by the gfx overlay and applied on the net thread.
RouteEditorSheet
Which sheet (sub-screen) the route editor is showing.
SessionEvent
SheetSync
ShopTab
StorageUiMode
Town storage manager focus (action list vs item pickers vs quantity).
UseWorldKind
What kind of world-use target this is (drives tint + verb).
WithdrawLineMode
Tri-state of one withdraw line draft: not included, take all, take qty.
WorkerRouteStop
One typed stop in an ordered worker route. Mirrors the sim WorkerRouteStop.

Constants§

ADD_MENU
Add-menu entries in display order.
CONTAINER_RANGE_M
Max distance (m) a placed chest can be browsed/moved-into from the inventory UI. Mirrors flatland_sim::interaction::CONTAINER_INTERACTION_RADIUS_M so the client only ever shows chests the server will actually let you use — this is what makes a chest disappear from the menu as soon as you walk away.
DEFAULT_API_PORT
DEFAULT_FIREBASE_BUCKET
DEFAULT_GAME_PORT
DEFAULT_TICK_HZ
Default sim tick rate when the client has no settings (matches server-settings).
LIST_PAGE_SIZE
Rows jumped by PageUp / PageDown in list UIs.
USE_WORLD_NEARBY_SCAN_M
Candidates beyond this are omitted from the probe list.
WAYPOINT_MENU
Waypoint submenu entries in display order.
WORKER_GIVE_RANGE_M
Max distance (m) to hand an item to a hired worker.

Traits§

PlayConnection
Gameplay session handle (remote TCP or in-process worker).

Functions§

api_base_url_for_host
Control-plane base URL for a DNS/IP host (optional :port is ignored for API; API always uses DEFAULT_API_PORT unless the host is already an http(s):// URL).
apply_host_override
Apply a one-shot host for this process only (no client.json write).
assets_index_url
body_slot_label
Short display label for a body slot (plans/08 §4.1) — shared by the inventory browser section headers and the move-destination picker.
build_bundle_index
Walk assets/gfx/sprites and build a publish manifest (relative paths → hash).
build_character_sheet
build_client_bundle_index
Build the installed-client asset index: sprites at the rev root plus optional paperdoll / player presentation / player art / client config trees.
connect
connect_tcp
contacts_from_stacks
default_api_base_url
default_game_server_addr
default_server_addr
equip_paperdoll_rows
firebase_download_url
firebase_object_path
format_binding_mode
format_binding_ttl
Human-readable remaining time for an item status binding.
format_pool_xp
format_progress_pct
format_status_bindings_suffix
Compact suffix for inventory / paperdoll rows, e.g. · fortify (while equipped, 58m left).
format_xp_band
format_xp_band_compact
format_xp_delta
Signed delta from baseline — always enough decimals to see harvest ticks.
format_xp_value
Adaptive precision so tiny harvest gains (0.08 XP) don’t display as 0.0.
host_override_active
True when this process applied (or inherited) a one-shot --host override.
inventory_category_group
Category group for On-person loose items (stable order).
list_label_matches
Case-insensitive substring match for list filters (name / template / label).
load_client_settings
needs_asset_sync
node_candidates
Harvestable resource nodes sorted by distance to the player.
normalize_host_input
Strip scheme/path and reject empty hosts. Allows DNS names and host:port.
owned_container_candidates
Owned containers (any with storage capacity, lodging flagged) sorted by distance to the player then name — the withdraw/deposit picker rows.
owned_container_candidates_with_occupants
Like owned_container_candidates, but lodging rows include occupant names in summary.
owned_lodging_container_ids
Owned placed lodging containers (camp beds) — used as the rest/bed target.
owned_lodging_container_ids_with_occupants
Lodging beds with display names that include occupant labels (Camp bed — Elda).
owned_storage_template_ids
Distinct item templates present in the employer’s owned placed containers — candidate sell templates for TradeWith stops.
page_list_index
Clamp a list selection after a page jump (pages is typically ±1).
pick_lodging_container_at
pick_resource_node_at
Nearest harvestable resource node within click range.
pick_storage_container_at
Pick any owned storage container at a click position (lodging or regular chest).
pick_trade_npc_at
Nearest trade-capable NPC within click range.
read_local_state
read_repo_publish_rev
Publish rev from assets/.content-publish.json when running from a dev checkout.
resolve_bundle_file_path
Resolve on-disk path for a relative key in the client asset bundle.
resolve_game_host_addr
Resolve a DNS name or IP (optional :port) to the gateway TCP address.
resolve_paperdoll_dir
Paperdoll root for installed / synced clients (rev-N/paperdoll) or repo checkout.
resolve_sprites_dir
Prefer the repo checkout when it is at least as new as the synced cache.
route_item_template_candidates
Item templates for deposit filters / sell stops — not limited to what is already in a chest. Includes storage, inventory, craft outputs/inputs, harvest node products, and any extra seeds (existing filter selections, route craft outputs) so factory lines can be authored before the first batch is made.
self_chat_rgb
Local player’s chat color (mint) — distinct from hashed peer colors.
should_prefer_repo_assets
True when this process should use the git checkout sprites instead of Firebase.
speaker_chat_rgb
Stable pastel from entity id (same color in CHAT log and world bubble).
summarize_contents
Summarize container contents as oak_log ×12 · lumber ×4 (or (empty)).
sync_assets
synced_rev_dir
Active synced rev directory (~/.flatland3/assets/rev-N or current).
trade_npc_candidates
Trade-capable NPCs sorted by distance to the player.
worker_attention_line
First non-transient worker issue for the status bar (strike, route error, etc.). Routine recovery noise (path failures → lodging) stays in the game log only.
worker_craft_blueprint_ids
Blueprint ids the route editor may assign to a craft_at hand stop.
worker_error_is_hud_noise
True for routine worker recoveries that should not paint the status bar. Still logged when they change (see GameState::apply_hired_workers).
worker_error_is_transient
True when a worker last_error is transient noise (soft-skip chatter).