Correctly display held root item
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -134,7 +134,6 @@ data LWorld = LWorld
|
|||||||
, _foregroundShapes :: IM.IntMap ForegroundShape
|
, _foregroundShapes :: IM.IntMap ForegroundShape
|
||||||
, _corpses :: IM.IntMap Corpse
|
, _corpses :: IM.IntMap Corpse
|
||||||
, _lightSources :: IM.IntMap LightSource
|
, _lightSources :: IM.IntMap LightSource
|
||||||
-- , _tempLightSources :: [TempLightSource]
|
|
||||||
, _lights :: [LSParam]
|
, _lights :: [LSParam]
|
||||||
, _seenLocations :: IM.IntMap (WdP2, String)
|
, _seenLocations :: IM.IntMap (WdP2, String)
|
||||||
, _selLocation :: Int
|
, _selLocation :: Int
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import ShapePicture
|
|||||||
itemEquipPict :: Creature -> LabelDoubleTree ItemLink ComposedItem -> SPic
|
itemEquipPict :: Creature -> LabelDoubleTree ItemLink ComposedItem -> SPic
|
||||||
itemEquipPict cr itmtree = case itm ^. itUse of
|
itemEquipPict cr itmtree = case itm ^. itUse of
|
||||||
UseHeld{} | itm ^? itLocation . ilIsRoot == Just True
|
UseHeld{} | itm ^? itLocation . ilIsRoot == Just True
|
||||||
&& itm ^? itLocation . ilIsSelected == Just True
|
&& itm ^? itLocation . ilInvID == cr ^? crManipulation . manObject . imRootSelectedItem
|
||||||
-> overPosSP (heldItemOffset itm cr) (itemTreeSPic itmtree)
|
-> overPosSP (heldItemOffset itm cr) (itemTreeSPic itmtree)
|
||||||
ituse -> fold $ do
|
ituse -> fold $ do
|
||||||
attachpos <- ituse ^? uequipEffect . eeAttachPos
|
attachpos <- ituse ^? uequipEffect . eeAttachPos
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ joinItemsInList f xs = snd $ h (xs, [])
|
|||||||
Nothing -> h (ys, y : z : zs)
|
Nothing -> h (ys, y : z : zs)
|
||||||
Just w -> h (w : ys, zs)
|
Just w -> h (w : ys, zs)
|
||||||
|
|
||||||
|
-- this puts the first elements in the intmap at the end of the list
|
||||||
invLDT :: IM.IntMap Item -> [LabelDoubleTree ItemLink PartiallyComposedItem]
|
invLDT :: IM.IntMap Item -> [LabelDoubleTree ItemLink PartiallyComposedItem]
|
||||||
invLDT =
|
invLDT =
|
||||||
joinItemsInList (leftRightCombine leftIsParentCombine rightIsParentCombine) . IM.elems
|
joinItemsInList (leftRightCombine leftIsParentCombine rightIsParentCombine) . IM.elems
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ teslaGun =
|
|||||||
& itUse . heldDelay .~ NoDelay
|
& itUse . heldDelay .~ NoDelay
|
||||||
& itUse . heldAim . aimWeight .~ 6
|
& itUse . heldAim . aimWeight .~ 6
|
||||||
& itUse . heldAim . aimStance .~ TwoHandFlat
|
& itUse . heldAim . aimStance .~ TwoHandFlat
|
||||||
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 4 0
|
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 10 0
|
||||||
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
|
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
|
||||||
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ TeslaGunFlare
|
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ TeslaGunFlare
|
||||||
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleTesla
|
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleTesla
|
||||||
@@ -44,7 +44,7 @@ laser =
|
|||||||
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
& itAmmoSlots .~ singleAmmo ElectricalAmmo
|
||||||
& itUse . heldDelay .~ NoDelay
|
& itUse . heldDelay .~ NoDelay
|
||||||
& itUse . heldTriggerType .~ AutoTrigger
|
& itUse . heldTriggerType .~ AutoTrigger
|
||||||
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 4 0
|
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 6 0
|
||||||
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
|
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
|
||||||
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ LasGunFlare
|
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ LasGunFlare
|
||||||
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleLaser
|
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleLaser
|
||||||
|
|||||||
@@ -12,33 +12,11 @@ import Dodge.Material.Sound
|
|||||||
import Dodge.WorldEvent.Sound
|
import Dodge.WorldEvent.Sound
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
import Geometry.Vector
|
import Geometry.Vector
|
||||||
import Geometry.Vector3D
|
|
||||||
import LensHelp
|
import LensHelp
|
||||||
|
|
||||||
lsPosRad :: Point3 -> Float -> LightSource
|
lsPosRad :: Point3 -> Float -> LightSource
|
||||||
lsPosRad = lsColPosRad 0.75
|
lsPosRad = lsColPosRad 0.75
|
||||||
|
|
||||||
--tlsTimeRadFunPos :: Int -> Float -> TLSIntensity -> Point3 -> TempLightSource
|
|
||||||
--tlsTimeRadFunPos t rmax intensityF p =
|
|
||||||
-- TLS
|
|
||||||
-- { _tlsParam =
|
|
||||||
-- LSParam
|
|
||||||
-- { _lsPos = p
|
|
||||||
-- , _lsRad = rmax
|
|
||||||
-- , _lsCol = 0 -- intensityF t
|
|
||||||
-- }
|
|
||||||
-- , _tlsUpdate = IntensityTLS intensityF
|
|
||||||
-- , _tlsTime = t
|
|
||||||
-- }
|
|
||||||
|
|
||||||
-- where
|
|
||||||
-- upF tls
|
|
||||||
-- | _tlsTime tls <= 0 = Nothing
|
|
||||||
-- | otherwise = Just $ tls
|
|
||||||
-- & tlsTime -~ 1
|
|
||||||
-- & tlsParam . lsCol .~ f (intensityF (_tlsTime tls) )
|
|
||||||
-- f x' = V3 x' x' x'
|
|
||||||
|
|
||||||
lsColPosID :: Point3 -> Point3 -> Int -> LightSource
|
lsColPosID :: Point3 -> Point3 -> Int -> LightSource
|
||||||
lsColPosID col p i = lsColPos col p & lsID .~ i
|
lsColPosID col p i = lsColPos col p & lsID .~ i
|
||||||
|
|
||||||
@@ -51,33 +29,6 @@ lsPosCol pos col = lsColPos col pos
|
|||||||
lsColPosRad :: Point3 -> Point3 -> Float -> LightSource
|
lsColPosRad :: Point3 -> Point3 -> Float -> LightSource
|
||||||
lsColPosRad col p r = LS 0 $ LSParam p r col
|
lsColPosRad col p r = LS 0 $ LSParam p r col
|
||||||
|
|
||||||
--lsRadCol :: Float -> Point3 -> LightSource
|
|
||||||
--lsRadCol r col =
|
|
||||||
-- defaultLS & lsParam . lsRad .~ r
|
|
||||||
-- & lsParam . lsCol .~ col
|
|
||||||
|
|
||||||
--tlsTimeRadColPos ::
|
|
||||||
-- Int ->
|
|
||||||
-- -- | maximal radius
|
|
||||||
-- Float ->
|
|
||||||
-- Point3 ->
|
|
||||||
-- Point3 ->
|
|
||||||
-- TempLightSource
|
|
||||||
--tlsTimeRadColPos t rmax col (V3 x y z) =
|
|
||||||
-- TLS
|
|
||||||
-- { _tlsParam =
|
|
||||||
-- LSParam
|
|
||||||
-- { _lsPos = V3 x y z
|
|
||||||
-- , _lsRad = rmax
|
|
||||||
-- , _lsCol = col
|
|
||||||
-- }
|
|
||||||
-- , _tlsUpdate = TimerTLS
|
|
||||||
-- , _tlsTime = t
|
|
||||||
-- }
|
|
||||||
--
|
|
||||||
--makeTlsTimeRadColPos :: Int -> Float -> Point3 -> Point3 -> World -> World
|
|
||||||
--makeTlsTimeRadColPos i rad (V3 r g b) p = cWorld . lWorld . tempLightSources .:~ tlsTimeRadColPos i rad (V3 r g b) p
|
|
||||||
|
|
||||||
destroyLS :: Int -> World -> World
|
destroyLS :: Int -> World -> World
|
||||||
destroyLS lsid w =
|
destroyLS lsid w =
|
||||||
w
|
w
|
||||||
@@ -89,14 +40,6 @@ destroyLS lsid w =
|
|||||||
p3 = _lsPos $ _lsParam ls
|
p3 = _lsPos $ _lsParam ls
|
||||||
|
|
||||||
destroyLSFlashAt :: Point3 -> World -> World
|
destroyLSFlashAt :: Point3 -> World -> World
|
||||||
destroyLSFlashAt (V3 x' y' z') =
|
destroyLSFlashAt x =
|
||||||
cWorld . lWorld . worldEvents .:~ MakeTempLight
|
cWorld . lWorld . worldEvents .:~ MakeTempLight
|
||||||
(LSParam (addZ z' p) 150 1) 20
|
(LSParam x 150 1) 20
|
||||||
-- cWorld . lWorld . tempLightSources
|
|
||||||
-- .:~ tlsTimeRadFunPos
|
|
||||||
-- 20
|
|
||||||
-- 150
|
|
||||||
-- (TLSFade 1 10)
|
|
||||||
-- (addZ z' p)
|
|
||||||
where
|
|
||||||
p = V2 x' y'
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ lightsToRender :: Configuration -> Camera -> LWorld -> [(Point3, Float, Point3)]
|
|||||||
lightsToRender cfig campos w = take (fromEnum $ cfig ^. graphics_num_shadow_casters) $
|
lightsToRender cfig campos w = take (fromEnum $ cfig ^. graphics_num_shadow_casters) $
|
||||||
sortOn (\(_,x,_) -> negate x) $
|
sortOn (\(_,x,_) -> negate x) $
|
||||||
mapMaybe getLS (IM.elems $ w ^. lightSources)
|
mapMaybe getLS (IM.elems $ w ^. lightSources)
|
||||||
-- ++ mapMaybe getTLS (w ^. tempLightSources)
|
|
||||||
++ mapMaybe getlsparam (w ^. lights)
|
++ mapMaybe getlsparam (w ^. lights)
|
||||||
where
|
where
|
||||||
getLS = getlsparam . _lsParam
|
getLS = getlsparam . _lsParam
|
||||||
|
|||||||
@@ -24,7 +24,14 @@ import Dodge.Data.Universe
|
|||||||
import qualified IntMapHelp as IM
|
import qualified IntMapHelp as IM
|
||||||
|
|
||||||
testStringInit :: Universe -> [String]
|
testStringInit :: Universe -> [String]
|
||||||
testStringInit u = [show $ length <$> u ^.. uvWorld . cWorld . lWorld . lights]
|
testStringInit u = [show $ u ^? uvWorld . cWorld . lWorld . creatures . ix 0 .
|
||||||
|
crManipulation . manObject . imRootSelectedItem]
|
||||||
|
-- fromMaybe mempty $ do
|
||||||
|
-- cr <- u ^? uvWorld . cWorld . lWorld . creatures . ix 0
|
||||||
|
-- let itms = IM.elems $ cr ^. crInv
|
||||||
|
-- return $ map (show . (^? itLocation . ilIsSelected)) itms
|
||||||
|
--return . foldMap (prettyLDT (show . (^. _1 . itType))) . invLDT $ _crInv cr
|
||||||
|
|
||||||
-- [ show $ u ^? uvWorld . input . mouseContext . mcoSelEnd
|
-- [ show $ u ^? uvWorld . input . mouseContext . mcoSelEnd
|
||||||
-- , show $ u ^? uvWorld . hud . hudElement . diSelection
|
-- , show $ u ^? uvWorld . hud . hudElement . diSelection
|
||||||
-- , show $ u ^? uvWorld . input . mouseContext
|
-- , show $ u ^? uvWorld . input . mouseContext
|
||||||
|
|||||||
+1
-1
@@ -162,7 +162,7 @@ updateUniverseMid u = case _uvScreenLayers u of
|
|||||||
--updateParticles
|
--updateParticles
|
||||||
(cWorld . lWorld . radarBlips .~ [])
|
(cWorld . lWorld . radarBlips .~ [])
|
||||||
-- . updateIMl _props _pjUpdate
|
-- . updateIMl _props _pjUpdate
|
||||||
-- . updateLightSources
|
-- might want to clear temp light sources here?
|
||||||
. (cWorld . lWorld . lights .~ [])
|
. (cWorld . lWorld . lights .~ [])
|
||||||
. updateClouds
|
. updateClouds
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user