Safe Haskell | None |
---|---|
Language | Haskell2010 |
UI of inventory management.
Synopsis
- data Suitability
- = SuitsEverything
- | SuitsSomething (ItemFull -> ItemQuant -> Bool)
- getFull :: MonadClientUI m => m Suitability -> (Actor -> ActorUI -> Skills -> ItemDialogMode -> State -> Text) -> (Actor -> ActorUI -> Skills -> ItemDialogMode -> State -> 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 -> Skills -> ItemDialogMode -> State -> Text) -> ItemDialogMode -> m (Either Text (ItemId, ItemBag, SingleItemSlots), (ItemDialogMode, Either KM SlotChar))
Documentation
data Suitability Source #
:: MonadClientUI m | |
=> m Suitability | which items to consider suitable |
-> (Actor -> ActorUI -> Skills -> ItemDialogMode -> State -> Text) | specific prompt for only suitable items |
-> (Actor -> ActorUI -> Skills -> ItemDialogMode -> State -> 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.
:: 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.
:: MonadClientUI m | |
=> (Actor -> ActorUI -> Skills -> ItemDialogMode -> State -> 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.