Skip to content

Commit

Permalink
level completed message in editor
Browse files Browse the repository at this point in the history
  • Loading branch information
joneugster committed Feb 14, 2024
1 parent 780514e commit 3775ad9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/src/components/infoview/goals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ interface GoalsProps {

export function Goals({ goals, filter }: GoalsProps) {
if (goals.goals.length === 0) {
return <>No goals</>
return <></>
} else {
return <>
{goals.goals.map((g, i) => <Goal typewriter={false} key={i} goal={g.goal} filter={filter} />)}
Expand Down
6 changes: 5 additions & 1 deletion client/src/components/infoview/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,11 @@ export function Main(props: { world: string, level: number, data: LevelInfo}) {
ret = <div><p>{serverStoppedResult.message}</p><p className="error">{serverStoppedResult.reason}</p></div>
} else {
ret = <div className="infoview vscode-light">
{proof.completed && <div className="level-completed">Level completed! 🎉</div>}
{proof.completedWithWarnings &&
<div className="level-completed">
{proof.completed ? "Level completed! 🎉" : "Level completed with warnings 🎭"}
</div>
}
<Infos />
<Hints hints={proof.steps[curPos?.line]?.goals[0]?.hints}
showHidden={showHelp.has(curPos?.line)} step={curPos?.line}
Expand Down
7 changes: 7 additions & 0 deletions client/src/css/infoview.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@
.level-completed {
font-size: 1.8rem;
font-weight: 500;
padding-left: .5em;
padding-right: .5em;
padding-top: .2em;
padding-bottom: .2em;
border-radius: .5em;
background-color: #eee;

}

.typewriter {
Expand Down

0 comments on commit 3775ad9

Please sign in to comment.