Move equipType out of record
This commit is contained in:
@@ -4,6 +4,7 @@ module Dodge.Inventory.RBList (
|
||||
eqSiteToPositions,
|
||||
) where
|
||||
|
||||
import Dodge.Data.EquipType
|
||||
import Control.Applicative
|
||||
import Control.Lens
|
||||
import Data.List (elemIndex, findIndex)
|
||||
@@ -19,7 +20,7 @@ updateRBList w = case w ^. rbOptions of
|
||||
EquipOptions{} -> w
|
||||
_ -> fromMaybe (w & rbOptions .~ NoRightButtonOptions) $ do
|
||||
i <- cr ^? crManipulation . manObject . imSelectedItem
|
||||
esite <- cr ^? crInv . ix i . itUse . uequipEffect . eeType
|
||||
esite <- cr ^? crInv . ix i >>= equipType -- . itUse . uequipEffect . eeType
|
||||
return $
|
||||
w & rbOptions
|
||||
.~ EquipOptions
|
||||
@@ -44,7 +45,7 @@ chooseFreeSite cr = fromMaybe 0 . findIndex hasnoequipment
|
||||
|
||||
getEquipmentAllocation :: Int -> World -> EquipmentAllocation
|
||||
getEquipmentAllocation invid w = fromMaybe DoNotMoveEquipment $ do
|
||||
esite <- you w ^? crInv . ix invid . itUse . uequipEffect . eeType
|
||||
esite <- you w ^? crInv . ix invid >>= equipType-- . itUse . uequipEffect . eeType
|
||||
i <-
|
||||
w ^? rbOptions . opSel
|
||||
<|> Just (chooseEquipPosition (you w) (eqSiteToPositions esite))
|
||||
|
||||
Reference in New Issue
Block a user