- turn off mouse and keyboard in headless mode
This commit is contained in:
parent
9cd6355733
commit
26d0b71bd5
|
@ -1287,6 +1287,10 @@ int Game::getFirstUnusedTeamNumber() {
|
|||
}
|
||||
|
||||
void Game::mouseDownLeft(int x, int y) {
|
||||
if(this->masterserverMode == true) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if(gameStarted == false) {
|
||||
Logger::getInstance().handleMouseClick(x, y);
|
||||
|
@ -1498,6 +1502,10 @@ void Game::mouseDownLeft(int x, int y) {
|
|||
}
|
||||
|
||||
void Game::mouseDownRight(int x, int y) {
|
||||
if(this->masterserverMode == true) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if(gameStarted == false) {
|
||||
Logger::getInstance().handleMouseClick(x, y);
|
||||
|
@ -1547,6 +1555,10 @@ void Game::mouseDownRight(int x, int y) {
|
|||
}
|
||||
|
||||
void Game::mouseUpCenter(int x, int y) {
|
||||
if(this->masterserverMode == true) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(gameStarted == false) {
|
||||
return;
|
||||
}
|
||||
|
@ -1560,6 +1572,10 @@ void Game::mouseDownRight(int x, int y) {
|
|||
}
|
||||
|
||||
void Game::mouseUpLeft(int x, int y) {
|
||||
if(this->masterserverMode == true) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if(gameStarted == false) {
|
||||
return;
|
||||
|
@ -1586,6 +1602,10 @@ void Game::mouseUpLeft(int x, int y) {
|
|||
}
|
||||
|
||||
void Game::mouseDoubleClickLeft(int x, int y) {
|
||||
if(this->masterserverMode == true) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if(gameStarted == false) {
|
||||
return;
|
||||
|
@ -1624,6 +1644,10 @@ void Game::mouseDoubleClickLeft(int x, int y) {
|
|||
}
|
||||
|
||||
void Game::mouseMove(int x, int y, const MouseState *ms) {
|
||||
if(this->masterserverMode == true) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if(gameStarted == false) {
|
||||
return;
|
||||
|
@ -1771,6 +1795,10 @@ void Game::eventMouseWheel(int x, int y, int zDelta) {
|
|||
}
|
||||
|
||||
void Game::keyDown(SDL_KeyboardEvent key) {
|
||||
if(this->masterserverMode == true) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c] [%d] gameStarted [%d]\n",__FILE__,__FUNCTION__,__LINE__,key.keysym.sym,key.keysym.sym, gameStarted);
|
||||
if(gameStarted == false) {
|
||||
|
@ -1987,6 +2015,10 @@ void Game::keyDown(SDL_KeyboardEvent key) {
|
|||
}
|
||||
|
||||
void Game::keyUp(SDL_KeyboardEvent key) {
|
||||
if(this->masterserverMode == true) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if(gameStarted == false) {
|
||||
return;
|
||||
|
@ -2083,6 +2115,10 @@ void Game::calcCameraMoveZ(){
|
|||
}
|
||||
|
||||
void Game::keyPress(SDL_KeyboardEvent c) {
|
||||
if(this->masterserverMode == true) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(gameStarted == false) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -702,7 +702,10 @@ void MenuStateCustomGame::returnToParentMenu() {
|
|||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
||||
void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton){
|
||||
void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton) {
|
||||
if(isMasterserverMode() == true) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
CoreData &coreData= CoreData::getInstance();
|
||||
|
@ -1338,7 +1341,11 @@ void MenuStateCustomGame::PlayNow(bool saveGame) {
|
|||
}
|
||||
}
|
||||
|
||||
void MenuStateCustomGame::mouseMove(int x, int y, const MouseState *ms){
|
||||
void MenuStateCustomGame::mouseMove(int x, int y, const MouseState *ms) {
|
||||
if(isMasterserverMode() == true) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mainMessageBox.getEnabled()) {
|
||||
mainMessageBox.mouseMove(x, y);
|
||||
}
|
||||
|
@ -3242,6 +3249,10 @@ void MenuStateCustomGame::updateNetworkSlots() {
|
|||
}
|
||||
|
||||
void MenuStateCustomGame::keyDown(SDL_KeyboardEvent key) {
|
||||
if(isMasterserverMode() == true) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(activeInputLabel != NULL) {
|
||||
string text = activeInputLabel->getText();
|
||||
//if(key == vkBack && text.length() > 0) {
|
||||
|
@ -3307,6 +3318,10 @@ void MenuStateCustomGame::keyDown(SDL_KeyboardEvent key) {
|
|||
}
|
||||
|
||||
void MenuStateCustomGame::keyPress(SDL_KeyboardEvent c) {
|
||||
if(isMasterserverMode() == true) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(activeInputLabel != NULL) {
|
||||
int maxTextSize= 16;
|
||||
for(int i = 0; i < GameConstants::maxPlayers; ++i) {
|
||||
|
@ -3344,6 +3359,10 @@ void MenuStateCustomGame::keyPress(SDL_KeyboardEvent c) {
|
|||
}
|
||||
|
||||
void MenuStateCustomGame::keyUp(SDL_KeyboardEvent key) {
|
||||
if(isMasterserverMode() == true) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(activeInputLabel==NULL) {
|
||||
if(hasNetworkGameSettings() == true) {
|
||||
chatManager.keyUp(key);
|
||||
|
|
Loading…
Reference in New Issue
Block a user