xoreos  0.0.5
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Engines::NWN::Module Class Reference

#include <module.h>

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

Classes

struct  Action
 

Public Member Functions

 Module (::Engines::Console &console, const Version &gameVersion)
 
 ~Module ()
 
const VersiongetGameVersion () const
 
void clear ()
 Clear the whole context. More...
 
bool isLoaded () const
 Is a module currently loaded and ready to run? More...
 
bool isRunning () const
 Is a module currently running? More...
 
void load (const Common::UString &module)
 Load a module. More...
 
void usePC (const Common::UString &bic, bool local)
 Use this character as the player character. More...
 
void usePC (Creature *creature)
 
void exit ()
 Exit the currently running module. More...
 
const Aurora::IFOFilegetIFO () const
 Return the IFO of the currently loaded module. More...
 
AreagetCurrentArea ()
 Return the area the PC is currently in. More...
 
CreaturegetPC ()
 Return the currently playing PC. More...
 
void showMenu ()
 Show the ingame main menu. More...
 
bool startConversation (const Common::UString &conv, Creature &pc, NWN::Object &obj, bool playHello=true)
 Start a conversation. More...
 
void delayScript (const Common::UString &script, const Aurora::NWScript::ScriptState &state, Aurora::NWScript::Object *owner, Aurora::NWScript::Object *triggerer, uint32 delay)
 
void movePC (const Common::UString &area)
 Move the player character to this area. More...
 
void movePC (float x, float y, float z)
 Move the player character to this position within the current area. More...
 
void movePC (const Common::UString &area, float x, float y, float z)
 Move the player character to this position within this area. More...
 
void movePC (Area *area, float x, float y, float z)
 Move the player character to this position within this area. More...
 
void movedPC ()
 Notify the module that the PC was moved. More...
 
void enter ()
 Enter the loaded module, starting it. More...
 
void leave ()
 Leave the running module, quitting it. More...
 
void addEvent (const Events::Event &event)
 Add a single event for consideration into the event queue. More...
 
void processEventQueue ()
 Process the current event queue. More...
 
- Public Member Functions inherited from Engines::NWN::Object
 Object (ObjectType type=kObjectTypeInvalid)
 
virtual ~Object ()
 
ObjectType getType () const
 Return the exact type of the object. More...
 
virtual void loadModel ()
 Load the object's model(s). More...
 
virtual void unloadModel ()
 Unload the object's model(s). More...
 
virtual void show ()
 Show the object's model(s). More...
 
virtual void hide ()
 Hide the object's model(s). More...
 
const std::list< uint32 > & getIDs () const
 Return the object's model IDs. More...
 
const Common::UStringgetName () const
 Return the object's name. More...
 
const Common::UStringgetDescription () const
 Return the object's description. More...
 
const Common::UStringgetPortrait () const
 Return the object's portrait. More...
 
const Common::UStringgetConversation () const
 Return the object's default conversation (DLG). More...
 
const Aurora::SSFFilegetSSF ()
 Return the object's sound set. More...
 
bool isStatic () const
 Is the object static (not manipulable at all)? More...
 
bool isUsable () const
 Can the object be used by the PC? More...
 
bool isClickable () const
 Can the player click the object? More...
 
Aurora::NWScript::ObjectgetPCSpeaker () const
 Return the PC currently speaking with this object. More...
 
void setPCSpeaker (Aurora::NWScript::Object *pc)
 Set the PC currently speaking with this object. More...
 
AreagetArea () const
 Return the area this object is currently in. More...
 
virtual void setArea (Area *)
 Set the area this object is currently in. More...
 
virtual void getPosition (float &x, float &y, float &z) const
 Return the object's position within its area. More...
 
virtual void getOrientation (float &x, float &y, float &z, float &angle) const
 Return the object's orientation. More...
 
virtual void setPosition (float x, float y, float z)
 Set the object's position within its area. More...
 
virtual void setOrientation (float x, float y, float z, float angle)
 Set the object's orientation. More...
 
Location getLocation () const
 Create a Location out of the object's area, position and orientation. More...
 
virtual void highlight (bool enabled)
 (Un)Highlight the object. More...
 
virtual bool click (Object *triggerer=0)
 The object was clicked. More...
 
virtual void speakString (const Common::UString &string, uint32 volume)
 Speak the specified string. More...
 
void speakOneLiner (Common::UString conv, Object *tokenTarget=0)
 Speak an one-liner from the specified conversation file. More...
 
void stopSound ()
 Stop the current object sound. More...
 
void playSound (const Common::UString &sound, bool pitchVariance=false)
 Play an object sound. More...
 
virtual void playAnimation (const Common::UString &animation="", bool restart=true, float length=0.0f, float speed=1.0f)
 Play an object animation. More...
 
virtual void playAnimation (Animation animation, bool restart=true, float length=0.0f, float speed=1.0f)
 Play a default object animation. More...
 
- Public Member Functions inherited from Aurora::NWScript::Object
 Object ()
 
uint32 getID () const
 
const Common::UStringgetTag () const
 
- Public Member Functions inherited from Aurora::NWScript::VariableContainer
 VariableContainer ()
 
virtual ~VariableContainer ()
 
bool hasVariable (const Common::UString &var) const
 
VariablegetVariable (const Common::UString &var, Type type=kTypeVoid)
 
const VariablegetVariable (const Common::UString &var) const
 
void setVariable (const Common::UString &var, const Variable &value)
 
void removeVariable (const Common::UString &var)
 
void clearVariables ()
 
- Public Member Functions inherited from Engines::NWN::ScriptContainer
 ScriptContainer ()
 
 ~ScriptContainer ()
 
const Common::UStringgetScript (Script script) const
 
bool hasScript (Script script) const
 
bool runScript (Script script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
 
- Public Member Functions inherited from Engines::NWN::ObjectContainer
 ObjectContainer ()
 
 ~ObjectContainer ()
 
void clearObjects ()
 
void addObject (NWN::Object &object)
 Add an object to this container. More...
 
void removeObject (NWN::Object &object)
 Remove an object from this container. More...
 
::Aurora::NWScript::ObjectgetFirstObjectByType (ObjectType type) const
 Return the first object of this type. More...
 
::Aurora::NWScript::ObjectSearchfindObjectsByType (ObjectType type) const
 Return a search context to iterate over all objects of this type. More...
 
- Public Member Functions inherited from Aurora::NWScript::ObjectContainer
 ObjectContainer ()
 
 ~ObjectContainer ()
 
void clearObjects ()
 
void addObject (Object &object)
 Add an object to this container. More...
 
void removeObject (Object &object)
 Remove an object from this container. More...
 
ObjectgetObjectByID (uint32 id) const
 Find a specific object by ID. More...
 
ObjectgetFirstObject () const
 Return the first object. More...
 
ObjectgetFirstObjectByTag (const Common::UString &tag) const
 Return the first object with this tag. More...
 
ObjectSearchfindObjects () const
 Return a search context to iterate over all objects. More...
 
ObjectSearchfindObjectsByTag (const Common::UString &tag) const
 Return a search context to iterate over all objects with this tag. More...
 

Static Public Member Functions

static Common::UString getDescription (const Common::UString &module)
 
- Static Public Member Functions inherited from Engines::NWN::ScriptContainer
static bool runScript (const Common::UString &script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
 
static bool runScript (const Common::UString &script, const Aurora::NWScript::ScriptState &state, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
 
- Static Public Member Functions inherited from Engines::NWN::ObjectContainer
static NWN::ObjecttoObject (::Aurora::NWScript::Object *object)
 
static ModuletoModule (Aurora::NWScript::Object *object)
 
static AreatoArea (Aurora::NWScript::Object *object)
 
static WaypointtoWaypoint (Aurora::NWScript::Object *object)
 
static SituatedtoSituated (Aurora::NWScript::Object *object)
 
static PlaceabletoPlaceable (Aurora::NWScript::Object *object)
 
static DoortoDoor (Aurora::NWScript::Object *object)
 
static CreaturetoCreature (Aurora::NWScript::Object *object)
 
static CreaturetoPC (Aurora::NWScript::Object *object)
 
static LocationtoLocation (Aurora::NWScript::EngineType *engineType)
 

Private Types

enum  ActionType { kActionNone = 0, kActionScript = 1 }
 
typedef Common::PtrMap< Common::UString, AreaAreaMap
 
typedef std::list< Events::EventEventQueue
 
typedef std::multiset< ActionActionQueue
 

Private Member Functions

void unload (bool completeUnload=true)
 Unload the whole shebang. More...
 
void unloadModule ()
 Unload the module. More...
 
void unloadPC ()
 Unload the PC. More...
 
void unloadTLK ()
 Unload the TLK used by the module. More...
 
void unloadHAKs ()
 Unload the HAKs required by the module. More...
 
void unloadTexturePack ()
 Unload the texture pack. More...
 
void unloadAreas ()
 Unload the areas. More...
 
void preparePremiumModule (const Common::UString &module)
 Check if this is premium module, and if so, prepare its loading. More...
 
void checkXPs ()
 Do we have all expansions needed for the module? More...
 
void checkHAKs ()
 Do we have all HAKs needed for the module? More...
 
void loadTLK ()
 Load the TLK used by the module. More...
 
void loadHAKs ()
 Load the HAKs required by the module. More...
 
void loadTexturePack ()
 Load the texture pack. More...
 
void loadAreas ()
 Load the areas. More...
 
void setPCTokens ()
 
void removePCTokens ()
 
void enterArea ()
 Enter a new area. More...
 
void loadModule (const Common::UString &module)
 Load the actual module. More...
 
void changeModule (const Common::UString &module)
 Schedule a change to a new module. More...
 
void replaceModule ()
 Actually replace the currently running module. More...
 
void handleEvents ()
 
void handleActions ()
 

Static Private Member Functions

static Common::UString getDescriptionExtra (Common::UString module)
 
static Common::UString getDescriptionCampaign (Common::UString module)
 

Private Attributes

::Engines::Console_console
 
const Version_gameVersion
 
bool _hasModule
 Do we have a module? More...
 
bool _running
 Are we currently running a module? More...
 
Common::ScopedPtr< IngameGUI_ingameGUI
 The ingame GUI elements. More...
 
Common::ChangeID _resModule
 Resources added by the module. More...
 
Common::ChangeID _resTLK
 Resources added for the custom TLK. More...
 
ChangeList _resHAKs
 Resources added by the HAKs of the module. More...
 
Aurora::IFOFile _ifo
 The module's IFO. More...
 
Common::ScopedPtr< Creature_pc
 The player character we use. More...
 
int _currentTexturePack
 
Common::ChangeID _resTP [4]
 
bool _exit
 Should we exit the module? More...
 
AreaMap _areas
 The areas in the current module. More...
 
Common::UString _newArea
 The new area to enter. More...
 
Area_currentArea
 The current area. More...
 
Common::UString _newModule
 The module we should change to. More...
 
EventQueue _eventQueue
 
ActionQueue _delayedActions
 

Additional Inherited Members

- Protected Member Functions inherited from Engines::NWN::Object
void loadSSF ()
 Load the object's sound set. More...
 
bool beginConversation (Object *triggerer)
 Begin a conversation between the triggerer and this object. More...
 
virtual bool createTooltip (Tooltip::Type type)
 Create an empty tooltip. More...
 
bool createFeedbackTooltip ()
 Create a tooltip with the name and/or portrait of the object. More...
 
bool createSpeechTooltip (const Common::UString &line)
 Create a tooltip with a line the object should speak. More...
 
void destroyTooltip ()
 Destroy all tooltips on this object. More...
 
bool showFeedbackTooltip ()
 Create and show a tooltip with the name and/or portrait of the object. More...
 
bool showSpeechTooltip (const Common::UString &line)
 Create and show a tooltip with a line the object speaks. More...
 
void hideTooltip ()
 Hide the tooltip again. More...
 
- Protected Member Functions inherited from Engines::NWN::ScriptContainer
void clearScripts ()
 
void readScripts (const Aurora::GFF3Struct &gff)
 
void readScripts (const ScriptContainer &container)
 
- Protected Member Functions inherited from Aurora::NWScript::ObjectContainer
void lock ()
 
void unlock ()
 
- Protected Attributes inherited from Engines::NWN::Object
ObjectType _type
 The object's type. More...
 
Common::UString _name
 The object's display name. More...
 
Common::UString _description
 The object's description. More...
 
Common::UString _portrait
 The object's portrait. More...
 
Common::UString _conversation
 The object's default conversation. More...
 
uint32 _soundSet
 The object's sound set, as an index into soundset.2da. More...
 
Common::ScopedPtr< Aurora::SSFFile_ssf
 The object's sound set. More...
 
bool _static
 Is the object static? More...
 
bool _usable
 Is the object usable? More...
 
std::list< uint32_ids
 The object's model IDs. More...
 
Aurora::NWScript::Object_pcSpeaker
 The current PC speaking with the object. More...
 
Area_area
 The area the object is currently in. More...
 
float _position [3]
 The object's position. More...
 
float _orientation [4]
 The object's orientation. More...
 
Sound::ChannelHandle _sound
 The currently playing object sound. More...
 
Common::ScopedPtr< Tooltip_tooltip
 The tooltip displayed over the object. More...
 
- Protected Attributes inherited from Aurora::NWScript::Object
uint32 _id
 
Common::UString _tag
 

Detailed Description

Definition at line 63 of file module.h.

Member Typedef Documentation

◆ ActionQueue

typedef std::multiset<Action> Engines::NWN::Module::ActionQueue
private

Definition at line 174 of file module.h.

◆ AreaMap

Definition at line 171 of file module.h.

◆ EventQueue

typedef std::list<Events::Event> Engines::NWN::Module::EventQueue
private

Definition at line 173 of file module.h.

Member Enumeration Documentation

◆ ActionType

Enumerator
kActionNone 
kActionScript 

Definition at line 152 of file module.h.

Constructor & Destructor Documentation

◆ Module()

Engines::NWN::Module::Module ( ::Engines::Console console,
const Version gameVersion 
)

Definition at line 105 of file module.cpp.

References _console, and _ingameGUI.

◆ ~Module()

Engines::NWN::Module::~Module ( )

Definition at line 112 of file module.cpp.

References clear().

Here is the call graph for this function:

Member Function Documentation

◆ addEvent()

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

Add a single event for consideration into the event queue.

Definition at line 454 of file module.cpp.

References _eventQueue.

◆ changeModule()

void Engines::NWN::Module::changeModule ( const Common::UString module)
private

Schedule a change to a new module.

Definition at line 302 of file module.cpp.

References _newModule.

Referenced by load().

Here is the caller graph for this function:

◆ checkHAKs()

void Engines::NWN::Module::checkHAKs ( )
private

Do we have all HAKs needed for the module?

Definition at line 209 of file module.cpp.

References _ifo, Aurora::IFOFile::getHAKs(), and ResMan.

Referenced by loadModule().

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

◆ checkXPs()

void Engines::NWN::Module::checkXPs ( )
private

Do we have all expansions needed for the module?

Definition at line 195 of file module.cpp.

References _ifo, ConfigMan, and Aurora::IFOFile::getExpansions().

Referenced by loadModule().

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

◆ clear()

void Engines::NWN::Module::clear ( )

Clear the whole context.

Definition at line 123 of file module.cpp.

References unload().

Referenced by ~Module().

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

◆ delayScript()

void Engines::NWN::Module::delayScript ( const Common::UString script,
const Aurora::NWScript::ScriptState state,
Aurora::NWScript::Object owner,
Aurora::NWScript::Object triggerer,
uint32  delay 
)

◆ enter()

void Engines::NWN::Module::enter ( )
virtual

◆ enterArea()

void Engines::NWN::Module::enterArea ( )
private

◆ exit()

void Engines::NWN::Module::exit ( )

Exit the currently running module.

Definition at line 440 of file module.cpp.

References _exit, and _ingameGUI.

Referenced by Engines::NWN::Console::cmdExitModule(), and Engines::NWN::Functions::endGame().

Here is the caller graph for this function:

◆ getCurrentArea()

Area * Engines::NWN::Module::getCurrentArea ( )

Return the area the PC is currently in.

Definition at line 752 of file module.cpp.

References _currentArea.

◆ getDescription()

Common::UString Engines::NWN::Module::getDescription ( const Common::UString module)
static

Definition at line 802 of file module.cpp.

References Common::UString::empty(), getDescriptionCampaign(), and getDescriptionExtra().

Here is the call graph for this function:

◆ getDescriptionCampaign()

Common::UString Engines::NWN::Module::getDescriptionCampaign ( Common::UString  module)
staticprivate

Definition at line 787 of file module.cpp.

References ConfigMan, Aurora::ERFFile::getDescription(), Common::FilePath::getExtension(), and Aurora::LocString::getString().

Referenced by getDescription().

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

◆ getDescriptionExtra()

Common::UString Engines::NWN::Module::getDescriptionExtra ( Common::UString  module)
staticprivate

Definition at line 772 of file module.cpp.

References ConfigMan, Aurora::ERFFile::getDescription(), Common::FilePath::getExtension(), and Aurora::LocString::getString().

Referenced by getDescription().

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

◆ getGameVersion()

const Version & Engines::NWN::Module::getGameVersion ( ) const

Definition at line 119 of file module.cpp.

References _gameVersion.

Referenced by Engines::NWN::MainMenu::createOptions(), and Engines::NWN::IngameGUI::IngameGUI().

Here is the caller graph for this function:

◆ getIFO()

const Aurora::IFOFile & Engines::NWN::Module::getIFO ( ) const

Return the IFO of the currently loaded module.

Definition at line 748 of file module.cpp.

References _ifo.

Referenced by Engines::NWN::Console::cmdGotoArea(), Engines::NWN::Console::cmdListAreas(), and Engines::NWN::Console::updateAreas().

Here is the caller graph for this function:

◆ getPC()

Creature * Engines::NWN::Module::getPC ( )

Return the currently playing PC.

Definition at line 298 of file module.cpp.

References _pc.

Referenced by Engines::NWN::Functions::beginConversation(), Engines::NWN::Area::click(), Engines::NWN::Functions::getFirstPC(), Engines::NWN::Functions::getTag(), and Engines::NWN::Functions::jumpTo().

Here is the caller graph for this function:

◆ handleActions()

void Engines::NWN::Module::handleActions ( )
private

Definition at line 516 of file module.cpp.

References _delayedActions, EventMan, kActionScript, and Engines::NWN::ScriptContainer::runScript().

Referenced by processEventQueue(), and unloadModule().

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

◆ handleEvents()

void Engines::NWN::Module::handleEvents ( )
private

◆ isLoaded()

bool Engines::NWN::Module::isLoaded ( ) const

Is a module currently loaded and ready to run?

Definition at line 446 of file module.cpp.

References _hasModule, and _pc.

◆ isRunning()

bool Engines::NWN::Module::isRunning ( ) const

Is a module currently running?

Definition at line 450 of file module.cpp.

References _exit, _newArea, _running, Common::UString::empty(), and EventMan.

Referenced by load(), and processEventQueue().

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

◆ leave()

void Engines::NWN::Module::leave ( )
virtual

Leave the running module, quitting it.

Reimplemented from Engines::NWN::Object.

Definition at line 389 of file module.cpp.

References _exit, _ingameGUI, and _running.

◆ load()

void Engines::NWN::Module::load ( const Common::UString module)

◆ loadAreas()

void Engines::NWN::Module::loadAreas ( )
private

Load the areas.

Definition at line 640 of file module.cpp.

References _areas, _ifo, Common::StackException::add(), Aurora::IFOFile::getAreas(), and status().

Referenced by enter().

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

◆ loadHAKs()

void Engines::NWN::Module::loadHAKs ( )
private

Load the HAKs required by the module.

Definition at line 592 of file module.cpp.

References _ifo, _resHAKs, Aurora::IFOFile::getHAKs(), and Engines::indexMandatoryArchive().

Referenced by enter().

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

◆ loadModule()

void Engines::NWN::Module::loadModule ( const Common::UString module)
private

◆ loadTexturePack()

void Engines::NWN::Module::loadTexturePack ( )
private

Load the texture pack.

Definition at line 610 of file module.cpp.

References _currentTexturePack, _resTP, ConfigMan, Engines::indexMandatoryArchive(), Engines::indexOptionalArchive(), status(), TextureMan, Engines::NWN::texturePacks, and unloadTexturePack().

Referenced by enter(), and showMenu().

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

◆ loadTLK()

void Engines::NWN::Module::loadTLK ( )
private

Load the TLK used by the module.

Definition at line 581 of file module.cpp.

References _ifo, _resTLK, Common::UString::empty(), Aurora::IFOFile::getTLK(), and TalkMan.

Referenced by enter().

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

◆ movedPC()

void Engines::NWN::Module::movedPC ( )

Notify the module that the PC was moved.

Definition at line 729 of file module.cpp.

References _ingameGUI, _newArea, _pc, CameraMan, and Common::UString::clear().

Referenced by Engines::NWN::Functions::jumpTo(), and movePC().

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

◆ movePC() [1/4]

void Engines::NWN::Module::movePC ( const Common::UString area)

Move the player character to this area.

Definition at line 689 of file module.cpp.

References _pc.

Referenced by Engines::NWN::Door::click(), Engines::NWN::Console::cmdGotoArea(), and movePC().

Here is the caller graph for this function:

◆ movePC() [2/4]

void Engines::NWN::Module::movePC ( float  x,
float  y,
float  z 
)

Move the player character to this position within the current area.

Definition at line 699 of file module.cpp.

References _currentArea, _pc, and movePC().

Here is the call graph for this function:

◆ movePC() [3/4]

void Engines::NWN::Module::movePC ( const Common::UString area,
float  x,
float  y,
float  z 
)

Move the player character to this position within this area.

Definition at line 706 of file module.cpp.

References _areas, _pc, and movePC().

Here is the call graph for this function:

◆ movePC() [4/4]

void Engines::NWN::Module::movePC ( Area area,
float  x,
float  y,
float  z 
)

Move the player character to this position within this area.

Definition at line 719 of file module.cpp.

References _pc, and movedPC().

Here is the call graph for this function:

◆ preparePremiumModule()

void Engines::NWN::Module::preparePremiumModule ( const Common::UString module)
private

Check if this is premium module, and if so, prepare its loading.

Definition at line 140 of file module.cpp.

References _resHAKs, Common::FilePath::changeExtension(), Common::hashMD5(), Engines::indexMandatoryArchive(), Engines::NWN::Game::isPremiumModule(), and ResMan.

Referenced by loadModule().

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

◆ processEventQueue()

void Engines::NWN::Module::processEventQueue ( )

Process the current event queue.

Definition at line 458 of file module.cpp.

References _ingameGUI, _pc, enterArea(), handleActions(), handleEvents(), isRunning(), and replaceModule().

Here is the call graph for this function:

◆ removePCTokens()

void Engines::NWN::Module::removePCTokens ( )
private

Definition at line 247 of file module.cpp.

References ARRAYSIZE, kGenderTokens, GenderToken::token, and TokenMan.

Referenced by unloadPC().

Here is the caller graph for this function:

◆ replaceModule()

void Engines::NWN::Module::replaceModule ( )
private

Actually replace the currently running module.

Definition at line 306 of file module.cpp.

References _console, _exit, _newModule, Common::UString::empty(), enter(), Engines::Console::hide(), loadModule(), and unload().

Referenced by processEventQueue().

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

◆ setPCTokens()

void Engines::NWN::Module::setPCTokens ( )
private

Definition at line 217 of file module.cpp.

References _pc, ARRAYSIZE, GenderToken::female, kGenderTokens, GenderToken::male, TalkMan, and TokenMan.

Referenced by usePC().

Here is the caller graph for this function:

◆ showMenu()

void Engines::NWN::Module::showMenu ( )

Show the ingame main menu.

Definition at line 671 of file module.cpp.

References _currentArea, _exit, _ingameGUI, loadTexturePack(), and Engines::NWN::Area::removeFocus().

Referenced by Engines::NWN::PartyLeader::callbackActive(), and handleEvents().

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

◆ startConversation()

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

Start a conversation.

Parameters
convThe dialog ResRef to use.
pcThe PC that initiated the conversation.
objThe object the PC is talking with.
playHelloShould the obj play its "Hello" sound?
Returns
true if the conversation was started successfully.

Definition at line 683 of file module.cpp.

References _ingameGUI.

Referenced by Engines::NWN::Functions::actionStartConversation(), and Engines::NWN::Functions::beginConversation().

Here is the caller graph for this function:

◆ unload()

void Engines::NWN::Module::unload ( bool  completeUnload = true)
private

Unload the whole shebang.

Parameters
completeUnloadAlso unload the PC and texture packs. true: completely quit the module false: the PC can be transferred to a new module.

Definition at line 533 of file module.cpp.

References GfxMan, unloadAreas(), unloadHAKs(), unloadModule(), unloadPC(), unloadTexturePack(), and unloadTLK().

Referenced by clear(), loadModule(), and replaceModule().

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

◆ unloadAreas()

void Engines::NWN::Module::unloadAreas ( )
private

Unload the areas.

Definition at line 662 of file module.cpp.

References _areas, _currentArea, _ingameGUI, _newArea, Common::PtrMap< Key, T, Compare, Deallocator >::clear(), and Common::UString::clear().

Referenced by unload().

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

◆ unloadHAKs()

void Engines::NWN::Module::unloadHAKs ( )
private

Unload the HAKs required by the module.

Definition at line 599 of file module.cpp.

References _resHAKs, and Engines::deindexResources().

Referenced by unload().

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

◆ unloadModule()

void Engines::NWN::Module::unloadModule ( )
private

◆ unloadPC()

void Engines::NWN::Module::unloadPC ( )
private

Unload the PC.

Definition at line 570 of file module.cpp.

References _pc, Engines::NWN::ObjectContainer::removeObject(), and removePCTokens().

Referenced by unload(), and usePC().

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

◆ unloadTexturePack()

void Engines::NWN::Module::unloadTexturePack ( )
private

Unload the texture pack.

Definition at line 633 of file module.cpp.

References _currentTexturePack, _resTP, and Engines::deindexResources().

Referenced by loadTexturePack(), and unload().

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

◆ unloadTLK()

void Engines::NWN::Module::unloadTLK ( )
private

Unload the TLK used by the module.

Definition at line 588 of file module.cpp.

References _resTLK, and TalkMan.

Referenced by unload().

Here is the caller graph for this function:

◆ usePC() [1/2]

void Engines::NWN::Module::usePC ( const Common::UString bic,
bool  local 
)

Use this character as the player character.

Definition at line 268 of file module.cpp.

References _pc, Common::StackException::add(), Engines::NWN::ObjectContainer::addObject(), Common::UString::c_str(), Common::UString::empty(), Aurora::kLanguageGenderFemale, Aurora::kLanguageGenderMale, LangMan, setPCTokens(), and unloadPC().

Referenced by Engines::NWN::CharPremadeMenu::playCharacter(), and Engines::NWN::CharGenChoices::useCharacter().

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

◆ usePC() [2/2]

void Engines::NWN::Module::usePC ( Creature creature)

Definition at line 287 of file module.cpp.

References _pc, Engines::NWN::ObjectContainer::addObject(), Aurora::kLanguageGenderFemale, Aurora::kLanguageGenderMale, LangMan, setPCTokens(), and unloadPC().

Here is the call graph for this function:

Member Data Documentation

◆ _areas

AreaMap Engines::NWN::Module::_areas
private

The areas in the current module.

Definition at line 204 of file module.h.

Referenced by enterArea(), loadAreas(), movePC(), and unloadAreas().

◆ _console

::Engines::Console* Engines::NWN::Module::_console
private

Definition at line 177 of file module.h.

Referenced by enter(), enterArea(), handleEvents(), Module(), and replaceModule().

◆ _currentArea

Area* Engines::NWN::Module::_currentArea
private

The current area.

Definition at line 206 of file module.h.

Referenced by enterArea(), getCurrentArea(), handleEvents(), movePC(), showMenu(), and unloadAreas().

◆ _currentTexturePack

int Engines::NWN::Module::_currentTexturePack
private

Definition at line 199 of file module.h.

Referenced by loadTexturePack(), and unloadTexturePack().

◆ _delayedActions

ActionQueue Engines::NWN::Module::_delayedActions
private

Definition at line 211 of file module.h.

Referenced by delayScript(), handleActions(), and unloadModule().

◆ _eventQueue

EventQueue Engines::NWN::Module::_eventQueue
private

Definition at line 210 of file module.h.

Referenced by addEvent(), handleEvents(), and unloadModule().

◆ _exit

bool Engines::NWN::Module::_exit
private

Should we exit the module?

Definition at line 202 of file module.h.

Referenced by enter(), enterArea(), exit(), isRunning(), leave(), replaceModule(), and showMenu().

◆ _gameVersion

const Version* Engines::NWN::Module::_gameVersion
private

Definition at line 179 of file module.h.

Referenced by getGameVersion().

◆ _hasModule

bool Engines::NWN::Module::_hasModule
private

Do we have a module?

Definition at line 181 of file module.h.

Referenced by enter(), isLoaded(), loadModule(), and unloadModule().

◆ _ifo

Aurora::IFOFile Engines::NWN::Module::_ifo
private

The module's IFO.

Definition at line 194 of file module.h.

Referenced by checkHAKs(), checkXPs(), enter(), getIFO(), loadAreas(), loadHAKs(), loadModule(), loadTLK(), and unloadModule().

◆ _ingameGUI

Common::ScopedPtr<IngameGUI> Engines::NWN::Module::_ingameGUI
private

◆ _newArea

Common::UString Engines::NWN::Module::_newArea
private

The new area to enter.

Definition at line 205 of file module.h.

Referenced by enter(), enterArea(), isRunning(), movedPC(), and unloadAreas().

◆ _newModule

Common::UString Engines::NWN::Module::_newModule
private

The module we should change to.

Definition at line 208 of file module.h.

Referenced by changeModule(), loadModule(), replaceModule(), and unloadModule().

◆ _pc

Common::ScopedPtr<Creature> Engines::NWN::Module::_pc
private

The player character we use.

Definition at line 196 of file module.h.

Referenced by enter(), enterArea(), getPC(), isLoaded(), movedPC(), movePC(), processEventQueue(), setPCTokens(), unloadModule(), unloadPC(), and usePC().

◆ _resHAKs

ChangeList Engines::NWN::Module::_resHAKs
private

Resources added by the HAKs of the module.

Definition at line 192 of file module.h.

Referenced by loadHAKs(), preparePremiumModule(), and unloadHAKs().

◆ _resModule

Common::ChangeID Engines::NWN::Module::_resModule
private

Resources added by the module.

Definition at line 187 of file module.h.

Referenced by loadModule(), and unloadModule().

◆ _resTLK

Common::ChangeID Engines::NWN::Module::_resTLK
private

Resources added for the custom TLK.

Definition at line 189 of file module.h.

Referenced by loadTLK(), and unloadTLK().

◆ _resTP

Common::ChangeID Engines::NWN::Module::_resTP[4]
private

Definition at line 200 of file module.h.

Referenced by loadTexturePack(), and unloadTexturePack().

◆ _running

bool Engines::NWN::Module::_running
private

Are we currently running a module?

Definition at line 182 of file module.h.

Referenced by enter(), isRunning(), and leave().


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