| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Game.LambdaHack.Client.UI.InventoryM
Contents
Description
UI of inventory management.
Synopsis
- data Suitability
- = SuitsEverything
- | SuitsSomething (Maybe CStore -> ItemFull -> ItemQuant -> Bool)
- data ResultItemDialogMode
- slotsOfItemDialogMode :: MonadClientUI m => ItemDialogMode -> m SingleItemSlots
- getFull :: (MonadClient m, MonadClientUI m) => m Suitability -> (Actor -> ActorUI -> Skills -> ItemDialogMode -> State -> Text) -> (Actor -> ActorUI -> Skills -> ItemDialogMode -> State -> Text) -> [CStore] -> Bool -> Bool -> m (Either Text (CStore, [(ItemId, ItemQuant)]))
- getGroupItem :: (MonadClient m, MonadClientUI m) => m Suitability -> Text -> Text -> Text -> Text -> [CStore] -> m (Either Text (CStore, ItemId))
- getStoreItem :: (MonadClient m, MonadClientUI m) => ItemDialogMode -> m (Either Text ResultItemDialogMode)
- data ItemDialogState
- accessModeBag :: ActorId -> State -> ItemDialogMode -> ItemBag
- storeItemPrompt :: FactionId -> Actor -> ActorUI -> Skills -> ItemDialogMode -> State -> Text
- getItem :: (MonadClient m, MonadClientUI m) => m Suitability -> (Actor -> ActorUI -> Skills -> ItemDialogMode -> State -> Text) -> (Actor -> ActorUI -> Skills -> ItemDialogMode -> State -> Text) -> ItemDialogMode -> [ItemDialogMode] -> Bool -> Bool -> m (Either Text ResultItemDialogMode)
- data DefItemKey m = DefItemKey {}
- transition :: forall m. (MonadClient m, MonadClientUI m) => m Suitability -> (Actor -> ActorUI -> Skills -> ItemDialogMode -> State -> Text) -> (Actor -> ActorUI -> Skills -> ItemDialogMode -> State -> Text) -> Bool -> Int -> ItemDialogMode -> [ItemDialogMode] -> ItemDialogState -> m (Either Text ResultItemDialogMode)
- keyOfEKM :: Int -> Either [KM] SlotChar -> Maybe KM
- runDefItemKey :: (MonadClient m, MonadClientUI m) => [(KM, DefItemKey m)] -> DefItemKey m -> OKX -> [KM] -> Text -> ItemDialogMode -> m (Either Text ResultItemDialogMode)
Documentation
data Suitability Source #
Constructors
| SuitsEverything | |
| SuitsSomething (Maybe CStore -> ItemFull -> ItemQuant -> Bool) |
data ResultItemDialogMode Source #
Constructors
| RStore CStore [ItemId] | |
| ROrgans ItemId ItemBag SingleItemSlots | |
| ROwned ItemId | |
| RSkills Int | |
| RLore SLore ItemId ItemBag SingleItemSlots | |
| RPlaces Int | |
| RModes Int |
Instances
| Show ResultItemDialogMode Source # | |
Defined in Game.LambdaHack.Client.UI.InventoryM Methods showsPrec :: Int -> ResultItemDialogMode -> ShowS # show :: ResultItemDialogMode -> String # showList :: [ResultItemDialogMode] -> ShowS # | |
slotsOfItemDialogMode :: MonadClientUI m => ItemDialogMode -> m SingleItemSlots Source #
Arguments
| :: (MonadClient m, 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] | stores to cycle through |
| -> 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 (CStore, [(ItemId, ItemQuant)])) |
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
| :: (MonadClient m, MonadClientUI m) | |
| => m Suitability | which items to consider suitable |
| -> Text | specific prompt for only suitable items |
| -> Text | generic prompt |
| -> Text | the verb to use |
| -> Text | the generic verb to use |
| -> [CStore] | stores to cycle through |
| -> m (Either Text (CStore, ItemId)) |
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
| :: (MonadClient m, MonadClientUI m) | |
| => ItemDialogMode | initial mode |
| -> m (Either Text ResultItemDialogMode) |
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.
Internal operations
data ItemDialogState Source #
Instances
| Eq ItemDialogState Source # | |
Defined in Game.LambdaHack.Client.UI.InventoryM Methods (==) :: ItemDialogState -> ItemDialogState -> Bool # (/=) :: ItemDialogState -> ItemDialogState -> Bool # | |
| Show ItemDialogState Source # | |
Defined in Game.LambdaHack.Client.UI.InventoryM Methods showsPrec :: Int -> ItemDialogState -> ShowS # show :: ItemDialogState -> String # showList :: [ItemDialogState] -> ShowS # | |
accessModeBag :: ActorId -> State -> ItemDialogMode -> ItemBag Source #
storeItemPrompt :: FactionId -> Actor -> ActorUI -> Skills -> ItemDialogMode -> State -> Text Source #
Arguments
| :: (MonadClient m, 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 |
| -> ItemDialogMode | first mode to display |
| -> [ItemDialogMode] | the (rest of) modes |
| -> 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 ResultItemDialogMode) |
Let the human player choose a single, preferably suitable, item from a list of items.
data DefItemKey m Source #
transition :: forall m. (MonadClient m, MonadClientUI m) => m Suitability -> (Actor -> ActorUI -> Skills -> ItemDialogMode -> State -> Text) -> (Actor -> ActorUI -> Skills -> ItemDialogMode -> State -> Text) -> Bool -> Int -> ItemDialogMode -> [ItemDialogMode] -> ItemDialogState -> m (Either Text ResultItemDialogMode) Source #
runDefItemKey :: (MonadClient m, MonadClientUI m) => [(KM, DefItemKey m)] -> DefItemKey m -> OKX -> [KM] -> Text -> ItemDialogMode -> m (Either Text ResultItemDialogMode) Source #