Skip to content

Commit

Permalink
End Credits: delay slightly before beginning scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Sep 11, 2016
1 parent 8604d81 commit 352e5f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/gui/dialogs/end_credits.cpp
Expand Up @@ -56,7 +56,10 @@ tend_credits::~tend_credits()

void tend_credits::pre_show(twindow& window)
{
timer_id_ = add_timer(10, std::bind(&tend_credits::timer_callback, this, std::ref(window)), true);
// Delay a little before beginning the scrolling
add_timer(1000, [this](size_t) {
timer_id_ = add_timer(10, std::bind(&tend_credits::timer_callback, this), true);
});

#if 0
connect_signal_pre_key_press(window, std::bind(&tend_credits::key_press_callback, this, _3, _4, _5));
Expand Down Expand Up @@ -91,7 +94,7 @@ void tend_credits::pre_show(twindow& window)
}
}

void tend_credits::timer_callback(twindow&)
void tend_credits::timer_callback()
{
text_widget_->scroll_vertical_scrollbar(tscrollbar_::ITEM_FORWARD);
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/dialogs/end_credits.hpp
Expand Up @@ -46,7 +46,7 @@ class tend_credits : public tdialog
/** Inherited from tdialog. */
void pre_show(twindow& window);

void timer_callback(twindow&);
void timer_callback();
#if 0
void key_press_callback(bool&, bool&, const SDLKey key);
#endif
Expand Down

0 comments on commit 352e5f2

Please sign in to comment.