diff --git a/src/Dodge/Creature/Impulse/UseItem.hs b/src/Dodge/Creature/Impulse/UseItem.hs index 410ecb9f7..13e02c46f 100644 --- a/src/Dodge/Creature/Impulse/UseItem.hs +++ b/src/Dodge/Creature/Impulse/UseItem.hs @@ -77,7 +77,7 @@ toggleEquipmentAt rbops invid cr w = case rbops ^? opAllocateEquipment of & crpoint . crEquipment . at newp ?~ invid & crpoint . crInvEquipped . at invid ?~ newp & onequip itm cr - & assignNewHotkey invid + & crpoint %~ assignNewHotkey invid Just MoveEquipment{_allocNewPos = newp, _allocOldPos = oldp} -> w & crpoint . crEquipment . at newp ?~ invid @@ -97,7 +97,7 @@ toggleEquipmentAt rbops invid cr w = case rbops ^? opAllocateEquipment of & onremove (itmat rid) cr & onequip itm cr & crpoint %~ removeHotkey rid - & assignNewHotkey invid + & crpoint %~ assignNewHotkey invid Just RemoveEquipment{_allocOldPos = oldp} -> w & crpoint . crEquipment . at oldp .~ Nothing diff --git a/src/Dodge/Creature/YourControl.hs b/src/Dodge/Creature/YourControl.hs index 3cc42f510..d9b611c0b 100644 --- a/src/Dodge/Creature/YourControl.hs +++ b/src/Dodge/Creature/YourControl.hs @@ -90,7 +90,7 @@ tryAssignHotkey w sc = fromMaybe w $ do guard (pt == InitialPress) cr <- w ^? cWorld . lWorld . creatures . ix 0 itid <- cr ^? crManipulation . manObject . inInventory . ispItem - return $ assignHotkey itid (scancodeToHotkey sc) w + return $ w & cWorld . lWorld . creatures . ix 0 %~ assignHotkey itid (scancodeToHotkey sc) -- | Turn key presses into creature movement. -- | note the order of operation, setting the posture first--this prevents the twist fire bug diff --git a/src/Dodge/Render/List.hs b/src/Dodge/Render/List.hs index 293696045..514c61068 100644 --- a/src/Dodge/Render/List.hs +++ b/src/Dodge/Render/List.hs @@ -119,13 +119,14 @@ listCursorChooseBorderScale :: Picture listCursorChooseBorderScale ygap s borders xoff yoff cfig yint xint col cursxsize cursysize = translate - (15 + (9 * s * (fromIntegral xint - 1)) + xoff - halfWidth cfig) - (halfHeight cfig + s * 12.5 - (yoff + (s * 10 + ygap) * (fromIntegral yint + 1))) + --(15 + (9 * s * (fromIntegral xint - 1)) + xoff - halfWidth cfig) + (xoff - halfWidth cfig) + (halfHeight cfig - (yoff + (s * 10 + ygap) * (fromIntegral yint + 1))) . color col $ chooseCursorBorders (s * wth) (s * hgt) borders where x = 9 - wth = x * fromIntegral cursxsize + 9 + wth = x * fromIntegral cursxsize + 10 hgt = 20 * fromIntegral cursysize -- TODO this should be changed! -- displays a cursor that should match up to list text pictures @@ -137,15 +138,12 @@ listCursorChooseBorder = listCursorChooseBorderScale 10 1 -- note we cannot simply scale lines because they are drawn as solid rectangles chooseCursorBorders :: Float -> Float -> [CardinalPoint] -> Picture -chooseCursorBorders wth hgt = foldMap (line . toLine) +chooseCursorBorders w h = foldMap (line . toLine) where - top = 0 - bot = - hgt - lef = 0 - toLine North = [V2 lef top, V2 wth top] - toLine East = [V2 wth top, V2 wth bot] - toLine South = [V2 wth bot, V2 lef bot] - toLine West = [V2 lef bot, V2 lef top] + toLine North = [V2 0 h, V2 w h] + toLine East = [V2 w h, V2 w 0] + toLine South = [V2 w 0, V2 0 0] + toLine West = [V2 0 0, V2 0 h] listCursorNS :: Float -> Float -> Configuration -> Int -> Int -> Color -> Int -> Int -> Picture listCursorNS = listCursorChooseBorder [North, South] diff --git a/src/Picture/Base.hs b/src/Picture/Base.hs index fbb81d834..2fe4a30b5 100644 --- a/src/Picture/Base.hs +++ b/src/Picture/Base.hs @@ -201,9 +201,12 @@ stackText = mconcat . zipWith (\y s -> translate 0 y $ centerText s) [0, 100 ..] text :: String -> Picture {-# INLINE text #-} -text = translate (-50) (-100) . drawText (-10) +--text = translate (-50) (-100) . drawText (-10) +text = drawText 0 +--text = drawText (-10) drawText :: Float -> String -> [Verx] +{-# INLINE drawText #-} drawText gap = map f . stringToList gap where f (pos, col, V3 a b c) = Verx pos col [a, b, c, 1] BottomLayer textNum