Fix selection in combine menu

This commit is contained in:
2022-12-26 09:34:23 +00:00
parent be1a48062f
commit 6e18c498af
3 changed files with 13 additions and 20 deletions
+1
View File
@@ -32,6 +32,7 @@ applyTerminalCommand s = case s of
(uvWorld . cWorld . lWorld %~ initSpecificCrItemLocations 0)
. (uvWorld . cWorld . lWorld . creatures . ix 0 . crInv .~ IM.fromList (zip [0 ..] $ inventoryX x))
. (uvWorld . cWorld . lWorld . creatures . ix 0 . crInvCapacity .~ 50)
['I','S',x,y] -> (uvWorld . cWorld . lWorld . creatures . ix 0 . crInvCapacity .~ read [x,y])
"GODON" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crMaterial .~ Crystal
"GODOFF" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crMaterial .~ Flesh
_ -> id
-9
View File
@@ -146,15 +146,6 @@ drawSubInventory subinv cfig w = case subinv of
closeobjectcursor = case selectedCloseObject w of
Nothing -> mempty
Just (i,_) -> drawCursorAt (invDisplayParams w & ldpCursorType .~ BorderCursor (Set.fromList [North,South])) cfig (Just i) (inventorySelectionList w)
-- Just (i, co) ->
-- listCursorNS
-- clObjFloatIn
-- 0
-- cfig
-- (selNumPos i w)
-- (closeObjectCol co)
-- topInvW
-- (invSelSize i w)
itcol = fromMaybe (greyN 0.5) (it ^? _Just . itInvColor)
cr = you w
it = yourItem w
+12 -11
View File
@@ -100,17 +100,18 @@ listCursorChooseBorderScale ygap s borders xoff yoff cfig yint col cursxsize cur
-- this is probably because it is 8 pixels plus one for the border
listCursorChooseBorder ::
Set CardinalPoint -> Float -> Float -> Configuration -> Int -> Color -> Int -> Int -> Picture
listCursorChooseBorder borders xoff yoff cfig yint col cursxsize cursysize =
winScale cfig
. translate
(6 + xoff - halfWidth cfig)
(halfHeight cfig + 12.5 - (20 * fromIntegral yint + yoff + 20 + hgt))
. color col
$ chooseCursorBorders wth hgt borders
where
x = 9
wth = x * fromIntegral cursxsize + 9
hgt = 20 * fromIntegral cursysize
listCursorChooseBorder = listCursorChooseBorderScale 10 1
--listCursorChooseBorder borders xoff yoff cfig yint col cursxsize cursysize =
-- winScale cfig
-- . translate
-- (6 + xoff - halfWidth cfig)
-- (halfHeight cfig + 12.5 - (20 * fromIntegral yint + yoff + 20 + hgt))
-- . color col
-- $ chooseCursorBorders wth hgt borders
-- where
-- x = 9
-- wth = x * fromIntegral cursxsize + 9
-- hgt = 20 * fromIntegral cursysize
-- note we cannot simply scale lines because they are drawn as solid rectangles
chooseCursorBorders :: Float -> Float -> Set CardinalPoint -> Picture