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
ClientConfig
ClientKeyBindings
ClientSettings
ConnectOptions
ContainerCandidate
One owned container row for the withdraw/deposit container pickers.
ContextLine
HUD line for the location / nearby panel.
GameClient
GameState
GfxWindowPrefs
InventoryRow
One row in the inventory browser tree.
InventoryRowView
Formatted inventory row text shared by TUI and gfx browsers.
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.
PoolRow
RemoteSession
RotationEditorState
Local rotation editor UI state (not persisted).
SkillRow
TradeNpcCandidate
One merchant row for the sell picker.
UseWorldCandidate
UseWorldProbe
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.
AuthCredential
How the client authenticates to the game gateway. Uses default serde enum encoding (postcard-compatible; not internally tagged).
CharacterSheetTab
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).
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
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
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§

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
connect
connect_tcp
default_api_base_url
default_game_server_addr
default_server_addr
equip_paperdoll_rows
firebase_download_url
firebase_object_path
format_pool_xp
format_progress_pct
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.
load_client_settings
needs_asset_sync
node_candidates
Harvestable resource nodes sorted by distance to the player.
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.
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_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.
summarize_contents
Summarize container contents as oak_log ×12 · lumber ×4 (or (empty)).
sync_assets
trade_npc_candidates
Trade-capable NPCs sorted by distance to the player.
worker_craft_blueprint_ids
Blueprint ids the route editor may assign to a craft_at hand stop.
worker_error_is_transient
True when a worker last_error is transient noise (path retries / soft-skip).