Safe Haskell | None |
---|---|
Language | Haskell2010 |
UI of inventory management.
Synopsis
- data Suitability
- = SuitsEverything
- | SuitsSomething (Maybe CStore -> ItemFull -> ItemQuant -> Bool)
- data ResultItemDialogMode
- slotsOfItemDialogMode :: MonadClientUI m => ItemDialogMode -> m SingleItemSlots
- getFull :: MonadClientUI m => ActorId -> m Suitability -> (Actor -> ActorUI -> Skills -> ItemDialogMode -> State -> Text) -> (Actor -> ActorUI -> Skills -> ItemDialogMode -> State -> Text) -> [CStore] -> Bool -> Bool -> m (Either Text (CStore, [(ItemId, ItemQuant)]))
- getGroupItem :: MonadClientUI m => ActorId -> m Suitability -> Text -> Text -> Text -> Text -> [CStore] -> m (Either Text (CStore, ItemId))
- getStoreItem :: MonadClientUI m => ActorId -> ItemDialogMode -> m (Either Text ResultItemDialogMode)
- skillCloseUp :: MonadClientUI m => ActorId -> Int -> m (Text, AttrString)
- placeCloseUp :: MonadClientUI m => [(ContentId PlaceKind, (EnumSet LevelId, Int, Int, Int))] -> Bool -> Int -> m (Text, [(DisplayFont, [Text])])
- data ItemDialogState
- accessModeBag :: ActorId -> State -> ItemDialogMode -> ItemBag
- storeItemPrompt :: FactionId -> Actor -> ActorUI -> Skills -> ItemDialogMode -> State -> Text
- getItem :: MonadClientUI m => ActorId -> 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. MonadClientUI m => ActorId -> 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 -> KeyOrSlot -> Maybe KM
- runDefItemKey :: MonadClientUI m => ActorId -> SingleItemSlots -> ItemBag -> [(KM, DefItemKey m)] -> DefItemKey m -> OKX -> [KM] -> Text -> ItemDialogMode -> m (Either Text ResultItemDialogMode)
- inventoryInRightPane :: MonadClientUI m => ActorId -> SingleItemSlots -> ItemBag -> ItemDialogMode -> KeyOrSlot -> m OKX
Documentation
data Suitability Source #
SuitsEverything | |
SuitsSomething (Maybe CStore -> ItemFull -> ItemQuant -> Bool) |
data ResultItemDialogMode Source #
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 showsPrec :: Int -> ResultItemDialogMode -> ShowS # show :: ResultItemDialogMode -> String # showList :: [ResultItemDialogMode] -> ShowS # |
slotsOfItemDialogMode :: MonadClientUI m => ItemDialogMode -> m SingleItemSlots Source #
:: MonadClientUI m | |
=> ActorId | |
-> 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.
:: MonadClientUI m | |
=> ActorId | |
-> 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.
:: MonadClientUI m | |
=> ActorId | the pointman |
-> 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.
skillCloseUp :: MonadClientUI m => ActorId -> Int -> m (Text, AttrString) Source #
placeCloseUp :: MonadClientUI m => [(ContentId PlaceKind, (EnumSet LevelId, Int, Int, Int))] -> Bool -> Int -> m (Text, [(DisplayFont, [Text])]) Source #
Internal operations
data ItemDialogState Source #
Instances
Eq ItemDialogState Source # | |
Defined in Game.LambdaHack.Client.UI.InventoryM (==) :: ItemDialogState -> ItemDialogState -> Bool # (/=) :: ItemDialogState -> ItemDialogState -> Bool # | |
Show ItemDialogState Source # | |
Defined in Game.LambdaHack.Client.UI.InventoryM 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 #
:: MonadClientUI m | |
=> ActorId | |
-> 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. MonadClientUI m => ActorId -> 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 :: MonadClientUI m => ActorId -> SingleItemSlots -> ItemBag -> [(KM, DefItemKey m)] -> DefItemKey m -> OKX -> [KM] -> Text -> ItemDialogMode -> m (Either Text ResultItemDialogMode) Source #
inventoryInRightPane :: MonadClientUI m => ActorId -> SingleItemSlots -> ItemBag -> ItemDialogMode -> KeyOrSlot -> m OKX Source #