Commit before using central mouse context type

This commit is contained in:
2024-11-10 17:56:50 +00:00
parent b48e949577
commit f35dfc66bd
8 changed files with 159 additions and 106 deletions
+13
View File
@@ -2,6 +2,7 @@ module Dodge.Render.Picture (
fixedCoordPictures,
) where
import Dodge.CharacterEnums
import Control.Lens
import Control.Monad
import Data.Maybe
@@ -79,6 +80,7 @@ drawMouseCursor u =
mouseCursorType :: Universe -> Picture
mouseCursorType u
| isselect = drawPlus 5
| Just tmid <- u ^? uvWorld . hud . hudElement . subInventory . termID = determineTermCursor tmid u
| Just csel <- u ^? uvWorld . hud . hudElement . subInventory . ciSelection =
if ( csel == u ^? uvWorld . hud . hudElement . subInventory . ciMouseOver . _Just
|| null (u ^? uvWorld . hud . hudElement . subInventory . ciMouseOver . _Just)
@@ -100,6 +102,17 @@ mouseCursorType u
argV (mouseWorldPos (w ^. input) (w ^. wCam) -.- cpos)
- w ^. wCam . camRot
determineTermCursor :: Int -> Universe -> Picture
determineTermCursor tmid u = fromMaybe (drawPlus 5) $ do
return drawReturn
drawReturn :: Picture
drawReturn = scale 0.1 0.1 . translate (-50) (-100) $ text [toEnum 153]
drawWireRectCursor :: Picture
drawWireRectCursor = scale 0.1 0.1 $ text [cWireRect]
--drawReturn = text "ASDF"
drawPlus :: Float -> Picture
drawPlus x = fold [line [V2 (- x) 0, V2 x 0], line [V2 0 (- x), V2 0 x]]