Skip to content

Commit

Permalink
NWN: Add back Creature::lastChangedGUIDisplay()
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Mar 20, 2014
1 parent babb952 commit adfbb95
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/engines/nwn/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ Creature::~Creature() {
}

void Creature::init() {
_lastChangedGUIDisplay = 0;

_gender = kGenderNone;
_race = kRaceInvalid;

Expand Down Expand Up @@ -145,6 +147,10 @@ void Creature::rotate(float radian, float x, float y, float z) {
_model->setOrientation(radian, x, z, -y);
}

uint32 Creature::lastChangedGUIDisplay() const {
return _lastChangedGUIDisplay;
}

const Common::UString &Creature::getFirstName() const {
return _firstName;
}
Expand Down Expand Up @@ -259,6 +265,8 @@ void Creature::loadCharacter(const Common::UString &bic, bool local) {
// Let's hope no script depends on it being "".

_tag = Common::UString::sprintf("[PC: %s]", _name.c_str());

_lastChangedGUIDisplay = EventMan.getTimestamp();
}

void Creature::load(const Aurora::GFFStruct &creature) {
Expand All @@ -276,6 +284,8 @@ void Creature::load(const Aurora::GFFStruct &creature) {
load(creature, utc ? &utc->getTopLevel() : 0);

delete utc;

_lastChangedGUIDisplay = EventMan.getTimestamp();
}

void Creature::load(const Aurora::GFFStruct &instance, const Aurora::GFFStruct *blueprint) {
Expand Down
6 changes: 6 additions & 0 deletions src/engines/nwn/creature.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ class Creature : public Object {
Creature(const Common::UString &bic, bool local);
~Creature();

/** Last time info was changed that's displayed in the GUI. */
uint32 lastChangedGUIDisplay() const;

// Basic visuals

void loadModel(); ///< Load the creature's model.
Expand Down Expand Up @@ -193,6 +196,9 @@ class Creature : public Object {
BodyPart();
};

/** The time a GUI relevant property was changed last. */
uint32 _lastChangedGUIDisplay;

Common::UString _firstName; ///< The creature's first name.
Common::UString _lastName; ///< The creature's last name.

Expand Down

0 comments on commit adfbb95

Please sign in to comment.