Hide screenshot window when taking normal screesnhot

This commit is contained in:
Jonathan G Rennison
2020-08-06 20:43:33 +01:00
parent cc45a99a4d
commit a65be9b747
3 changed files with 18 additions and 0 deletions

View File

@@ -27,6 +27,7 @@
#include "landscape.h" #include "landscape.h"
#include "smallmap_colours.h" #include "smallmap_colours.h"
#include "smallmap_gui.h" #include "smallmap_gui.h"
#include "screenshot_gui.h"
#include "table/strings.h" #include "table/strings.h"
@@ -920,8 +921,10 @@ bool MakeScreenshot(ScreenshotType t, const char *name)
* of the screenshot. This way the screenshot will always show the name * of the screenshot. This way the screenshot will always show the name
* of the previous screenshot in the 'successful' message instead of the * of the previous screenshot in the 'successful' message instead of the
* name of the new screenshot (or an empty name). */ * name of the new screenshot (or an empty name). */
SetScreenshotWindowHidden(true);
UndrawMouseCursor(); UndrawMouseCursor();
DrawDirtyBlocks(); DrawDirtyBlocks();
SetScreenshotWindowHidden(false);
} }
_screenshot_name[0] = '\0'; _screenshot_name[0] = '\0';

View File

@@ -72,3 +72,17 @@ void ShowScreenshotWindow()
DeleteWindowById(WC_SCREENSHOT, 0); DeleteWindowById(WC_SCREENSHOT, 0);
new ScreenshotWindow(&_screenshot_window_desc); new ScreenshotWindow(&_screenshot_window_desc);
} }
void SetScreenshotWindowHidden(bool hidden)
{
ScreenshotWindow *scw = (ScreenshotWindow *) FindWindowById(WC_SCREENSHOT, 0);
if (scw != nullptr) {
if (hidden) {
scw->SetDirtyAsBlocks();
SetBit(scw->left, 30);
} else {
ClrBit(scw->left, 30);
scw->SetDirtyAsBlocks();
}
}
}

View File

@@ -11,5 +11,6 @@
#define SCREENSHOT_GUI_H #define SCREENSHOT_GUI_H
void ShowScreenshotWindow(); void ShowScreenshotWindow();
void SetScreenshotWindowHidden(bool hidden);
#endif /* SCREENSHOT_GUI_H */ #endif /* SCREENSHOT_GUI_H */