- fixed screenshots so holding shift ignores the screenshot key

This commit is contained in:
Mark Vejvoda 2012-11-20 01:12:07 +00:00
parent f7ebba0301
commit c3ff9973d9
3 changed files with 28 additions and 4 deletions

View File

@ -924,19 +924,29 @@ void MainWindow::eventKeyDown(SDL_KeyboardEvent key) {
}
}
//else if(key == configKeys.getCharKey("ReloadINI")) {
else if(isKeyPressed(configKeys.getSDLKey("ReloadINI"),key) == true) {
else if(isKeyPressed(configKeys.getSDLKey("ReloadINI"),key,false) == true) {
Config &config = Config::getInstance();
config.reload();
}
//else if(key == configKeys.getCharKey("Screenshot")) {
else if(isKeyPressed(configKeys.getSDLKey("Screenshot"),key) == true) {
else if(isKeyPressed(configKeys.getSDLKey("Screenshot"),key,false) == true) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Screenshot key pressed\n");
string userData = Config::getInstance().getString("UserData_Root","");
if(userData != "") {
endPathWithSlash(userData);
}
string path = userData + GameConstants::folder_path_screenshots;
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Screenshot checking path [%s]\n",path.c_str());
if(isdir(path.c_str()) == false) {
createDirectoryPaths(path);
}
if(isdir(path.c_str()) == true) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Screenshot path [%s]\n",path.c_str());
Config &config= Config::getInstance();
string fileFormat = config.getString("ScreenShotFileType","jpg");
@ -962,14 +972,20 @@ void MainWindow::eventKeyDown(SDL_KeyboardEvent key) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] %s\n",__FILE__,__FUNCTION__,__LINE__,szBuf);
if(Config::getInstance().getBool("DisableScreenshotConsoleText","false") == false) {
bool showScreenshotSavedMsg = Config::getInstance().getBool("DisableScreenshotConsoleText","false");
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Screenshot console showScreenshotSavedMsg = %d\n",showScreenshotSavedMsg);
if(showScreenshotSavedMsg == false) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Screenshot console [%s]\n",szBuf);
program->consoleAddLine(szBuf);
}
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Screenshot save to [%s]\n",path.c_str());
Renderer::getInstance().saveScreen(path);
break;
}
else {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("CANNOT save Screenshot [%s]\n",path.c_str());
fclose(f);
}
}

View File

@ -337,7 +337,14 @@ MenuState::~MenuState() {
}
void MenuState::consoleAddLine(string line) {
bool onlyWantChatMsgs = console.getOnlyChatMessagesInStoredLines();
if(onlyWantChatMsgs == true) {
console.setOnlyChatMessagesInStoredLines(false);
}
console.addLine(line);
if(onlyWantChatMsgs == true) {
console.setOnlyChatMessagesInStoredLines(true);
}
}
void MenuState::reloadUI() {

View File

@ -880,7 +880,8 @@ bool isKeyPressed(SDLKey compareKey, SDL_KeyboardEvent input,bool modifiersAllow
//printf("input.keysym.mod = %d\n",input.keysym.mod);
if( (input.keysym.mod & (KMOD_LCTRL | KMOD_RCTRL)) ||
(input.keysym.mod & (KMOD_LALT | KMOD_RALT))) {
(input.keysym.mod & (KMOD_LALT | KMOD_RALT)) ||
(input.keysym.mod & (KMOD_LSHIFT | KMOD_RSHIFT))) {
//input.keysym.mod & (KMOD_LSHIFT | KMOD_RSHIFT)) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] result *WOULD HAVE BEEN TRUE* but is false due to: modifiersAllowed = %d input.keysym.mod = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,modifiersAllowed,input.keysym.mod);
result = false;