From cc35e6a080e0cc964b891afdcb5756b905672cae Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Sat, 27 Jul 2024 00:12:42 +0000 Subject: [PATCH] Restyled by fourmolu --- src/swarm-tui/Swarm/TUI/View.hs | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/swarm-tui/Swarm/TUI/View.hs b/src/swarm-tui/Swarm/TUI/View.hs index d258be21e..aabf2e6ec 100644 --- a/src/swarm-tui/Swarm/TUI/View.hs +++ b/src/swarm-tui/Swarm/TUI/View.hs @@ -592,14 +592,14 @@ drawTPS s = hBox (tpsInfo : rateInfo) where tpsInfo | l >= 0 = hBox [str (show n), txt " ", tpsIndicator s, txt (number n "tick"), txt " / s"] - -- | l >= 0 = hBox [str (show n), txt " ", txt (number n "tick"), txt " / s"] + -- \| l >= 0 = hBox [str (show n), txt " ", txt (number n "tick"), txt " / s"] | otherwise = hBox [txt "1 tick / ", str (show n), txt " s"] rateInfo | s ^. uiState . uiGameplay . uiTiming . uiShowFPS = [ txt " (" , (if tpf >= fromIntegral ticksPerFrameCap then withAttr redAttr else id) - (str (printf "%0.1f" tpf)) + (str (printf "%0.1f" tpf)) , txt " tpf, " , str (printf "%0.1f" (s ^. uiState . uiGameplay . uiTiming . uiFPS)) , txt " fps)" @@ -611,18 +611,20 @@ drawTPS s = hBox (tpsInfo : rateInfo) n = 2 ^ abs l tpsIndicator :: AppState -> Widget Name -tpsIndicator s - = hBox [txt "(", str $ show tps, txt ") "] +tpsIndicator s = + hBox [txt "(", str $ show tps, txt ") "] + where -- = str (show $ round tps ) - -- | (tps / target) < 0.9 = str (show $ round tps ) - -- | otherwise = emptyWidget - where - tpf = s ^. uiState . uiGameplay . uiTiming . uiTPF - fps = s ^. uiState . uiGameplay . uiTiming . uiFPS - tps = tpf * fps - -- l = s ^. uiState . uiGameplay . uiTiming . lgTicksPerSecond - -- target = 2 ^^ l + -- \| (tps / target) < 0.9 = str (show $ round tps ) + -- \| otherwise = emptyWidget + + tpf = s ^. uiState . uiGameplay . uiTiming . uiTPF + fps = s ^. uiState . uiGameplay . uiTiming . uiFPS + tps = tpf * fps + +-- l = s ^. uiState . uiGameplay . uiTiming . lgTicksPerSecond +-- target = 2 ^^ l -- | The height of the REPL box. Perhaps in the future this should be -- configurable.