Adonthell  0.4
dialog_screen Class Reference

Allows the running of dialogues through a nice interface. More...

#include <dialog_screen.h>

Inheritance diagram for dialog_screen:
Collaboration diagram for dialog_screen:

Public Member Functions

 dialog_screen (character_base *mynpc, char *dlg_file, u_int8 size=1)
 Constructor.
 ~dialog_screen ()
 Destructor.
void init (character_base *mynpc, char *dlg_file, u_int8 size=1)
 Inits the dialogue engine (similar to a constructor call).
void set_portrait (const string &new_portrait)
 Changes the displayed NPC portrait.
void set_name (const string &new_name)
 Changes the displayed NPC name.
void set_npc (const string &new_npc)
 Changes the whole NPC.
bool update ()
 React to (keyboard) input.
void run ()
 Execute one step of the dialogue.
- Public Member Functions inherited from win_container
void move (s_int16, s_int16)
 Move the win_*.
void resize (u_int16, u_int16)
 Rezise the win_*.
virtual void add (win_base *)
virtual void remove (win_base *)
virtual void remove_all ()
virtual void destroy ()
virtual bool input_update ()
 Input Update process
virtual bool draw ()
 Draw process.
void set_visible_all (bool b)
virtual void set_brightness (bool b)
 Set the transluency parameter.
virtual void set_trans (bool b)
 Set the transluency parameter.
virtual void set_space_with_border (u_int16 b)
virtual void set_space_with_object (u_int16 o)
u_int16 space_with_border ()
u_int16 space_with_object ()
void set_layout (u_int8 l)
void set_focus_object (win_base *f)
win_basefocus_object ()
- Public Member Functions inherited from win_base
 win_base ()
 Default constructor:
s_int16 x () const
 Return the relative horizontal position of the win_*.
s_int16 y () const
 Return the relative vertical position of the win_*.
s_int16pad_x ()
 Return the pad horizontal position of the win_*.
s_int16pad_y ()
 Return the pad vertical position of the win_*.
s_int16 real_x () const
 Return the horizontal position of the win_*.
s_int16 real_y () const
 Return the vertical position of the win_*.
bool is_visible () const
 Test if win_* is visible.
void set_visible (const bool b)
 Set the visible parameter.
bool is_activate () const
 Test if win_* is activated.
void set_activate (const bool b)
 Set the activate parameter When a win_* is setup on, the keys queue is cleared.
bool is_focus () const
 Test if win_* has focus on.
void set_focus (const bool b)
 Set the focus parameter.
bool is_trans () const
 Test if win_* has focus on.
bool is_brightness () const
 Test if win_* is in brightness.
void set_align (const u_int8 a)
 Set alignement of win_*.
u_int8 align () const
 Return alignment of win_*.
bool is_can_be_selected () const
 Test if win_* can be selected.
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.
void set_manager (win_manager *)
- Public Member Functions inherited from win_event
void set_return_code (int rc)
void set_signal_connect (const Functor0 &func, u_int8 signal)
void set_callback_destroy (const Functor0wRet< bool > &func)
void set_callback_quit (const Functor1< int > &func)
void py_signal_connect (PyObject *pyfunc, int signal, PyObject *args=NULL)
- Public Member Functions inherited from win_border
 win_border (win_base *wb)
 win_border (win_border &)
 win_border (char *rep, const char *size=WIN_BORDER_NORMAL_SIZE)
void load (char *, const char *)
void draw (drawing_area *da)
void set_visible_border (bool b)
void set_brightness_border (bool b)
void set_border (win_border &)
void set_border (win_theme &wth, u_int8 size=win_border::NORMAL)
void set_trans_border (bool b)
u_int16 length_border ()
u_int16 height_border ()
- Public Member Functions inherited from drawing_area
 drawing_area ()
 Default constructor.
 drawing_area (s_int16 px, s_int16 py, u_int16 pw, u_int16 ph)
 Builds a drawing_area from the parameters.
u_int16 length () const
 Returns the length of the drawing_area.
u_int16 height () const
 Returns the height of the drawing_area.
void assign_drawing_area (const drawing_area *da)
 Assign a drawing_area to this drawing_area.
drawing_areaassigned_drawing_area () const
 Returns a pointer to the drawing_area assigned to this one.
void detach_drawing_area ()
 Detach (if needed) the drawing_area which was attached to this one.
drawing_areaoperator= (SDL_Rect &r)
 Convert an SDL_Rect into a drawing_area.
SDL_Rect setup_rects () const
 Gets the real parameters of this drawing_area.
- Public Member Functions inherited from win_background
 win_background (win_base *)
 win_background (win_background &)
 win_background (char *rep)
void load (char *)
void draw (drawing_area *da=NULL)
void set_visible_background (bool b)
void set_background (win_background &)
void set_background (win_theme &wt)
void set_brightness_background (bool b)
void set_trans_background (bool b)

Additional Inherited Members

- Static Public Attributes inherited from win_container
static const u_int8 SPACE_WITH_BORDER = 10
static const u_int8 SPACE_WITH_OBJECT = 10
static const u_int8 LIST_LAYOUT = 1
static const u_int8 NO_LAYOUT = 0
- Protected Member Functions inherited from win_container
void update_position ()
void update_layout ()
- Protected Attributes inherited from win_container
u_int16 space_with_object_
u_int16 space_with_border_
u_int8 layout_
lwb list_wb_
win_basefocus_object_

Detailed Description

Allows the running of dialogues through a nice interface.

Definition at line 44 of file dialog_screen.h.

Constructor & Destructor Documentation

dialog_screen::dialog_screen ( character_base mynpc,
char *  dlg_file,
u_int8  size = 1 
)

Constructor.

Parameters
mynpcnpc the player is talking with.
dlg_filedialogue file to use.
sizeif 1, use a large window, else a small one.

Definition at line 39 of file dialog_screen.cc.

dialog_screen::~dialog_screen ( )

Destructor.

Definition at line 152 of file dialog_screen.cc.

Member Function Documentation

void dialog_screen::init ( character_base mynpc,
char *  dlg_file,
u_int8  size = 1 
)

Inits the dialogue engine (similar to a constructor call).

Parameters
mynpcnpc the player is talking with.
dlg_filedialogue file to use.
sizeif 1, use a large window, else a small one.

Definition at line 44 of file dialog_screen.cc.

void dialog_screen::set_portrait ( const string &  new_portrait)

Changes the displayed NPC portrait.

Parameters
new_portraitfile name of the new portrait image to set.

Definition at line 241 of file dialog_screen.cc.

void dialog_screen::set_name ( const string &  new_name)

Changes the displayed NPC name.

Parameters
char*new name of the npc.

Definition at line 258 of file dialog_screen.cc.

void dialog_screen::set_npc ( const string &  new_npc)

Changes the whole NPC.

Parameters
char*the name of the new npc to use.

Definition at line 265 of file dialog_screen.cc.

bool dialog_screen::update ( )
virtual

React to (keyboard) input.

Returns
true if the dialog is still running, false otherwise.

Reimplemented from win_container.

Definition at line 218 of file dialog_screen.cc.

void dialog_screen::run ( )

Execute one step of the dialogue.

Definition at line 162 of file dialog_screen.cc.


The documentation for this class was generated from the following files: