Cleanup, stop rboptions extending into examine inventory

This commit is contained in:
2022-12-31 12:25:29 +00:00
parent 828c4d9c5b
commit 67a13c1d01
2 changed files with 9 additions and 7 deletions
+3 -2
View File
@@ -69,7 +69,7 @@ defaultSubInvSelectionList =
invDisplayParams :: World -> ListDisplayParams
invDisplayParams w =
defaultListDisplayParams
& ldpWidth .~ FixedSelectionWidth topInvW
-- & ldpWidth .~ FixedSelectionWidth topInvW
& ldpCursorType .~ BorderCursor selcursortype
& ldpWidth .~ FixedSelectionWidth (determineInvSelCursorWidth w)
where
@@ -294,7 +294,8 @@ determineInvSelCursorWidth :: World -> Int
determineInvSelCursorWidth w = case _rbOptions w of
NoRightButtonOptions -> topInvW
EquipOptions{}
| ButtonRight `M.member` _mouseButtons (_input w) -> 47
| ButtonRight `M.member` _mouseButtons (_input w)
&& w ^? hud . hudElement . subInventory == Just NoSubInventory -> 47
| otherwise -> topInvW
combineListSelection :: World -> Maybe Int -> SelectionList ()
+6 -5
View File
@@ -198,11 +198,11 @@ functionalUpdate' u = case u ^. uvWorld . cWorld . timeFlow of
ScrollTimeFlow smoothing _ _ _ -> over uvWorld (doTimeScroll smoothing) u
RewindLeftClick 0 _ -> u & uvWorld . cWorld . timeFlow .~ NormalTimeFlow
RewindLeftClick _ _ -> over uvWorld scrollTimeBack u -- & uvWorld . cWorld . timeFlow .~ NormalTimeFlow
DeathTime {} -> u
DeathTime{} -> u
PausedTimeFlow _ itmloc -> over uvWorld (pauseTime itmloc) u
pauseTime :: Int -> World -> World
pauseTime itmloc w
pauseTime itmloc w
| justPressedButtonLeft || outofcharge = w & cWorld . timeFlow .~ NormalTimeFlow
| otherwise = w & pointerToItemLocation (w ^?! cWorld . lWorld . itemLocations . ix itmloc) . itUse . leftConsumption . wpCharge -~ 1
where
@@ -225,7 +225,6 @@ doTimeScroll' smoothing w = case w ^. input . scrollAmount of
_ | smoothing < 0 -> scrollTimeForward w & cWorld . timeFlow . scrollSmoothing +~ 1
_ -> w
scrollTimeBack :: World -> World
scrollTimeBack w = case w ^? cWorld . pastWorlds . _head of
Nothing -> w
@@ -236,10 +235,11 @@ scrollTimeBack w = case w ^? cWorld . pastWorlds . _head of
& cWorld . timeFlow . futureWorlds .:~ (w ^. cWorld . lWorld)
& cWorld . timeFlow . reverseAmount -~ 1
& cWorld . lWorld .~ lw
& pointerToItemLocation (w ^?! cWorld . lWorld . itemLocations . ix i) . itUse . leftConsumption . wpCharge .~ (x -1)
& pointerToItemLocation (w ^?! cWorld . lWorld . itemLocations . ix i) . itUse . leftHammer .~ HammerDown
& pointituse . leftConsumption . wpCharge .~ (x -1)
& pointituse . leftHammer .~ HammerDown
_ -> w
where
pointituse = pointerToItemLocation (w ^?! cWorld . lWorld . itemLocations . ix i) . itUse
i = w ^?! cWorld . timeFlow . scrollItemLocation
scrollTimeForward :: World -> World
@@ -350,6 +350,7 @@ advanceScrollAmount u =
updatePastWorlds :: CWorld -> CWorld
updatePastWorlds w = w & pastWorlds %~ (forceFoldable . take 100 . ((w ^. lWorld) :))
--updatePastWorlds w = w & pastWorlds .~ []
moveHammersUp :: Universe -> Universe