1 /*
2  * Dialogue to increase map size.
3  */
4 
5 #ifndef bigger_map_gui_h
6 #define bigger_map_gui_h
7 
8 #include "gui_frame.h"
9 #include "components/gui_label.h"
10 #include "components/action_listener.h"
11 #include "components/gui_numberinput.h"
12 #include "components/gui_map_preview.h"
13 
14 class settings_t;
15 
16 class enlarge_map_frame_t  : public gui_frame_t, private action_listener_t
17 {
18 private:
19 	// local settings of the new world ...
20 	settings_t* sets;
21 
22 	/**
23 	* Mini Map-Preview
24 	* @author Hj. Malthaner
25 	*/
26 	array2d_tpl<PIXVAL> map;
27 	gui_map_preview_t
28 		map_preview;
29 
30 	bool changed_number_of_towns;
31 
32 	gui_numberinput_t
33 		inp_x_size,
34 		inp_y_size,
35 		inp_number_of_towns,
36 		inp_town_size;
37 
38 	/*
39 	 * Label to display current map seed number.
40 	 */
41 	gui_label_buf_t	map_number_label;
42 
43 	button_t
44 		start_button;
45 
46 	gui_label_buf_t
47 		size_label; // memory requirement
48 
49 
50 public:
51 	static inline koord koord_from_rotation(settings_t const*, sint16 y, sint16 x, sint16 w, sint16 h);
52 
53 	enlarge_map_frame_t();
54 	~enlarge_map_frame_t();
55 
56 	/**
57 	* Calculate the new Map-Preview. Initialize the new RNG!
58 	* public, because also the climate dialog need it
59 	* @author Hj. Malthaner
60 	*/
61 	void update_preview();
62 
63 	bool action_triggered(gui_action_creator_t*, value_t) OVERRIDE;
64 
65 	/**
66 	 * Set the window associated helptext
67 	 * @return the filename for the helptext, or NULL
68 	 * @author Hj. Malthaner
69 	 */
get_help_filename()70 	const char * get_help_filename() const OVERRIDE { return "enlarge_map.txt";}
71 
72 	/**
73 	 * Draw new component. The values to be passed refer to the window
74 	 * i.e. It's the screen coordinates of the window where the
75 	 * component is displayed.
76 	 * @author Hj. Malthaner
77 	 */
78 	void draw(scr_coord pos, scr_size size) OVERRIDE;
79 };
80 
81 #endif
82