diff --git a/assets/misc/vending.kra b/assets/misc/vending.kra new file mode 100644 index 0000000..f8f6f1c Binary files /dev/null and b/assets/misc/vending.kra differ diff --git a/assets/misc/vending.png b/assets/misc/vending.png new file mode 100644 index 0000000..1511c95 Binary files /dev/null and b/assets/misc/vending.png differ diff --git a/src/Load.hs b/src/Load.hs index 34ef62c..de0bd21 100644 --- a/src/Load.hs +++ b/src/Load.hs @@ -63,7 +63,7 @@ loadFork -> MVar (Float, T.Text) -> IO () loadFork ws win glc nvg future progress = do - let stateSteps = 40 + let stateSteps = 41 increment = 1 / stateSteps SDL.glMakeCurrent win glc modifyMVar_ progress (return . (\(p, _) -> @@ -206,6 +206,11 @@ loadFork ws win glc nvg future progress = do , "Loading asset \"watercooler\"" ))) mmiscWatercooler <- createImage nvg (FileName "assets/misc/watercooler.png") 0 + modifyMVar_ progress (return . (\(p, _) -> + ( p + increment + , "Loading asset \"vending machine\"" + ))) + mmiscVending <- createImage nvg (FileName "assets/misc/vending.png") 0 let micons = [ mcontrblue, mcontrgreen, marrow ] @@ -221,7 +226,7 @@ loadFork ws win glc nvg future progress = do , mtablec1, mtablec2, mtablec3, mtablec4 , mmiscFlipchart , mmiscPlant1, mmiscPlant2 - , mmiscWatercooler + , mmiscWatercooler, mmiscVending ] when (any isNothing mimgs) $ do liftIO $logIO Error "Failed to load image assets" @@ -234,7 +239,7 @@ loadFork ws win glc nvg future progress = do -- (zipWith (\a b -> (a, [b])) [0..] $ [ImgIntrE .. ImgIntrN] ++ [ImgIntrNE]) let imgs = zipWith (\a b -> (a, fromJust b)) [ ImgWallAsc - .. ImgMiscWatercooler + .. ImgMiscVending ] mimgs icons = zipWith (\a b -> (a, fromJust b)) diff --git a/src/Types/Collidible.hs b/src/Types/Collidible.hs index 323c67c..3bab3ce 100644 --- a/src/Types/Collidible.hs +++ b/src/Types/Collidible.hs @@ -96,6 +96,9 @@ instance Collidible ImgId where collisionObstacle ImgMiscWatercooler = [ Boundaries (14/36, 14/36) (22/36, 22/36) ] + collisionObstacle ImgMiscVending = + [ Boundaries (0, 2/36) (24/36, 34/36) + ] collisionObstacle ImgEmptyNoWalk = [ Boundaries (0, 0) (0.99, 0.99) ] collisionObstacle _ = [] diff --git a/src/Types/ImgId.hs b/src/Types/ImgId.hs index 45bcb4d..a45bd08 100644 --- a/src/Types/ImgId.hs +++ b/src/Types/ImgId.hs @@ -34,6 +34,7 @@ data ImgId | ImgMiscPlant1 | ImgMiscPlant2 | ImgMiscWatercooler + | ImgMiscVending -- | ImgIntrNE -- | ImgIntrE -- | ImgIntrSE diff --git a/src/Types/Interior.hs b/src/Types/Interior.hs index f65f840..ec48ccd 100644 --- a/src/Types/Interior.hs +++ b/src/Types/Interior.hs @@ -27,6 +27,7 @@ data Cluster | ClusterPlant2 | ClusterToilet | ClusterWatercooler + | ClusterVending deriving (Enum, Bounded, Show) -- row -> NS; col -> WE @@ -112,6 +113,11 @@ clusterMat ClusterWatercooler _ = [ [ Just ImgMiscWatercooler ] , [ Just ImgEmpty ] ] +clusterMat ClusterVending _ = + M.fromLists + [ [ Just ImgMiscVending ] + , [ Just ImgEmpty ] + ] clusterRoom :: Cluster -> [TileState] clusterRoom ClusterBox1 = [Offi] @@ -128,6 +134,7 @@ clusterRoom ClusterPlant1 = [Offi] clusterRoom ClusterPlant2 = [Offi] clusterRoom ClusterToilet = [Toil] clusterRoom ClusterWatercooler = [Kitc, Offi] +clusterRoom ClusterVending = [Kitc] clusterPoints :: Cluster -> (Int, Int) -> [ReachPoint] clusterPoints ClusterBox1 _ = [] @@ -167,6 +174,9 @@ clusterPoints ClusterToilet _ = clusterPoints ClusterWatercooler _ = [ ReachPoint Drink (V2 2 1) NW ] +clusterPoints ClusterVending _ = + [ ReachPoint Eat (V2 2 1) NW + ] clusterPoints _ _ = [] instance Size (Cluster, (Int, Int)) where