From 218d0736defc167948a10b39df7ca58952a94c30 Mon Sep 17 00:00:00 2001 From: mbays Date: Sun, 13 Dec 2020 00:00:00 +0000 Subject: [PATCH] indicate initlock solvedness in hover strings --- SDLUI.hs | 14 ++++++++------ SDLUIMInstance.hs | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/SDLUI.hs b/SDLUI.hs index a0e708a..032007a 100644 --- a/SDLUI.hs +++ b/SDLUI.hs @@ -212,8 +212,8 @@ markButtonGroup = ([Button (tl+^hw) CmdMark [("set",hu+^neg hw),("mark",hu+^neg data AccessedInfo = AccessedSolved | AccessedPublic | AccessedReadNotes | AccessedUndeclared deriving (Eq, Ord, Show) data Selectable = SelOurLock - | SelTut - | SelInitLock HexVec + | SelTut Bool + | SelInitLock HexVec Bool | SelLock ActiveLock | SelLockUnset Bool ActiveLock | SelSelectedCodeName Codename @@ -254,8 +254,8 @@ registerUndoButtons noUndo noRedo = do unless noUndo $ registerButton (periphery 2+^hu) CmdUndo 0 [("undo",hu+^neg hw)] unless noRedo $ registerButton (periphery 2+^hu+^neg hv) CmdRedo 2 [("redo",hu+^neg hw)] -commandOfSelectable IMInit SelTut _ = Just . CmdSolveInit $ Just zero -commandOfSelectable IMInit (SelInitLock v) _ = Just . CmdSolveInit $ Just v +commandOfSelectable IMInit (SelTut _) _ = Just . CmdSolveInit $ Just zero +commandOfSelectable IMInit (SelInitLock v _) _ = Just . CmdSolveInit $ Just v commandOfSelectable IMMeta SelOurLock _ = Just CmdEdit commandOfSelectable IMMeta (SelLock (ActiveLock _ i)) False = Just $ CmdSolve (Just i) commandOfSelectable IMMeta (SelLock (ActiveLock _ i)) True = Just $ CmdPlaceLock (Just i) @@ -286,8 +286,10 @@ commandOfSelectable IMTextInput (SelRandom name) _ = Just $ CmdInputCodename nam commandOfSelectable IMTextInput (SelUndeclared undecl) _ = Just $ CmdInputSelUndecl undecl commandOfSelectable _ _ _ = Nothing -helpOfSelectable SelTut = Just "Enter tutorials" -helpOfSelectable (SelInitLock _) = Just "Solve lock" +helpOfSelectable (SelTut False) = Just "Enter tutorials" +helpOfSelectable (SelTut True) = Just "Revisit tutorials" +helpOfSelectable (SelInitLock _ False) = Just "Attempt lock" +helpOfSelectable (SelInitLock _ True) = Just "Revisit solved lock" helpOfSelectable SelOurLock = Just "Design a lock." helpOfSelectable (SelSelectedCodeName name) = Just $ diff --git a/SDLUIMInstance.hs b/SDLUIMInstance.hs index a52ee1f..f8b94ce 100644 --- a/SDLUIMInstance.hs +++ b/SDLUIMInstance.hs @@ -506,7 +506,7 @@ drawMainState' InitState {initLocks=initLocks, tutProgress=TutProgress{tutSolved | otherwise = Just True == (initLockSolved <$> Map.lookup v accessible) drawInitLock v = do let pos = tutPos +^ 2 *^ v - drawNameCol (name v) pos $ if solved v then brightish purple else brightish green + drawNameCol (name v) pos $ if solved v then brightish green else brightish yellow renderToMain $ sequence_ [ (if open then PathGlyph h $ brightish white else GateGlyph h $ (if inbounds then dim else bright) white) @@ -516,7 +516,7 @@ drawMainState' InitState {initLocks=initLocks, tutProgress=TutProgress{tutSolved , let inbounds = abs (hy v') < 2 && hx v' >= 0 && hz v' <= 0 , (v' `notElem` Map.keys accessible) || h `elem` [hu, neg hw, neg hv] , let open = inbounds && (solved v || solved v') ] - registerSelectable pos 0 $ if v == zero then SelTut else SelInitLock v + registerSelectable pos 0 $ if v == zero then SelTut (solved v) else SelInitLock v (solved v) drawMainState' MetaState {curServer=saddr, undeclareds=undecls, cacheOnly=cOnly, curAuth=auth, codenameStack=names, randomCodenames=rnamestvar, retiredLocks=mretired, curLockPath=path, -- 2.11.4.GIT