Cleanup, add a slight border to ideal camera zoom
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
{-# LANGUAGE TupleSections #-}
|
||||
|
||||
module Dodge.Debug.Terminal where
|
||||
|
||||
import Dodge.Inventory
|
||||
import Data.Foldable
|
||||
--import Dodge.Item.Location.Initialize
|
||||
import Control.Applicative
|
||||
@@ -13,14 +15,12 @@ import Dodge.Creature
|
||||
import Dodge.Data.Universe
|
||||
import Dodge.Inventory.Add
|
||||
import Dodge.Item
|
||||
--import Dodge.Menu.PushPop
|
||||
--import qualified IntMapHelp as IM
|
||||
import LensHelp
|
||||
import MaybeHelp
|
||||
import Text.Read (readMaybe)
|
||||
|
||||
applyTerminalString :: [String] -> Universe -> Universe
|
||||
applyTerminalString ss = case ss of
|
||||
applyTerminalString = \case
|
||||
[] -> id
|
||||
[s] -> applyTerminalCommand s
|
||||
(s : ss') -> applyTerminalCommandArguments s ss'
|
||||
@@ -28,11 +28,16 @@ applyTerminalString ss = case ss of
|
||||
applyTerminalCommand :: String -> Universe -> Universe
|
||||
applyTerminalCommand s = case s of
|
||||
"NOCLIP" -> uvConfig . debug_booleans . at Noclip %~ toggleJust
|
||||
"GODON" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crType . avatarMaterial .~ Crystal
|
||||
"GODOFF" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crType . avatarMaterial .~ Flesh
|
||||
"GODON" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crType . avatarMaterial
|
||||
.~ Crystal
|
||||
"GODOFF" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crType . avatarMaterial
|
||||
.~ Flesh
|
||||
"CLEAR" -> \uv -> uv & uvWorld %~ destroyAllInvItems
|
||||
(uv ^?! uvWorld . cWorld . lWorld . creatures . ix 0)
|
||||
x -> fromMaybe (g x) $ do
|
||||
(ibt, n) <- parseItem [x]
|
||||
return $ uvWorld %~ flip (foldl' (&)) (replicate n ( createItemYou (itemFromBase ibt)))
|
||||
return $ uvWorld
|
||||
%~ flip (foldl' (&)) (replicate n ( createItemYou (itemFromBase ibt)))
|
||||
where
|
||||
g xs = uvWorld %~ \w -> foldl' (flip createItemYou) w (inventoryX xs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user