1 | /********************************************************************** <BR>
|
---|
2 | This file is part of Crack dot Com's free source code release of
|
---|
3 | Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
|
---|
4 | information about compiling & licensing issues visit this URL</a>
|
---|
5 | <PRE> If that doesn't help, contact Jonathan Clark at
|
---|
6 | golgotha_source@usa.net (Subject should have "GOLG" in it)
|
---|
7 | ***********************************************************************/
|
---|
8 |
|
---|
9 | #ifndef G1_TIME_MODE_HH
|
---|
10 | #define G1_TIME_MODE_HH
|
---|
11 |
|
---|
12 | #include "editor/mode/e_mode.hh"
|
---|
13 | #include "editor/dialogs/tile_picker.hh"
|
---|
14 | #include "rotation.hh"
|
---|
15 |
|
---|
16 | class g1_map_vertex_class;
|
---|
17 |
|
---|
18 | class g1_tile_mode : public g1_mode_handler
|
---|
19 | {
|
---|
20 | float vert_exact_z;
|
---|
21 | g1_map_vertex_class *move_pivot;
|
---|
22 | i4_bool focus_visible;
|
---|
23 |
|
---|
24 | public:
|
---|
25 | virtual void mouse_down();
|
---|
26 | virtual void mouse_move(sw32 mx, sw32 my);
|
---|
27 |
|
---|
28 | virtual i4_bool select_object(sw32 mx, sw32 my,
|
---|
29 | i4_float &ox, i4_float &oy, i4_float &oz,
|
---|
30 | select_modifier mod);
|
---|
31 |
|
---|
32 | virtual void select_objects_in_area(sw32 x1, sw32 y1, sw32 x2, sw32 y2,
|
---|
33 | select_modifier mod);
|
---|
34 |
|
---|
35 | virtual void move_selected(i4_float xc, i4_float yc, i4_float zc,
|
---|
36 | sw32 mouse_x, sw32 mouse_y);
|
---|
37 |
|
---|
38 | virtual void hide_focus();
|
---|
39 | virtual void show_focus();
|
---|
40 |
|
---|
41 | virtual state current_state();
|
---|
42 | virtual void key_press(i4_key_press_event_class *kev);
|
---|
43 |
|
---|
44 | g1_tile_mode(g1_controller_edit_class *c);
|
---|
45 |
|
---|
46 | };
|
---|
47 |
|
---|
48 |
|
---|
49 | class g1_tile_params : public g1_mode_creator
|
---|
50 | {
|
---|
51 | void refresh_picker();
|
---|
52 | i4_parent_window_class *picker_mp_window;
|
---|
53 | i4_event_handler_reference_class<g1_tile_picker_class> picker;
|
---|
54 | i4_event_handler_reference_class<i4_parent_window_class> mp_window;
|
---|
55 | g1_rotation_type current_cell_rotation;
|
---|
56 | i4_bool mirrored;
|
---|
57 | int vert_move_snap; // number of units to move a vert when dragging
|
---|
58 | w16 current_cell_type;
|
---|
59 |
|
---|
60 | g1_scroll_picker_info picker_info;
|
---|
61 |
|
---|
62 | public:
|
---|
63 | g1_tile_params();
|
---|
64 | char *name() { return "TILE"; }
|
---|
65 |
|
---|
66 | enum
|
---|
67 | { ROTATE,
|
---|
68 | ZOOM,
|
---|
69 | PLACE,
|
---|
70 | FILL,
|
---|
71 | HEIGHT
|
---|
72 | };
|
---|
73 |
|
---|
74 |
|
---|
75 | g1_rotation_type get_cell_rotation() { return current_cell_rotation; }
|
---|
76 | void set_cell_rotation(g1_rotation_type rot) { current_cell_rotation=rot; refresh_picker(); }
|
---|
77 |
|
---|
78 | i4_bool get_mirrored() { return mirrored; }
|
---|
79 | void set_mirrored(i4_bool value) { mirrored=value; refresh_picker(); }
|
---|
80 |
|
---|
81 | w16 get_cell_type() { return current_cell_type; }
|
---|
82 | void set_cell_type(w16 type) { current_cell_type=type; refresh_picker(); }
|
---|
83 |
|
---|
84 |
|
---|
85 | enum { HEIGHT_ONLY=1 } modifer_flags;
|
---|
86 |
|
---|
87 | void create_buttons(i4_parent_window_class *container);
|
---|
88 |
|
---|
89 | g1_mode_handler *create_mode_handler(g1_controller_edit_class *c)
|
---|
90 | { return new g1_tile_mode(c); }
|
---|
91 |
|
---|
92 | i4_bool allow_picker_creation() { return picker.get()==0; }
|
---|
93 |
|
---|
94 | void open_picker();
|
---|
95 | void cleanup();
|
---|
96 |
|
---|
97 |
|
---|
98 | } ;
|
---|
99 |
|
---|
100 | extern g1_tile_params g1_e_tile;
|
---|
101 |
|
---|
102 |
|
---|
103 |
|
---|
104 | #endif
|
---|