Story Viewer: fix stack background disappearing when pressing Next when fading in (fixes #1687)

This commit is contained in:
Charles Dang 2017-05-22 14:20:34 +11:00
parent 57d825d114
commit 8a1f292222
2 changed files with 9 additions and 1 deletions

View file

@ -361,6 +361,7 @@ void story_viewer::nav_button_callback(window& window, NAV_DIRECTION direction)
// Only set full alpha if Forward was pressed.
if(direction == DIR_FORWARD) {
find_widget<scroll_label>(&window, "part_text", false).set_text_alpha(ALPHA_OPAQUE);
flag_stack_as_dirty(window);
return;
}
}
@ -457,7 +458,7 @@ void story_viewer::draw_callback(window& window)
find_widget<scroll_label>(&window, "part_text", false).set_text_alpha(new_alpha);
// The text stack also needs to be marked dirty so the background panel redraws correctly.
find_widget<stacked_widget>(&window, "text_and_control_stack", false).set_is_dirty(true);
flag_stack_as_dirty(window);
if(fade_state_ == FADING_IN) {
fade_step_ ++;
@ -468,5 +469,10 @@ void story_viewer::draw_callback(window& window)
set_next_draw();
}
void story_viewer::flag_stack_as_dirty(window& window)
{
find_widget<stacked_widget>(&window, "text_and_control_stack", false).set_is_dirty(true);
}
} // namespace dialogs
} // namespace gui2

View file

@ -69,6 +69,8 @@ private:
void draw_callback(window& window);
void flag_stack_as_dirty(window& window);
storyscreen::controller controller_;
int part_index_;