Tweak combine inventory display/click events
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
All good (594 modules, at 09:31:25)
|
All good (594 modules, at 10:00:00)
|
||||||
|
|||||||
+21
-10
@@ -79,16 +79,19 @@ drawMouseCursor u =
|
|||||||
mouseCursorType :: Universe -> Picture
|
mouseCursorType :: Universe -> Picture
|
||||||
mouseCursorType u
|
mouseCursorType u
|
||||||
| isselect = drawPlus 5
|
| isselect = drawPlus 5
|
||||||
| Just csel <- u ^? uvWorld . hud . hudElement . subInventory . ciSelection
|
| Just csel <- u ^? uvWorld . hud . hudElement . subInventory . ciSelection =
|
||||||
= if (csel == u ^? uvWorld . hud . hudElement . subInventory . ciMouseOver . _Just
|
if ( csel == u ^? uvWorld . hud . hudElement . subInventory . ciMouseOver . _Just
|
||||||
|| null (u ^? uvWorld . hud . hudElement . subInventory . ciMouseOver . _Just))
|
|| null (u ^? uvWorld . hud . hudElement . subInventory . ciMouseOver . _Just)
|
||||||
|
)
|
||||||
&& null (u ^? uvWorld . hud . hudElement . diMouseOver . _Just)
|
&& null (u ^? uvWorld . hud . hudElement . diMouseOver . _Just)
|
||||||
&& fmap fst csel /= Just (-1)
|
&& fmap fst csel /= Just (-1)
|
||||||
then drawDoublePlus 5
|
&& fromMaybe True (u ^? uvWorld . hud . hudElement . subInventory . ciSections . ix 0 . ssItems . ix 0 . siIsSelectable) --HACK to check there is something creatable
|
||||||
|
then drawGapPlus 5
|
||||||
else drawPlus 5
|
else drawPlus 5
|
||||||
| otherwise = rotate a (drawPlus 5)
|
| otherwise = rotate a (drawPlus 5)
|
||||||
where
|
where
|
||||||
isselect = not (null $ u ^. uvScreenLayers)
|
isselect =
|
||||||
|
not (null $ u ^. uvScreenLayers)
|
||||||
|| not (null $ u ^? uvWorld . hud . hudElement . diMouseOver . _Just)
|
|| not (null $ u ^? uvWorld . hud . hudElement . diMouseOver . _Just)
|
||||||
w = u ^. uvWorld
|
w = u ^. uvWorld
|
||||||
a = fromMaybe 0 $ do
|
a = fromMaybe 0 $ do
|
||||||
@@ -100,12 +103,20 @@ mouseCursorType u
|
|||||||
drawPlus :: Float -> Picture
|
drawPlus :: Float -> Picture
|
||||||
drawPlus x = fold [line [V2 (- x) 0, V2 x 0], line [V2 0 (- x), V2 0 x]]
|
drawPlus x = fold [line [V2 (- x) 0, V2 x 0], line [V2 0 (- x), V2 0 x]]
|
||||||
|
|
||||||
drawDoublePlus :: Float -> Picture
|
--drawDoublePlus :: Float -> Picture
|
||||||
drawDoublePlus x = fold [line [V2 (- (1.5*x)) 0, V2 (1.5*x) 0]
|
--drawDoublePlus x = fold [line [V2 (- (1.5*x)) 0, V2 (1.5*x) 0]
|
||||||
, line [V2 (0.5 * x) (- x), V2 (0.5 * x) x]
|
-- , line [V2 (0.5 * x) (- x), V2 (0.5 * x) x]
|
||||||
, line [V2 (negate 0.5 * x) (- x), V2 (negate 0.5 * x) x]
|
-- , line [V2 (negate 0.5 * x) (- x), V2 (negate 0.5 * x) x]
|
||||||
]
|
-- ]
|
||||||
|
|
||||||
|
drawGapPlus :: Float -> Picture
|
||||||
|
drawGapPlus x =
|
||||||
|
fold
|
||||||
|
[ line [V2 (-1.5 * x) 0, V2 (-0.5 * x) 0]
|
||||||
|
, line [V2 (0.5 * x) 0, V2 (1.5 * x) 0]
|
||||||
|
, line [V2 (0.5 * x) (- x), V2 (0.5 * x) x]
|
||||||
|
, line [V2 (-0.5 * x) (- x), V2 (-0.5 * x) x]
|
||||||
|
]
|
||||||
|
|
||||||
aimDelaySweep :: World -> Picture
|
aimDelaySweep :: World -> Picture
|
||||||
aimDelaySweep w = fromMaybe mempty $ do
|
aimDelaySweep w = fromMaybe mempty $ do
|
||||||
|
|||||||
@@ -113,6 +113,9 @@ updateCombineInvClick msel sss w = fromMaybe trydocombination $ do
|
|||||||
& worldEventFlags . at CombineInventoryChange ?~ ()
|
& worldEventFlags . at CombineInventoryChange ?~ ()
|
||||||
| i == -1 -> w & hud . hudElement . subInventory . ciFilter .~ Nothing
|
| i == -1 -> w & hud . hudElement . subInventory . ciFilter .~ Nothing
|
||||||
& worldEventFlags . at CombineInventoryChange ?~ ()
|
& worldEventFlags . at CombineInventoryChange ?~ ()
|
||||||
|
_ | (w ^? hud . hudElement . subInventory . ciSelection . _Just . _1) == Just (-1)
|
||||||
|
-> w & hud . hudElement . subInventory . ciFilter .~ Nothing
|
||||||
|
& worldEventFlags . at CombineInventoryChange ?~ ()
|
||||||
_ -> (worldEventFlags . at InventoryChange ?~ ()) . maybeExitCombine $
|
_ -> (worldEventFlags . at InventoryChange ?~ ()) . maybeExitCombine $
|
||||||
tryCombine sss msel w
|
tryCombine sss msel w
|
||||||
& worldEventFlags . at CombineInventoryChange ?~ ()
|
& worldEventFlags . at CombineInventoryChange ?~ ()
|
||||||
|
|||||||
Reference in New Issue
Block a user