Skip to content

Commit

Permalink
UPBGE: Fix documentation for deprecated joystick.[hatValues/numHats].
Browse files Browse the repository at this point in the history
hatValues return an empty list instead of rasing an error now.
  • Loading branch information
panzergame committed Feb 23, 2017
1 parent 536ff87 commit ea680e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions doc/python_api/rst/bge_types/bge.types.SCA_PythonJoystick.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ base class --- :class:`PyObjectPlus`
* up:[0.0, -1.0, ...]
* down:[0.0, 1.0, ...]

.. attribute:: hatValues (Deprecated. Use :data:activeButtons instead)
.. attribute:: hatValues (Deprecated. Use :data:`activeButtons` instead)

The state of the joysticks hats as a list of values :data:`numHats` long. (read-only).

Expand Down Expand Up @@ -69,7 +69,7 @@ base class --- :class:`PyObjectPlus`

:type: integer

.. attribute:: numHats (Deprecated. Use :data:numButtons instead)
.. attribute:: numHats (Deprecated. Use :data:`numButtons` instead)

The number of hats for the joystick at this index. (read-only).

Expand Down
2 changes: 1 addition & 1 deletion source/gameengine/GameLogic/SCA_PythonJoystick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ PyObject* SCA_PythonJoystick::pyattr_get_active_buttons(PyObjectPlus *self_v, co
PyObject* SCA_PythonJoystick::pyattr_get_hat_values(PyObjectPlus *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
ShowDeprecationWarning("SCA_PythonJoystick.hatValues", "SCA_PythonJoystick.activeButtons");
return nullptr;
return PyList_New(0);
}

PyObject* SCA_PythonJoystick::pyattr_get_axis_values(PyObjectPlus *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
Expand Down

1 comment on commit ea680e3

@youle31
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh thanks, sorry for the mistake

Please sign in to comment.