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
}
| DisplayCarte
deriving (Eq, Ord, Show, Read) --Generic, Flat)
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
data SubInventory
= NoSubInventory
@@ -25,7 +25,7 @@ data SubInventory
, _subInvRegexInput :: Bool}
| LockedInventory
| DisplayTerminal {_termID :: Int}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
data HUD = HUD
{ _hudElement :: HUDElement
-1
View File
@@ -8,7 +8,6 @@ import qualified Data.Map.Strict as M
import Dodge.Data.CWorld
import Geometry.Data
import SDL (MouseButton, Scancode)
import qualified Data.Text as T
data PressType = InitialPress
| ShortPress
-1
View File
@@ -18,7 +18,6 @@ import Control.Lens
--import qualified Data.Map.Strict as M
import Data.Preload
import Data.Sequence (Seq (..))
import qualified Data.Text as T
import Dodge.Data.Config
import Dodge.Data.World
import Loop.Data
+5 -1
View File
@@ -328,9 +328,13 @@ determineInvSelCursorWidth w = case _rbOptions w of
NoRightButtonOptions -> topInvW
EquipOptions{}
| ButtonRight `M.member` _mouseButtons (_input w)
&& w ^? hud . hudElement . subInventory == Just NoSubInventory ->
&& hasnosubinv ->
47
| otherwise -> topInvW
where
hasnosubinv = case w ^? hud . hudElement . subInventory of
Just NoSubInventory -> True
_ -> False
combineListSelection :: World -> Maybe Int -> String -> Bool -> SelectionList ()
combineListSelection w mi regex x =