Modified Files:
animation.cxx: Add a button argument to that animation. The default is to accept any mouse button.
This commit is contained in:
@@ -2092,6 +2092,7 @@ class SGPickAnimation::PickCallback : public SGPickCallback {
|
|||||||
public:
|
public:
|
||||||
PickCallback(const SGPropertyNode* configNode,
|
PickCallback(const SGPropertyNode* configNode,
|
||||||
SGPropertyNode* modelRoot) :
|
SGPropertyNode* modelRoot) :
|
||||||
|
_button(configNode->getIntValue("button", -1)),
|
||||||
_repeatable(configNode->getBoolValue("repeatable", false)),
|
_repeatable(configNode->getBoolValue("repeatable", false)),
|
||||||
_repeatInterval(configNode->getDoubleValue("interval-sec", 0.1))
|
_repeatInterval(configNode->getDoubleValue("interval-sec", 0.1))
|
||||||
{
|
{
|
||||||
@@ -2112,6 +2113,8 @@ public:
|
|||||||
}
|
}
|
||||||
virtual bool buttonPressed(int button, const Info&)
|
virtual bool buttonPressed(int button, const Info&)
|
||||||
{
|
{
|
||||||
|
if (0 <= _button && button != _button)
|
||||||
|
return false;
|
||||||
SGBindingList::const_iterator i;
|
SGBindingList::const_iterator i;
|
||||||
for (i = _bindingsDown.begin(); i != _bindingsDown.end(); ++i)
|
for (i = _bindingsDown.begin(); i != _bindingsDown.end(); ++i)
|
||||||
(*i)->fire();
|
(*i)->fire();
|
||||||
@@ -2140,6 +2143,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
SGBindingList _bindingsDown;
|
SGBindingList _bindingsDown;
|
||||||
SGBindingList _bindingsUp;
|
SGBindingList _bindingsUp;
|
||||||
|
int _button;
|
||||||
bool _repeatable;
|
bool _repeatable;
|
||||||
double _repeatInterval;
|
double _repeatInterval;
|
||||||
double _repeatTime;
|
double _repeatTime;
|
||||||
|
|||||||
Reference in New Issue
Block a user