Fix combine item menu

This commit is contained in:
2022-02-16 22:55:00 +00:00
parent 60463ea9c0
commit 6573b3346e
4 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -98,7 +98,7 @@ handlePressedMouseButton but w
_ -> Just w _ -> Just w
| otherwise = Just w | otherwise = Just w
-- note "reverse" on the inventory indices; otherwise -- note "sort" on the inventory indices; otherwise
-- lower items may be shifted up and items below these removed instead -- lower items may be shifted up and items below these removed instead
doCombine :: Int -> World -> World doCombine :: Int -> World -> World
doCombine i w = case combineItemListYou w !? i of doCombine i w = case combineItemListYou w !? i of
@@ -106,7 +106,7 @@ doCombine i w = case combineItemListYou w !? i of
Just (is,it) -> enterCombineInv Just (is,it) -> enterCombineInv
. uncurry (putItemInInvID yid) . uncurry (putItemInInvID yid)
. copyItemToFloorID (_crPos $ you w) it . copyItemToFloorID (_crPos $ you w) it
$ foldr (rmInvItem yid) w (reverse is) & enterCombineInv $ foldr (rmInvItem yid) w (sort is)
where where
yid = _yourID w yid = _yourID w
+1 -1
View File
@@ -313,7 +313,7 @@ miniGunXPict i spin _ =
, mempty , mempty
) )
where where
aBarrel = translateSH (V3 15 0 2) baseCaneShape aBarrel = translateSH (V3 15 2 2) baseCaneShape
barrels = concatMap (\an -> aBarrel & rotateSHx (2*pi * fromIntegral an / fromIntegral i)) [1..i] barrels = concatMap (\an -> aBarrel & rotateSHx (2*pi * fromIntegral an / fromIntegral i)) [1..i]
a = fromIntegral spin / 100 a = fromIntegral spin / 100
--x = fromIntegral am / 10 --x = fromIntegral am / 10
+2 -1
View File
@@ -100,8 +100,9 @@ subInventoryDisplay cfig w = case _inventoryMode w of
return $ listCursorNSW subInvX 60 cfig cpos col 15 csize return $ listCursorNSW subInvX 60 cfig cpos col 15 csize
, fromMaybe mempty $ do , fromMaybe mempty $ do
i <- mi i <- mi
cpos <- combinePoss w !? i
lnks <- combineListLnks w !? i lnks <- combineListLnks w !? i
return $ uncurry (lnkMidPosInvSels cfig w) lnks return $ (lnkMidPosInvSels cfig w) cpos (snd lnks)
<> foldMap (cursorAtInvSel listCursorNESW cfig w) (snd lnks) <> foldMap (cursorAtInvSel listCursorNESW cfig w) (snd lnks)
] ]
InspectInventory -> invHead cfig "INSPECT" InspectInventory -> invHead cfig "INSPECT"
+1 -2
View File
@@ -1,8 +1,7 @@
{- The menu picture. -} {- The menu picture. -}
module Dodge.Render.MenuScreen module Dodge.Render.MenuScreen
( menuScreen ( menuScreen
) ) where
where
import Dodge.Data import Dodge.Data
import Dodge.Base.Window import Dodge.Base.Window
import Picture import Picture