Tweak debug display
This commit is contained in:
+14
-2
@@ -18,11 +18,18 @@ import ShortShow
|
||||
|
||||
debugEvents :: Universe -> Universe
|
||||
debugEvents u = case dbools ^. at Display_debug of
|
||||
Nothing -> u
|
||||
Nothing -> u & uvDebug .~ mempty
|
||||
Just () -> S.foldr debugEvent (u & uvDebug .~ mempty) dbools
|
||||
& overDebugEvent
|
||||
where
|
||||
dbools = u ^. uvConfig . debug_booleans
|
||||
|
||||
overDebugEvent :: Universe -> Universe
|
||||
overDebugEvent u = fromMaybe u $ do
|
||||
OverDebug db i <- u ^? uvWorld . input . mouseContext
|
||||
DebugItem s f <- u ^? uvDebug . ix db . ix i
|
||||
return $ f s u
|
||||
|
||||
debugEvent :: DebugBool -> Universe -> Universe
|
||||
debugEvent db u = u & uvDebug . at db .~ debugItem db u
|
||||
|
||||
@@ -50,12 +57,17 @@ debugItem = \case
|
||||
Inspect_wall -> mempty
|
||||
Cr_awareness -> mempty
|
||||
Show_sound -> mempty
|
||||
Cr_status -> Just . drawCrInfo
|
||||
Cr_status -> drawCrInfo'
|
||||
Mouse_position -> mempty
|
||||
Walls_info -> mempty
|
||||
Pathing -> mempty
|
||||
Show_path_between -> mempty
|
||||
|
||||
drawCrInfo' :: Universe -> Maybe [DebugItem]
|
||||
drawCrInfo' u = case drawCrInfo u of
|
||||
[] -> Nothing
|
||||
xs -> Just xs
|
||||
|
||||
drawCrInfo :: Universe -> [DebugItem]
|
||||
drawCrInfo u = foldMap f . IM.elems $ w ^. cWorld . lWorld . creatures
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user