55 set_background(*theme);
58 set_trans_background(
true);
62 image_list->
move (10, 0);
63 image_list->
resize (250, 210);
64 image_list->set_mode (win_select::MODE_BRIGHTNESS);
65 image_list->set_layout (win_container::LIST_LAYOUT);
66 image_list->set_circle (
true);
67 image_list->set_space_with_border (9);
68 image_list->set_space_with_object (9);
70 image_list->set_scrollbar (*theme);
71 image_list->set_visible_scrollbar (
true);
77 set_focus_object (image_list);
79 image_list->set_signal_connect (
80 makeFunctor (*
this, &data_screen::on_select),
81 win_event::ACTIVATE_KEY);
90 set_visible_background (
true);
91 set_visible_border (
true);
92 set_visible_all (
true);
98 if (mode == LOAD_SCREEN && !aborted) data::engine->
fade_in ();
101 void data_screen::init ()
116 filepath +=
"/preview.pnm";
119 shot->image::load_pnm (filepath);
121 shot->set_border (*theme, win_border::MINI);
122 shot->set_visible_border (
true);
127 ((
label*)date)->resize (130, 14);
128 date->set_font (*yellow);
129 date->set_text (gdata->
gametime ());
130 date->set_cursor_visible (
false);
134 entry->
move (100, 18);
136 entry->set_font (*font);
138 entry->set_cursor_visible (
false);
141 entry_list.push_back (entry);
149 box->set_visible_all (
true);
153 box->set_focus_object (entry);
155 image_list->add (box);
161 if (mode == SAVE_SCREEN)
168 shot->load_pnm (
"gfx/empty_slot.pnm");
169 shot->set_border (*theme, win_border::MINI);
170 shot->set_visible_border (
true);
175 ((
label*)date)->resize (130, 14);
176 date->set_font (*yellow);
178 date->set_cursor_visible (
false);
182 entry->set_font (*font);
183 entry->
move (100, 18);
185 entry->set_text (
"Empty Slot");
186 entry->set_cursor_visible (
false);
189 entry_list.push_back (entry);
197 box->set_visible_all (
true);
201 box->set_focus_object(entry);
203 image_list->add (box);
204 image_list->set_default_object (box);
208 else image_list->set_default_position (0);
218 mess->set_font (*font);
220 mess->set_form (label::AUTO_SIZE);
221 mess->set_text (
"You have no saved games yet!");
222 mess->
set_align (win_base::ALIGN_CENTER);
227 mess->set_font (*font);
229 mess->set_form (label::AUTO_SIZE);
230 mess->set_text (
"Press ESC.");
231 mess->
set_align (win_base::ALIGN_CENTER);
235 box->set_visible_all (
true);
238 image_list->add (box);
254 void data_screen::on_select ()
256 int pos = image_list->get_selected_position ();
259 if (mode == LOAD_SCREEN)
271 image_list->set_focus_object(tmp);
273 entry = (
win_write*) tmp->focus_object();
274 entry->set_cursor_visible (
true);
275 entry->set_cursor_moveable (
true);
277 const char *txt = entry->text_char ();
278 if (txt && !strncmp (txt,
"Empty Slot", 10))
279 entry->set_text (
"");
281 entry->set_signal_connect (makeFunctor (*
this, &data_screen::on_save),
282 win_event::ACTIVATE_KEY);
288 void data_screen::on_save ()
290 const char* description = entry->text_char ();
291 int pos = image_list->get_selected_position ();
300 filepath +=
"/preview.pnm";
301 save_preview (filepath);
308 void data_screen::save_preview (
string path)
312 image preview (72, 54);
316 (data::the_player->submap ());
339 else if (x - length < 0) x = 0;
343 else if (y - height < 0) y = 0;
346 data::engine->
draw (x, y, &da, &temp);
348 preview.save_pnm (path);
u_int16 height() const
Returns the height of the drawing_area.
static bool save(u_int32 pos, string desc, string time)
Save a game.
void fade_in()
Fades in from a black screen.
static win_font * get_font(string name)
Returns a pointer to a font.
virtual void move(s_int16 tx, s_int16 ty)
Move the win_*.
u_int16 length() const
Returns the length of the drawable.
u_int16 posx() const
Returns the X position of the mapcharacter.
void fade_out()
Fades the screen to black.
const char * description()
Returns the description of the saved game.
static bool load(u_int32 pos)
Loads a previously saved game.
#define u_int16
16 bits long unsigned integer
const char * directory()
A bunch of methods to access the private attributes.
static win_theme * get_theme(string name)
Returns a pointer to a theme.
u_int16 area_height() const
Returns the height of the area.
void set_visible(const bool b)
Set the visible parameter.
void draw(s_int16 x, s_int16 y, drawing_area *da_opt=NULL, surface *target=NULL)
static u_int16 hour()
Return the hour of the current day.
~data_screen()
Destructor.
Image manipulation class.
Declares the gametime class.
void resize(u_int16, u_int16)
Rezise the win_*.
static u_int16 length()
Returns the length of the screen.
Tehe gametime class makes the speed of the game independent of the machine it runs on...
s_int16 y() const
Return the relative vertical position of the win_*.
void move(s_int16, s_int16)
Move the win_*.
u_int16 area_length() const
Returns the length of the area.
mapsquare_area * get_submap(u_int16 pos)
Returns a pointer to a submap belonging to this landmap.
static gamedata * next_save()
Returns a pointer to the next saved game.
void main_quit()
Quit the main loop.
static u_int16 day()
Returns the current day in the gameworld.
Declares the image class.
u_int16 length() const
Returns the length of the drawing_area.
static u_int16 minute()
Return the minute of the current hour.
Declares the data_screen class.
Allows you to display a landmap on a specified area of a surface.
u_int16 posx() const
Returns the X position of the mapview.
Declares the gamedata and data classes.
u_int16 posy() const
Returns the Y position of the mapcharacter.
Implements "drawing zones" for drawing operations.
Declares the gamedate class.
u_int16 height() const
Returns the height of the drawable.
#define s_int16
16 bits long signed integer
void set_align(const u_int8 a)
Set alignement of win_*.
data_screen(int m)
Constructor.
static gamedata * get_saved_game(u_int32 pos)
Returns a pointer to a saved game.
A* pathfinding algorithm implementation class.
void set_can_be_selected(const bool b)
Set the object to be selected A win_obj can be selectable or not when it is inside a win_select...
const u_int16 MAPSQUARE_SIZE
Size of a mapsquare (in pixels).
bool update()
React to input.
Declares the pnm static class.
const char * gametime()
Returns the in-game time of the saved game.
u_int16 posy() const
Returns the Y position of the mapview.
Declares the win_manager class.
virtual bool update()
Update process.
s_int16 x() const
Return the relative horizontal position of the win_*.
void set_activate(const bool b)
Set the activate parameter When a win_* is setup on, the keys queue is cleared.
static u_int16 height()
Returns the height of the screen.
Area of mapsquares, for use with landmap.
Contains all the attributes related to a saved game and the high level methods for loading/saving the...