Skip to content

Commit

Permalink
Restyled by fourmolu
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits committed Jul 20, 2024
1 parent ce66ee4 commit 48b3a73
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/swarm-tui/Swarm/TUI/View.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -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 = fps / tpf
-- 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 = fps / tpf

-- l = s ^. uiState . uiGameplay . uiTiming . lgTicksPerSecond
-- target = 2 ^^ l

-- | The height of the REPL box. Perhaps in the future this should be
-- configurable.
Expand Down

0 comments on commit 48b3a73

Please sign in to comment.