Fold some ammo data into its own type

This commit is contained in:
2021-11-27 13:40:56 +00:00
parent bfdac2fad5
commit 92a8dd59b8
21 changed files with 175 additions and 115 deletions
+3 -3
View File
@@ -57,7 +57,7 @@ subInventoryDisplay w = case _inventoryMode w of
col = itCol it
cursorsZ :: World -> Int -> Item -> Picture
cursorsZ w ipos it = case it ^? wpAmmo . amParamSel of
cursorsZ w ipos it = case it ^? wpAmmo . aoType . amParamSel of
Nothing -> f $ zConnect sp (V2 (155- hw) ( hh - 77.5))
Just jpos -> f $ zConnect sp (V2 (155 - hw) ( hh - (20 * fromIntegral jpos + 77.5)))
where
@@ -74,12 +74,12 @@ topInvCursor col iPos w
| otherwise = mainListCursor col iPos w
ammoTweakStrings :: Item -> [String]
ammoTweakStrings it = case it ^? wpAmmo . amPjParams of
ammoTweakStrings it = case it ^? wpAmmo . aoType . amPjParams of
Just l -> map pjTweakString l
_ -> ["NOT TWEAKABLE"]
mCurs :: Item -> World -> Picture
mCurs it w = case it ^? wpAmmo . amParamSel of
mCurs it w = case it ^? wpAmmo . aoType . amParamSel of
Nothing -> []
Just i
| ButtonRight `S.member` _mouseButtons w ->