Improve mouse menu controls, tweak charmap

This commit is contained in:
2022-12-21 11:33:11 +00:00
parent 860d63df45
commit 03c945d189
12 changed files with 68 additions and 50 deletions
+16 -14
View File
@@ -1,7 +1,7 @@
module Dodge.Menu.Option
where
--import Dodge.ScodeToChar
import Data.Maybe
--import Data.Maybe
import Dodge.WindowLayout
import Padding
import Picture.Base
@@ -18,11 +18,13 @@ slTitleOptionsEff title ops defstr eff u =
, _scOptions = ops
, _scMaybeOption = fmap (Toggle eff . const . MODString) defstr
, _scOptionFlag = NormalOptions
, _scSelectionList = makeOptionsSelectionList (Just 0) u ops defstr
, _scSelectionList = makeOptionsSelectionList (Just 0) u ops
}
makeOptionsSelectionList :: Maybe Int -> Universe -> [MenuOption] -> Maybe String -> SelectionList
makeOptionsSelectionList mselpos u mos defstr = SelectionList
--makeOptionsSelectionList :: Maybe Int -> Universe -> [MenuOption] -> Maybe String -> SelectionList
--makeOptionsSelectionList mselpos u mos defstr = SelectionList
makeOptionsSelectionList :: Maybe Int -> Universe -> [MenuOption] -> SelectionList
makeOptionsSelectionList mselpos u mos = SelectionList
{ _slPosX = 50
, _slPosY = 50
, _slOffset = 0
@@ -36,16 +38,16 @@ makeOptionsSelectionList mselpos u mos defstr = SelectionList
, _slLength = length $ optionsToSelections u mos
, _slSizeRestriction = SelectionSizeRestriction (availableMenuLines cfig) overflowit overflowit
(SSRFromScreenBottom 5)
, _slSpecialItem = fromMaybe NoSpecialSelectionItem $ do
str <- defstr
return $ BottomSelectionItem SelectionItem
{ _siPictures = [color white $ text str]
, _siHeight = 1
, _siIsSelectable = True
, _siWidth = length str
, _siColor = white
, _siOffX = 0
}
-- , _slSpecialItem = fromMaybe NoSpecialSelectionItem $ do
-- str <- defstr
-- return $ BottomSelectionItem SelectionItem
-- { _siPictures = [color white $ text str]
-- , _siHeight = 1
-- , _siIsSelectable = True
-- , _siWidth = length str
-- , _siColor = white
-- , _siOffX = 0
-- }
}
where
cfig = u ^. uvConfig