notify added for nodepath bool

This commit is contained in:
Zachary Pavlov 2009-04-22 23:43:01 +00:00
parent e54901c125
commit 069ecee3e0

View File

@ -78,6 +78,7 @@ enum EmptyNodePathType {
ENP_future,
ENP_transition,
ENP_deprecated,
ENP_notify,
};
ostream &operator << (ostream &out, EmptyNodePathType enp) {
@ -88,6 +89,8 @@ ostream &operator << (ostream &out, EmptyNodePathType enp) {
return out << "transition";
case ENP_deprecated:
return out << "deprecated";
case ENP_notify:
return out << "notify";
}
return out << "**invalid EmptyNodePathType value (" << (int)enp << ")**";
}
@ -101,6 +104,8 @@ istream &operator >> (istream &in, EmptyNodePathType &enp) {
enp = ENP_transition;
} else if (word == "deprecated") {
enp = ENP_deprecated;
} else if (word == "notify") {
enp = ENP_notify;
} else {
pgraph_cat.warning()
<< "Invalid EmptyNodePathType value (\"" << word << "\")\n";
@ -137,6 +142,15 @@ operator bool () const {
case ENP_deprecated:
return true;
case ENP_notify:
{
const char *msg = "NodePath being used as a Boolean (talk to Zac)";
#ifdef HAVE_PYTHON
PyErr_Warn(PyExc_FutureWarning, (char *)msg);
#endif
}
return true;
case ENP_transition:
if (!is_empty()) {
return true;