Refactor inventory management, add tweak, combine and inspect modes
This commit is contained in:
+6
-10
@@ -10,16 +10,6 @@ import qualified Data.IntMap.Strict as IM
|
||||
--import System.Random
|
||||
import Control.Lens
|
||||
|
||||
checkInvSlotsYou' :: Maybe Item -> World -> Maybe Int
|
||||
checkInvSlotsYou' it w = fst <$> find cond invListSelFirst
|
||||
where
|
||||
cond (_,NoItem) = True
|
||||
cond (_,it' ) = itNotFull it' && fmap _itName it == Just (_itName it')
|
||||
youCr = you w
|
||||
youSel = _crInvSel youCr
|
||||
invList = _crInv youCr
|
||||
invListSelFirst = (youSel , invList IM.! youSel) : IM.toList invList
|
||||
|
||||
checkInvSlotsYou :: Item -> World -> Maybe Int
|
||||
checkInvSlotsYou it w = fst <$> find cond invListSelFirst
|
||||
where
|
||||
@@ -93,6 +83,12 @@ updateCloseObjects w = w & closeActiveObjects .~ unionBy eTest oldCloseFiltered
|
||||
oldClose = filt $ _closeActiveObjects w
|
||||
oldCloseFiltered = intersectBy eTest oldClose currentClose
|
||||
|
||||
closeObjScrollDir :: Float -> World -> World
|
||||
closeObjScrollDir x
|
||||
| x > 0 = closeObjScrollUp
|
||||
| x < 0 = closeObjScrollDown
|
||||
| otherwise = id
|
||||
|
||||
closeObjScrollUp :: World -> World
|
||||
closeObjScrollUp = over closeActiveObjects rotU
|
||||
where rotU [] = []
|
||||
|
||||
Reference in New Issue
Block a user