Make examine inventory controlled by item, perhaps still buggy

This commit is contained in:
2025-01-01 21:14:38 +00:00
parent 86aba6d115
commit 5b978d9f1c
25 changed files with 523 additions and 502 deletions
+5 -2
View File
@@ -23,8 +23,8 @@ import qualified SDL
yourControl :: Creature -> World -> World
yourControl _ w
| inTextInputFocus w = w
| Just NoSubInventory{} <- w ^? hud . hudElement . subInventory =
w
| Just x <- w ^? hud . hudElement . subInventory
, f x = w
& cWorld . lWorld . creatures . ix 0
%~ (wasdWithAiming w . setCrPosture pkeys)
& tryClickUse pkeys
@@ -32,6 +32,9 @@ yourControl _ w
| otherwise =
w & cWorld . lWorld . creatures . ix 0 %~ wasdWithAiming w
where
f NoSubInventory = True
f ExamineInventory = True
f _ = False
pkeys = w ^. input . mouseButtons
handleHotkeys :: World -> World