Add 8-way cardinal/intercardinal datatype

This commit is contained in:
2024-10-18 12:39:46 +01:00
parent d256bc0443
commit 8b6f5529ff
12 changed files with 267 additions and 157 deletions
+5 -5
View File
@@ -226,9 +226,9 @@ spaceAction w = case w ^. hud . hudElement of
& worldEventFlags . at InventoryChange ?~ ()
_ -> w
DisplayInventory{_subInventory = DisplayTerminal{}} ->
w & hud . hudElement . subInventory .~ NoSubInventory Nothing Nothing
w & hud . hudElement . subInventory .~ NoSubInventory NoMouseSel Nothing
& worldEventFlags . at InventoryChange ?~ ()
_ -> w & hud . hudElement . subInventory .~ NoSubInventory Nothing Nothing
_ -> w & hud . hudElement . subInventory .~ NoSubInventory NoMouseSel Nothing
where
theLoc =
doWorldPos
@@ -240,14 +240,14 @@ toggleMap u = case u ^. uvWorld . hud . hudElement of
DisplayCarte ->
u & uvWorld . hud . hudElement
.~ DisplayInventory
{ _subInventory = NoSubInventory Nothing Nothing
{ _subInventory = NoSubInventory NoMouseSel Nothing
, _diSections = defaultInvSections
}
_ -> u & uvWorld . hud . hudElement .~ DisplayCarte
toggleTweakInv :: World -> World
toggleTweakInv w = case w ^? hud . hudElement . subInventory of
Just ExamineInventory{} -> w & thepointer .~ NoSubInventory Nothing Nothing
Just ExamineInventory{} -> w & thepointer .~ NoSubInventory NoMouseSel Nothing
_ -> w & thepointer .~ ExamineInventory -- mi
where
thepointer = hud . hudElement . subInventory
@@ -265,4 +265,4 @@ tryCombine sss w = fromMaybe w $ do
maybeExitCombine :: Universe -> Universe
maybeExitCombine u
| ButtonRight `M.member` (u ^. uvWorld . input . mouseButtons) = u
| otherwise = u & uvWorld . hud . hudElement . subInventory .~ NoSubInventory Nothing Nothing
| otherwise = u & uvWorld . hud . hudElement . subInventory .~ NoSubInventory NoMouseSel Nothing