Rethink selection lists as intmaps
This commit is contained in:
@@ -3,6 +3,7 @@ module Dodge.Update.UsingInput (
|
||||
updateUsingInput,
|
||||
) where
|
||||
|
||||
import Dodge.Data.SelectionList
|
||||
import Control.Lens
|
||||
import qualified Data.Map.Strict as M
|
||||
import Dodge.Base.You
|
||||
@@ -30,11 +31,12 @@ pressedMBEffects subinv pkeys w = case subinv of
|
||||
| ButtonLeft `M.member` pkeys && w ^?! input . hammers . ix SubInvHam /= HammerUp ->
|
||||
w & input . hammers . ix SubInvHam .~ HammerDown
|
||||
| otherwise -> pressedMBEffectsNoInventory pkeys w
|
||||
CombineInventory mi _ False
|
||||
CombineInventory SelectionIntMap {_smSelPos = mi, _smRegexInput = False}
|
||||
| pkeys ^? ix ButtonLeft == Just False ->
|
||||
maybeexitcombine (maybe id doCombine mi w) & input . hammers . ix SubInvHam .~ HammerDown
|
||||
CombineInventory _ _ True | pkeys ^? ix ButtonLeft == Just False
|
||||
-> w & hud . hudElement . subInventory . subInvRegexInput .~ False
|
||||
CombineInventory SelectionIntMap {_smRegexInput = True}
|
||||
| pkeys ^? ix ButtonLeft == Just False
|
||||
-> w & hud . hudElement . subInventory . subInvMap . smRegexInput .~ False
|
||||
DisplayTerminal tmid
|
||||
| pkeys ^? ix ButtonLeft == Just False && inTermFocus w ->
|
||||
doTerminalEffectLB (w ^?! cWorld . lWorld . terminals . ix tmid) w
|
||||
|
||||
Reference in New Issue
Block a user