xoreos
0.0.5
|
#include <object.h>
Public Member Functions | |
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::UString & | getName () const |
Return the object's name. More... | |
const Common::UString & | getDescription () const |
Return the object's description. More... | |
const Common::UString & | getPortrait () const |
Return the object's portrait. More... | |
const Common::UString & | getConversation () const |
Return the object's default conversation (DLG). More... | |
const Aurora::SSFFile * | getSSF () |
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::Object * | getPCSpeaker () 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... | |
Area * | getArea () 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 | enter () |
The cursor entered the object. More... | |
virtual void | leave () |
The cursor left the object. 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::UString & | getTag () const |
Public Member Functions inherited from Aurora::NWScript::VariableContainer | |
VariableContainer () | |
virtual | ~VariableContainer () |
bool | hasVariable (const Common::UString &var) const |
Variable & | getVariable (const Common::UString &var, Type type=kTypeVoid) |
const Variable & | getVariable (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::UString & | getScript (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()) |
Protected Member Functions | |
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 Attributes | |
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 |
Additional Inherited Members | |
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()) |
Engines::NWN::Object::Object | ( | ObjectType | type = kObjectTypeInvalid | ) |
Definition at line 52 of file object.cpp.
References Aurora::NWScript::Object::_id, _orientation, _position, Common::generateIDNumber(), and ObjectMan.
|
virtual |
Reimplemented from Aurora::NWScript::Object.
Definition at line 68 of file object.cpp.
References destroyTooltip(), and ObjectMan.
|
protected |
Begin a conversation between the triggerer and this object.
Definition at line 260 of file object.cpp.
References FunctionMan, Aurora::NWScript::FunctionContext::getParams(), Aurora::NWScript::FunctionContext::setCaller(), and Aurora::NWScript::FunctionContext::setTriggerer().
Referenced by Engines::NWN::Creature::click().
|
virtual |
The object was clicked.
Reimplemented in Engines::NWN::Creature, Engines::NWN::Placeable, and Engines::NWN::Door.
Definition at line 256 of file object.cpp.
Referenced by Engines::NWN::Area::click().
|
protected |
Create a tooltip with the name and/or portrait of the object.
Definition at line 288 of file object.cpp.
References _name, _tooltip, createTooltip(), and Engines::NWN::Tooltip::kTypeFeedback.
Referenced by showFeedbackTooltip().
|
protected |
Create a tooltip with a line the object should speak.
Definition at line 298 of file object.cpp.
References _tooltip, createTooltip(), and Engines::NWN::Tooltip::kTypeSpeech.
Referenced by showSpeechTooltip().
|
protectedvirtual |
Create an empty tooltip.
Reimplemented in Engines::NWN::Creature, and Engines::NWN::Situated.
Definition at line 284 of file object.cpp.
Referenced by createFeedbackTooltip(), and createSpeechTooltip().
|
protected |
Destroy all tooltips on this object.
Definition at line 308 of file object.cpp.
References _tooltip, and hideTooltip().
Referenced by Engines::NWN::Situated::unloadModel(), Engines::NWN::Creature::unloadModel(), unloadModel(), and ~Object().
|
virtual |
The cursor entered the object.
Reimplemented in Engines::NWN::Creature, Engines::NWN::Module, Engines::NWN::Placeable, and Engines::NWN::Door.
Definition at line 183 of file object.cpp.
Referenced by Engines::NWN::Area::setActive().
Area * Engines::NWN::Object::getArea | ( | ) | const |
Return the area this object is currently in.
Definition at line 136 of file object.cpp.
References _area.
Referenced by Engines::NWN::Door::click(), Engines::NWN::Functions::getArea(), Engines::NWN::Functions::getNearestCreature(), Engines::NWN::Functions::getNearestObject(), Engines::NWN::Functions::getNearestObjectByTag(), and Engines::NWN::Functions::jumpTo().
const Common::UString & Engines::NWN::Object::getConversation | ( | ) | const |
Return the object's default conversation (DLG).
Definition at line 102 of file object.cpp.
References _conversation.
Referenced by Engines::NWN::Functions::actionStartConversation(), and Engines::NWN::Functions::beginConversation().
const Common::UString & Engines::NWN::Object::getDescription | ( | ) | const |
Return the object's description.
Definition at line 94 of file object.cpp.
References _description.
Referenced by Engines::NWN::NewModuleMenu::selectedModule(), and Engines::NWN::NewPremiumMenu::selectedModule().
const std::list< uint32 > & Engines::NWN::Object::getIDs | ( | ) | const |
Location Engines::NWN::Object::getLocation | ( | ) | const |
Create a Location out of the object's area, position and orientation.
Definition at line 144 of file object.cpp.
References _area, _position, Engines::NWN::Location::setArea(), Engines::NWN::Location::setFacing(), and Engines::NWN::Location::setPosition().
const Common::UString & Engines::NWN::Object::getName | ( | ) | const |
Return the object's name.
Definition at line 90 of file object.cpp.
References _name.
Referenced by Engines::NWN::Functions::actionStartConversation(), Engines::NWN::Functions::beginConversation(), Engines::NWN::Creature::getArmorModels(), Engines::NWN::Area::getName(), Engines::NWN::Functions::sendMessageToPC(), speakString(), Engines::NWN::Dialog::updateBox(), and Engines::NWN::IngameGUI::updatePartyMember().
|
virtual |
Return the object's orientation.
Definition at line 162 of file object.cpp.
References _orientation.
Referenced by Engines::NWN::Situated::loadModel(), Engines::NWN::Item::loadModel(), Engines::NWN::Creature::loadModel(), Engines::NWN::Situated::setOrientation(), and Engines::NWN::Creature::setOrientation().
Aurora::NWScript::Object * Engines::NWN::Object::getPCSpeaker | ( | ) | const |
Return the PC currently speaking with this object.
Definition at line 128 of file object.cpp.
References _pcSpeaker.
Referenced by Engines::NWN::Functions::actionStartConversation(), and Engines::NWN::Functions::beginConversation().
const Common::UString & Engines::NWN::Object::getPortrait | ( | ) | const |
Return the object's portrait.
Definition at line 98 of file object.cpp.
References _portrait.
Referenced by Engines::NWN::Dialog::updateBox().
|
virtual |
Return the object's position within its area.
Definition at line 156 of file object.cpp.
References _position.
Referenced by Engines::NWN::Door::click(), Engines::NWN::ObjectDistanceSort::getDistance(), Engines::NWN::Functions::getDistanceToObject(), Engines::NWN::Situated::loadModel(), Engines::NWN::Item::loadModel(), Engines::NWN::Creature::loadModel(), Engines::NWN::ObjectDistanceSort::ObjectDistanceSort(), Engines::NWN::Situated::setPosition(), and Engines::NWN::Creature::setPosition().
const Aurora::SSFFile * Engines::NWN::Object::getSSF | ( | ) |
Return the object's sound set.
Definition at line 106 of file object.cpp.
References _ssf, Common::ScopedPtrBase< T, Deallocator >::get(), and loadSSF().
Referenced by Engines::NWN::Dialog::playSound().
ObjectType Engines::NWN::Object::getType | ( | ) | const |
Return the exact type of the object.
Definition at line 73 of file object.cpp.
References _type.
Referenced by Engines::NWN::Functions::getNearestObject(), Engines::NWN::Functions::getObjectType(), and Engines::NWN::Functions::getParamObject().
|
virtual |
Hide the object's model(s).
Reimplemented in Engines::NWN::Area, Engines::NWN::Creature, Engines::NWN::Item, Engines::NWN::Door, Engines::NWN::Placeable, and Engines::NWN::Situated.
Definition at line 87 of file object.cpp.
Referenced by Engines::NWN::Waypoint::~Waypoint().
|
protected |
Hide the tooltip again.
Definition at line 337 of file object.cpp.
References _tooltip.
Referenced by destroyTooltip(), Engines::NWN::Situated::hide(), Engines::NWN::Creature::hide(), Engines::NWN::Placeable::highlight(), Engines::NWN::Creature::highlight(), showFeedbackTooltip(), and showSpeechTooltip().
|
virtual |
(Un)Highlight the object.
Reimplemented in Engines::NWN::Creature, Engines::NWN::Placeable, and Engines::NWN::Door.
Definition at line 189 of file object.cpp.
bool Engines::NWN::Object::isClickable | ( | ) | const |
Can the player click the object?
Definition at line 120 of file object.cpp.
References _static, and _usable.
Referenced by Engines::NWN::Situated::loadModel(), Engines::NWN::Item::loadModel(), and Engines::NWN::Creature::loadModel().
bool Engines::NWN::Object::isStatic | ( | ) | const |
Is the object static (not manipulable at all)?
Definition at line 112 of file object.cpp.
References _static.
Referenced by Engines::NWN::Area::loadModels().
bool Engines::NWN::Object::isUsable | ( | ) | const |
|
virtual |
The cursor left the object.
Reimplemented in Engines::NWN::Creature, Engines::NWN::Module, Engines::NWN::Placeable, and Engines::NWN::Door.
Definition at line 186 of file object.cpp.
Referenced by Engines::NWN::Area::removeFocus(), and Engines::NWN::Area::setActive().
|
virtual |
Load the object's model(s).
Reimplemented in Engines::NWN::Creature, Engines::NWN::Item, and Engines::NWN::Situated.
Definition at line 77 of file object.cpp.
Referenced by Engines::NWN::Area::loadModels().
|
protected |
Load the object's sound set.
Definition at line 192 of file object.cpp.
References _soundSet, _ssf, Aurora::NWScript::Object::_tag, Common::UString::c_str(), Common::UString::empty(), Common::exceptionDispatcherWarning(), Aurora::TwoDAFile::getRow(), Aurora::TwoDARow::getString(), Aurora::kFieldIDInvalid, Common::ScopedPtrBase< T, Deallocator >::reset(), and TwoDAReg.
Referenced by getSSF().
|
virtual |
Play an object animation.
Reimplemented in Engines::NWN::Creature, Engines::NWN::Placeable, and Engines::NWN::Door.
Definition at line 274 of file object.cpp.
References Common::UString::c_str(), and warning().
Referenced by Engines::NWN::Door::playAnimation(), Engines::NWN::Placeable::playAnimation(), Engines::NWN::Dialog::playAnimation(), and Engines::NWN::Dialog::stopAnimation().
|
virtual |
Play a default object animation.
Reimplemented in Engines::NWN::Creature, Engines::NWN::Placeable, and Engines::NWN::Door.
Definition at line 279 of file object.cpp.
References warning().
void Engines::NWN::Object::playSound | ( | const Common::UString & | sound, |
bool | pitchVariance = false |
||
) |
Play an object sound.
Definition at line 248 of file object.cpp.
References _sound, Common::UString::empty(), Sound::kSoundTypeVoice, Engines::playSound(), and stopSound().
Referenced by Engines::NWN::Placeable::activate(), Engines::NWN::Placeable::click(), Engines::NWN::Placeable::deactivate(), Engines::NWN::Placeable::open(), Engines::NWN::Door::open(), Engines::NWN::Door::playAnimation(), Engines::NWN::Placeable::playAnimation(), Engines::NWN::Dialog::playSound(), Engines::NWN::Functions::playSound(), and speakOneLiner().
|
virtual |
Set the area this object is currently in.
Reimplemented in Engines::NWN::Creature.
Definition at line 140 of file object.cpp.
References _area.
Referenced by Engines::NWN::Creature::setArea().
|
virtual |
Set the object's orientation.
Reimplemented in Engines::NWN::Creature, and Engines::NWN::Situated.
Definition at line 176 of file object.cpp.
References _orientation.
Referenced by Engines::NWN::Waypoint::load(), Engines::NWN::Item::loadModel(), Engines::NWN::Situated::setOrientation(), and Engines::NWN::Creature::setOrientation().
void Engines::NWN::Object::setPCSpeaker | ( | Aurora::NWScript::Object * | pc | ) |
Set the PC currently speaking with this object.
Definition at line 132 of file object.cpp.
References _pcSpeaker.
Referenced by Engines::NWN::Dialog::abort(), and Engines::NWN::Dialog::Dialog().
|
virtual |
Set the object's position within its area.
Reimplemented in Engines::NWN::Creature, and Engines::NWN::Situated.
Definition at line 170 of file object.cpp.
References _position.
Referenced by Engines::NWN::Waypoint::load(), Engines::NWN::Item::loadModel(), Engines::NWN::Situated::setPosition(), and Engines::NWN::Creature::setPosition().
|
virtual |
Show the object's model(s).
Reimplemented in Engines::NWN::Area, Engines::NWN::Creature, Engines::NWN::Item, Engines::NWN::Door, Engines::NWN::Placeable, and Engines::NWN::Situated.
Definition at line 84 of file object.cpp.
|
protected |
Create and show a tooltip with the name and/or portrait of the object.
Definition at line 314 of file object.cpp.
References _tooltip, createFeedbackTooltip(), Engines::NWN::Tooltip::getDefaultDelay(), and hideTooltip().
Referenced by Engines::NWN::Placeable::highlight(), and Engines::NWN::Creature::highlight().
|
protected |
Create and show a tooltip with a line the object speaks.
Definition at line 325 of file object.cpp.
References _tooltip, createSpeechTooltip(), and hideTooltip().
Referenced by speakString().
void Engines::NWN::Object::speakOneLiner | ( | Common::UString | conv, |
Object * | tokenTarget = 0 |
||
) |
Speak an one-liner from the specified conversation file.
Definition at line 215 of file object.cpp.
References _conversation, Common::UString::c_str(), Common::UString::empty(), Common::exceptionDispatcherWarning(), Aurora::DLGFile::getOneLiner(), Aurora::LocString::getString(), playSound(), Aurora::DLGFile::Line::sound, speakString(), and Aurora::DLGFile::Line::text.
|
virtual |
Speak the specified string.
Definition at line 210 of file object.cpp.
References getName(), showSpeechTooltip(), and status().
Referenced by Engines::NWN::Functions::actionSpeakString(), speakOneLiner(), and Engines::NWN::Functions::speakString().
void Engines::NWN::Object::stopSound | ( | ) |
Stop the current object sound.
Definition at line 244 of file object.cpp.
References _sound, and SoundMan.
Referenced by Engines::NWN::Dialog::abort(), and playSound().
|
virtual |
Unload the object's model(s).
Reimplemented in Engines::NWN::Creature, Engines::NWN::Item, and Engines::NWN::Situated.
Definition at line 80 of file object.cpp.
References destroyTooltip().
|
protected |
The area the object is currently in.
Definition at line 182 of file object.h.
Referenced by getArea(), getLocation(), Engines::NWN::Creature::loadModel(), and setArea().
|
protected |
The object's default conversation.
Definition at line 170 of file object.h.
Referenced by getConversation(), Engines::NWN::Situated::loadProperties(), Engines::NWN::Creature::loadProperties(), and speakOneLiner().
|
protected |
The object's description.
Definition at line 166 of file object.h.
Referenced by getDescription(), Engines::NWN::Situated::loadProperties(), Engines::NWN::Item::loadProperties(), and Engines::NWN::Creature::loadProperties().
|
protected |
The object's model IDs.
Definition at line 178 of file object.h.
Referenced by getIDs(), Engines::NWN::Situated::loadModel(), Engines::NWN::Item::loadModel(), and Engines::NWN::Creature::loadModel().
|
protected |
The object's display name.
Definition at line 165 of file object.h.
Referenced by createFeedbackTooltip(), getName(), Engines::NWN::Area::loadARE(), Engines::NWN::Creature::loadCharacter(), Engines::NWN::Situated::loadModel(), Engines::NWN::Item::loadModel(), Engines::NWN::Module::loadModule(), Engines::NWN::Situated::loadProperties(), Engines::NWN::Item::loadProperties(), and Engines::NWN::Creature::loadProperties().
|
protected |
The object's orientation.
Definition at line 185 of file object.h.
Referenced by getOrientation(), Object(), and setOrientation().
|
protected |
The current PC speaking with the object.
Definition at line 180 of file object.h.
Referenced by getPCSpeaker(), and setPCSpeaker().
|
protected |
The object's portrait.
Definition at line 168 of file object.h.
Referenced by Engines::NWN::Situated::createTooltip(), Engines::NWN::Creature::createTooltip(), getPortrait(), Engines::NWN::Creature::getPortrait(), Engines::NWN::Creature::init(), Engines::NWN::Door::loadAppearance(), Engines::NWN::Creature::loadModel(), Engines::NWN::Situated::loadPortrait(), Engines::NWN::Item::loadPortrait(), Engines::NWN::Creature::loadProperties(), and Engines::NWN::Creature::setPortrait().
|
protected |
The object's position.
Definition at line 184 of file object.h.
Referenced by getLocation(), getPosition(), Object(), and setPosition().
|
protected |
The currently playing object sound.
Definition at line 187 of file object.h.
Referenced by playSound(), and stopSound().
|
protected |
The object's sound set, as an index into soundset.2da.
Definition at line 172 of file object.h.
Referenced by Engines::NWN::Creature::loadProperties(), loadSSF(), and Engines::NWN::Creature::setSoundSet().
|
protected |
|
protected |
Is the object static?
Definition at line 175 of file object.h.
Referenced by isClickable(), isStatic(), and Engines::NWN::Situated::loadProperties().
|
protected |
The tooltip displayed over the object.
Definition at line 189 of file object.h.
Referenced by createFeedbackTooltip(), createSpeechTooltip(), Engines::NWN::Situated::createTooltip(), Engines::NWN::Creature::createTooltip(), destroyTooltip(), hideTooltip(), showFeedbackTooltip(), and showSpeechTooltip().
|
protected |
|
protected |
Is the object usable?
Definition at line 176 of file object.h.
Referenced by isClickable(), isUsable(), and Engines::NWN::Situated::loadProperties().