diff options
-rw-r--r-- | src/Main.hs | 2 | ||||
-rw-r--r-- | src/Sequence/Types.hs | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/Main.hs b/src/Main.hs index 903da05..ea663e8 100644 --- a/src/Main.hs +++ b/src/Main.hs | |||
@@ -38,7 +38,7 @@ main = do | |||
38 | let | 38 | let |
39 | description = initialShellDescription | 39 | description = initialShellDescription |
40 | { historyFile = Just historyFile | 40 | { historyFile = Just historyFile |
41 | , prompt = \st -> return $ maybe "" (++ " ") ((evalState ?? st) . toName . snd <$> (listToMaybe $ view priorityQueue st)) ++ "→ " | 41 | , prompt = \st -> return $ maybe "" (++ " ") ((evalState ?? st) . toName <$> view tip st) ++ "→ " |
42 | , beforePrompt = gets stateOutline >>= (\str -> if null str then return () else shellPutStrLn str) | 42 | , beforePrompt = gets stateOutline >>= (\str -> if null str then return () else shellPutStrLn str) |
43 | , commandStyle = OnlyCommands | 43 | , commandStyle = OnlyCommands |
44 | , shellCommands = [ exitCommand "exit" | 44 | , shellCommands = [ exitCommand "exit" |
diff --git a/src/Sequence/Types.hs b/src/Sequence/Types.hs index afe1060..fd8d7ab 100644 --- a/src/Sequence/Types.hs +++ b/src/Sequence/Types.hs | |||
@@ -7,7 +7,7 @@ module Sequence.Types | |||
7 | , Entity(..), eFaction, eSeqVal | 7 | , Entity(..), eFaction, eSeqVal |
8 | , EntityName(..), entityName | 8 | , EntityName(..), entityName |
9 | , EntityIdentifier(..), entityId | 9 | , EntityIdentifier(..), entityId |
10 | , inhabitedFactions, priorityQueue | 10 | , inhabitedFactions, priorityQueue, tip |
11 | ) where | 11 | ) where |
12 | 12 | ||
13 | import Control.Lens | 13 | import Control.Lens |
@@ -99,3 +99,6 @@ priorityQueue = to priorityQueue' | |||
99 | priorityQueue' (Map.toAscList . view gEntities -> entities) = sortBy (comparing $ Down . snd) . concat . map filter . map (over _1 $ view eSeqVal) . map swap $ entities | 99 | priorityQueue' (Map.toAscList . view gEntities -> entities) = sortBy (comparing $ Down . snd) . concat . map filter . map (over _1 $ view eSeqVal) . map swap $ entities |
100 | filter (Nothing, _) = mempty | 100 | filter (Nothing, _) = mempty |
101 | filter (Just val, id) = pure (val, id) | 101 | filter (Just val, id) = pure (val, id) |
102 | |||
103 | tip :: Getter GameState (Maybe EntityIdentifier) | ||
104 | tip = priorityQueue . to (fmap snd . listToMaybe) | ||