Add Read instances

This commit is contained in:
2022-07-22 01:06:35 +01:00
parent d4e5b02874
commit 4c5218c633
44 changed files with 209 additions and 126 deletions
+4 -5
View File
@@ -3,6 +3,7 @@ module Dodge.Render.HUD
( hudDrawings
) where
import Dodge.Data
import Dodge.Tweak.Show
import Dodge.Item.Display
import Dodge.Combine
import Dodge.Clock
@@ -79,11 +80,9 @@ subInventoryDisplay subinv cfig w = case subinv of
, fromMaybe mempty $ do
tweaki <- it ^? _Just . itTweaks . tweakSel
-- consider moving this functionality out into a tweaks module
showtweak <- it ^? _Just . itTweaks . tweakParams . ix tweaki . showTweak
tweakname <- it ^? _Just . itTweaks . tweakParams . ix tweaki . nameTweak
tweakstring <- showtweak <$> (it ^? _Just . itTweaks . tweakParams . ix tweaki . curTweak)
tparam <- it ^? _Just . itTweaks . tweakParams . ix tweaki
return $ lnkMidInvSel cfig w curpos tweaki
<> listCursorNSW subInvX 60 cfig tweaki white (length $ tweakstring ++ tweakname) 1
<> listCursorNSW subInvX 60 cfig tweaki white (length $ showTweak tparam) 1
, invHead cfig "TWEAK"
, listPicturesAt subInvX 60 cfig $ map text (ammoTweakStrings it)
]
@@ -269,7 +268,7 @@ ammoTweakStrings it = case it ^? _Just . itTweaks . tweakParams of
_ -> ["NOT TWEAKABLE"]
tweakString :: TweakParam -> String
tweakString tp = rightPad 12 ' ' (_nameTweak tp) ++ " " ++ _showTweak tp (_curTweak tp)
tweakString tp = rightPad 12 ' ' (show $ _tweakType tp) ++ " " ++ showTweak tp
invHead :: Configuration -> String -> Picture
invHead cfig s = winScale cfig