Remove equality derivation for hud elements

This commit is contained in:
2023-01-15 12:38:06 +00:00
parent a50e2ff406
commit 17734738f6
4 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -16,7 +16,7 @@ data HUDElement
{ _subInventory :: SubInventory { _subInventory :: SubInventory
} }
| DisplayCarte | DisplayCarte
deriving (Eq, Ord, Show, Read) --Generic, Flat) -- deriving (Eq, Ord, Show, Read) --Generic, Flat)
data SubInventory data SubInventory
= NoSubInventory = NoSubInventory
@@ -25,7 +25,7 @@ data SubInventory
, _subInvRegexInput :: Bool} , _subInvRegexInput :: Bool}
| LockedInventory | LockedInventory
| DisplayTerminal {_termID :: Int} | DisplayTerminal {_termID :: Int}
deriving (Eq, Ord, Show, Read) --Generic, Flat) -- deriving (Eq, Ord, Show, Read) --Generic, Flat)
data HUD = HUD data HUD = HUD
{ _hudElement :: HUDElement { _hudElement :: HUDElement
-1
View File
@@ -8,7 +8,6 @@ import qualified Data.Map.Strict as M
import Dodge.Data.CWorld import Dodge.Data.CWorld
import Geometry.Data import Geometry.Data
import SDL (MouseButton, Scancode) import SDL (MouseButton, Scancode)
import qualified Data.Text as T
data PressType = InitialPress data PressType = InitialPress
| ShortPress | ShortPress
-1
View File
@@ -18,7 +18,6 @@ import Control.Lens
--import qualified Data.Map.Strict as M --import qualified Data.Map.Strict as M
import Data.Preload import Data.Preload
import Data.Sequence (Seq (..)) import Data.Sequence (Seq (..))
import qualified Data.Text as T
import Dodge.Data.Config import Dodge.Data.Config
import Dodge.Data.World import Dodge.Data.World
import Loop.Data import Loop.Data
+5 -1
View File
@@ -328,9 +328,13 @@ determineInvSelCursorWidth w = case _rbOptions w of
NoRightButtonOptions -> topInvW NoRightButtonOptions -> topInvW
EquipOptions{} EquipOptions{}
| ButtonRight `M.member` _mouseButtons (_input w) | ButtonRight `M.member` _mouseButtons (_input w)
&& w ^? hud . hudElement . subInventory == Just NoSubInventory -> && hasnosubinv ->
47 47
| otherwise -> topInvW | otherwise -> topInvW
where
hasnosubinv = case w ^? hud . hudElement . subInventory of
Just NoSubInventory -> True
_ -> False
combineListSelection :: World -> Maybe Int -> String -> Bool -> SelectionList () combineListSelection :: World -> Maybe Int -> String -> Bool -> SelectionList ()
combineListSelection w mi regex x = combineListSelection w mi regex x =