59 set_background(*theme);
62 set_trans_background(
true);
66 image_list->
move (10, 0);
67 image_list->
resize (250, 210);
68 image_list->set_mode (win_select::MODE_BRIGHTNESS);
69 image_list->set_layout (win_container::LIST_LAYOUT);
70 image_list->set_circle (
true);
71 image_list->set_space_with_border (9);
72 image_list->set_space_with_object (9);
74 image_list->set_scrollbar (*theme);
75 image_list->set_visible_scrollbar (
true);
81 set_focus_object (image_list);
83 image_list->set_signal_connect (
84 makeFunctor (*
this, &data_screen::on_select),
85 win_event::ACTIVATE_KEY);
94 set_visible_background (
true);
95 set_visible_border (
true);
96 set_visible_all (
true);
102 if (mode == LOAD_SCREEN && !aborted && data::engine->update_map()) data::engine->
fade_in ();
105 void data_screen::init ()
120 filepath +=
"/preview.pnm";
123 shot->image::load_pnm (filepath);
125 shot->set_border (*theme, win_border::MINI);
126 shot->set_visible_border (
true);
131 ((
label*)date)->resize (130, 14);
132 date->set_font (*yellow);
133 date->set_text (gdata->
gametime ());
134 date->set_cursor_visible (
false);
138 entry->
move (100, 18);
140 entry->set_font (*font);
142 entry->set_cursor_visible (
false);
145 entry_list.push_back (entry);
153 box->set_visible_all (
true);
157 box->set_focus_object (entry);
159 image_list->add (box);
165 if (mode == SAVE_SCREEN)
172 shot->load_pnm (
"gfx/empty_slot.pnm");
173 shot->set_border (*theme, win_border::MINI);
174 shot->set_visible_border (
true);
179 ((
label*)date)->resize (130, 14);
180 date->set_font (*yellow);
182 date->set_cursor_visible (
false);
186 entry->set_font (*font);
187 entry->
move (100, 18);
189 entry->set_text (
"Empty Slot");
190 entry->set_cursor_visible (
false);
193 entry_list.push_back (entry);
201 box->set_visible_all (
true);
205 box->set_focus_object(entry);
207 image_list->add (box);
208 image_list->set_default_object (box);
212 else image_list->set_default_position (0);
222 mess->set_font (*font);
224 mess->set_form (label::AUTO_SIZE);
225 mess->set_text (
"You have no saved games yet!");
226 mess->
set_align (win_base::ALIGN_CENTER);
231 mess->set_font (*font);
233 mess->set_form (label::AUTO_SIZE);
234 mess->set_text (
"Press ESC.");
235 mess->
set_align (win_base::ALIGN_CENTER);
239 box->set_visible_all (
true);
242 image_list->add (box);
258 void data_screen::on_select ()
260 int pos = image_list->get_selected_position ();
263 if (mode == LOAD_SCREEN)
275 image_list->set_focus_object(tmp);
277 entry = (
win_write*) tmp->focus_object();
278 entry->set_cursor_visible (
true);
279 entry->set_cursor_moveable (
true);
281 const char *txt = entry->text_char ();
282 if (txt && !strncmp (txt,
"Empty Slot", 10))
283 entry->set_text (
"");
285 entry->set_signal_connect (makeFunctor (*
this, &data_screen::on_save),
286 win_event::ACTIVATE_KEY);
292 void data_screen::on_save ()
294 const char* description = entry->text_char ();
295 int pos = image_list->get_selected_position ();
304 filepath +=
"/preview.pnm";
305 save_preview (filepath);
312 void data_screen::save_preview (
string path)
316 image preview (72, 54);
320 (data::the_player->submap ());
343 else if (x - length < 0) x = 0;
347 else if (y - height < 0) y = 0;
350 data::engine->
draw (x, y, &da, &temp);
352 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...