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 %~ initSpecificCrItemLocations 0)
. (uvWorld . cWorld . lWorld . creatures . ix 0 . crInv .~ IM.fromList (zip [0 ..] $ inventoryX x)) . (uvWorld . cWorld . lWorld . creatures . ix 0 . crInv .~ IM.fromList (zip [0 ..] $ inventoryX x))
. (uvWorld . cWorld . lWorld . creatures . ix 0 . crInvCapacity .~ 50) . (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 "GODON" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crMaterial .~ Crystal
"GODOFF" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crMaterial .~ Flesh "GODOFF" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crMaterial .~ Flesh
_ -> id _ -> id
-9
View File
@@ -146,15 +146,6 @@ drawSubInventory subinv cfig w = case subinv of
closeobjectcursor = case selectedCloseObject w of closeobjectcursor = case selectedCloseObject w of
Nothing -> mempty Nothing -> mempty
Just (i,_) -> drawCursorAt (invDisplayParams w & ldpCursorType .~ BorderCursor (Set.fromList [North,South])) cfig (Just i) (inventorySelectionList w) 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) itcol = fromMaybe (greyN 0.5) (it ^? _Just . itInvColor)
cr = you w cr = you w
it = yourItem 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 -- this is probably because it is 8 pixels plus one for the border
listCursorChooseBorder :: listCursorChooseBorder ::
Set CardinalPoint -> Float -> Float -> Configuration -> Int -> Color -> Int -> Int -> Picture Set CardinalPoint -> Float -> Float -> Configuration -> Int -> Color -> Int -> Int -> Picture
listCursorChooseBorder borders xoff yoff cfig yint col cursxsize cursysize = listCursorChooseBorder = listCursorChooseBorderScale 10 1
winScale cfig --listCursorChooseBorder borders xoff yoff cfig yint col cursxsize cursysize =
. translate -- winScale cfig
(6 + xoff - halfWidth cfig) -- . translate
(halfHeight cfig + 12.5 - (20 * fromIntegral yint + yoff + 20 + hgt)) -- (6 + xoff - halfWidth cfig)
. color col -- (halfHeight cfig + 12.5 - (20 * fromIntegral yint + yoff + 20 + hgt))
$ chooseCursorBorders wth hgt borders -- . color col
where -- $ chooseCursorBorders wth hgt borders
x = 9 -- where
wth = x * fromIntegral cursxsize + 9 -- x = 9
hgt = 20 * fromIntegral cursysize -- wth = x * fromIntegral cursxsize + 9
-- hgt = 20 * fromIntegral cursysize
-- note we cannot simply scale lines because they are drawn as solid rectangles -- note we cannot simply scale lines because they are drawn as solid rectangles
chooseCursorBorders :: Float -> Float -> Set CardinalPoint -> Picture chooseCursorBorders :: Float -> Float -> Set CardinalPoint -> Picture