| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Game.LambdaHack.Client.UI.InventoryM
Description
UI of inventory management.
Synopsis
- data Suitability
- = SuitsEverything
- | SuitsSomething (ItemFull -> ItemQuant -> Bool)
- getFull :: MonadClientUI m => m Suitability -> (Actor -> ActorUI -> AspectRecord -> ItemDialogMode -> Text) -> (Actor -> ActorUI -> AspectRecord -> ItemDialogMode -> Text) -> [CStore] -> [CStore] -> Bool -> Bool -> m (Either Text ([(ItemId, ItemFullKit)], (ItemDialogMode, Either KM SlotChar)))
- getGroupItem :: MonadClientUI m => m Suitability -> Text -> Text -> [CStore] -> [CStore] -> m (Either Text ((ItemId, ItemFull), (ItemDialogMode, Either KM SlotChar)))
- getStoreItem :: MonadClientUI m => (Actor -> ActorUI -> AspectRecord -> ItemDialogMode -> Text) -> ItemDialogMode -> m (Either Text (ItemId, ItemBag, SingleItemSlots), (ItemDialogMode, Either KM SlotChar))
- ppItemDialogMode :: ItemDialogMode -> (Text, Text)
- ppItemDialogModeFrom :: ItemDialogMode -> Text
Documentation
data Suitability Source #
Constructors
| SuitsEverything | |
| SuitsSomething (ItemFull -> ItemQuant -> Bool) |
Arguments
| :: MonadClientUI m | |
| => m Suitability | which items to consider suitable |
| -> (Actor -> ActorUI -> AspectRecord -> ItemDialogMode -> Text) | specific prompt for only suitable items |
| -> (Actor -> ActorUI -> AspectRecord -> ItemDialogMode -> Text) | generic prompt |
| -> [CStore] | initial legal modes |
| -> [CStore] | legal modes with Calm taken into account |
| -> Bool | whether to ask, when the only item in the starting mode is suitable |
| -> Bool | whether to permit multiple items as a result |
| -> m (Either Text ([(ItemId, ItemFullKit)], (ItemDialogMode, Either KM SlotChar))) |
Let the human player choose a single, preferably suitable, item from a list of items. Don't display stores empty for all actors. Start with a non-empty store.
Arguments
| :: MonadClientUI m | |
| => m Suitability | which items to consider suitable |
| -> Text | specific prompt for only suitable items |
| -> Text | generic prompt |
| -> [CStore] | initial legal modes |
| -> [CStore] | legal modes after Calm taken into account |
| -> m (Either Text ((ItemId, ItemFull), (ItemDialogMode, Either KM SlotChar))) |
Let a human player choose any item from a given group. Note that this does not guarantee the chosen item belongs to the group, as the player can override the choice. Used e.g., for applying and projecting.
Arguments
| :: MonadClientUI m | |
| => (Actor -> ActorUI -> AspectRecord -> ItemDialogMode -> Text) | how to describe suitable items |
| -> ItemDialogMode | initial mode |
| -> m (Either Text (ItemId, ItemBag, SingleItemSlots), (ItemDialogMode, Either KM SlotChar)) |
Display all items from a store and let the human player choose any or switch to any other store. Used, e.g., for viewing inventory and item descriptions.
ppItemDialogMode :: ItemDialogMode -> (Text, Text) Source #