Cleanup, split CWorld into separate file
This commit is contained in:
+3
-3
@@ -97,7 +97,7 @@ wheelEvent y w = case _hudElement $ _hud (_cWorld w) of
|
||||
-- functions that modify the inventory should be centralised so that
|
||||
-- this lock can be sensibly applied, perhaps
|
||||
| _crInvLock (_creatures (_cWorld w) IM.! _yourID (_cWorld w)) -> w
|
||||
| rbDown -> case (yourItem w ^? _Just . itUse . heldScroll,_rbOptions (_cWorld w)) of
|
||||
| rbDown -> case (yourItem w ^? _Just . itUse . heldScroll,_rbOptions w) of
|
||||
(_,EquipOptions{}) -> scrollRBOption y w
|
||||
(Nothing,_) -> closeObjScrollDir y w
|
||||
(Just f,_) -> w & cWorld . creatures . ix 0 . crInv . ix (crSel $ you w) %~ doHeldScroll f y (you w)
|
||||
@@ -159,8 +159,8 @@ nullCommand = TerminalCommand
|
||||
|
||||
scrollRBOption :: Float -> World -> World
|
||||
scrollRBOption y w
|
||||
| y < 0 = w & cWorld . rbOptions . opSel %~ (min (length (_opEquip (_rbOptions (_cWorld w)))-1) . (+1))
|
||||
| y > 0 = w & cWorld . rbOptions . opSel %~ (max 0 . subtract 1)
|
||||
| y < 0 = w & rbOptions . opSel %~ (min (length (_opEquip (_rbOptions w))-1) . (+1))
|
||||
| y > 0 = w & rbOptions . opSel %~ (max 0 . subtract 1)
|
||||
| otherwise = w
|
||||
|
||||
moveTweakSel :: Int -> World -> World
|
||||
|
||||
Reference in New Issue
Block a user