xoreos  0.0.5
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Engines::NWN::Dialog Class Reference

#include <dialog.h>

Inheritance diagram for Engines::NWN::Dialog:
Inheritance graph
[legend]
Collaboration diagram for Engines::NWN::Dialog:
Collaboration graph
[legend]

Public Member Functions

 Dialog (const Common::UString &conv, Creature &pc, Object &obj, Module &module, bool playHello=true)
 
 ~Dialog ()
 
bool hasEnded () const
 Has the conversation ended? More...
 
void show ()
 Show the dialog. More...
 
void hide ()
 Hide the dialog. More...
 
void abort ()
 Abort the current conversation. More...
 
void addEvent (const Events::Event &event)
 Add a single event for consideration into the event queue. More...
 
int processEventQueue ()
 Process the current event queue. More...
 
- Public Member Functions inherited from Events::Notifyable
 Notifyable ()
 
virtual ~Notifyable ()
 

Protected Member Functions

void notifyResized (int oldWidth, int oldHeight, int newWidth, int newHeight)
 

Private Member Functions

void updateBox ()
 Update the box's contents. More...
 
ObjectgetSpeaker ()
 Get the current speaker. More...
 
void playSound (bool greeting)
 Play a conversation sound. More...
 
void playAnimation ()
 Play a conversation animation. More...
 
void stopAnimation ()
 Stop a conversation animation. More...
 
void mouseMove ()
 The mouse was moved. More...
 
void mouseClick (const Events::Event &event)
 The mouse was clicked. More...
 
void keyPressed (const Events::Event &event)
 A keyboard key was pressed. More...
 
void checkPicked ()
 

Private Attributes

Common::UString _conv
 The conversation file. More...
 
Creature_pc
 The conversation's PC. More...
 
Object_object
 The conversation's NPC. More...
 
Module_module
 The module this dialog is in. More...
 
Common::ScopedPtr< DialogBox_dlgBox
 The actual dialog box. More...
 
Common::ScopedPtr< Aurora::DLGFile_dlg
 The conversation file. More...
 
std::list< Events::Event_eventQueue
 The event queue. More...
 

Detailed Description

Definition at line 189 of file dialog.h.

Constructor & Destructor Documentation

◆ Dialog()

Engines::NWN::Dialog::Dialog ( const Common::UString conv,
Creature pc,
Object obj,
Module module,
bool  playHello = true 
)

◆ ~Dialog()

Engines::NWN::Dialog::~Dialog ( )

Definition at line 561 of file dialog.cpp.

References abort().

Here is the call graph for this function:

Member Function Documentation

◆ abort()

void Engines::NWN::Dialog::abort ( )

Abort the current conversation.

Definition at line 577 of file dialog.cpp.

References _dlg, _object, hide(), Engines::NWN::Object::setPCSpeaker(), stopAnimation(), and Engines::NWN::Object::stopSound().

Referenced by keyPressed(), and ~Dialog().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addEvent()

void Engines::NWN::Dialog::addEvent ( const Events::Event event)

Add a single event for consideration into the event queue.

Definition at line 588 of file dialog.cpp.

References _eventQueue.

◆ checkPicked()

void Engines::NWN::Dialog::checkPicked ( )
private

Definition at line 659 of file dialog.cpp.

References _dlg, _dlgBox, Aurora::DLGFile::kInvalidLine, mouseMove(), playAnimation(), playSound(), stopAnimation(), and updateBox().

Referenced by keyPressed(), and mouseClick().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSpeaker()

Object * Engines::NWN::Dialog::getSpeaker ( )
private

Get the current speaker.

Definition at line 732 of file dialog.cpp.

References _dlg, _module, _object, Common::UString::empty(), Aurora::NWScript::ObjectContainer::getFirstObjectByTag(), and Aurora::DLGFile::Line::speaker.

Referenced by playAnimation(), stopAnimation(), and updateBox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasEnded()

bool Engines::NWN::Dialog::hasEnded ( ) const

Has the conversation ended?

Definition at line 565 of file dialog.cpp.

References _dlg.

Referenced by processEventQueue().

Here is the caller graph for this function:

◆ hide()

void Engines::NWN::Dialog::hide ( )

Hide the dialog.

Definition at line 573 of file dialog.cpp.

References _dlgBox.

Referenced by abort().

Here is the caller graph for this function:

◆ keyPressed()

void Engines::NWN::Dialog::keyPressed ( const Events::Event event)
private

A keyboard key was pressed.

Definition at line 629 of file dialog.cpp.

References _dlgBox, abort(), and checkPicked().

Referenced by processEventQueue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mouseClick()

void Engines::NWN::Dialog::mouseClick ( const Events::Event event)
private

The mouse was clicked.

Definition at line 621 of file dialog.cpp.

References _dlgBox, and checkPicked().

Referenced by processEventQueue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mouseMove()

void Engines::NWN::Dialog::mouseMove ( )
private

The mouse was moved.

Definition at line 614 of file dialog.cpp.

References _dlgBox, and CursorMan.

Referenced by checkPicked(), and processEventQueue().

Here is the caller graph for this function:

◆ notifyResized()

void Engines::NWN::Dialog::notifyResized ( int  oldWidth,
int  oldHeight,
int  newWidth,
int  newHeight 
)
protectedvirtual

Reimplemented from Events::Notifyable.

Definition at line 678 of file dialog.cpp.

References _dlgBox.

Referenced by Dialog().

Here is the caller graph for this function:

◆ playAnimation()

void Engines::NWN::Dialog::playAnimation ( )
private

Play a conversation animation.

Definition at line 769 of file dialog.cpp.

References _dlg, Aurora::DLGFile::Line::animation, Engines::NWN::getCreatureTalkAnimationName(), getSpeaker(), Engines::NWN::Object::playAnimation(), and stopAnimation().

Referenced by checkPicked(), and Dialog().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ playSound()

void Engines::NWN::Dialog::playSound ( bool  greeting)
private

Play a conversation sound.

Definition at line 743 of file dialog.cpp.

References _dlg, _object, Common::UString::empty(), Aurora::SSFFile::getSoundFile(), Engines::NWN::Object::getSSF(), Engines::NWN::kSSFHello, Engines::NWN::Object::playSound(), and Aurora::DLGFile::Line::sound.

Referenced by checkPicked(), and Dialog().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ processEventQueue()

int Engines::NWN::Dialog::processEventQueue ( )

Process the current event queue.

Definition at line 592 of file dialog.cpp.

References _eventQueue, hasEnded(), Events::kEventKeyDown, Events::kEventMouseDown, Events::kEventMouseMove, keyPressed(), mouseClick(), and mouseMove().

Here is the call graph for this function:

◆ show()

void Engines::NWN::Dialog::show ( )

Show the dialog.

Definition at line 569 of file dialog.cpp.

References _dlgBox.

◆ stopAnimation()

void Engines::NWN::Dialog::stopAnimation ( )
private

Stop a conversation animation.

Definition at line 783 of file dialog.cpp.

References getSpeaker(), and Engines::NWN::Object::playAnimation().

Referenced by abort(), checkPicked(), and playAnimation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateBox()

void Engines::NWN::Dialog::updateBox ( )
private

Update the box's contents.

Definition at line 687 of file dialog.cpp.

References _dlg, _dlgBox, Common::UString::empty(), Engines::NWN::Object::getName(), Engines::NWN::Object::getPortrait(), getSpeaker(), Aurora::LocString::getString(), GfxMan, kContinue, kEndDialog, Aurora::DLGFile::kEndLine, TalkMan, and Aurora::DLGFile::Line::text.

Referenced by checkPicked(), and Dialog().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _conv

Common::UString Engines::NWN::Dialog::_conv
private

The conversation file.

Definition at line 212 of file dialog.h.

◆ _dlg

Common::ScopedPtr<Aurora::DLGFile> Engines::NWN::Dialog::_dlg
private

The conversation file.

Definition at line 221 of file dialog.h.

Referenced by abort(), checkPicked(), Dialog(), getSpeaker(), hasEnded(), playAnimation(), playSound(), and updateBox().

◆ _dlgBox

Common::ScopedPtr<DialogBox> Engines::NWN::Dialog::_dlgBox
private

The actual dialog box.

Definition at line 219 of file dialog.h.

Referenced by checkPicked(), Dialog(), hide(), keyPressed(), mouseClick(), mouseMove(), notifyResized(), show(), and updateBox().

◆ _eventQueue

std::list<Events::Event> Engines::NWN::Dialog::_eventQueue
private

The event queue.

Definition at line 223 of file dialog.h.

Referenced by addEvent(), and processEventQueue().

◆ _module

Module* Engines::NWN::Dialog::_module
private

The module this dialog is in.

Definition at line 217 of file dialog.h.

Referenced by getSpeaker().

◆ _object

Object* Engines::NWN::Dialog::_object
private

The conversation's NPC.

Definition at line 215 of file dialog.h.

Referenced by abort(), Dialog(), getSpeaker(), and playSound().

◆ _pc

Creature* Engines::NWN::Dialog::_pc
private

The conversation's PC.

Definition at line 214 of file dialog.h.


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