Cleanup input.xml file (remove unused properties in some cases), add a little inline doc to make it a little easier to customize

This commit is contained in:
auria.mg 2018-04-09 19:28:22 -04:00
parent 4ef196d086
commit ca771f6218
2 changed files with 19 additions and 3 deletions

View File

@ -29,9 +29,13 @@
*/
void Binding::save(std::ofstream& stream) const
{
stream << "id=\"" << m_id << "\" "
<< "event=\"" << m_type << "\" "
<< "character=\"" << m_character << "\" ";
stream << "event=\"" << m_type << "\" ";
stream << "id=\"" << m_id << "\" ";
if (m_type == Input::IT_KEYBOARD)
{
stream << "character=\"" << m_character << "\" ";
}
// Only serialize the direction and the range for stick motions
if (m_type == Input::IT_STICKMOTION)

View File

@ -643,6 +643,18 @@ void DeviceManager::save()
configfile << "<input version=\"" << INPUT_FILE_VERSION << "\">\n\n";
configfile << "<!--\n"
<< "Event 1 : Keyboard button press\n"
<< " 'id' indicates which button, as defined by irrlicht's EKEY_CODE enum\n"
<< " 'character' contains the associated unicode character.\n"
<< " Only used as fallback when displaying special characters in the UI.\n"
<< "Event 2 : Gamepad stick motion\n"
<< " 'id' indicates which stick, starting from 0\n"
<< " 'direction' 0 means negative, 1 means positive\n"
<< "Event 3 : Gamepad button press\n"
<< " 'id' indicates which button, starting from 0\n"
<< "-->\n\n";
for(unsigned int n=0; n<m_keyboard_configs.size(); n++)
{
m_keyboard_configs[n].save(configfile);