Simplify menu screens (no choice of display parameters)
This commit is contained in:
+13
-1
@@ -7,7 +7,6 @@ module Dodge.Concurrent (
|
||||
|
||||
import Data.Sequence (Seq (..))
|
||||
import Dodge.Data.Universe
|
||||
import Dodge.Menu.Loading
|
||||
import LensHelp
|
||||
|
||||
conEffects :: Universe -> ConcurrentEffect Universe
|
||||
@@ -53,3 +52,16 @@ blockingLoad str f u =
|
||||
--clearConcEff eff = do
|
||||
-- f <- eff
|
||||
-- return (f . (uvConcEffects .~ NoConcEffect))
|
||||
|
||||
loadingScreen :: String -> ScreenLayer
|
||||
loadingScreen str =
|
||||
OptionScreen
|
||||
{ _scTitle = str
|
||||
, _scOptions = mempty
|
||||
, _scOffset = 0
|
||||
, _scPositionedMenuOption = NoEscapeMenuOption
|
||||
, _scOptionFlag = LoadingScreen
|
||||
, _scSelectionList = mempty
|
||||
, _scAvailableLines = 0
|
||||
, _scDisplayTime = 0
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
module Dodge.Menu.Loading (
|
||||
loadingScreen,
|
||||
) where
|
||||
|
||||
import Dodge.Data.Universe
|
||||
import Dodge.ListDisplayParams
|
||||
|
||||
loadingScreen :: String -> ScreenLayer
|
||||
loadingScreen str =
|
||||
OptionScreen
|
||||
{ _scTitle = str
|
||||
, _scOptions = []
|
||||
, _scOffset = 0
|
||||
, _scPositionedMenuOption = NoEscapeMenuOption
|
||||
, _scOptionFlag = LoadingScreen
|
||||
, _scSelectionList = []
|
||||
, _scAvailableLines = 0
|
||||
-- , _scListDisplayParams = optionListDisplayParams
|
||||
, _scDisplayTime = 0
|
||||
}
|
||||
@@ -29,7 +29,6 @@ import Dodge.Flame
|
||||
import Dodge.Inventory
|
||||
import Dodge.Laser.Update
|
||||
import Dodge.LinearShockwave.Update
|
||||
import Dodge.ListDisplayParams
|
||||
import Dodge.Machine.Update
|
||||
import Dodge.Menu
|
||||
import Dodge.ModificationEffect
|
||||
@@ -371,7 +370,6 @@ getMenuMouseContext :: ScreenLayer -> Universe -> MouseContext
|
||||
getMenuMouseContext screen u = case screen ^. scOptions of
|
||||
[] -> NoMouseContext
|
||||
_ -> fromMaybe MouseMenuCursor $ do
|
||||
-- ldps <- screen ^? scListDisplayParams
|
||||
let ymax = maybe 0 length $ screen ^? scSelectionList
|
||||
yi <-
|
||||
ldpVerticalSelection
|
||||
|
||||
@@ -84,8 +84,5 @@ ldpVerticalSelection cfig ldp (V2 _ y)
|
||||
ylower = ceiling ((top - y) / yoff) - 1
|
||||
|
||||
setSelectionListRestriction :: Configuration -> ScreenLayer -> ScreenLayer
|
||||
setSelectionListRestriction cfig screen =
|
||||
screen & scAvailableLines %~ const (getAvailableListLines optionListDisplayParams cfig)
|
||||
-- fromMaybe screen $ do
|
||||
-- ldps <- screen ^? scListDisplayParams
|
||||
-- return $ screen & scAvailableLines %~ const (getAvailableListLines ldps cfig)
|
||||
setSelectionListRestriction cfig =
|
||||
scAvailableLines %~ const (getAvailableListLines optionListDisplayParams cfig)
|
||||
|
||||
Reference in New Issue
Block a user