Reorganise/cleanup

This commit is contained in:
2023-02-21 01:24:22 +00:00
parent dee7472d31
commit 4904c57972
13 changed files with 119 additions and 140 deletions
+9 -9
View File
@@ -38,7 +38,7 @@ drawHUD cfig w = case w ^. hud . hudElement of
DisplayCarte -> drawCarte cfig w
DisplayInventory {_diSections = sections, _subInventory = subinv} ->
drawHP cfig w
<> inventoryDisplay (sections ^. fssSections) w cfig
<> inventoryDisplay sections w cfig
<> drawSubInventory subinv cfig w
drawHP :: Configuration -> World -> Picture
@@ -80,7 +80,7 @@ drawSelectionSections sss ldps cfig = listPicturesAtScaleOff
<> thecursor'
where
thecursor' = fromMaybe mempty $ do
(i,j) <- sss ^? sssSelPos . _Just
(i,j) <- sss ^? sssExtra . sssSelPos . _Just
return $ selSecDrawCursor 15 [North,South,West] cfig ldps sss i j
pics = foldMap _ssShownItems (_sssSections sss)
@@ -93,7 +93,7 @@ drawSubInventory subinv cfig w = case subinv of
NoSubInventory -> drawNoSubInventory cfig w
ExamineInventory mtweaki -> drawExamineInventory cfig mtweaki w
DisplayTerminal tid -> displayTerminal tid cfig (w ^. cWorld . lWorld)
CombineInventory {_ciSections = FilterableSections {_fssSections = sss}}
CombineInventory {_ciSections = sss}
-> titledSub' cfig "COMBINE" sss
<> combineInventoryExtra sss cfig w
@@ -156,11 +156,11 @@ drawNoSubInventory cfig w =
where
equipcursor = fromMaybe mempty $ do
invid <- cr ^. crLeftInvSel . lisMPos
sss <- w ^? hud . hudElement . diSections . fssSections
sss <- w ^? hud . hudElement . diSections
pos <- selSecSelPos 0 invid sss
return $ listTextPictureAt 144 0 cfig pos . color cyan . text . eqPosText $_crInvEquipped cr IM.! invid
f col invid epos = fromMaybe mempty $ do
sss <- w ^? hud . hudElement . diSections . fssSections
sss <- w ^? hud . hudElement . diSections
pos <- selSecSelPos 0 invid sss
return $ listTextPictureAt 144 0 cfig pos . color col $ text $ eqPosText epos
equipcursors = IM.foldMapWithKey (f yellow) (_crInvEquipped cr)
@@ -179,7 +179,7 @@ examineInventoryExtra mtweaki mitm cfig = fromMaybe mempty $ do
combineInventoryExtra :: SelectionSections CombinableItem -> Configuration -> World -> Picture
combineInventoryExtra sss cfig w = fromMaybe mempty $ do
(i,j) <- sss ^? sssSelPos . _Just
(i,j) <- sss ^? sssExtra . sssSelPos . _Just
si <- sss ^? sssSections . ix i . ssItems . ix j
cpos <- selSecSelPos i j sss
let col = _siColor si
@@ -197,7 +197,7 @@ combineInventoryExtra sss cfig w = fromMaybe mempty $ do
]
where
invcursor i = fromMaybe mempty $ do
sss' <- w ^? hud . hudElement . diSections . fssSections
sss' <- w ^? hud . hudElement . diSections
return $ selSecDrawCursor 17 [North,South,East] cfig (invDisplayParams w) sss' 0 i
-- fromMaybe mempty $ do
-- i <- mi
@@ -324,7 +324,7 @@ combineCounts cfig w = winScale cfig . foldMap f . group
where
f (i : is) = fromMaybe mempty $ do
_ <- yourInv w ^? ix i . itUse . useAmount
sss <- w ^? hud . hudElement . diSections . fssSections
sss <- w ^? hud . hudElement . diSections
p <- selNumTextEndPos cfig (invDisplayParams w) sss 0 i
col <- selSecSelCol 0 i sss
return $ color col $ uncurryV translate p . scale 0.1 0.1 . text $ ('-' : show (length is + 1))
@@ -335,7 +335,7 @@ lnkMidPosInvSelsCol cfig w i col = winScale cfig
. foldMap f
where
f j = fromMaybe mempty $ do
sss <- w ^? hud . hudElement . diSections . fssSections
sss <- w ^? hud . hudElement . diSections
h <- selNumEndMidHeight cfig (invDisplayParams w) sss 0 j
invcol <- selSecSelCol 0 j sss
return $ zConnectCol rp (V2 18 0 + h) col white white invcol