mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
Add output() and write() to ButtonMap
This commit is contained in:
parent
e9ec2cbf78
commit
fd09dc0ab2
@ -36,3 +36,32 @@ map_button(ButtonHandle raw_button, ButtonHandle button, const string &label) {
|
||||
_button_map[index] = bnode;
|
||||
_buttons.push_back(&_button_map[index]);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: ButtonMap::output
|
||||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void ButtonMap::
|
||||
output(ostream &out) const {
|
||||
out << "ButtonMap (" << get_num_buttons() << " buttons)";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: ButtonMap::write
|
||||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void ButtonMap::
|
||||
write(ostream &out, int indent_level) const {
|
||||
indent(out, indent_level)
|
||||
<< "ButtonMap, " << get_num_buttons() << " buttons:\n";
|
||||
|
||||
pvector<ButtonNode*>::const_iterator it;
|
||||
for (it = _buttons.begin(); it != _buttons.end(); ++it) {
|
||||
const ButtonNode *bn = *it;
|
||||
|
||||
indent(out, indent_level + 2)
|
||||
<< bn->_raw << " -> " << bn->_mapped << " \"" << bn->_label << "\"\n";
|
||||
}
|
||||
}
|
||||
|
@ -42,6 +42,9 @@ PUBLISHED:
|
||||
INLINE const string &get_mapped_button_label(ButtonHandle raw) const;
|
||||
INLINE const string &get_mapped_button_label(const string &raw_name) const;
|
||||
|
||||
void output(ostream &out) const;
|
||||
void write(ostream &out, int indent_level = 0) const;
|
||||
|
||||
public:
|
||||
void map_button(ButtonHandle raw_button, ButtonHandle button, const string &label = "");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user