Distinguish between selected item and root-selected item

This commit is contained in:
2024-09-21 21:59:53 +01:00
parent 2154abfb1d
commit 31b5db6e9e
33 changed files with 313 additions and 281 deletions
+3 -1
View File
@@ -4,6 +4,8 @@ module Dodge.Inventory.Add (
createAndSelectItem,
) where
import Dodge.Inventory.FindRoot
--import Dodge.Item.Grammar
import Control.Lens
import Data.Maybe
import Dodge.Base.You
@@ -47,7 +49,7 @@ createAndSelectItem itm w = case createPutItem itm w of
w'
& hud . hudElement . diSections . sssExtra . sssSelPos ?~ (0, i)
& cWorld . lWorld . creatures . ix 0 . crManipulation . manObject
.~ InInventory (SelItem i NoInvSelAction)
.~ InInventory (SelectedItem i (getRootItemID i (you w)))
(Nothing, w') -> w'
createPutItem :: Item -> World -> (Maybe Int, World)