Cleanup
This commit is contained in:
Binary file not shown.
@@ -1,5 +1,4 @@
|
||||
--{-# LANGUAGE TupleSections #-}
|
||||
|
||||
module Dodge.Inventory (
|
||||
selSecSelPos,
|
||||
checkInvSlotsYou,
|
||||
@@ -89,9 +88,6 @@ rmInvItem cid invid w = case w ^? getcid . crInv . ix invid . itUse . useAmount
|
||||
doanyitemeffect = fromMaybe id $ do
|
||||
rmf <- itm ^? itEffect . ieOnDrop
|
||||
return $ doInvEffect rmf itm cr
|
||||
--removeAnySlotEquipment = case w ^? cWorld . lWorld . creatures . ix cid . crInvEquipped . ix invid of
|
||||
-- Just epos -> pointcid . crEquipment . at epos .~ Nothing
|
||||
-- Nothing -> id
|
||||
removeAnySlotEquipment = fromMaybe id $ do
|
||||
epos <- w ^? cWorld . lWorld . creatures . ix cid . crInvEquipped . ix invid
|
||||
return $ pointcid . crEquipment . at epos .~ Nothing
|
||||
@@ -114,16 +110,6 @@ rmSelectedInvItem cid w = case w ^? cWorld . lWorld . creatures . ix cid . crMan
|
||||
Just i -> rmInvItem cid i w
|
||||
Nothing -> w
|
||||
|
||||
--selNumPos :: ManipulatedObject -> World -> Maybe Int
|
||||
--selNumPos mo w =
|
||||
-- w ^? hud . hudElement . diSections
|
||||
-- >>= case mo of
|
||||
-- InInventory SortInventory -> selSecSelPos (-1) 0
|
||||
-- InInventory (SelItem i _) -> selSecSelPos 0 i
|
||||
-- SelNothing -> selSecSelPos 1 0
|
||||
-- InNearby SortNearby -> selSecSelPos 2 0
|
||||
-- InNearby (SelCloseObject i) -> selSecSelPos 3 i
|
||||
|
||||
-- there are still more ListDisplayParams to integrate here
|
||||
selNumTextEndPos :: Configuration -> ListDisplayParams -> SelectionSections a -> Int -> Int -> Maybe Point2
|
||||
selNumTextEndPos cfig ldp sss i j = do
|
||||
|
||||
+2
-2
@@ -293,8 +293,8 @@ advanceScrollAmount u =
|
||||
& uvWorld . input . smoothScrollAmount %~ advanceSmoothScroll
|
||||
|
||||
updatePastWorlds :: World -> World
|
||||
--updatePastWorlds w = w & pastWorlds %~ (forceFoldable . take 100 . ((w ^. cWorld . lWorld) :))
|
||||
updatePastWorlds w = w & pastWorlds %~ (forceFoldable . take 600 . ((w ^. cWorld . lWorld) :))
|
||||
updatePastWorlds w = w & pastWorlds %~ (forceFoldable . take 100 . ((w ^. cWorld . lWorld) :))
|
||||
--updatePastWorlds w = w & pastWorlds %~ (forceFoldable . take 600 . ((w ^. cWorld . lWorld) :))
|
||||
|
||||
doWorldEvents :: World -> World
|
||||
doWorldEvents w =
|
||||
|
||||
@@ -2,7 +2,6 @@ module Dodge.Update.Scroll (
|
||||
updateWheelEvent,
|
||||
) where
|
||||
|
||||
import Dodge.SelectionSections
|
||||
import qualified Data.Map.Strict as M
|
||||
import Data.Maybe
|
||||
import Dodge.Base
|
||||
@@ -10,6 +9,7 @@ import Dodge.Data.Universe
|
||||
import Dodge.HeldScroll
|
||||
import Dodge.InputFocus
|
||||
import Dodge.Inventory
|
||||
import Dodge.SelectionSections
|
||||
import Dodge.SoundLogic
|
||||
import Dodge.Terminal
|
||||
import Dodge.Tweak
|
||||
@@ -49,8 +49,10 @@ updateWheelEvent yi w = case w ^. hud . hudElement of
|
||||
invKeyDown = ScancodeCapsLock `M.member` _pressedKeys (_input w)
|
||||
|
||||
moveCombineSel :: Int -> World -> World
|
||||
moveCombineSel yi = (hud . hudElement . subInventory . ciSections
|
||||
%~ scrollSelectionSections yi)
|
||||
moveCombineSel yi =
|
||||
( hud . hudElement . subInventory . ciSections
|
||||
%~ scrollSelectionSections yi
|
||||
)
|
||||
. (worldEventFlags . at CombineInventoryChange ?~ ())
|
||||
|
||||
moveSubSel :: Int -> Int -> World -> World
|
||||
@@ -65,12 +67,12 @@ guardDisconnectedID tmid w w' = case w ^? cWorld . lWorld . terminals . ix tmid
|
||||
|
||||
terminalWheelEvent :: Int -> Int -> World -> World
|
||||
terminalWheelEvent yi tmid w
|
||||
-- | isJust $ w ^? cWorld . lWorld . terminals . ix tmid . tmPartialCommand . _Just = w
|
||||
| rbDown && inTermFocus w =
|
||||
guardDisconnectedID tmid w $
|
||||
w
|
||||
& cWorld . lWorld . terminals . ix tmid %~ updatetermsubsel
|
||||
| inTermFocus w = guardDisconnectedID tmid w $
|
||||
| inTermFocus w =
|
||||
guardDisconnectedID tmid w $
|
||||
w
|
||||
& cWorld . lWorld . terminals . ix tmid %~ updatetermsel
|
||||
| otherwise = w
|
||||
@@ -119,9 +121,7 @@ changeTweakParam mi i w = fromMaybe w $ do
|
||||
)
|
||||
|
||||
scrollCommands :: Terminal -> [TerminalCommand]
|
||||
scrollCommands tm = (nullCommand :) $ _tmScrollCommands tm
|
||||
-- | null $ _tmPartialCommand tm = (nullCommand :) $ _tmScrollCommands tm
|
||||
-- | otherwise = [nullCommand]
|
||||
scrollCommands = (nullCommand :) . _tmScrollCommands
|
||||
|
||||
scrollCommandStrings :: World -> Terminal -> [String]
|
||||
scrollCommandStrings w tm = case tm ^? tmPartialCommand . _Just of
|
||||
|
||||
Reference in New Issue
Block a user