mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Added ability to bind restart to a controller.
This commit is contained in:
committed by
Ethan Lee
parent
af88aee7c0
commit
1376e65b5d
@@ -4544,6 +4544,15 @@ void Game::loadstats(int *width, int *height, bool *vsync)
|
||||
}
|
||||
}
|
||||
|
||||
if (pKey == "restartButton")
|
||||
{
|
||||
SDL_GameControllerButton newButton;
|
||||
if (GetButtonFromString(pText, &newButton))
|
||||
{
|
||||
controllerButton_restart.push_back(newButton);
|
||||
}
|
||||
}
|
||||
|
||||
if (pKey == "controllerSensitivity")
|
||||
{
|
||||
controllerSensitivity = help.Int(pText);
|
||||
@@ -4571,6 +4580,10 @@ void Game::loadstats(int *width, int *height, bool *vsync)
|
||||
{
|
||||
controllerButton_esc.push_back(SDL_CONTROLLER_BUTTON_B);
|
||||
}
|
||||
if (controllerButton_restart.size() < 1)
|
||||
{
|
||||
controllerButton_restart.push_back(SDL_CONTROLLER_BUTTON_RIGHTSHOULDER);
|
||||
}
|
||||
}
|
||||
|
||||
void Game::savestats()
|
||||
@@ -4789,6 +4802,12 @@ void Game::savestats()
|
||||
msg->LinkEndChild(doc.NewText(help.String((int) controllerButton_esc[i]).c_str()));
|
||||
dataNode->LinkEndChild(msg);
|
||||
}
|
||||
for (size_t i = 0; i < controllerButton_restart.size(); i += 1)
|
||||
{
|
||||
msg = doc.NewElement("restartButton");
|
||||
msg->LinkEndChild(doc.NewText(help.String((int) controllerButton_restart[i]).c_str()));
|
||||
dataNode->LinkEndChild(msg);
|
||||
}
|
||||
|
||||
msg = doc.NewElement( "controllerSensitivity" );
|
||||
msg->LinkEndChild( doc.NewText( help.String(controllerSensitivity).c_str()));
|
||||
|
||||
Reference in New Issue
Block a user