Fix combinations filter

This commit is contained in:
2023-02-21 11:10:59 +00:00
parent 4904c57972
commit 8b0e1eab81
9 changed files with 211 additions and 227 deletions
+1 -50
View File
@@ -5,6 +5,7 @@ module Dodge.Render.HUD (
secondColumnParams,
) where
import Dodge.ListDisplayParams
import Dodge.Inventory
import Dodge.Data.Combine
import Dodge.Default.SelectionList
@@ -44,29 +45,6 @@ drawHUD cfig w = case w ^. hud . hudElement of
drawHP :: Configuration -> World -> Picture
drawHP cfig w = winScale cfig . dShadCol white $ displayHP 0 cfig w
defaultListDisplayParams :: ListDisplayParams
defaultListDisplayParams =
ListDisplayParams
{ _ldpVerticalGap = 10
, _ldpScale = 1
, _ldpPosX = 0
, _ldpPosY = 0
, _ldpCursorType = NoCursor
, _ldpWidth = FixedSelectionWidth 15
}
invDisplayParams :: World -> ListDisplayParams
invDisplayParams w =
defaultListDisplayParams
& ldpCursorType .~ BorderCursor selcursortype
& ldpWidth .~ FixedSelectionWidth (determineInvSelCursorWidth w)
where
selcursortype
| isexaminesub || ButtonRight `M.member` _mouseButtons (_input w) = [North, South, East, West]
| otherwise = [North, South, West]
isexaminesub = case w ^? hud . hudElement . subInventory of
Just ExamineInventory{} -> True
_ -> False
drawSelectionSections :: SelectionSections a -> ListDisplayParams -> Configuration -> Picture
drawSelectionSections sss ldps cfig = listPicturesAtScaleOff
@@ -221,18 +199,7 @@ combineInventoryExtra sss cfig w = fromMaybe mempty $ do
-- sss <- w ^? hud . hudElement . diSections
-- return $ selSecDrawCursor 17 [North,South,East] cfig (invDisplayParams w) sss 0 i
secondColumnParams :: ListDisplayParams
secondColumnParams =
defaultListDisplayParams
& ldpPosX .~ subInvX
& ldpPosY .~ 60
& ldpCursorType .~ BorderCursor [North, South, West]
--thirdColumnParams :: ListDisplayParams
--thirdColumnParams =
-- defaultListDisplayParams
-- & ldpPosX .~ 9 * fromIntegral topInvW + 275
-- & ldpPosY .~ 60
--thirdColumnPara :: [String] -> SelectionList ()
--thirdColumnPara strs = SelectionList (map f strs) Nothing (length strs)
@@ -313,11 +280,7 @@ eqPosText ep = case ep of
OnLegs -> "LEGS"
OnSpecial -> "EQUIPPED"
topInvW :: Int
topInvW = 15
subInvX :: Float
subInvX = 9 * fromIntegral topInvW + 50
combineCounts :: Configuration -> World -> [Int] -> Picture
combineCounts cfig w = winScale cfig . foldMap f . group
@@ -343,18 +306,6 @@ lnkMidPosInvSelsCol cfig w i col = winScale cfig
hh = halfHeight cfig
hw = halfWidth cfig
determineInvSelCursorWidth :: World -> Int
determineInvSelCursorWidth w = case _rbOptions w of
NoRightButtonOptions -> topInvW
EquipOptions{}
| ButtonRight `M.member` _mouseButtons (_input w)
&& hasnosubinv ->
47
| otherwise -> topInvW
where
hasnosubinv = case w ^? hud . hudElement . subInventory of
Just NoSubInventory -> True
_ -> False
ammoTweakSelectionItems :: Maybe Item -> [SelectionItem ()]