This commit is contained in:
ackimixs
2024-05-28 17:57:47 +02:00
parent 466e94254b
commit f9cde13976
2 changed files with 11 additions and 0 deletions

View File

@@ -39,6 +39,8 @@ void GameControllerHandler::handleMessage(const std::string &message) {
if (tokens[1] == "all" || tokens[1] == "gc") {
if (tokens[2] == "stop proximity") {
if (!this->rumble) return;
std::vector<std::string> args = Modelec::split(tokens[3], ",");
double distance = stod(args[0]);
Uint16 strength;
@@ -60,6 +62,13 @@ void GameControllerHandler::handleMessage(const std::string &message) {
if (tokens[2] == "ready") {
this->sendMessage("gc;all;game mode;gc\n");
}
if (tokens[2] == "start proximity") {
this->rumble = true;
}
else if (tokens[2] == "stop proximity") {
this->rumble = false;
}
}
}

View File

@@ -28,4 +28,6 @@ private:
SDL_GameController* controller;
double lidarDectectionDistance = 0;
bool rumble = true;
};