43 _state(kStateDefault), _hasInventory(false) {
67 _model->setState(
"default");
134 _model->drawBound(enabled);
166 return close(triggerer);
168 return open(triggerer);
291 _model->playAnimation(anim, restart, length, speed);
Class to hold the two-dimensional array of a 2DA file.
Handling version V3.2/V3.3 of BioWare's GFFs (generic file format).
#define MKTAG(a0, a1, a2, a3)
A wrapper macro used around four character constants, like 'DATA', to ensure portability.
const Common::UString & getString(size_t column) const
Return the contents of a cell as a string.
bool getBool(const Common::UString &field, bool def=false) const
A class holding an UTF-8 string.
void load(const Aurora::GFF3Struct &placeable)
Load from a placeable instance.
void reset(PointerType o=0)
Resets the pointer with the new value.
A placeable object in a Neverwinter Nights area.
void setModelState()
Sync the model's state with the placeable's state.
const Common::UString & getAnimationSound(Animation animation)
State _state
The current state of the placeable.
bool isOpen() const
Is the placeable open?
bool activate(Object *opener)
The user object activates this placeable.
void load(const Aurora::GFF3Struct &instance, const Aurora::GFF3Struct *blueprint=0)
Load the situated object from an instance and its blueprint.
uint64 getUint(const Common::UString &field, uint64 def=0) const
Aurora::GFF3File * loadOptionalGFF3(const Common::UString &gff3, Aurora::FileType type, uint32 id, bool repairNWNPremium)
Load a GFF3, but return 0 instead of throwing on error.
Common::UString _soundClosed
The sound the object makes when closed.
void leave()
The cursor left the placeable.
Common::ScopedPtr< Graphics::Aurora::Model > _model
The situated object's model.
State
The state of a placeable.
A simple scoped smart pointer template.
bool click(Object *triggerer=0)
The placeable was clicked.
virtual void playAnimation(const Common::UString &animation="", bool restart=true, float length=0.0f, float speed=1.0f)
Play an object animation.
Placeable(const Aurora::GFF3Struct &placeable)
Load from a placeable instance.
void hide()
Hide the placeable's model.
Utility templates and functions.
Common::UString _soundOpened
The sound the object makes when opened.
void loadObject(const Aurora::GFF3Struct &gff)
Load placeable-specific properties.
Placeable template (user), GFF.
Handling BioWare's 2DAs (two-dimensional array).
bool deactivate(Object *closer)
The user object deactivates this placeable.
void highlight(bool enabled)
(Un)Highlight the placeable.
Common::UString _soundLocked
The sound the object makes when locked.
bool showFeedbackTooltip()
Create and show a tooltip with the name and/or portrait of the object.
void enter()
The cursor entered the placeable.
void playSound(const Common::UString &sound, bool pitchVariance=false)
Play an object sound.
bool empty() const
Is the string empty?
#define TwoDAReg
Shortcut for accessing the 2da registry.
void show()
Show the placeable's model.
Object * _lastClosedBy
The object that last closed this situated object.
uint32 _appearanceID
The index within the situated appearance 2DA.
uint32 _soundAppType
The index within the situated sounds 2DA.
int32 getInt(size_t column) const
Return the contents of a cell as an int.
Object * _lastUsedBy
The object that last used this situated object.
void loadAppearance()
Load appearance-specific properties.
Object * _lastOpenedBy
The object that last opened this situated object.
void playAnimation(const Common::UString &animation="", bool restart=true, float length=0.0f, float speed=1.0f)
Play a placeable animation.
const TwoDARow & getRow(size_t row) const
Get a row.
bool isAnimationLooping(Animation animation)
Return true if the specified animation allows looping.
bool isLocked() const
Is the situated object locked?
Common::UString getString(const Common::UString &field, const Common::UString &def="") const
Generic Aurora engines utility functions.
Common::UString getPlaceableAnimationName(Animation animation)
Return the name (as found in the models) of a specific placeable animation.
bool open(Object *opener)
The opener object opens this placeable.
bool runScript(Script script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
bool _hasInventory
Does this placeable have an inventory?
bool isActivated() const
Is the placeable activated?
void hideTooltip()
Hide the tooltip again.
void show()
Show the situated object's model.
void hide()
Hide the situated object's model.
bool close(Object *closer)
The closer object closes this placeable.
Common::UString _modelName
The model's resource name.