Cleanup
This commit is contained in:
+32
-13
@@ -59,7 +59,7 @@ drawHP cfig =
|
||||
drawInventory :: SelectionSections () -> World -> Configuration -> Picture
|
||||
drawInventory sss w cfig =
|
||||
drawSelectionSections sss ldp cfig
|
||||
<> drawSSCursor sss (w ^? hud . hudElement . diSelection . _Just) ldp curs cfig
|
||||
<> drawSSCursor sss (w ^? hud . hudElement . diSelection . _Just) ldp curs cfig
|
||||
<> iextra
|
||||
<> translateScreenPos
|
||||
cfig
|
||||
@@ -82,9 +82,9 @@ drawDIMouseOver w = fromMaybe mempty $ do
|
||||
(_, i) <- w ^? hud . hudElement . subInventory . nsMouseOver . _Just
|
||||
sss <- w ^? hud . hudElement . diSections
|
||||
let idp = invDisplayParams w
|
||||
return . color (withAlpha 0.5 white) $ selSecDrawCursorAt (0, i) 10 idp curs sss
|
||||
return . color (withAlpha 0.5 white) $ selSecDrawCursorAt 10 idp curs sss (0, i)
|
||||
where
|
||||
curs = CursorDisplay [North,South]
|
||||
curs = BoundaryCursor [North, South]
|
||||
|
||||
getMouseInvSel :: World -> Maybe ((Int, Int), (Int, Int))
|
||||
getMouseInvSel w = case w ^? hud . hudElement . subInventory . nsSelected of
|
||||
@@ -130,7 +130,7 @@ drawCombineInventory cfig sss w =
|
||||
<> drawSSCursor sss msel secondColumnParams curs cfig
|
||||
<> combineInventoryExtra sss msel cfig w
|
||||
where
|
||||
curs = CursorDisplay [North,South,West]
|
||||
curs = BoundaryCursor [North, South, West]
|
||||
msel = w ^? hud . hudElement . subInventory . ciSelection . _Just
|
||||
|
||||
drawExamineInventory :: Configuration -> World -> Picture
|
||||
@@ -185,7 +185,9 @@ drawRBOptions :: Configuration -> World -> Picture
|
||||
drawRBOptions cfig w = fromMaybe mempty $ do
|
||||
guard $ ButtonRight `M.member` _mouseButtons (_input w)
|
||||
invid <- you w ^? crManipulation . manObject . imSelectedItem
|
||||
eslist <- fmap equipSiteToPositions $ you w ^? crInv . ix invid . itUse . uequipEffect . eeSite
|
||||
eslist <-
|
||||
fmap equipSiteToPositions $
|
||||
you w ^? crInv . ix invid . itUse . uequipEffect . eeSite
|
||||
i <- w ^? rbOptions . opSel
|
||||
let ae = getEquipmentAllocation w
|
||||
sss <- w ^? hud . hudElement . diSections
|
||||
@@ -202,23 +204,36 @@ drawRBOptions cfig w = fromMaybe mempty $ do
|
||||
return $
|
||||
toTopLeft cfig $
|
||||
translate 290 (-1) (ytext midstr)
|
||||
<> translate 160 (-1) (listCursorChooseBorderScale 0 1 [North, South] curpos 0 white 21 1)
|
||||
<> translate
|
||||
160
|
||||
(-1)
|
||||
( listCursorChooseBorderScale
|
||||
0
|
||||
1
|
||||
(BoundaryCursor [North, South])
|
||||
curpos
|
||||
0
|
||||
white
|
||||
21
|
||||
1
|
||||
)
|
||||
<> translate
|
||||
380
|
||||
(-1)
|
||||
( drawListYoff (curpos - i) (map (text . eqPosText) eslist)
|
||||
<> listCursorChooseBorderScale 0 1 [East] (curpos - i) 0 white 7 (length eslist)
|
||||
<> listCursorChooseBorderScale 0 1 [West] (curpos + 1) 0 white 7 (length eslist - (i + 1))
|
||||
<> listCursorChooseBorderScale 0 1 [West] (curpos - i) 0 white 7 i
|
||||
<> listCursorChooseBorderScale 0 1 (bc East) (curpos - i) 0 white 7 (length eslist)
|
||||
<> listCursorChooseBorderScale 0 1 (bc West) (curpos + 1) 0 white 7 (length eslist - (i + 1))
|
||||
<> listCursorChooseBorderScale 0 1 (bc West) (curpos - i) 0 white 7 i
|
||||
<> maybetopborder i curpos
|
||||
<> maybebottomborder i (length eslist) curpos
|
||||
)
|
||||
<> translate 460 (-1) (ytext extrastr)
|
||||
where
|
||||
maybetopborder 0 curpos = listCursorChooseBorderScale 0 1 [North] curpos 0 white 7 1
|
||||
bc x = BoundaryCursor [x]
|
||||
maybetopborder 0 curpos = listCursorChooseBorderScale 0 1 (bc North) curpos 0 white 7 1
|
||||
maybetopborder _ _ = mempty
|
||||
maybebottomborder a b curpos
|
||||
| a == b - 1 = listCursorChooseBorderScale 0 1 [South] curpos 0 white 7 1
|
||||
| a == b - 1 = listCursorChooseBorderScale 0 1 (bc South) curpos 0 white 7 1
|
||||
| otherwise = mempty
|
||||
otheritem j = fromMaybe "" $ do
|
||||
itm <- you w ^? crInv . ix j
|
||||
@@ -282,8 +297,12 @@ combineInventoryExtra sss msel cfig w = fromMaybe mempty $ do
|
||||
let idp = invDisplayParams w
|
||||
return $
|
||||
translateScreenPos cfig (idp ^. ldpPos) $
|
||||
selSecDrawCursor 17 idp (CursorDisplay [North, South, East, West])
|
||||
sss' (Just (0, i))
|
||||
selSecDrawCursor
|
||||
17
|
||||
idp
|
||||
(BoundaryCursor [North, South, East, West])
|
||||
sss'
|
||||
(Just (0, i))
|
||||
|
||||
displayTerminal :: Int -> Configuration -> LWorld -> Picture
|
||||
displayTerminal tid cfig w = fromMaybe mempty $ do
|
||||
|
||||
Reference in New Issue
Block a user