Factor out the game toolbars into a class.

This includes the following related or incidental changes:
* Remove the win_from_rects global variable. With one minor exception, they were all equal to the relevant render texture's size anyway.
* Split out time advancement from the handle_action function into a separate function
* Split out each individual button action into its own function
* Thanks to the above two, button actions triggered from the keyboard (and menu spells) no longer pass thru handle_action
* Side-effect: keyboard shortcuts and menu spells no longer trigger the button press animation
* Button presses now behave like proper buttons
* Button clicks are now grouped by effect in the handling code, rather than by index
* Removed a variable that mysteriously caused dialogue to become blank
This commit is contained in:
2020-01-30 00:00:40 -05:00
parent 1d61d48ec3
commit 4859fa70bc
12 changed files with 466 additions and 296 deletions

View File

@@ -24,13 +24,11 @@ void draw_startup(short but_type);
void draw_anim();
void place_anim();
void draw_start_button(eStartButton which_position,short which_button);
void main_button_click(int which_button);
void arrow_button_click(rectangle button_rect);
void end_startup();
void load_main_screen();
void redraw_screen(int refresh);
void put_background();
void draw_buttons(short mode);
void draw_text_bar();
void refresh_text_bar();
void put_text_bar(std::string str);