Rethink item ammo to item consumables, start item type datatype

This commit is contained in:
2021-11-29 16:22:31 +00:00
parent 3a605b8156
commit f40d486d68
31 changed files with 238 additions and 193 deletions
+3 -3
View File
@@ -58,7 +58,7 @@ subInventoryDisplay cfig w = case _inventoryMode w of
col = itCol it
cursorsZ :: Configuration -> Int -> Item -> Picture
cursorsZ cfig ipos it = case it ^? wpAmmo . aoType . amParamSel of
cursorsZ cfig ipos it = case it ^? itConsumption . 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
@@ -75,12 +75,12 @@ topInvCursor col iPos cfig w
| otherwise = mainListCursor col iPos cfig
ammoTweakStrings :: Item -> [String]
ammoTweakStrings it = case it ^? wpAmmo . aoType . amPjParams of
ammoTweakStrings it = case it ^? itConsumption . aoType . amPjParams of
Just l -> map pjTweakString l
_ -> ["NOT TWEAKABLE"]
mCurs :: Item -> Configuration -> World -> Picture
mCurs it cfig w = case it ^? wpAmmo . aoType . amParamSel of
mCurs it cfig w = case it ^? itConsumption . aoType . amParamSel of
Nothing -> []
Just i
| ButtonRight `S.member` _mouseButtons w ->