Skip to content

Commit

Permalink
Show timeout in QuestionView
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Klimek committed Oct 14, 2016
1 parent 8e44724 commit 3f1d671
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
7 changes: 2 additions & 5 deletions MovieQuiz/Controller/MainController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,8 @@ public void OnPlayerStateChange(int NewState)
public void OnTimerTick(object sender, EventArgs e)
{
timeleft--;
if (timeleft > 0)
{
view.ShowRemainingTime(timeleft);
}
else
view.ShowRemainingTime(timeleft);
if (timeleft <= 0)
{
timer.Stop();
view.ShowTimeout(quiz.Score);
Expand Down
14 changes: 14 additions & 0 deletions MovieQuiz/Views/QuestionView.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion MovieQuiz/Views/QuestionView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ internal void SetQuestion(List<string> answers, int questionNumber, int question
button.Click += onButtonClicked;
answerPanel.Controls.Add(button);
}

this.timeoutLabel.Text = String.Empty;
}

private void onButtonClicked(object sender, EventArgs e)
Expand All @@ -48,7 +50,7 @@ private void onButtonClicked(object sender, EventArgs e)

internal void ShowRemainingTime(int seconds)
{
// TODO
this.timeoutLabel.Text = seconds.ToString();
}
}
}

0 comments on commit 3f1d671

Please sign in to comment.