Make hud non-saveable
This commit is contained in:
@@ -18,7 +18,7 @@ import ListHelp
|
||||
import SDL
|
||||
|
||||
updateUsingInput :: World -> World
|
||||
updateUsingInput w = case w ^. cWorld . lWorld . hud . hudElement of
|
||||
updateUsingInput w = case w ^. hud . hudElement of
|
||||
DisplayInventory subinv ->
|
||||
pressedMBEffects subinv (_mouseButtons (_input w)) w
|
||||
DisplayCarte ->
|
||||
@@ -47,7 +47,7 @@ pressedMBEffects subinv pkeys w = case subinv of
|
||||
where
|
||||
maybeexitcombine
|
||||
| ButtonRight `M.member` _mouseButtons (_input w) = id
|
||||
| otherwise = cWorld . lWorld . hud . hudElement . subInventory .~ NoSubInventory
|
||||
| otherwise = hud . hudElement . subInventory .~ NoSubInventory
|
||||
|
||||
pressedMBEffectsNoInventory :: M.Map MouseButton Bool -> World -> World
|
||||
pressedMBEffectsNoInventory pkeys w
|
||||
@@ -65,7 +65,7 @@ pressedMBEffectsNoInventory pkeys w
|
||||
| isDown ButtonLeft = w & input . hammers . ix DoubleMouseHam .~ HammerDown
|
||||
| otherwise = w
|
||||
where
|
||||
inTopInv = case w ^. cWorld . lWorld . hud . hudElement of
|
||||
inTopInv = case w ^. hud . hudElement of
|
||||
DisplayInventory NoSubInventory -> True
|
||||
_ -> False
|
||||
justPressedDown but = (pkeys ^. at but) == Just False
|
||||
@@ -91,15 +91,15 @@ updatePressedButtonsCarte pkeys w
|
||||
| isDown ButtonRight =
|
||||
w
|
||||
& input . clickMousePos .~ _mousePos (_input w)
|
||||
& cWorld . lWorld . hud . carteCenter %~ (-.- trans)
|
||||
& hud . carteCenter %~ (-.- trans)
|
||||
| isDown ButtonLeft =
|
||||
w
|
||||
& input . clickMousePos .~ _mousePos (_input w)
|
||||
& cWorld . lWorld . hud . carteRot -~ rot
|
||||
& cWorld . lWorld . hud . carteZoom *~ czoom
|
||||
& hud . carteRot -~ rot
|
||||
& hud . carteZoom *~ czoom
|
||||
| otherwise = w
|
||||
where
|
||||
isDown but = but `M.member` pkeys
|
||||
rot = angleBetween (_mousePos (_input w)) (_clickMousePos (_input w))
|
||||
czoom = magV (_mousePos (_input w)) / magV (_clickMousePos (_input w))
|
||||
trans = rotateV (w ^. cWorld . lWorld . hud . carteRot) $ 1 / (w ^. cWorld . lWorld . hud . carteZoom) *.* (_mousePos (_input w) -.- _clickMousePos (_input w))
|
||||
trans = rotateV (w ^. hud . carteRot) $ 1 / (w ^. hud . carteZoom) *.* (_mousePos (_input w) -.- _clickMousePos (_input w))
|
||||
|
||||
Reference in New Issue
Block a user