xoreos
0.0.5
|
#include <placeable.h>
Public Member Functions | |
Placeable (const Aurora::GFF3Struct &placeable) | |
Load from a placeable instance. More... | |
~Placeable () | |
void | show () |
Show the placeable's model. More... | |
void | hide () |
Hide the placeable's model. More... | |
bool | open (Object *opener) |
The opener object opens this placeable. More... | |
bool | close (Object *closer) |
The closer object closes this placeable. More... | |
void | enter () |
The cursor entered the placeable. More... | |
void | leave () |
The cursor left the placeable. More... | |
virtual void | highlight (bool enabled) |
(Un)Highlight the placeable. More... | |
Public Member Functions inherited from Engines::Jade::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... | |
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 & | getConversation () const |
Return the object's default conversation (DLG). 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... | |
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 | isActive () const |
Is the object currently active/available/visible? More... | |
bool | isNoCollide () const |
Is collision checking disabled? More... | |
void | setNoCollide (bool noCollide) |
Enable or disable collision checking. More... | |
bool | isClickable () const |
Can the player click the object? More... | |
Area * | getArea () const |
Return the area this object is currently in. More... | |
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 bool | click (Object *triggerer=0) |
The object was clicked. More... | |
Object * | getLastTriggerer () const |
Return the object that last triggered this object. More... | |
void | speakString (int32 resref) |
Speak the specified string. More... | |
virtual void | playAnimation (const Common::UString &animation="", bool restart=true, int32 loopCount=0) |
Play an object animation. More... | |
virtual void | playAnimation (Animation animation) |
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::Jade::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 Attributes | |
Common::UString | _modelName |
The model's resource name. More... | |
Common::UString | _soundCue |
The placeable's sound cue. More... | |
Common::UString | _resRef |
The placeable's description resref. More... | |
uint32 | _appearanceType |
The index within the placeable 2DA. More... | |
Object * | _lastOpenedBy |
The object that last opened this placeable object. More... | |
Object * | _lastClosedBy |
The object that last closed this placeable object. More... | |
Common::ScopedPtr< Graphics::Aurora::Model > | _model |
The placeable's model. More... | |
int32 | _state |
The placeable's current state. More... | |
Common::ScopedPtr< Aurora::GFF3File > | _fsm |
The placeable's state file. More... | |
Protected Attributes inherited from Engines::Jade::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 | _conversation |
The object's default conversation. More... | |
bool | _static |
Is the object static? More... | |
bool | _usable |
Is the object usable? More... | |
bool | _active |
Is the object currently active/available/visible? More... | |
bool | _noCollide |
Is collision checking for the object disabled? 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... | |
Object * | _lastTriggerer |
The object that last used this object. More... | |
float | _position [3] |
The object's position. More... | |
float | _orientation [4] |
The object's orientation. More... | |
Protected Attributes inherited from Aurora::NWScript::Object | |
uint32 | _id |
Common::UString | _tag |
Private Member Functions | |
void | load (const Aurora::GFF3Struct &placeable) |
Load from a placeable instance. More... | |
void | loadBlueprint (const Aurora::GFF3Struct &gff) |
Load the placeable's blueprint properties. More... | |
void | loadInstance (const Aurora::GFF3Struct &gff) |
Load the placeable's instance properties. More... | |
void | loadProperties () |
Load properties from placeable.2da. More... | |
void | loadAppearance () |
Load appearance-specific properties. More... | |
int32 | nextState (const Common::UString &input) |
Determines the result State according to the state model. More... | |
Definition at line 40 of file placeable.h.
Engines::Jade::Placeable::Placeable | ( | const Aurora::GFF3Struct & | placeable | ) |
Load from a placeable instance.
Definition at line 44 of file placeable.cpp.
References load().
Engines::Jade::Placeable::~Placeable | ( | ) |
Definition at line 50 of file placeable.cpp.
bool Engines::Jade::Placeable::close | ( | Object * | closer | ) |
The closer object closes this placeable.
Definition at line 200 of file placeable.cpp.
References _lastClosedBy, _state, Engines::Jade::kScriptOnClose, nextState(), and Engines::Jade::ScriptContainer::runScript().
Referenced by Engines::Jade::Functions::actionCloseDoor().
|
virtual |
The cursor entered the placeable.
Reimplemented from Engines::Jade::Object.
Definition at line 170 of file placeable.cpp.
References highlight().
|
virtual |
Hide the placeable's model.
Reimplemented from Engines::Jade::Object.
Definition at line 58 of file placeable.cpp.
References _model, and leave().
|
virtual |
(Un)Highlight the placeable.
Reimplemented from Engines::Jade::Object.
Definition at line 178 of file placeable.cpp.
References _model.
Referenced by enter(), and leave().
|
virtual |
The cursor left the placeable.
Reimplemented from Engines::Jade::Object.
Definition at line 174 of file placeable.cpp.
References highlight().
Referenced by hide().
|
private |
Load from a placeable instance.
Definition at line 64 of file placeable.cpp.
References _resRef, Aurora::NWScript::Object::_tag, Common::StackException::add(), Common::UString::c_str(), Common::UString::empty(), Aurora::GFF3Struct::getString(), Aurora::kFileTypePLA, loadAppearance(), loadBlueprint(), loadInstance(), loadProperties(), and MKTAG.
Referenced by Placeable().
|
private |
Load appearance-specific properties.
Definition at line 141 of file placeable.cpp.
References Engines::Jade::Object::_ids, _model, _modelName, Engines::Jade::Object::_name, Aurora::NWScript::Object::_tag, Common::UString::c_str(), Common::UString::empty(), Engines::Jade::Object::getOrientation(), Engines::Jade::Object::getPosition(), Engines::Jade::Object::isClickable(), Engines::loadModelObject(), Common::ScopedPtrBase< T, Deallocator >::reset(), and warning().
Referenced by load().
|
private |
Load the placeable's blueprint properties.
Definition at line 85 of file placeable.cpp.
References _appearanceType, Engines::Jade::Object::_conversation, _soundCue, Aurora::GFF3Struct::getString(), Aurora::GFF3Struct::getUint(), and Engines::Jade::ScriptContainer::readScripts().
Referenced by load().
|
private |
Load the placeable's instance properties.
Definition at line 114 of file placeable.cpp.
References Engines::Jade::Object::_active, _fsm, _modelName, _soundCue, _state, Aurora::NWScript::Object::_tag, Common::UString::empty(), Aurora::GFF3Struct::getBool(), Aurora::GFF3Struct::getSint(), Aurora::GFF3Struct::getString(), Aurora::kFileTypeFSM, Engines::Jade::Object::loadPositional(), MKTAG, and Common::ScopedPtrBase< T, Deallocator >::reset().
Referenced by load().
|
private |
Load properties from placeable.2da.
Definition at line 99 of file placeable.cpp.
References _appearanceType, _modelName, Engines::Jade::Object::_name, Aurora::NWScript::Object::_tag, Common::UString::c_str(), Aurora::TwoDARow::getInt(), Aurora::TwoDARow::getString(), Aurora::kFieldIDInvalid, TalkMan, TwoDAReg, and warning().
Referenced by load().
|
private |
Determines the result State according to the state model.
Definition at line 215 of file placeable.cpp.
References _fsm, _state, Common::UString::format(), Aurora::GFF3Struct::getSint(), Aurora::GFF3Struct::getString(), and Aurora::GFF3Struct::getStruct().
Referenced by close(), and open().
bool Engines::Jade::Placeable::open | ( | Object * | opener | ) |
The opener object opens this placeable.
Definition at line 183 of file placeable.cpp.
References _lastOpenedBy, _state, Engines::Jade::kAnimationOpeningADoorDoubleDoor, Engines::Jade::kScriptOnFailToOpen, Engines::Jade::kScriptOnOpen, nextState(), Engines::Jade::Object::playAnimation(), and Engines::Jade::ScriptContainer::runScript().
Referenced by Engines::Jade::Functions::actionOpenDoor().
|
virtual |
Show the placeable's model.
Reimplemented from Engines::Jade::Object.
Definition at line 53 of file placeable.cpp.
References _model.
|
protected |
The index within the placeable 2DA.
Definition at line 71 of file placeable.h.
Referenced by loadBlueprint(), and loadProperties().
|
protected |
The placeable's state file.
Definition at line 79 of file placeable.h.
Referenced by loadInstance(), and nextState().
|
protected |
The object that last closed this placeable object.
Definition at line 74 of file placeable.h.
Referenced by close().
|
protected |
The object that last opened this placeable object.
Definition at line 73 of file placeable.h.
Referenced by open().
|
protected |
The placeable's model.
Definition at line 76 of file placeable.h.
Referenced by hide(), highlight(), loadAppearance(), and show().
|
protected |
The model's resource name.
Definition at line 67 of file placeable.h.
Referenced by loadAppearance(), loadInstance(), and loadProperties().
|
protected |
The placeable's description resref.
Definition at line 69 of file placeable.h.
Referenced by load().
|
protected |
The placeable's sound cue.
Definition at line 68 of file placeable.h.
Referenced by loadBlueprint(), and loadInstance().
|
protected |
The placeable's current state.
Definition at line 78 of file placeable.h.
Referenced by close(), loadInstance(), nextState(), and open().