Rename help text-> footer text, rename tractor param

This commit is contained in:
2022-03-20 18:13:34 +00:00
parent d19bd5c327
commit ff93d1d041
5 changed files with 47 additions and 44 deletions
+5 -6
View File
@@ -5,7 +5,7 @@ module Dodge.Event.Menu
where
import Dodge.Data
import Dodge.Debug.Terminal
import Dodge.Menu
--import Dodge.Menu
import Dodge.Menu.PushPop
import Data.Maybe
@@ -13,12 +13,12 @@ import Control.Monad
--import Control.Lens
import SDL
import Control.Lens ((%~))
import qualified Debug.Trace
--import qualified Debug.Trace
handleTextInMenu :: ScreenLayer -> [Char] -> Universe -> IO (Maybe Universe)
handleTextInMenu mState text = case mState of
InputScreen s help-> return . (popScreen' >=> pushScreen' (InputScreen new_text help))
InputScreen s help -> return . (popScreen' >=> pushScreen' (InputScreen new_text help))
where
new_text
-- Text events occur after key events so ignore the first
@@ -27,7 +27,6 @@ handleTextInMenu mState text = case mState of
| otherwise = s ++ text
_ -> return . Just
handlePressedKeyInMenu :: ScreenLayer -> Scancode -> Universe -> IO (Maybe Universe)
handlePressedKeyInMenu mState scode = case mState of
OptionScreen { _scOptions = mos, _scDefaultEff = defeff}
@@ -35,7 +34,7 @@ handlePressedKeyInMenu mState scode = case mState of
DisplayScreen {} -> popScreen
ColumnsScreen {} -> popScreen
WaitScreen {} -> return . Just
InputScreen s help -> case scode of
InputScreen s help -> case scode of
ScancodeEscape -> popScreen
-- Remove the menu layer (we readd it in applyTerminalString if the commmand fails)
ScancodeReturn -> return. Just . applyTerminalString (tail s) . (menuLayers %~ tail)
@@ -45,7 +44,7 @@ handlePressedKeyInMenu mState scode = case mState of
-- Ignore (text input now handled by handleText)
_ -> return . (popScreen' >=> pushScreen' (InputScreen s help))
where
dropLast [x] = ['>']
dropLast [_] = ['>']
dropLast (x:xs) = init (x:xs)
dropLast _ = ['>']