Simplify menu screens (no choice of display parameters)

This commit is contained in:
2025-01-07 01:03:12 +00:00
parent fe3e0b1373
commit 4a9c1cd6b3
4 changed files with 15 additions and 28 deletions
+13 -1
View File
@@ -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
}
-20
View File
@@ -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
}
-2
View File
@@ -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
+2 -5
View File
@@ -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)