mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
notify added for nodepath bool
This commit is contained in:
parent
e54901c125
commit
069ecee3e0
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user